# Data Usage, No\_ACK, and SLEEP\_NETWORK\_STANDBY Help

**URL:** <https://community.particle.io/t/data-usage-no-ack-and-sleep-network-standby-help/25600>\
**Category:** Troubleshooting\
**Created:** [September 4, 2016, 4:51pm UTC](https://community.particle.io/t/data-usage-no-ack-and-sleep-network-standby-help/25600 "2016-09-04T16:51:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SirT](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@SirT](https://community.particle.io/u/SirT)\
**Post date:** [September 4, 2016, 4:51pm UTC](https://community.particle.io/t/data-usage-no-ack-and-sleep-network-standby-help/25600/1 "2016-09-04T16:51:37Z")

</div>

Hi all,

My project sends data once every half an hour using the following command:

“Particle.publish(“SendByteKeeperData”, bigstr, PRIVATE, NO\_ACK);”

After this I then use the following to put the device into deep sleep:

“System.sleep(SLEEP\_MODE\_DEEP, 1800);”

Despite its name, “bigstr” is actually only 26 characters long. Doing this I am using 0.1MB of data every 12 hours, which seems like a lot to me.

The NO\_ACK is new, I tried adding that with no change in data usage. Meaning it must not be the responses/retries that are using up my data. Because I am using SLEEP\_MODE\_DEEP I am now suspecting it may be all the handshaking. I want to try a different mode (I actually have an excess of power so I have room to play with). However I have confused myself big time with regard to regular sleep mode.

Per documentation:  
“System.sleep() can be used to dramatically improve the battery life of a Particle-powered project by temporarily deactivating the Wi-Fi module, which is by far the biggest power draw.”

But that would require a handshake upon wake-up no? But wait there is a solution: SLEEP\_NETWORK\_STANDBY  
BUT per documentation:  
"The Electron maintains the cellular connection for the duration of the sleep when SLEEP\_NETWORK\_STANDBY is given as the last parameter value. On wakeup, the device is able to reconnect to the cloud much quicker, at the expense of increased power "

So, now I am confused the SLEEP\_NETWORK\_STANDBY appears to undo the one thing the regular sleep mode does. Help please!

Also, if I do use System.sleep() and I dont want my code looping for the duration of the sleep, is there a more elegant solution than using delay, or telling it to look for a rising edge on a grounded pin for 30 min?

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [September 4, 2016, 6:01pm UTC](https://community.particle.io/t/data-usage-no-ack-and-sleep-network-standby-help/25600/2 "2016-09-04T18:01:23Z")

</div>

How about waking every 23 minutes as this is the keepAlive periode for Particle SIMs?  
Any longer and you'll inevitably have to rehandshake.

SLEEP\_NETWORK\_STANDBY has a very low impact on the current draw of the module while sleeping but that tiny amount of current used will help you save loads on next wake.

> [@SirT](#):
>
> Also, if I do use System.sleep() and I dont want my code looping for the duration of the sleep, is there a more elegant solution than using delay, or telling it to look for a rising edge on a grounded pin for 30 min?

I don't quite understand that. What's looping and where will you use a delay?  
If you want to stop your code from running you'd use Stop Mode sleep (aka `System.sleep(pin, trigger, timeout, SLEEP_NETWORK_STANDBY)`) - what's not elegant in that?

---

<div class="post-metadata">

**Author:** ![SirT](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@SirT](https://community.particle.io/u/SirT)\
**Post date:** [September 4, 2016, 7:44pm UTC](https://community.particle.io/t/data-usage-no-ack-and-sleep-network-standby-help/25600/3 "2016-09-04T19:44:29Z")

</div>

Thanks ScruffR! I will give using deep sleep mode every 20 min a try and see how that does.

What I was trying to ask about the System.sleep() is it says it will keep running your code even after you call it, I don’t want that, which is why I went to deep sleep. But I was wondering if maybe I would be better off using regular System.sleep() followed by a delay to hold the code there until sleep is done (if I don’t want to reference an external pin).

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [September 4, 2016, 7:52pm UTC](https://community.particle.io/t/data-usage-no-ack-and-sleep-network-standby-help/25600/4 "2016-09-04T19:52:53Z")

</div>

If you mean the network sleep (`System.sleep(timeout)`) then you won’t really save a lot of energy regardless if your code runs or you just idle in a delay or loop.  
To be honest, I don’t even see a lot of use in its existence.

I’d rather go for the Stop Mode sleep, as mentioned above and if you don’t want to donate any of your pins for that, you can use a dummy pin (which doesn’t feature interrupt capabilities, or you could try a nonexistent pin e.g. -1) or what I like to do, use the SETUP button:

```cpp
  System.sleep(BTN, FALLING, timeout, SLEEP_NETWORK_STANDBY);

```

---

<div class="post-metadata">

**Author:** ![SirT](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@SirT](https://community.particle.io/u/SirT)\
**Post date:** [September 4, 2016, 8:06pm UTC](https://community.particle.io/t/data-usage-no-ack-and-sleep-network-standby-help/25600/5 "2016-09-04T20:06:05Z")

</div>

> I'd rather go for the Stop Mode sleep, as mentioned above and if you don't want to donate any of your pins for that, you can use a dummy pin (which doesn't feature interrupt capabilities, or you could try a nonexistent pin e.g. -1) or what I like to do, use the SETUP button:

> System.sleep(BTN, FALLING, timeout, SLEEP\_NETWORK\_STANDBY);

Perfect! Thanks!!
