Dear Particle Commmunity,
I’ve started to see some of our B523 SoM fail to connect on DeviceOS 3.2.0/3.1.0. They are sleepy devices, so the connection logic is executed every hour or so, and I utilize Rickkas PublishAsyncQueuePosix to store events during offline measuring and I loop while connected. However, it seems like the connection state never reaches ‘connected’. It simply fails to initialize modem, powers it down and retries over and over without any luck.
0107049906 [ncp.client] ERROR: Failed to perform early initialization
0107049906 [ncp.client] TRACE: Hard resetting the modem
0107050306 [ncp.client] TRACE: Waiting the modem to restart.
0107061181 [ncp.client] TRACE: Successfully reset the modem.
0107061182 [net.pppncp] TRACE: NCP event 3
0107061182 [net.pppncp] TRACE: NCP power state changed: IF_POWER_STATE_POWERING_DOWN
0107061182 [system.nm] TRACE: Interface 4 power state changed: 3
0107066182 [ncp.client] TRACE: Powering modem off
0107087752 [net.pppncp] TRACE: NCP event 3
0107087753 [net.pppncp] TRACE: NCP power state changed: IF_POWER_STATE_DOWN
0107087753 [system.nm] TRACE: Interface 4 power state changed: 1
0107087754 [ncp.client] TRACE: Modem powered off
0107087754 [net.pppncp] ERROR: Failed to initialize cellular NCP client: -210
0107087854 [ncp.client] TRACE: Powering modem on, ncpId: 0x62
0107087855 [net.pppncp] TRACE: NCP event 3
0107087855 [net.pppncp] TRACE: NCP power state changed: IF_POWER_STATE_POWERING_UP
0107087855 [system.nm] TRACE: Interface 4 power state changed: 4
0107098960 [net.pppncp] TRACE: NCP event 3
0107098961 [net.pppncp] TRACE: NCP power state changed: IF_POWER_STATE_UP
0107098961 [system.nm] TRACE: Interface 4 power state changed: 2
0107098962 [ncp.client] TRACE: Modem powered on
0107099962 [ncp.at] TRACE: > AT
0107099965 [ncp.at] TRACE: < OK
0107099965 [ncp.client] TRACE: NCP ready to accept AT commands
0107099966 [ncp.at] TRACE: > AT+CFUN=1,0
0107099969 [ncp.at] TRACE: < OK
0107099970 [ncp.at] TRACE: > AT+IFC=2,2
0107099973 [ncp.at] TRACE: < OK
0107099973 [ncp.at] TRACE: > AT
0107099974 [ncp.at] TRACE: < OK
0107099975 [ncp.at] TRACE: > AT+IPR=460800
0107099978 [ncp.at] TRACE: < OK
0107100979 [ncp.at] TRACE: > AT
0107100981 [ncp.at] TRACE: < OK
0107100981 [ncp.at] TRACE: > AT+CPIN?
0107100983 [ncp.at] TRACE: < +CPIN: READY
0107100983 [ncp.at] TRACE: < OK
0107100984 [ncp.at] TRACE: > AT+CCID
0107100985 [ncp.at] TRACE: < +CCID: 89314404000821576023
0107100985 [ncp.at] TRACE: < OK
0107100985 [ncp.at] TRACE: > AT+QDSIM=0
0107100986 [ncp.at] TRACE: < OK
0107100987 [ncp.at] TRACE: > AT+CMUX=0,0,7,1509,,,,,
0107100988 [ncp.at] TRACE: < OK
0107100988 [mux] INFO: Starting GSM07.10 muxer
0107100989 [ncp.client] ERROR: Failed to perform early initialization
0107100989 [ncp.client] TRACE: Hard resetting the modem
0107101389 [ncp.client] TRACE: Waiting the modem to restart.
0107112319 [ncp.client] TRACE: Successfully reset the modem.
0107112320 [net.pppncp] TRACE: NCP event 3
0107112320 [net.pppncp] TRACE: NCP power state changed: IF_POWER_STATE_POWERING_DOWN
0107112320 [system.nm] TRACE: Interface 4 power state changed: 3
0107117320 [ncp.client] TRACE: Powering modem off
0107139515 [net.pppncp] TRACE: NCP event 3
0107139516 [net.pppncp] TRACE: NCP power state changed: IF_POWER_STATE_DOWN
0107139516 [system.nm] TRACE: Interface 4 power state changed: 1
0107139516 [ncp.client] TRACE: Modem powered off
0107139517 [net.pppncp] ERROR: Failed to initialize cellular NCP client: -210
0107139617 [ncp.client] TRACE: Powering modem on, ncpId: 0x62
0107139618 [net.pppncp] TRACE: NCP event 3
0107139618 [net.pppncp] TRACE: NCP power state changed: IF_POWER_STATE_POWERING_UP
0107139618 [system.nm] TRACE: Interface 4 power state changed: 4
0107150718 [net.pppncp] TRACE: NCP event 3
0107150719 [net.pppncp] TRACE: NCP power state changed: IF_POWER_STATE_UP
0107150719 [system.nm] TRACE: Interface 4 power state changed: 2
0107150720 [ncp.client] TRACE: Modem powered on
0107151720 [ncp.at] TRACE: > AT
0107151723 [ncp.at] TRACE: < OK
0107151723 [ncp.client] TRACE: NCP ready to accept AT commands
0107151724 [ncp.at] TRACE: > AT+CFUN=1,0
0107151728 [ncp.at] TRACE: < OK
0107151728 [ncp.at] TRACE: > AT+IFC=2,2
0107151731 [ncp.at] TRACE: < OK
0107151731 [ncp.at] TRACE: > AT
0107151733 [ncp.at] TRACE: < OK
0107151733 [ncp.at] TRACE: > AT+IPR=460800
0107151736 [ncp.at] TRACE: < OK
0107152737 [ncp.at] TRACE: > AT
0107152739 [ncp.at] TRACE: < OK
0107152740 [ncp.at] TRACE: > AT+CPIN?
0107152742 [ncp.at] TRACE: < +CPIN: READY
0107152742 [ncp.at] TRACE: < OK
0107152743 [ncp.at] TRACE: > AT+CCID
0107152744 [ncp.at] TRACE: < +CCID: 89314404000821576023
0107152744 [ncp.at] TRACE: < OK
0107152745 [ncp.at] TRACE: > AT+QDSIM=0
0107152746 [ncp.at] TRACE: < OK
0107152746 [ncp.at] TRACE: > AT+CMUX=0,0,7,1509,,,,,
0107152747 [ncp.at] TRACE: < OK
0107152748 [mux] INFO: Starting GSM07.10 muxer
0107152748 [ncp.client] ERROR: Failed to perform early initialization
0107152748 [ncp.client] TRACE: Hard resetting the modem
0107153148 [ncp.client] TRACE: Waiting the modem to restart.
0107163993 [ncp.client] TRACE: Successfully reset the modem.
My disconnect logic before sleep is as follows:
void Namespace::disconnect()
{
// Disconnect from cloud
Particle.disconnect();
// Turn cellular module off
Cellular.off();
}
and connection logic is:
bool Namespace::connect(int timeout)
{
// Disable System OTA updates whilst connecting and transmitting
System.disableUpdates();
// Check whether we're connected, if not -> connect!
if (Particle.connected() == false)
{
// Turn on cellular module
Cellular.on();
delay(500);
// Connect GSM
Cellular.connect();
waitFor(Cellular.ready, timeout);
// Connect to Cloud
Particle.connect();
waitFor(Particle.connected, timeout);
}
if (Particle.connected)
{
return true;
}
return false;
}
Edit: Not sure if I should check for Cellular.isOn after calling Cellular.on - I guess that would be good practise. Reference says I shouldn’t worry about the Cellular but simply call Particle.connect (On Gen 3 devices (Argon, Boron, B Series SoM, and Tracker), prior to Device OS 2.0.0, you needed to call WiFi.on()
or Cellular.on()
before calling Particle.connect()
. This is not necessary on Gen 2 devices (any Device OS version) or with 2.0.0 and later.)