User`s guide

XBee Sensors
56
Upload Python modules to gateway
1. Go to www.digi.com/din/docs.
2. In the list of downloadable files, select and download file
XBee Adapter Libraries.
3. Unzip the downloaded file.
4. Read the readme file.
5. Open the web interface for the gateway, go to Applications > Python.
6. In the Upload File edit box, enter the file name for the
XBee Adapter Libraries, DigiXBeeDrivers.zip, using the Browse
button as needed, and click Upload.
Use Python modules in programs
To use the Python modules in the XBee Adapter Libraries in programs that
you develop, append this statement:
sys.path.append("WEB/python/DigiXBeeDrivers.zip")
Use xbeelt.py functions in Python programs
To use the functions in the module xbeelt.py for programming light and
temperature functions in a XBee Sensor /L/T product, any Python
programs you create must contain this statement:
from xbeeltn import *
The functions and arguments in module xbeelt.py are as follows:
############################################################################
# #
# Class XBeeLTN #
# #
############################################################################
# #
# This class derives from the base XBeeDevice class, and implements #
# the LT (Light/Temperature) layer of the Digi XBee LT Adapter. #
# #
############################################################################
# #
# Functions: #
# #
# raw_sample() #
# #
# Returns a dictionary of raw analog sample data #
# #
# The dictionary will contain the following keys: #
# 1) 'temperature' #
# 2) 'light' #
# #
# #
# sample() #
# #
# Returns a dictionary of data scaled into actual usable values. #
# #
# The dictionary will contain the following keys: #
# 1) 'temperature' - Degrees in Celsius. #
# 2) 'light' - value in lux. #
# #
############################################################################