# How to stop end devices going to sleep after 30 seconds

**URL:** <https://forums.digi.com/t/how-to-stop-end-devices-going-to-sleep-after-30-seconds/16132>\
**Category:** XBee & XBee Gateway\
**Tags:** data, lost\
**Created:** [January 22, 2016, 8:24am UTC](https://forums.digi.com/t/how-to-stop-end-devices-going-to-sleep-after-30-seconds/16132 "2016-01-22T08:24:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rich\_at\_home](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@rich\_at\_home](https://forums.digi.com/u/rich_at_home)\
**Post date:** [January 22, 2016, 8:24am UTC](https://forums.digi.com/t/how-to-stop-end-devices-going-to-sleep-after-30-seconds/16132/1 "2016-01-22T08:24:57Z")

</div>

I have a Co-ordinator and an End Device.

Anything I send from the co-ordinator arrives at the end device as expected.

Any response from the end device arrives at the Co-ordinator as expected UNLESS there is a gap of no data for 30 seconds.

In this case, data entered at the end device does not get sent for 15 seconds. Anything entered into the end device during that 15 seconds is lost.

So for example a command is sent from the co-ordinator to the end device. As long as the end device replies within 30 seconds, all is ok. If the end device takes longer than 30 seconds to reply, the reply is lost.

How can I fix this?

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [January 22, 2016, 8:46am UTC](https://forums.digi.com/t/how-to-stop-end-devices-going-to-sleep-after-30-seconds/16132/2 "2016-01-22T08:46:21Z")

</div>

Try using CTS flow control and adjusting your sleep settings.

---

<div class="post-metadata">

**Author:** ![rich\_at\_home](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@rich\_at\_home](https://forums.digi.com/u/rich_at_home)\
**Post date:** [January 22, 2016, 2:35pm UTC](https://forums.digi.com/t/how-to-stop-end-devices-going-to-sleep-after-30-seconds/16132/3 "2016-01-22T14:35:57Z")

</div>

Sleep settings on end device are:

Sleep Mode 4  
Time Before Sleep 8000  
Cyclic sleep period 20  
No of Cycles to Power Down IO 1  
Sleep Options 0  
Poll Rate 0

Serial Settings:

Paketization Timeout 3  
DIO7 Config CTS flow control  
DIO6 Config Disable

---

<div class="post-metadata">

**Author:** ![rich\_at\_home](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@rich\_at\_home](https://forums.digi.com/u/rich_at_home)\
**Post date:** [January 22, 2016, 2:36pm UTC](https://forums.digi.com/t/how-to-stop-end-devices-going-to-sleep-after-30-seconds/16132/4 "2016-01-22T14:36:11Z")

</div>

I have just tried monitoring CTS and I can see the end device turns CTS off after 30 seconds of inactivity.

Actually, it pulses CTS on for 9ms every 260ms once in this state.

Data arriving from the Co-ordinator sets CTS back on for another 30 seconds.

Sending data while CTS is pulsing will also force it to go back on but only after a few bytes are entered (these are lost and not send over the air).

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [January 22, 2016, 3:48pm UTC](https://forums.digi.com/t/how-to-stop-end-devices-going-to-sleep-after-30-seconds/16132/5 "2016-01-22T15:48:58Z")

</div>

Adjust the SP and ST time frames on the module.
