Description
Description of defect
I'm using a u-blox SARA-R412M module and was unable to get a connection to a LTE Cat M1 network. We have our own APN, which I've configured using CellularContext::set_credentials
before starting the connection.
There appear to be two issues, which might be related so I'm listing both here. If they're not related, please let me know and I can split this into two separate issues.
- I had to manually do the AT command
CGDCONT
in to be able to send data. - I had to add
CellularNetwork::C_REG
to thereg_params._type
check inCellularStateMachine::cellular_event_changed
in order to get a registration to the network.
I've attached a couple of logs that are, hopefully, explaining this behaviour. In the logs and diff I've redacted the custom APN with XXX as well as the IP's.
log | CGDCONT set |
C_REG added |
---|---|---|
0569.log | yes | yes |
0570.log | no | yes |
0571.log | yes | no |
Logs 569 and 571 are using the following patch in order to manually add the AT command CGDCONT
, to fix 1.
diff --git a/features/cellular/framework/AT/AT_CellularNetwork.cpp b/features/cellular/framework/AT/AT_CellularNetwork.cpp
index 4e35dcb4..24910a61 100644
--- a/features/cellular/framework/AT/AT_CellularNetwork.cpp
+++ b/features/cellular/framework/AT/AT_CellularNetwork.cpp
@@ -182,6 +182,11 @@ void AT_CellularNetwork::attach(Callback<void(nsapi_event_t, intptr_t)> status_c
nsapi_error_t AT_CellularNetwork::set_registration_urc(RegistrationType type, bool urc_on)
{
+ tr_info("WTG set_registration_urc");
+ _at.cmd_start("AT+CGDCONT=1,\"IP\",\"XXX.com\"");
+ _at.cmd_stop_read_resp();
+
int index = (int)type;
MBED_ASSERT(index >= 0 && index < C_MAX);
@@ -223,7 +228,7 @@ nsapi_error_t AT_CellularNetwork::set_registration(const char *plmn)
if (_op_act != RAT_UNKNOWN) {
return _at.at_cmd_discard("+COPS", "=1,2,", "%s%d", plmn, _op_act);
} else {
- return _at.at_cmd_discard("+COPS", "=1,2", "%s", plmn);
+ return _at.at_cmd_discard("+COPS", "=1,2,", "%s", plmn);
}
}
}
Logs 569 and 570 are using the following patch in order to enable the CREG registration, to fix 2.
diff --git a/features/cellular/framework/device/CellularStateMachine.cpp b/features/cellular/framework/device/CellularStateMachine.cpp
index 08b77977..633a5b20 100644
--- a/features/cellular/framework/device/CellularStateMachine.cpp
+++ b/features/cellular/framework/device/CellularStateMachine.cpp
@@ -708,8 +708,12 @@ void CellularStateMachine::cellular_event_changed(nsapi_event_t ev, intptr_t ptr
// expect packet data so only these states are valid
CellularNetwork::registration_params_t reg_params;
nsapi_error_t err = _network.get_registration_params(reg_params);
+ tr_info("TEST: err %d, type %d", err, reg_params._type);
- if (err == NSAPI_ERROR_OK && (reg_params._type == CellularNetwork::C_EREG || reg_params._type == CellularNetwork::C_GREG)) {
+ if (err == NSAPI_ERROR_OK && (reg_params._type == CellularNetwork::C_EREG
+ || reg_params._type == CellularNetwork::C_GREG
+ || reg_params._type == CellularNetwork::C_REG
+ )) {
if ((data->status_data == CellularNetwork::RegisteredHomeNetwork ||
data->status_data == CellularNetwork::RegisteredRoaming) && data->error == NSAPI_ERROR_OK) {
_queue.cancel(_event_id);
Target(s) affected by this defect ?
All targets using the u-blox SARA-R412M (and perhaps other u-blox modules as well, especially the R4x series).
Toolchain(s) (name and version) displaying this defect ?
GCC_ARM
What version of Mbed-os are you using (tag or sha) ?
5.15.0
I didn't see significant changes in cellular in the release notes up to 5.15.3 except #12088 , which I manually patched in my 5.15.0 code.
What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
$ mbed --version
1.10.0
$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]
How is this defect reproduced ?
- Do a cellular connection with the u-blox SARA-R412M and connect to a LTE Cat M1 network with a custom APN.
- Have APN configured using
CellularContext::set_credentials
and disable APN lookup.