User`s guide
XBee RS-232 PH Adapter
12
Configuration
There are four key attributes of the Serial PH adapter’s firmware that allow
it to have a net charge on its batteries:
• Sleep Mode (SM)
•Idle Time (ST)
• Sleep Period (SP)
• Sleep Number (SN)
Sleep mode, determines what sleeping behavior the adapter has. By
default the adapter has cyclical sleep enabled. With cyclical sleep enabled,
if the adapter is idle (No RS-232 traffic, no transmit/receive) for the given
amount of Idle Time, it then performs Sleep Number amount of sleeping
cycles, each for the duration of the value of Sleep Period.
The default sleep mode settings are:
• SM = 4 (Cyclical sleep enabled)
• ST = 0x3E8 (Idle time of 1 second)
• SP = 0x40 (Each sleep period’s duration is 640 ms)
• SN = 1 (Perform 1 sleep period when sleeping)
For this configuration, the adapter would sleep for a total of 640 ms when
performing a sleep period, after it was idle for 1 second. During an RF
receive/transmit, the device is in an active state for a significant amount of
time, regardless of the Idle Time setting. If continuous requests/queries are
made to the device, it will stay in an active state, which can lead to a net
discharge of the battery, and eventually the adapter will become
unresponsive.
Adjusting the default settings is not recommended. Doing so can lead to
unit that will not power on. The fix is to remove the module from the adapter
and plug it into the serial line. Then, you can adjust these parameters
through X-CTU software. This software is available on the Software and
Documentation CD that accompanies Drop-in Networking kits and
ConnectPort X gateways.
The battery can take up to 24 hours to fully charge, and if the unit is run in
the worst-case scenario, no sleep mode enabled and continuously queried,
the battery has only a charge for around 40 minutes. After that, the unit will
become unresponsive. In addition, if the unit isn’t immediately put into a
sleep mode after the battery first becomes unable to power the adapter, the
battery will further deplete, and you will have to perform the fix mentioned
above to recover the device.
Data retrieval
Retrieving data from XBee adapters is done by issuing a remote AT IS
(Force Sample) command through the XBee API. The XBee API and AT IS
command are described in detail in the XBee ZNet 2.5 (Series 2) RF
Module data sheet. AT IS commands can be issued via a Python program
that is executed on the gateway. See also the Product Manual for the XBee
Module and the Digi Python Programming Guide.