Electron will not properly sleep unless connected to cloud first

I am having an issue where the Electron (FW v. 0.7.0) will not properly enter its lowest power sleep mode unless the Electron first connects to the Particle server. This occurs on a cold boot from external power. My device is configured to only connect to the “cloud” only at particular times of day and by default will not connect the cloud on power-up. I can remedy this by forcing a connect to the cloud then allowing the device to sleep, which will then properly enter the “SLEEP_MODE_SOFTPOWEROFF” mode.

The problem with this is that the device will consume >1ma of current instead of the 130uA it normally does with no external way to know aside from ammeter in the power loop.

loop(){
// do stuff …
StopTimers();
Serial.flush();
Serial.end();
Particle.process();
System.sleep(SLEEP_MODE_SOFTPOWEROFF, 60-Time.second()); //sleeps until top of next minute
}//loop

Does anyone know if this issue might have been resolved in 0.8.0?

Thanks!

You don’t need to connect to the cloud. You only need to make sure the modem is turned on and off at least once after cold boot.

I use a retained variable to know if it’s a cold boot. You don’t need to power on and off the modem once you’ve done it once.

2 Likes

Thank you! That tip fixed the issue perfectly!

I really appreciate the help.