Skip to content

Cellular: Make AT_CellularContext::get_context() virtual #10442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 24, 2019

Conversation

trowbridgec
Copy link

@trowbridgec trowbridgec commented Apr 18, 2019

Description

I have observed that some cell modules (namely the Telit ME910C1) pre-fill the contexts with dummy values. When the current get_context() function calls the AT+CGDCONT? command, the module responds with 6 already populated dummy contexts. For example:

AT+CGDCONT?<cr><cr><ln>
+CGDCONT: 1,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0<cr><ln>
+CGDCONT: 2,"IPV4V6","ims","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0<cr><ln>
+CGDCONT: 3,"IPV4V6","sos","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,1<cr><ln>
+CGDCONT: 4,"IPV4V6","attm2mglobal","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0<cr><ln>
+CGDCONT: 5,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0<cr><ln>
+CGDCONT: 6,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0<cr><ln>
<cr><ln>
OK<cr><ln>

I would expect the get_context() function to select and overwrite the 1st context, but instead cycles through all of the contexts, rejects them all (none of them match the target APN for my SIM), and tries to create a 7th. This then throws an error since the ME910C1 only supports 6 contexts.

Therefore, I propose making the get_context() function virtual and overwrite-able by the individual cell module driver authors (similar to what is available for other AT_CellularContext functions, like do_connect()), which is what this PR enables.

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[x] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

Release Notes

Makes AT_CellularContext::get_context() virtual - overwrite-able by the individual cell module driver authors (similar to what is available for other AT_CellularContext functions, like do_connect()).

@0Grit
Copy link

0Grit commented Apr 18, 2019

@ARMmbed/team-embeddedplanet

@0Grit
Copy link

0Grit commented Apr 18, 2019

@ARMmbed/mbed-os-wan

@0Grit
Copy link

0Grit commented Apr 18, 2019

@maclobdell

@ciarmcom ciarmcom requested review from a team April 18, 2019 21:00
@ciarmcom
Copy link
Member

@trowbridgec, thank you for your changes.
@ARMmbed/mbed-os-wan @ARMmbed/mbed-os-maintainers please review.

@AriParkkila
Copy link

@trowbridgec do you have a log with AT debug to see why the first APN is not selected?

I'm guessing your problem might be due to the automatic APN lookup, which you could try to disable in mbed_app.json:

            "ppp-cell-iface.apn-lookup": false,
            "cellular.use-apn-lookup": false,

@trowbridgec
Copy link
Author

@AriParkkila

I'm trying out your suggestion on the APN lookup now.

In the mean time, below is an AT log from when I see this issue. It looks like it asks the module what contexts are configured, doesn't match to any of them, decides to create a new one (a 7th one), and then gets rejected because the module only supports 6 contexts. I would expect/hope that it would realize the first context has an empty APN and use with that one.

BTW, the APN we're using is "11583.mcs".

[INFO][CELL]: AT TX (11): AT+CGDCONT?
[INFO][CELL]: AT TX ( 1): <cr>
[INFO][CELL]: AT RX (12): AT+CGDCONT?<cr>
[INFO][CELL]: AT RX ( 4): <cr><ln>+C
[INFO][CELL]: AT RX (14): GDCONT: 1,"IPV
[INFO][CELL]: AT RX (16): 4V6","","0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0.0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0",0,0,0,
[INFO][CELL]: AT RX (16): 0<cr><ln>+CGDCONT: 2,"
[INFO][CELL]: AT RX (16): IPV4V6","ims","0
[INFO][CELL]: AT RX (16): .0.0.0.0.0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0.0.0.0",
[INFO][CELL]: AT RX (16): 0,0,0,0<cr><ln>+CGDCON
[INFO][CELL]: AT RX ( 9): T: 3,"IPV
[INFO][CELL]: AT RX (16): 4V6","sos","0.0.
[INFO][CELL]: AT RX (16): 0.0.0.0.0.0.0.0.
[INFO][CELL]: AT RX (16): 0.0.0.0.0.0",0,0
[INFO][CELL]: AT RX (16): ,0,1<cr><ln>+CGDCONT:
[INFO][CELL]: AT RX (16): 4,"IPV4V6","attm
[INFO][CELL]: AT RX (16): 2mglobal","0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0.0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0.0",0,0,
[INFO][CELL]: AT RX (16): 0,0<cr><ln>+CGDCONT: 5
[INFO][CELL]: AT RX (16): ,"IPV4V6","","0.
[INFO][CELL]: AT RX (16): 0.0.0.0.0.0.0.0.
[INFO][CELL]: AT RX (16): 0.0.0.0.0.0.0",0
[INFO][CELL]: AT RX (16): ,0,0,0<cr><ln>+CGDCONT
[INFO][CELL]: AT RX ( 8): : 6,"IPV
[INFO][CELL]: AT RX (16): 4V6","","0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0.0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0",0,0,0,
[INFO][CELL]: AT RX ( 9): 0<cr><ln><cr><ln>OK<cr><ln>
[INFO][CELL]: AT TX (11): AT+CGDCONT=
[INFO][CELL]: AT TX ( 1): 7
[INFO][CELL]: AT TX ( 1): ,
[INFO][CELL]: AT TX ( 1): "
[INFO][CELL]: AT TX ( 6): IPV4V6
[INFO][CELL]: AT TX ( 1): "
[INFO][CELL]: AT TX ( 1): ,
[INFO][CELL]: AT TX ( 1): "
[INFO][CELL]: AT TX ( 9): 11583.mcs
[INFO][CELL]: AT TX ( 1): "
[INFO][CELL]: AT TX ( 1): <cr>
[INFO][CELL]: AT RX (16): AT+CGDCONT=7,"IP
[INFO][CELL]: AT RX (16): V4V6","11583.mcs
[INFO][CELL]: AT RX (11): "<cr><cr><ln>ERROR<cr><ln>
[INFO][CELL]: AT RX (11): <cr><ln>+PACSP0<cr><ln>
[INFO][CELL]: AT RX ( 1): <cr>
[INFO][CELL]: AT RX (10): <ln>+PACSP0<cr><ln>
[INFO][CELL]: AT RX ( 9): <cr><ln>+PACSP0
[INFO][CELL]: AT RX ( 2): <cr><ln>
[INFO][CELL]: AT RX (11): <cr><ln>+PACSP0<cr><ln>
[WARN][CELL]: AT timeout
[DBG ][CELL]: AT error -3012
[DBG ][CELL]: consume_to_tag not found
[DBG ][CELL]: AT stop tag not found
[DBG ][CELL]: AT error -3012
[ERR ][CELL]: Failed to activate network context! (-3004)
Unable to connect to network (-3004). Retrying...
[INFO][CELL]: CellularContext connect
[INFO][CELL]: AT TX (11): AT+CGDCONT?
[INFO][CELL]: AT TX ( 1): <cr>
[INFO][CELL]: AT RX (12): AT+CGDCONT?<cr>
[INFO][CELL]: AT RX ( 4): <cr><ln>+C
[INFO][CELL]: AT RX (14): GDCONT: 1,"IPV
[INFO][CELL]: AT RX (16): 4V6","","0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0.0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0",0,0,0,
[INFO][CELL]: AT RX (16): 0<cr><ln>+CGDCONT: 2,"
[INFO][CELL]: AT RX (16): IPV4V6","ims","0
[INFO][CELL]: AT RX (16): .0.0.0.0.0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0.0.0.0",
[INFO][CELL]: AT RX (16): 0,0,0,0<cr><ln>+CGDCON
[INFO][CELL]: AT RX ( 9): T: 3,"IPV
[INFO][CELL]: AT RX (16): 4V6","sos","0.0.
[INFO][CELL]: AT RX (16): 0.0.0.0.0.0.0.0.
[INFO][CELL]: AT RX (16): 0.0.0.0.0.0",0,0
[INFO][CELL]: AT RX (16): ,0,1<cr><ln>+CGDCONT:
[INFO][CELL]: AT RX (16): 4,"IPV4V6","attm
[INFO][CELL]: AT RX (16): 2mglobal","0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0.0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0.0",0,0,
[INFO][CELL]: AT RX (16): 0,0<cr><ln>+CGDCONT: 5
[INFO][CELL]: AT RX (16): ,"IPV4V6","","0.
[INFO][CELL]: AT RX (16): 0.0.0.0.0.0.0.0.
[INFO][CELL]: AT RX (16): 0.0.0.0.0.0.0",0
[INFO][CELL]: AT RX (16): ,0,0,0<cr><ln>+CGDCONT
[INFO][CELL]: AT RX ( 8): : 6,"IPV
[INFO][CELL]: AT RX (16): 4V6","","0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0.0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0",0,0,0,
[INFO][CELL]: AT RX ( 9): 0<cr><ln><cr><ln>OK<cr><ln>
[INFO][CELL]: AT TX (11): AT+CGDCONT=
[INFO][CELL]: AT TX ( 1): 7
[INFO][CELL]: AT TX ( 1): ,
[INFO][CELL]: AT TX ( 1): "
[INFO][CELL]: AT TX ( 6): IPV4V6
[INFO][CELL]: AT TX ( 1): "
[INFO][CELL]: AT TX ( 1): ,
[INFO][CELL]: AT TX ( 1): "
[INFO][CELL]: AT TX ( 9): 11583.mcs
[INFO][CELL]: AT TX ( 1): "
[INFO][CELL]: AT TX ( 1): <cr>
[INFO][CELL]: AT RX (16): AT+CGDCONT=7,"IP
[INFO][CELL]: AT RX (16): V4V6","11583.mcs
[INFO][CELL]: AT RX (11): "<cr><cr><ln>ERROR<cr><ln>

@trowbridgec
Copy link
Author

@AriParkkila

After adding the suggested settings to mbed_app.json, I still get the same error:

...
[DBG ][CELL]: +CEREG: RegisteredHomeNetwork, LAC -1, cell -1, RAT unknown
[INFO][CELL]: AT RX ( 3): K<cr><ln>
[DBG ][CELL]: callback: 4098, err: 0, data: 1
[INFO][CELL]: Registering network => Attaching network
[INFO][CELL]: AT TX ( 6): AT+CSQ
[INFO][CELL]: AT TX ( 1): <cr>
[INFO][CELL]: AT RX ( 8): AT+CSQ<cr><cr>
[INFO][CELL]: AT RX ( 8): <ln>+CSQ: 2
[INFO][CELL]: AT RX (11): 1,5<cr><ln><cr><ln>OK<cr><ln>
[INFO][CELL]: RSSI -71 dBm
[INFO][CELL]: Attaching network (timeout 60 s)
[INFO][CELL]: AT TX ( 9): AT+CGATT?
[INFO][CELL]: AT TX ( 1): <cr>
[INFO][CELL]: AT RX (11): AT+CGATT?<cr><cr>
[INFO][CELL]: AT RX ( 5): <ln>+CGA
[INFO][CELL]: AT RX (12): TT: 1<cr><ln><cr><ln>OK<cr>
[INFO][CELL]: AT RX ( 1): <ln>
[DBG ][CELL]: callback: 4102, err: 0, data: 1
[INFO][CELL]: AT TX (11): AT+CGDCONT?
[INFO][CELL]: AT TX ( 1): <cr>
[INFO][CELL]: AT RX (12): AT+CGDCONT?<cr>
[INFO][CELL]: AT RX ( 4): <cr><ln>+C
[INFO][CELL]: AT RX (14): GDCONT: 1,"IPV
[INFO][CELL]: AT RX (16): 4V6","","0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0.0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0",0,0,0,
[INFO][CELL]: AT RX (16): 0<cr><ln>+CGDCONT: 2,"
[INFO][CELL]: AT RX (16): IPV4V6","ims","0
[INFO][CELL]: AT RX (16): .0.0.0.0.0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0.0.0.0",
[INFO][CELL]: AT RX (16): 0,0,0,0<cr><ln>+CGDCON
[INFO][CELL]: AT RX ( 9): T: 3,"IPV
[INFO][CELL]: AT RX (16): 4V6","sos","0.0.
[INFO][CELL]: AT RX (16): 0.0.0.0.0.0.0.0.
[INFO][CELL]: AT RX (16): 0.0.0.0.0.0",0,0
[INFO][CELL]: AT RX (16): ,0,1<cr><ln>+CGDCONT:
[INFO][CELL]: AT RX (16): 4,"IPV4V6","attm
[INFO][CELL]: AT RX (16): 2mglobal","0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0.0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0.0",0,0,
[INFO][CELL]: AT RX (16): 0,0<cr><ln>+CGDCONT: 5
[INFO][CELL]: AT RX (16): ,"IPV4V6","","0.
[INFO][CELL]: AT RX (16): 0.0.0.0.0.0.0.0.
[INFO][CELL]: AT RX (16): 0.0.0.0.0.0.0",0
[INFO][CELL]: AT RX (16): ,0,0,0<cr><ln>+CGDCONT
[INFO][CELL]: AT RX ( 8): : 6,"IPV
[INFO][CELL]: AT RX (16): 4V6","","0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0.0.0.0.0
[INFO][CELL]: AT RX (16): .0.0.0.0",0,0,0,
[INFO][CELL]: AT RX ( 9): 0<cr><ln><cr><ln>OK<cr><ln>
[INFO][CELL]: AT TX (11): AT+CGDCONT=
[INFO][CELL]: AT TX ( 1): 7
[INFO][CELL]: AT TX ( 1): ,
[INFO][CELL]: AT TX ( 1): "
[INFO][CELL]: AT TX ( 6): IPV4V6
[INFO][CELL]: AT TX ( 1): "
[INFO][CELL]: AT TX ( 1): ,
[INFO][CELL]: AT TX ( 1): "
[INFO][CELL]: AT TX ( 9): 11583.mcs
[INFO][CELL]: AT TX ( 1): "
[INFO][CELL]: AT TX ( 1): <cr>
[INFO][CELL]: AT RX (16): AT+CGDCONT=7,"IP
[INFO][CELL]: AT RX (16): V4V6","11583.mcs
[INFO][CELL]: AT RX (11): "<cr><cr><ln>ERROR<cr><ln>
[WARN][CELL]: AT timeout
[DBG ][CELL]: AT error -3012
[DBG ][CELL]: consume_to_tag not found
[DBG ][CELL]: AT stop tag not found
[DBG ][CELL]: AT error -3012
[ERR ][CELL]: Failed to activate network context! (-3004)
Unable to connect to network (-3004). Retrying...
...

If I tweak the get_context() function to always use context 1 (probably not ideal for all modules, but a good test for my case), the module connects and receives an IP just fine.

Any other ideas?

@AriParkkila
Copy link

@trowbridgec you need to clear existing contexts, e.g. add temporarily this code to make cleanup:

bool AT_CellularContext::get_context()
{
  for (int i=0; i<7; i++) {
    _at.cmd_start("AT+CGDCONT=");
    _at.write_int(i);
    _at.cmd_stop();
    _at.resp_start();
    _at.resp_stop();
    _at.clear_error();
  }

@trowbridgec
Copy link
Author

@AriParkkila Adding the tweak to clear out the contexts before choosing one seems to have worked; however, in order to add this change, wouldn't I still need to be able to write my own implementation of the get_context() function?

@AriParkkila
Copy link

@trowbridgec The problem was likely that there were too many existing contexts. After that cleanup tweak was once executed those extra contexts were removed. It should work fine without that cleanup tweak now due to Mbed cellular framework should clear any new contexts that it creates.

@0Grit
Copy link

0Grit commented Apr 26, 2019

@AriParkkila

I'm not up to speed with this topic. But I believe we were seeing the issue with a number of ME910 modules.

I wasn't sure if they shipped that way or if the driver had been adding the extra profiles.

@AriParkkila
Copy link

@loverdeg-ep could you implement some recovery code at your application, e.g. for APN cleanup:

void clean_context() {
  ATHandler *at = CellularDevice::get_default_instance->get_at_handler();
  for (int i=0; i<7; i++) {
    at->cmd_start("AT+CGDCONT=");
    at->write_int(i);
    at->cmd_stop();
    at->resp_start();
    at->resp_stop();
    at->clear_error();
  }
  CellularDevice::get_default_instance->release_at_handler(at);
}

@40Grit
Copy link

40Grit commented Apr 29, 2019

@AriParkilla it would need to be part of our BSP or factory code.

Being a solution & design services provider we do everything we can not to push any workarounds upto the application level. This would burden the application writer otherwise.

Not necessarily saying this MR needs to make it into the OS. Maybe a better solution will appear as we gain deeper understanding of the module.

@trowbridgec
Copy link
Author

@AriParkkila I think you're right that the issue was just that there were too many contexts already populated, but as @loverdeg-ep pointed out, we are seeing this on some ME910s and not others (it isn't just an isolated incident on one board).

I agree that this might not be the best solution moving forward; how do you feel about a change where the get_context() function only rejects a context if it's APN length is greater than 0?

bool AT_CellularContext::get_context()
{
...

    while (_at.info_resp()) {
        int cid = _at.read_int();
        if (cid > cid_max) {
            cid_max = cid;
        }
        char pdp_type_from_context[10];
        int pdp_type_len = _at.read_string(pdp_type_from_context, sizeof(pdp_type_from_context) - 1);
        if (pdp_type_len > 0) {
            apn_len = _at.read_string(apn, sizeof(apn) - 1);
            if (apn_len >= 0) {
                if (_apn && apn_len > 0 && (strcmp(apn, _apn) != 0)) { // <- add check here for length of apn
                    continue;
                }

                // APN matched -> Check PDP type
                pdp_type_t pdp_type = string_to_pdp_type(pdp_type_from_context);

                // Accept exact matching PDP context type or dual PDP context for IPv4/IPv6 only modems
                if (get_property(pdp_type_t_to_cellular_property(pdp_type)) ||
                        ((pdp_type == IPV4V6_PDP_TYPE && (modem_supports_ipv4 || modem_supports_ipv6)) && !_nonip_req)) {
                    _pdp_type = pdp_type;
                    _cid = cid;
                }
            }
        }
    }

...
}

@AriParkkila
Copy link

@trowbridgec It doesn't sound good to ignore APN if given, and you probably shouldn't define APN at all in that case.

@trowbridgec
Copy link
Author

@AriParkkila apn here is the current APN value for the context we're looking at (get_context() loops through the results of the AT+CGDCONT? command, which to my understanding, returns the states of the module's contexts).

So, my argument is that if a context exists but has an APN of an empty string (apn_length == 0), it is unused, and it is acceptable to use it.

@0Grit
Copy link

0Grit commented May 2, 2019

@AriParkkila any further thoughts?

@trowbridgec trowbridgec changed the title Make AT_CellularContext::get_context() virtual Cellular: Make AT_CellularContext::get_context() virtual May 2, 2019
@0xc0170
Copy link
Contributor

0xc0170 commented May 3, 2019

@ARMmbed/mbed-os-wan Can we progress here?

@40Grit
Copy link

40Grit commented May 3, 2019

Yes please. Embedded Planet is a partner and is attempting to get an Mbed based Pelion ready product launched.

@maclobdell

@maclobdell
Copy link
Contributor

@AriParkkila Can you comment on this PR and/or the proposed alternative workaround? It seems that if this function was virtual and allowed to be overridden, that could allow flexibility for specific cellular module drivers.

Also, please comment about why overwriting an APN with length of 0 could be a problem.

@AriParkkila
Copy link

@maclobdell virtual getcontext() is fine, I just wanted to understand the root cause :)

Do you mean that when APN is "", that is accepted match to any APN in json setup?

@trowbridgec
Copy link
Author

From my understanding, the purpose of the get_context() function is to provide the function caller with the next, available context. So, I guess my question would be, in your opinion, is it appropriate to modify the get_context() function to consider a context that currently has an empty string for the APN setting (as returned by the AT+CGDCONT? command) 'available' for use? Essentially, can we change the logic to return as valid a context that has no assigned APN?

If yes, then I'd vote we make that change instead.

If no, then I'd vote we make the get_context() function virtual as this change will need to be made to support some modules (e.g. the Telit ME910).

@adbridge
Copy link
Contributor

@AriParkkila are you happy with @trowbridgec comments ?

@40Grit
Copy link

40Grit commented May 17, 2019

@adbridge your issue bumps have been sorely needed. Thank you.

@AriParkkila
Copy link

a context that currently has an empty string for the APN setting (as returned by the AT+CGDCONT? command) 'available' for use

@trowbridgec I'm not quite following here... If you don't require any named APN then get_context should be happy to give any. If you have set APN then get_context should give only APN which has a matching name.

@trowbridgec
Copy link
Author

@AriParkkila maybe I'm not explaining the issue properly.

When the mbed ATHandler calls the AT+CGDCONT? command, the cell module replies with this list of available contexts:

+CGDCONT: 1,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0<cr><ln>
+CGDCONT: 2,"IPV4V6","ims","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0<cr><ln>
+CGDCONT: 3,"IPV4V6","sos","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,1<cr><ln>
+CGDCONT: 4,"IPV4V6","attm2mglobal","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0<cr><ln>
+CGDCONT: 5,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0<cr><ln>
+CGDCONT: 6,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0<cr><ln>

The APN that I am trying to use is 11583.mcs which you can see is not one of contexts listed. So, I have just been using context 1 (which shows an empty string as the APN), and everything works fine.

The current logic from the get_context() function tries to match the APN configured in the mbed_app.json file to one of the contexts returned from the AT+CGDCONT? command. If it can't find it, it tries to create a new context with that APN. My cell module only supports up to 6 contexts, so creating a new context returns an error. If I change the logic of the get_context() function to return an unused context (e.g. context 1 in the example above which has no APN assigned to it), I was able to connect without issue.

@maclobdell
Copy link
Contributor

@AriParkkila @AnttiKauppila Please let us know if this request is clear to you. Can the logic change to get an unused context?

@AriParkkila
Copy link

@trowbridgec I'm not sure... Would it be better to have getter for a list of APNs from which you could select one? Another (not so optimal) way would be first try to connect with a named APN and in case unsuccessful with a void APN?

@trowbridgec
Copy link
Author

@AriParkkila Would the list of APNs be generated from the APN database (i.e. APN_db.h) or from the results of the AT+CGDCONT? call? From the APN database wouldn't be ideal because it seems to be rather sparse (e.g. the APN for my SIM cards/cellular provider is not in there and neither are some big names like Verizon in the US).

I think the 2nd method might be ok. I have seen that some of our modules will somtimes come up with the correct APN name in one of the contexts (I'm assuming it's because the module itself remembers the last used APN?), so I think the logic to first attempt to connect via a named APN is valid.

Do you want me to update my PR to meet your second suggestion?

@AriParkkila
Copy link

@trowbridgec That sounds good, but now as I see what you try to achieve virtual get_context() might be the simplest way to do it :)

@0xc0170
Copy link
Contributor

0xc0170 commented May 23, 2019

I updated "Release Notes" to contain bit more details.

CI started

@mbed-ci
Copy link

mbed-ci commented May 23, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170
Copy link
Contributor

0xc0170 commented May 23, 2019

@AnttiKauppila Please review this functionality change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants