XBee Wall Router

From Digi Developer

Revision as of 20:22, 15 March 2012 by Lynnlinse (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search
Product Information
Image:XBee_Wall_Router.jpg
Product Name:XBee Wall Router
Digi Product Page:[1]

Contents

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

Major Features of the XBee Wall Router:

  • Provides XBee network extension
  • Light sensor
  • Temperature sensor

Supported Platforms

The XBee Wall Router is supported on:

  • XBee-PRO ZB Wall Router (ZB or ZigBee)
  • XBee Smart Energy Range Extender (SE)
  • Xbee-PRO DigiMesh 2.4 Range Extender (DM24 - there is no DM 868/900Mhz versions!)

Five versions of each exist with interchangeable AC power pins for use in: US, EU, UK, Australia and Japan. All of Digi's gateway products that support ZB, SE and DM24 are compatible.

Note that the units are chemically welded shut for UL safety reasons. Therefore, you cannot buy a ZB unit and for example convert it into a DM 900Mhz unit by just swapping XBee modules.

Supported Firmware

  • For the ZB Wall Router, run 'ZIGBEE AT Router' firmware. Newer firmware sets include a better 'ZIGBEE ROUTER AT (WALL RT)' firmware which supports 20 end-device/children nodes instead of the traditional 12.
  • For the SE Range Extender, run 'SE RANGE EXTENDER' firmware.
  • For the DM24 Range Extender, run 'XBEE PRO DIGIMESH 2.4 WALL_ROUTER' firmware.

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.

 - name: hallway
   driver: devices.xbee.xbee_devices.xbee_xbr:XBeeXBR
   settings:
       xbee_device_manager: zb_man
       extended_address: "00:13:a2:00:40:6b:16:31!"
       sample_rate_ms: 60000


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:

degf = (degc * 1.8) + 32.0
Personal tools
Wiki Editing