Boron "Hard resetting the modem" loop

We use external (ATT) sims with borons. They work fine except I have one device that experiences the following endless looping error when powered up:

0000040067 [app] INFO: Starting loop
0000047113 [net.pppncp] TRACE: NCP event 3
0000047113 [net.pppncp] TRACE: NCP power state changed: IF_POWER_STATE_DOWN
0000047113 [system.nm] TRACE: Interface 4 power state changed: 1
0000047114 [ncp.client] TRACE: Deinit modem serial.
0000047115 [net.pppncp] ERROR: Failed to initialize cellular NCP client: -210
0000047215 [net.pppncp] TRACE: NCP event 3
0000047215 [net.pppncp] TRACE: NCP power state changed: IF_POWER_STATE_POWERING_UP
0000047216 [system.nm] TRACE: Interface 4 power state changed: 4
0000047216 [ncp.client] TRACE: Powering modem on
0000047367 [net.pppncp] TRACE: NCP event 3
0000047367 [net.pppncp] TRACE: NCP power state changed: IF_POWER_STATE_UP
0000047367 [system.nm] TRACE: Interface 4 power state changed: 2
0000047368 [ncp.client] TRACE: Modem powered on
0000047369 [ncp.client] TRACE: Setting UART voltage translator state 1
0000047469 [ncp.client] TRACE: Setting UART voltage translator state 0
0000047569 [ncp.client] TRACE: Setting UART voltage translator state 1
0000048570 [ncp.at] TRACE: > AT
0000049570 [ncp.at] TRACE: > AT
0000050570 [ncp.at] TRACE: > AT
0000051570 [ncp.at] TRACE: > AT
0000051655 [ncp.at] TRACE: < OK
0000051655 [ncp.client] TRACE: NCP ready to accept AT commands
0000051656 [ncp.at] TRACE: > ATI9
0000051658 [ncp.at] TRACE: < L0.0.00.00.05.08,A.02.04
0000051658 [ncp.at] TRACE: < OK
0000051658 [ncp.client] TRACE: App firmware: 204
0000051659 [ncp.at] TRACE: > AT+UGPIOC?
0000051661 [ncp.at] TRACE: < +UGPIOC:
0000051661 [ncp.at] TRACE: < 7,255
0000051662 [ncp.at] TRACE: < 16,255
0000051662 [ncp.at] TRACE: < 19,255
0000051663 [ncp.at] TRACE: < 23,0
0000051663 [ncp.at] TRACE: < 24,255
0000051664 [ncp.at] TRACE: < 25,255
0000051664 [ncp.at] TRACE: < 42,255
0000051665 [ncp.at] TRACE: < OK
0000051665 [ncp.at] TRACE: > AT+UGPIOR=23
0000051667 [ncp.at] TRACE: < +UGPIOR: 23,0
0000051668 [ncp.at] TRACE: < OK
0000051668 [ncp.client] INFO: Using external Nano SIM card
0000051668 [ncp.at] TRACE: > AT+CPIN?
0000051670 [ncp.at] TRACE: < +CPIN: READY
0000051671 [ncp.at] TRACE: < OK
0000051671 [ncp.at] TRACE: > AT+CCID
0000051674 [ncp.at] TRACE: < +CCID: 89011703278603965339
0000051674 [ncp.at] TRACE: < OK
0000051674 [ncp.at] TRACE: > AT+CCID
0000051677 [ncp.at] TRACE: < +CCID: 89011703278603965339
0000051677 [ncp.at] TRACE: < OK
0000051677 [ncp.at] TRACE: > AT+CIMI
0000051679 [ncp.at] TRACE: < +CME ERROR: SIM failure
0000051679 [ncp.client] ERROR: Failed to perform early initialization
0000051680 [ncp.client] TRACE: Setting UART voltage translator state 0
0000051681 [ncp.client] TRACE: Hard resetting the modem

The crazy thing is that if I open another particle command line and send a reset then the device comes right up. I can’t help but wonder if there is some “hygiene” that should be in my firmware that would take care of this?

At the moment my SYSTEM_MODE is AUTOMATIC. The only calls to Cellular are during setup():

void setup() {

// Don't assume it remembered
Cellular.setActiveSim(EXTERNAL_SIM);	
Cellular.setCredentials("m2mxxxxx.attz");  // our APN

What can I do to make this more robust and programmatically “snap out” of this?
Thanks,
Tim

Quick update. I noticed that there have been multiple reports in the forum of Borons that experience this connection issue (evidenced by “Hard resetting the modem” in the trace). The workaround that I have found is to add a System.reset() to the setup process. Here’s the code:


SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(AUTOMATIC);
int      resetflag;

/*******************************************************************************
 * Function Name  : setup
 * Description    : None.
 *******************************************************************************/
void setup() {

    // Give modem a chance to connect
    delay(40000);
    
    // Display our current cellular status
    if (Cellular.isOn()) Log.info("Cellular on: true");
    else Log.info("Cellular on: false");
    if (Cellular.ready()) Log.info("Cellular ready: true");
    else Log.info("Cellular ready: false");
    
    // Check to see if we need a system reset.  Note
    // that we only make this check every other time through setup.
    EEPROM.get(20,resetflag);
    if(resetflag==0xFFFFFFFF || resetflag==0) {
        resetflag=1;
        EEPROM.put(20,resetflag);
        
        Log.info("Checking to see if system reset is needed");
        if (!Cellular.ready()) {
            
            // Don't assume it remembered
    	    Cellular.setActiveSim(EXTERNAL_SIM);
    	    Cellular.setCredentials("m2mxxxxx.attz");
    	    delay(1000);
    	    
    	    // Send System reset
            Log.info("System reset IS needed");
            System.reset();
        }
        else {
            // Send System reset
            Log.info("System reset IS NOT needed");
        }
    }
    else {
        resetflag=0;
        EEPROM.put(20,resetflag);
    }
    
    // Log Messages
    Log.info("System version: %s", (const char*)System.version());
    Log.info("System deviceID: %s", (const char*)System.deviceID());

}
4 Likes

Thanks! What OS version was this?