When connecting from a cold boot, UBLOX_AT_CellularContext::activate_profile issues some profile-configuration commands before finally issuing AT+UPSDA=0,3 to activate the profile. On the G450 modem, this returns OK immediately but it appears that the profile is not actually active until a +UUPSDA URC has been received. The following code appears to address this issue but I'm not sure whether it is G450-specific.
if (_at.get_last_error() == NSAPI_ERROR_OK) {
// Activate, wait upto 30 seconds for the connection to be made
_at.set_at_timeout(30000);
_at.cmd_start("AT+UPSDA=0,3");
_at.cmd_stop();
_at.resp_start();
_at.resp_stop();
_at.resp_start("+UUPSDA:"); //wait for URC
_at.restore_at_timeout();
if (_at.get_last_error() == NSAPI_ERROR_OK) {
activated = true;
}
}
[ ] Question
[ ] Enhancement
[x] Bug
Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-859
@ARMmbed/team-ublox , have you seen this?
Internal Jira ticket : PGM_NO_MBD-216
@NeilMacMullen thanks for the input. I have checked with SARA-G450 FW:09.02,A02.01 and I dont see any problem if I dont wait for the +UUPSDA URC. Infact, this URC is present for U201 as well and is received as soon as the UPSDA command is sent (for both modules). I checked with m-center (AT terminal) and I also used UPING command immediately after the context activation, able to see ping responses from 8.8.8.8. Please let me know how I can replicate this issue.
Moreover, as you might already know, the cellular state machine in mbed always makes sure that modem wakes up, initializes, perform SIM checks and registers on the network. For this reason, the URC can be ignored but it makes perfect sense to parse it for result (and in that case, we will be waiting for it as well).
@bqam-ublox Thanks for looking at this. IIRC, the error that occurs is that if you try to set up a socket without waiting for the UUPDSA URC, you get a CME ERROR (can't remember which one - probably invalid operation). Since the logical flow is
context->connect
open-socket
it seems desirable to include waiting for the URC as some part of the connect block. (Whether activate_profile is the right part is a different question.)
@NeilMacMullen I understand your point plus we need to be sure if the context is activated, will generate a pull request for review.
PR#10636 generated. This should fix the issue. Please note that this PR is not tested on G450 but should be applicable on all modems.
Tested by Ublox and agreed to closed.