Specifications

XBee®/XBeePRO®SERFModules
©2009DigiInternational,Inc. 78
devices in a network have more than one SP setting, SP on the routers and coordinators should be
set to match the largest SP setting of any end device. This will ensure the RF packet buffering, poll
timeout, and transmission timeouts are set correctly.
Extended Sleep Periods
Pin and cyclic sleep devices that might sleep longer than 30 seconds cannot receive data
transmissions reliably unless certain design approaches are taken. Specifically, the end devices
should use IO sampling or another mechanism to transmit data when they wake to inform the
network they can receive data. SP and SN should be set on routers and coordinators such that (SP
* SN) matches the longest expected sleep time. This configures the poll timeout so end devices
are not expired from the child table unless a poll request is not received for 3 consecutive sleep
periods.
As a general rule of thumb, SP and SN should be set the same on all devices in almost all cases.
Sleep Examples
This section covers some sample XBee configurations to support different sleep modes. Several AT
commands are listed with suggested parameter values. The notation in this section includes an '='
sign to indicate what each command register should be set to - for example, SM=4. This is not the
correct notation for setting command values in the XBee. In the API, the two byte command is
used in the command field, and parameters are populated as binary values in the parameter field.
Example 1
Configure a device to sleep for 20 seconds, but set SN such that the On/Sleep line will
remain de-asserted for up to 1 minute.
The following settings should be configured on the end device.
SM = 4 (cyclic sleep) or 5 (cyclic sleep, pin wake)
SP = 0x7D0 (2000 decimal). This causes the end device to sleep for 20 seconds since SP is
measured in units of 10ms.
SN = 3. (With this setting, the On/Sleep pin will assert once every 3 sleep cycles, or when RF data
is received)
SO = 0
All router and coordinator devices on the network should set SP to match SP on the end device.
This ensures that RF packet buffering times and transmission timeouts will be set correctly.
Since the end device wakes after each sleep period (SP), the SN command can be set to 1 on all
routers and the coordinator.
All router and coordinator devices on the network should set SP to match SP on the end device.
This ensures that RF packet buffering times and transmission timeouts will be set correctly.
Example 2
Configure a device for extended sleep: to sleep for 4 minutes.
SP and SN must be set such that SP * SN = 4 minutes. Since SP is measured in 10ms units, the
following settings can be used to obtain 4 minute sleep.
SM = 4 (cyclic sleep) or 5 (cyclic sleep, pin wake)
SP = 0x7D0 (2000 decimal, or 20 seconds)
SN = 0x0B (12 decimal)
SO = 0x04 (enable extended sleep)
With these settings, the module will sleep 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.