Skip to main content

Python tools for working with XBee radios

Project description

XBee provides an implementation of the XBee serial communication API. It allows one to easily access advanced features of one or more XBee devices from an application written in Python. An example use case might look like this:

#! /usr/bin/python

# Import and init an XBee device
from xbee import XBee,ZigBee
import serial

ser = serial.Serial('/dev/ttyUSB0', 9600)

# Use an XBee 802.15.4 device
# To use with an XBee ZigBee device, replace with:
#xbee = ZigBee(ser)
xbee = XBee(ser)

# Set remote DIO pin 2 to low (mode 4)



Extract the source code to your computer, then run the following command in the root of the source tree:

python install

This will automatically test and install the package for you.

Additionally, one may run this package’s automated tests at any time by executing:

python test

If a Test Fails

If an automated test fails, the installation will be halted to prevent one from using a potentially broken build.

In this event, one may comment out the ‘strict’ flag in setup.cfg in order to force the installation to proceed. Do so at your own risk.


See the python-xbee project on Google Code ( for the latest documentation.

To build the documentation yourself, ensure that Sphynx ( is installed. Then cd into the docs folder, and run ‘make html’. The documentation can then be opened in any modern web browser at docs/build/html/index.html.

For more information about building or modifying this project’s documentation, see the documentation for the Sphinx project.



Additional Dependencies

To run automated tests: Nose ( To build the documentation: Sphinx (

XBee Firmware

Please ensure that your XBee device is programmed with the latest firmware provided by Digi. Using an old firmware revision is not supported and may result in unspecified behavior.


Paul Malmsten <> Greg Rapp <> Brian <>

Special Thanks

Amit Synderman, Marco Sangalli

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

XBee-2.0.0.tar.gz (28.7 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page