Hi,
We are currently trying to create a small test code to test multiple operator with different modes:
- lte-m1 or lte-nb1
- edrx 0s, 5.12s, 10.24s
- with and without psm
Our board has multiple SIM slot, with a SIM switch rerouting the SIM_xxx signals from the nRF9160.
After an initial lte_lc_init(), we setup the link control to use the configuration for the test.
Then we wait for a connection, turn the modem off, reconfigure the modem etc...
for (int i = 0; i < ARRAY_SIZE(test); i++) {
const struct test_data *data = &test[i];
LOG_WRN("====Starting test %d in 3 seconds=====", i);
k_sleep(K_SECONDS(3));
lte_lc_system_mode_set(data->mode, 0);
lte_lc_psm_req(false);
if (!data->use_edrx) {
lte_lc_edrx_req(false);
}
else {
lte_lc_edrx_param_set(LTE_LC_LTE_MODE_LTEM,
data->ltem_edrx_value);
lte_lc_edrx_param_set(LTE_LC_LTE_MODE_NBIOT,
data->nbiot_edrx_value);
lte_lc_edrx_req(true);
}
err = lte_lc_connect();
if (err) {
LOG_ERR("Test %d fails: no connection", i);
}
else {
LOG_WRN("Connected ! Checking eDRX value");
at_cmd_write("AT+CEDRXRDP", NULL, 0, NULL);
k_sleep(K_SECONDS(2));
at_cmd_write("AT+CEDRXRDP", NULL, 0, NULL);
k_sleep(K_SECONDS(2));
at_cmd_write("AT+CEDRXRDP", NULL, 0, NULL);
}
LOG_WRN("====Test %d done. "
"Starting next one in 10 seconds====", i);
lte_lc_power_off();
k_sleep(K_SECONDS(10));
}
Once we are done with a SIM card, we turn off the modem, switch sim card and we go again.
The main issue that we have is that the modem is not reliable at all in that configuration.
Sometimes, a SIM card can connect when we start the test with it, but if it's the second SIM card to be tested, the connection is stuck at +CEREG=2 forever (literally)
With CONFIG_LTE_NETWORK_TIMEOUT=90, I would expect the connection to return an error once the timeout is reached, but not stuck forever.
What is the correct workflow to set the modem in multiple configuration in a short amount of time without the firmware being unreliable ?
Regards
Giuliano