PPP error event data=5 when waking from sleep

I'm building a small firmware to explore different types of sleep on the Boron. However, I've started having problems with my device including struggles to connect to the cloud, go to sleep or wake up from sleep.

I followed the cellular trouble guide - ensuring my LiPo battery is connected, I'm running 6.1.1 software, the antenna is firmly connected. But my device still doesn't wake up

I then ran the device doctor and got what look like normal results, including ability to connect with cellular networks.

I am now running a basic sleep program:

// Include Particle Device OS APIs
#include "Particle.h"

SYSTEM_MODE(AUTOMATIC);
SYSTEM_THREAD(ENABLED);

SerialLogHandler logHandler(LOG_LEVEL_INFO);

SystemSleepConfiguration sleepConfig;
String getTimestamp();

void setup() {
 Serial.begin(9600);
 delay(100);
  waitFor(Serial.isConnected, 30000);

      // Wait for cellular connection
    Cellular.on();
    Cellular.connect();
    waitFor(Cellular.ready, 180000);
   

// Synchronize time with the Particle Cloud
    Particle.connect();
    waitFor(Particle.connected, 30000);
    Particle.syncTime();
    waitFor(Particle.syncTimeDone,30000);
    Time.zone(-2); // Set your time zone (e.g., -5 for Eastern Time)
//Prepare Sleep
    sleepConfig.mode(SystemSleepMode::ULTRA_LOW_POWER) //Default
              .duration(1min);
delay(100);
Serial.printlnf("%s Set up v4 complete", getTimestamp().c_str());
}

void loop() {
  
Serial.printlnf("%s Loop start", getTimestamp().c_str());
  delay(100);
  Serial.printlnf("%s Going to sleep for 1 min", getTimestamp().c_str());
delay(100);
  System.sleep(sleepConfig);

Serial.printlnf("%s Waking up", getTimestamp().c_str());
  }
String getTimestamp() {
    time_t currentTime = Time.now();

     // Manually adjust the timestamp by subtracting 5 hours (18000 seconds)
    currentTime -= 18000;

    char timestamp[9];
    strftime(timestamp, sizeof(timestamp), "%H:%M:%S", localtime(&currentTime));
    return String(timestamp);
}

When I run this code, the device goes to sleep, but generates three errors when it attempts to wake: "Failed to enter data mode", "Failed to dial", "ppp error event data=5"

Here are logs showing proper entry to sleep and two failed wake attempts:

**Serial connection closed. Attempting to reconnect...**

**Serial monitor opened successfully:**

0000001332 [mux] INFO: Stopping GSM07.10 muxer

0000001332 [mux] INFO: Gracefully stopping GSM07.10 muxer

0000001333 [mux] INFO: Closing all muxed channels

0000001333 [mux] INFO: Muxed channel 1 already closed

0000001333 [mux] INFO: Muxed channel 2 already closed

0000001334 [mux] INFO: Muxed channel 3 already closed

0000001334 [mux] INFO: Muxed channel 4 already closed

0000001335 [mux] INFO: Sending CLD (multiplexer close down)

0000002235 [mux] INFO: Received response to CLD or timed out, exiting multiplexed mode

0000002285 [mux] INFO: GSM07.10 muxer thread exiting

0000002285 [mux] INFO: GSM07.10 muxer stopped

0000002301 [ncp.client] INFO: Using internal SIM card

0000003387 [mux] INFO: Starting GSM07.10 muxer

0000003388 [mux] INFO: Opening mux channel 0

0000003388 [mux] INFO: GSM07.10 muxer thread started

0000003395 [mux] INFO: Opening mux channel 1

0000005157 [mux] INFO: Opening mux channel 2

0000007455 [system.nm] INFO: State changed: IFACE_UP -> IFACE_LINK_UP

0000007457 [system.nm] INFO: State changed: IFACE_LINK_UP -> IP_CONFIGURED

0000007459 [system] INFO: Cloud: connecting

0000007461 [system] INFO: Cloud socket connected

0000007461 [comm.protocol.handshake] INFO: Establish secure connection

0000007464 [comm.dtls] INFO: session has 0 uses

0000007473 [comm.dtls] INFO: (CMPL,RENEG,NO_SESS,ERR) restoreStatus=0

0000007474 [comm.dtls] INFO: out_ctr 0,1,0,0,0,0,0,23, next_coap_id=13

0000007474 [comm.dtls] INFO: restored session from persisted session data. next_msg_id=19

0000007475 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 2

0000007730 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4

0000007730 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3

0000007731 [comm.protocol.handshake] INFO: Sending HELLO message

0000007842 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4

0000007843 [comm.protocol.handshake] INFO: Handshake completed

0000007843 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4

0000007844 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3

0000008242 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4

0000008689 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3

0000008990 [comm.protocol] INFO: Received TIME response: 1737569393

0000009095 [system] INFO: Cloud connected

0000009294 [comm.protocol] INFO: Received TIME response: 1737569394

13:09:54 Set up v4 complete

13:09:54 Loop start

0000009397 [comm.protocol] INFO: Sending subscriptions

13:09:54 Going to sleep for 1 min

0000009503 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4

0000009504 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3

0000009545 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4

0000009546 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3

0000009598 [system] INFO: Cloud: disconnecting

0000009598 [system] INFO: Cloud: disconnected

0000009599 [system.nm] INFO: State changed: IP_CONFIGURED -> IFACE_LINK_UP

0000009605 [system.nm] INFO: State changed: IFACE_LINK_UP -> IFACE_UP

0000009606 [net.pppncp] ERROR: PPP error event data=5

0000009610 [system.nm] INFO: State changed: IFACE_UP -> IFACE_REQUEST_DOWN

0000009610 [system.nm] INFO: State changed: IFACE_REQUEST_DOWN -> IFACE_DOWN

0000009611 [system.nm] INFO: State changed: IFACE_DOWN -> DISABLED

0000018333 [mux] INFO: Stopping GSM07.10 muxer

0000018333 [mux] INFO: Gracefully stopping GSM07.10 muxer

0000018334 [mux] INFO: Closing all muxed channels

0000018334 [mux] INFO: Closing mux channel 1

0000018335 [mux] INFO: Closing mux channel 2

0000018335 [mux] INFO: Muxed channel 3 already closed

0000018335 [mux] INFO: Muxed channel 4 already closed

0000018336 [mux] INFO: GSM07.10 muxer thread exiting

0000018337 [mux] INFO: GSM07.10 muxer stopped

**Serial connection closed. Attempting to reconnect...**

**Serial monitor opened successfully:**

0000098128 [net.pppncp] ERROR: PPP error event data=5

0000102164 [system.nm] INFO: State changed: IFACE_UP -> IFACE_REQUEST_DOWN

0000107164 [system.nm] INFO: State changed: IFACE_REQUEST_DOWN -> IFACE_DOWN

0000108469 [mux] INFO: Stopping GSM07.10 muxer

0000108469 [mux] INFO: Gracefully stopping GSM07.10 muxer

0000108469 [mux] INFO: Closing all muxed channels

0000108470 [mux] INFO: Closing mux channel 1

0000108470 [mux] INFO: Closing mux channel 2

0000108471 [mux] INFO: Muxed channel 3 already closed

0000108471 [mux] INFO: Muxed channel 4 already closed

0000108472 [mux] INFO: GSM07.10 muxer thread exiting

0000108472 [mux] INFO: GSM07.10 muxer stopped

0000112165 [system.nm] INFO: State changed: IFACE_DOWN -> DISABLED

**Serial connection closed. Attempting to reconnect...**

**Serial monitor opened successfully:**

0000199803 [ncp.client] ERROR: Failed to enter data mode

0000199804 [net.ppp.client] ERROR: Failed to dial

0000199809 [net.pppncp] ERROR: PPP error event data=5

0000200925 [mux] INFO: Stopping GSM07.10 muxer

0000200925 [mux] INFO: Gracefully stopping GSM07.10 muxer

0000200926 [mux] INFO: Closing all muxed channels

0000200926 [mux] INFO: Closing mux channel 1

0000200926 [mux] INFO: Closing mux channel 2

0000200927 [mux] INFO: Muxed channel 3 already closed

0000200927 [mux] INFO: Muxed channel 4 already closed

0000200928 [mux] INFO: GSM07.10 muxer thread exiting

0000200928 [mux] INFO: GSM07.10 muxer stopped

0000200929 [net.pppncp] ERROR: Failed to initialize cellular NCP client: -210

0000202971 [system.nm] INFO: State changed: IFACE_REQUEST_DOWN -> IFACE_DOWN

0000204100 [ncp.client] INFO: Using internal SIM card

0000206573 [mux] INFO: Starting GSM07.10 muxer

0000206574 [mux] INFO: Opening mux channel 0

0000206574 [mux] INFO: GSM07.10 muxer thread started

0000206577 [mux] INFO: Opening mux channel 1

0000207971 [system.nm] INFO: State changed: IFACE_DOWN -> DISABLED

0000214552 [mux] INFO: Stopping GSM07.10 muxer

0000214552 [mux] INFO: Gracefully stopping GSM07.10 muxer

0000214553 [mux] INFO: Closing all muxed channels

0000214553 [mux] INFO: Closing mux channel 1

0000214553 [mux] INFO: Muxed channel 2 already closed

0000214554 [mux] INFO: Muxed channel 3 already closed

0000214554 [mux] INFO: Muxed channel 4 already closed

0000214555 [mux] INFO: GSM07.10 muxer thread exiting

0000214556 [mux] INFO: GSM07.10 muxer stopped

You should not call syncTime as it's done automatically when you connect to the cloud.

30 seconds is not long enough to connect if there a problem. We recoomend more than 10 minutes because if the modem gets into bad state, that's how long it will retry before powering down the modem. However if you are using sleep you may be able to reduce this to 3 or 4 minutes since that will also power down the modem.

It's recommended that you wait at least 8 seconds before sleeping for two reasons: it's possible that not everything is complete at that point (subscriptions and ledger sync in particular) and also if you have a product firmware, you won't get an update notification until then. It's possible that your immediate sleep is causing issues.

I assume this is for testing, but a 1 minute sleep will likely get your device banned from mobile networks eventually. The recommended minimum is 10 minutes if you are not using network standby mode. Even for testing I wouldn't go less than 2 minutes because the shutdown process might not be complete before the wakeup which could affect the cellular modem operation.

1 Like

@rickkas7 Thanks for the helpful response. I made the following changes:
-In setup adjusted the wait time from 30 s -> 10 min: waitFor(Particle.connected, 10601000);
-Removed Synctime entirely
-Added an 8 second delay immediately before sleep
-Adjusted the sleep time to 3 min (I'll adjust to 10 min as soon as I'm done testing)

The Boron is now able to wake up.

I still see instances of the PPP error as the device is getting prepared for sleep. But given that the device is doing what it's intended to, I don't think I need to spend extra time troubleshooting.

1 Like

You may get a PPP error when disconnecting; I wouldn't worry about that either.