# Electron will not properly sleep unless connected to cloud first

**URL:** <https://community.particle.io/t/electron-will-not-properly-sleep-unless-connected-to-cloud-first/42445>\
**Category:** Firmware\
**Created:** [June 15, 2018, 10:08pm UTC](https://community.particle.io/t/electron-will-not-properly-sleep-unless-connected-to-cloud-first/42445 "2018-06-15T22:08:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LabSpokane](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@LabSpokane](https://community.particle.io/u/LabSpokane)\
**Post date:** [June 15, 2018, 10:08pm UTC](https://community.particle.io/t/electron-will-not-properly-sleep-unless-connected-to-cloud-first/42445/1 "2018-06-15T22:08:55Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [June 15, 2018, 10:18pm UTC](https://community.particle.io/t/electron-will-not-properly-sleep-unless-connected-to-cloud-first/42445/2 "2018-06-15T22:18:14Z")

</div>

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.

> [@Electron SLEEP\_MODE\_DEEP tips and examples](https://community.particle.io/t/electron-sleep-mode-deep-tips-and-examples/27823):
>
> It’s a little confusing getting an Electron to go into deep sleep, using the 130 µA that it should. These six annotated code examples should hopefully clear things up. All tests were run on 0.6.0 on a Electron G350. AUTOMATIC, no system thread #include "Particle.h" void setup() { } void loop() { // Results in 133 uA power consumption // Modem is turned off, full cellular resync after restart (blinking green, blinking cyan, fast blinking cyan), 5-6K of data usage System.sleep(SLEEP\_MODE\_DE…

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.

---

<div class="post-metadata">

**Author:** ![LabSpokane](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@LabSpokane](https://community.particle.io/u/LabSpokane)\
**Post date:** [June 15, 2018, 10:57pm UTC](https://community.particle.io/t/electron-will-not-properly-sleep-unless-connected-to-cloud-first/42445/3 "2018-06-15T22:57:00Z")

</div>

Thank you! That tip fixed the issue perfectly!

I really appreciate the help.
