Product Description

The XBee Wall Router is a XBee network extending device that is mains powered and additionally provides temperature and light sensor input. It is designed to be used in conjunction with other XBee enabled devices. For more details of usage and configuration, please review the Drop-in-Networking Accessories User's Guide at: http://www.digi.com/din/docs

In all 3 products, any normal 'router' firmware can be used. However, never load one of the special ANALOG, DIGITAL, SENSOR, 232 or 485 firmwares since these will assume I/O pin assignments which are not true within the product - recovery may not be possible.

Programming Options

The XBee Wall Router uses a Router AT command set. Due to not having serial port access, all configuration must be done via RF through remote AT commands.

Note: the information below does not apply to the XBee Smart Energy Range Extender! Use the Smart-Energy framework for that product.

Enabling the sensors

Enabling the light sensor

D1=2 (Enables the DIO line tied to the light sensor for analog input)

Enabling the temperature sensor

D2=2 (Enables the DIO line tied to the temperature sensor for analog input)

Note: Due to being mains powered, self heating occurs in the device and the temperature sensor may read several degrees higher Celsius then its outside environment. It is estimated that this affect is approximately 4 degrees Centigrade.

Obtaining the Data

Since the Wall Router is always awake, you can poll with the remote AT request for the 'IS' value. The result is a packed binary structure defined in the various XBee manuals in sections titled "Analog and Digital IO Lines" and/or "IO Sampling".

Yet polling has two disadvantages:

It creates two RF packets instead of one

if the Wall-Router is offline, literally your outbound XBee channel may be limited for up to 30 seconds.

The better solution is to set the XBee IR parameter to a non-zero value - for example 60,000 (0xEA60) to cause the Wall Router to asynchronously send the same 'IS' response once per minute without the need to issue the poll. You would bind on the socket ("", 0xe8, 0xc105, 0x92) to receive all incoming 'IS' responses and decode them per the XBee documentation.

General XBee Programming Options

There are many options to consider when making wireless programmatic access to an XBee network of devices or device adapters. In broad terms, one may write a program which runs on a PC to interact with a network or one may use a gateway device, such a ConnectPort X [2] gateway.

When using a PC, one may consider using the simplistic and easy "AT-Command" mode for the XBee attached to the computer. Although using this mode is straight-forward it does not offer one as fine of control as when using the "API mode" firmware option.

One may also consider using a Digi ConnectPort X family of gateway device to provide additional intelligence and flexibility when connecting to a network of wireless devices. The ConnectPort X [3] offers a customizable Python Programming Environment and instant connectivity to the Device Cloud Management Platform. The ConnectPort X offers users the ability to choose to write their own applications from the ground-up, using Digi's and Python's[4] reference and example information, or to use the highly extensible DIA Application to collect and aggregate information.

iDigi Dia Configuration and Programming Examples

The Wall Router uses the Dia driver named XBR (xbee_xbr.py). The YML example below adds support for a Wall Router or Range Extender with the extended (MAC) address of "00:13:a2:00:40:6b:16:31!". The unit sends in its data (without polling) once per minute. In this example the device has been called hallway, so its data would exist in iDigi channels named hallway.temperature and hallway.light.

Python Programming Examples

Calculating the millivolts

The formulas to create real-world readings for both analog sensors requires knowing the millivolts which the Xbee within the wall-router/range-extender sees. The data sample returns the ADC value as between 0-1023, which your code needs to return to millivolts (mv). You should force the result to a floating point value.

The millivolt formula for ZB / SE:

mv = float(value * 1200) / 1023

The millivolt formula for DM (the DM VRef varies product by product - for the Range Extender it is 3.3vdc):

mv = float(value * 3300) / 1023

Calculating the light reading

The light sensor is not reading a standardized light-level. It is a number which increases with brightness and decreases with dimness.

light = mv

Calculating the temperature reading

Given the mv, we can directly calculate degree Celsius. Since the AC/DC conversion within the products tends to be self-heating, we subtract a fixed 'fudge-factor' which tends to be around 4 DegC. :

degc = ((mv - 500.0) / 10.0) - {fudget factor of about 4.0 degC}

If you wish to have degree Fahrenheit instead, you can convert the degree Celsius like this: