User`s guide

XBee Digital I/O Adapter
35
Python modules for configuring inputs and outputs
Digi provides a library of Python modules for configuring inputs and outputs
on the adapter and retrieving data from the adapter. These modules are
available for downloading from www.digi.com/din/docs, in a file named
XBee Adapter Libraries. By uploading these Python modules to the
gateway that serves as a coordinator for the adapter, you can use them in
your own programs.
The Python modules in the zip file that are relevant to programming the
XBee Digital I/O Adapter are:
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")
Module Description
xbeeprodid.py Contains calls to determine the type of adapter; (Analog,
Digital, Sensor, RS-232, etc.)
xbeedevice.py Implements a base class of any XBee device on the ZigBee
network.
xbeedin.py Configures inputs and outputs, issues AT commands to
retrieve data from the adapter, and toggles power on/off on
terminal 6. Functions and arguments are shown page 36.
Derives an DIO (digital input/output) class from the base
class of any Digi Xbee device on the mesh network. That is,
module xbeedin.py uses xbeedevice.py internally.
sensor_io.py Decodes the output of the AT IS command.