Troubles with sleep duration

Hi,

Im having troubles putting my devices to sleep.
I want the devices to sleep for a given time and then wake up again.
But it wakes up after about 2 minutes no matter what I try.

here's the code that i use to put it to sleep. It have worked previously it's a while back tho.

                    Log.info("going to sleep for %u minutes", sleepTime);
                    SystemSleepConfiguration config;
                    config.mode(SystemSleepMode::ULTRA_LOW_POWER)
                          .duration(std::chrono::minutes(sleepTime));
                        
                    System.sleep(config);

                    System.reset();

I've tried different things in the .duration()
as of now sleepTime is a usigned long with the value 20.

I've tried:
.duration(20min)
.duration(1h)
.duration(1200000) ~ 20 min in ms

All with the same result. It wakes up after about 2 minutes.

I know from the Log that it does enter the code for sleep.

Im using a B524 and device OS 6.1.0 ive tried on device OS 5.5.0 with the same result.

Best regards
Rune

Hi!
Could you please post the logs here as well?

Hi,

Sure, here's an the output from the terminal:


Serial monitor opened successfully:
0000085766 [system] INFO: Cloud: disconnecting

Serial connection closed. Attempting to reconnect...
Serial monitor opened successfully:
0000001785 [system.nm] INFO: State changed: IFACE_UP -> IFACE_LINK_UP
0000001788 [system.nm] INFO: State changed: IFACE_LINK_UP -> IP_CONFIGURED
0000001790 [system] INFO: Cloud: connecting
0000001794 [system] INFO: Cloud socket connected
0000001795 [comm.protocol.handshake] INFO: Establish secure connection
0000001800 [comm.dtls] INFO: session has 0 uses
0000001816 [comm.dtls] INFO: (CMPL,RENEG,NO_SESS,ERR) restoreStatus=0
0000001816 [comm.dtls] INFO: out_ctr 0,1,0,0,0,0,1,89, next_coap_id=863
0000001818 [comm.dtls] INFO: restored session from persisted session data. next_msg_id=2147
0000001818 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 2
0000002254 [comm.protocol.handshake] INFO: Skipping HELLO message
0000002262 [comm.protocol] INFO: Checksum has not changed; not sending application DESCRIBE
0000002262 [comm.protocol] INFO: Checksum has not changed; not sending subscriptions
0000002445 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000002465 [comm.protocol] INFO: Received TIME response: 1720424994
0000002764 [system] INFO: Cloud connected
0000090055 [app] INFO: Going to sleep
0000090055 [app] INFO: going to sleep for 20 minutes
0000090055 [system] INFO: Cloud: disconnecting
0000091058 [system] INFO: Cloud: disconnected
0000091059 [system.nm] INFO: State changed: IP_CONFIGURED -> IFACE_LINK_UP
0000091065 [system.nm] INFO: State changed: IFACE_LINK_UP -> IFACE_UP
0000091066 [net.pppncp] ERROR: PPP error event data=5
0000091070 [system.nm] INFO: State changed: IFACE_UP -> IFACE_REQUEST_DOWN
0000091071 [system.nm] INFO: State changed: IFACE_REQUEST_DOWN -> IFACE_DOWN
0000091073 [system.nm] INFO: State changed: IFACE_DOWN -> DISABLED
0000104016 [mux] INFO: Stopping GSM07.10 muxer
0000104016 [mux] INFO: Gracefully stopping GSM07.10 muxer
0000104016 [mux] INFO: Closing all muxed channels
0000104017 [mux] INFO: Closing mux channel 1
0000104017 [mux] INFO: Closing mux channel 2
0000104018 [mux] INFO: Muxed channel 3 already closed
0000104019 [mux] INFO: Muxed channel 4 already closed
0000104020 [mux] INFO: GSM07.10 muxer thread exiting
0000104021 [mux] INFO: GSM07.10 muxer stopped

Serial connection closed. Attempting to reconnect...
Serial monitor opened successfully:
0000012881 [mux] INFO: Starting GSM07.10 muxer
0000012882 [mux] INFO: GSM07.10 muxer thread started
0000012882 [mux] INFO: Opening mux channel 0
0000012933 [mux] INFO: Opening mux channel 1
0000013628 [mux] INFO: Opening mux channel 2
0000014745 [system.nm] INFO: State changed: IFACE_UP -> IFACE_LINK_UP
0000014747 [system.nm] INFO: State changed: IFACE_LINK_UP -> IP_CONFIGURED
0000014749 [system] INFO: Cloud: connecting
0000014754 [system] INFO: Cloud socket connected
0000014755 [comm.protocol.handshake] INFO: Establish secure connection
0000014761 [comm.dtls] INFO: session has 0 uses
0000014777 [comm.dtls] INFO: (CMPL,RENEG,NO_SESS,ERR) restoreStatus=0
0000014778 [comm.dtls] INFO: out_ctr 0,1,0,0,0,0,1,98, next_coap_id=86b
0000014778 [comm.dtls] INFO: restored session from persisted session data. next_msg_id=2155
0000014780 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 2
0000015210 [comm.protocol.handshake] INFO: Skipping HELLO message
0000015217 [comm.protocol] INFO: Checksum has not changed; not sending application DESCRIBE
0000015218 [comm.protocol] INFO: Checksum has not changed; not sending subscriptions
0000015446 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000015547 [comm.protocol] INFO: Received TIME response: 1720425217
0000015847 [system] INFO: Cloud connected
0000091496 [app] INFO: Going to sleep
0000091496 [app] INFO: going to sleep for 20 minutes
0000091497 [system] INFO: Cloud: disconnecting
0000092499 [system] INFO: Cloud: disconnected
0000092500 [system.nm] INFO: State changed: IP_CONFIGURED -> IFACE_LINK_UP
0000092506 [system.nm] INFO: State changed: IFACE_LINK_UP -> IFACE_UP
0000092507 [net.pppncp] ERROR: PPP error event data=5
0000092511 [system.nm] INFO: State changed: IFACE_UP -> IFACE_REQUEST_DOWN
0000092512 [system.nm] INFO: State changed: IFACE_REQUEST_DOWN -> IFACE_DOWN
0000092513 [system.nm] INFO: State changed: IFACE_DOWN -> DISABLED
0000105407 [mux] INFO: Stopping GSM07.10 muxer
0000105408 [mux] INFO: Gracefully stopping GSM07.10 muxer
0000105408 [mux] INFO: Closing all muxed channels
0000105408 [mux] INFO: Closing mux channel 1
0000105409 [mux] INFO: Closing mux channel 2
0000105409 [mux] INFO: Muxed channel 3 already closed
0000105410 [mux] INFO: Muxed channel 4 already closed
0000105410 [mux] INFO: GSM07.10 muxer thread exiting
0000105411 [mux] INFO: GSM07.10 muxer stopped

Serial connection closed. Attempting to reconnect...


And the device just runs this cycle repeatedly.

Are you using the hardware watchdog? By default it continues to run in sleep mode and will reset the device at the end of its watch period if the device is sleeping.

I do have a watchdog. And i think you just saved me some bald spots :slight_smile:

Thanks alot!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.