Manage End Devices Sleep examples
Digi XBee® 3 Zigbee® RF Module
166
Example 3: configure a device for extended sleep: to sleep for 4
minutes.
n SP and SN must be set such that SP * SN = 4 minutes. Since SP is measured in 10 ms units, use
the following settings to obtain 4 minute sleep.
n SM = 4 (cyclic sleep) or 5 (cyclic sleep, pin wake) SP = 0x7D0 (2000 decimal, or 20 seconds).
n SN = 0x0B (12 decimal).
n SO = 0x04 (enable extended sleep).
With these settings, the module sleeps for SP * SN time, or (20 seconds * 12) = 240 seconds = 4
minutes.
For best results, the end device should send a transmission when it wakes to inform the coordinator
(or network) when it wakes. It should also remain awake for a short time to allow devices to send
data to it. The following are recommended settings.
n ST = 0x7D0 (2 second wake time)
n SO = 0x06 (enable extended sleep and wake for ST time)
n IR = 0x800 (send 1 I/O sample after waking). Enable at least one analog or digital I/O sample
enabled for I/O sampling.
With these settings, the end device wakes after 4 minutes and sends 1 I/O sample. It then remains
awake for 2 seconds before returning to sleep.
Set SP and SN to the same values on all routers and coordinators that could potentially allow the end
device to join. This ensures the parent does not timeout the end device from its child table too quickly.
The SI command can optionally be sent to the end device to cause it to sleep before the sleep timer
expires.