# Keepalives between sleep (stop mode) periods

**URL:** <https://community.particle.io/t/keepalives-between-sleep-stop-mode-periods/25276>\
**Category:** General\
**Created:** [August 22, 2016, 11:43am UTC](https://community.particle.io/t/keepalives-between-sleep-stop-mode-periods/25276 "2016-08-22T11:43:42Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Eco-Ants](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@Eco-Ants](https://community.particle.io/u/Eco-Ants)\
**Post date:** [March 4, 2017, 8:59pm UTC](https://community.particle.io/t/keepalives-between-sleep-stop-mode-periods/25276/11 "2017-03-04T20:59:49Z")

</div>

> [@peekay123](#):
>
> @ScruffR, the keep-alive won't work when sleeping. @BDub will be writing some docs for the power/data saving modes. Bottom line is you can save on data or you can save on power but you can't do both together without some caveats.

Hi, Have the above mentioned docs on power/data saving modes been written ?

I too am very interested in low data use, **and** low power use for a battery powered sensor project.

I have trawled through pages and pages of forum wisdom. I've also read:  
[https://docs.particle.io/reference/firmware/electron/#sleep-sleep-29](https://docs.particle.io/reference/firmware/electron/#sleep-sleep-29)

I will try to explain...  
I'm using an Electron with an additional 12v 9Ahr battery (boosted with solar charging) that reads an anemometer every 2 s.  
Stop-mode sleeping (System.sleep(SLEEP\_PIN,FALLING,2))  
in between readings and only publishing a Health Status update daily (to me) and publishing an alert to the client if wind exceeds storm levels.  
This has been working fine for the last 6 months 😄

Now I want to add 20min live web based graphing.  
I have hacked up test code working on my test Electron, but I now want to optimise that code for battery life.  
The code I have working simply uses a delay of 2s, stays connected all the time and publishes data every 20mins to keep inside the magic 23 minute ping window. Thus keeping the data use as low as possible.

To keep my current consumption as low as possible I would like to be able to stop the micro and sleep for 2s between readings as the time spent awake to do a few ADC readings and check for excessive winds is very short.

The tricksy part is that I then want to connect every 20 mins, publish a string of data values concatenated together and **disconnect** while **leaving the network on standby** for the next publish in 20mins.  
From what I have read, it seems this isn't possible at the moment because when I call Celular off(), it's not possible to also call NETWORK\_STANDBY.  
(please correct me if I'm wrong)

> [@SLEEP\_NETWORK\_STANDBY with Cellular.off()?](https://community.particle.io/t/sleep-network-standby-with-cellular-off/22138/7):
>
> This will be addressed in 0.6 which will also avoid needing to resync with the cloud after waking up from deep sleep.

It seems that the above will be fixed with 0.6  
Does anyone know when this 0.6 will be released ??

If anyone can see a way around the above issues before 0.6 comes out, please let me know 😄  
Thanks  
Ants

---

_[View the full topic](https://community.particle.io/t/keepalives-between-sleep-stop-mode-periods/25276)._
