Software Overview  |  Sitemap  |  Downloads  |  Developers  |  Forums
Small_clear_logo_llc

Recipe for Remote Sensing of Light and Temperature

This Recipe uses a Digi XBee Wall Router to remotely monitor light and temperature. One could use as many Wall Routers as one wishes to monitor light and temperature in multiple locations.

Ingredients

For this Recipe you will need:

  • an XBee Wall Router
  • an XBee Coordinator (XStick)

Before installing the Wall Router, inspect the Wall Router case until you find its serial number label. It often has a bar code at the top, and has a string underneath that begins with "SN:(S)". The serial number follows the "SN:(S)" and is a string with the digits 0-9 and the letters A-F. The serial number is a 16 digit (64 bit) hexadecimal number (a number in base 16). Write the serial number down, as you will need it for this Recipe.

Plug the Wall Router into an electrical socket where you wish to monitor light and/or temperature, and plug the XStick into a USB port on your host computer. Keep the XStick and the Wall Router less then a few tens of feet apart to begin with, as the two are wireless devices and can get out of range. Once you have things working, you can experiment over greater distances.

Here is the Script you need to run for this Recipe:

# Install an XBee Wall Router

# get the XBee address of the Wall Router
script_parameters("router_address")
# get Coordinator's USB port
script_parameters("coordinator_port")


# Add a Coordinator
run_script("Scripts/Device/XBee/Coordinator", id:"coordinator", port_location:coordinator_port)


# Add the Wall Router
run_script("Scripts/Device/XBee/WallRouter", address:router_address, id:"wall_router", port_location:coordinator_port)

To run this Script, you need two parameters, the "router_address" and the "coordinator_port". The router_address parameter is the serial number of the Wall Router. To convert the serial number to the router_address parameter, strip any leading zeros from the serial number and replace them with "0x". The coordinator_port parameter is the name of the USB port of the Coordinator. On *nix hosts, the USB port name is in the "/dev" directory. To see the devices in order of their creation, type "ls -lrt /dev" at a shell prompt and look near the bottom of the list for your Coordinator's USB port.

As an example, for a Coordinator at USB port "/dev/cu.usbserial-00002006" and a Wall Router with serial number "0013A200406B0263", the Script parameters are:

coordinator_port: "/dev/cu.usbserial-00002006"
router_address: 0x13A200406B0263

Running the Script

Run the Script. Go to the Device Explorer and expand the "wall_router". Hit the refresh button after about 30 seconds have passed. You should see the 'light_Lux', 'temp_C' and 'temp_F' terminals update with the ambient light and temperature.

Catalina Computing, LLC.

Copyright © Catalina Computing, LLC. (2013-2017)




Page last updated: Mon Dec 2 00:03:05 2013 (UTC)