If your XBee-based solution follows a hosted architecture, where the intelligence primarily resides in an external microcontroller or processor connected to the XBee device, you’ll need to develop an application on the host microcontroller to manage interactions with the XBee module.
To simplify this development process, Digi provides a variety of XBee libraries in different programming languages, allowing you to easily integrate XBee devices into your applications. These libraries handle common communication tasks, including sending and receiving data, configuring the XBee module, and managing network settings, enabling you to focus on the higher-level logic of your solution.
The following table lists the XBee libraries Digi provides to develop XBee applications for different programming languages.
Library | Language | URL | Documentation |
---|---|---|---|
Python |
|||
Java |
|||
ANSI C |
XBee Python library
The XBee Python Library is a high-level Python API designed to streamline and accelerate the development of Python applications that interact with XBee devices, significantly reducing time to market.
The XBee Python Library is only compatible with Python 3. |
Features:
Key features of the XBee Python Library include:
-
Support for multiple XBee devices and communication protocols.
-
High-level abstraction for simplified workflows and device interaction.
-
Capability to configure both local and remote XBee devices within the network.
-
Discovery of remote nodes in the same network as the local XBee module.
-
Seamless transmission and reception of data between any XBee devices on the network.
-
Management of General Purpose Input and Output (GPIO) lines for all XBee modules.
-
Communication across various XBee interfaces, including Serial, Bluetooth Low Energy (BLE), and MicroPython.
-
Discover and obtain the network topology, including the list of nodes, connections, and events.
-
Firmware updates for both local and remote XBee devices within the network.
-
Management of the file system on the XBee device.
-
Ability to apply XBee profiles to both local and remote XBee devices within the network.
Target platforms
The XBee Python Library is preferred for:
-
32-bit and 64-bit microcontrollers with an OS and sufficient resources to run Python.
-
Single-board computers (SBCs) such as Raspberry Pi, Beagle Board, Tinker Board, and similar platforms.
-
XBee Gateways.
-
General-purpose computers where multithreading and simple scripting are required.
For more information on this library and how to use it, refer to the XBee Python library User Guide. |
XBee Java library
The XBee Java Library is a high-level Java API designed to significantly reduce development time for Java applications that communicate with XBee devices, making the process more efficient.
Features:
Key features of the XBee Python Java include:
-
Support for multiple XBee devices and communication protocols.
-
High-level abstraction for simplified workflows and device interaction.
-
Capability to configure both local and remote XBee devices within the network.
-
Network discovery for identifying remote nodes in the same network as the local XBee module.
-
Seamless transmission and reception of data between any XBee devices on the network.
-
Management of General Purpose Input and Output (GPIO) lines for all XBee modules.
-
Communication across various XBee interfaces, including Serial, Bluetooth Low Energy (BLE), and MicroPython.
Target platforms
The XBee Java library is ideal for:
-
32-bit and 64-bit microcontrollers (with OS and sufficent resources to support a JVM environment)
-
Single-board computers (SBCs) like Raspberry Pi, Beagle Board, Tinker Board, etc.
-
General-purpose computers (where multithreading and cross-platform applications are needed)
For more information on this library and how to use it, refer to the XBee Java library User Guide. |
XBee ANSI-C library
The XBee ANSI-C Library is a portable collection of ANSI C code designed for seamless communication with XBee devices. Unlike shared or dynamic-link libraries, the ANSI-C Library is intended to be directly compiled and linked into your application, with most of the configuration handled during the compilation process.
Features:
Key features of the XBee ANSI-C Library include:
-
A frame dispatcher that routes complete API frames from the XBee radio to appropriate functions based on frame type.
-
An interface for sending API frames serially, handling the header and checksum automatically.
-
Message delivery that includes detailed addressing information, such as short/long remote addresses, source/destination endpoints, cluster IDs, and profile IDs.
-
The ability to respond to messages using addressing details from the envelope of a received message.
-
Support for sending AT Command frames.
-
Node Discovery functionality, with the ability to maintain a list of discovered nodes.
-
Capability to install firmware images (.EBL/.GBL or .OEM files) on the XBee radio.
-
Functions to parse and display digital and analog I/O samples.
-
An interface to interact with the General Purpose Memory (GPM) available on some XBee modules.
Target platforms
The XBee ANSI-C Library is best suited for:
-
8-bit and 16-bit microcontrollers with limited memory and processing power.
-
32-bit microcontrollers, especially in scenarios where efficiency and low-level control are essential.
It currently supports the following platforms:
-
POSIX operating systems (Windows with Cygwin or MSYS2, Mac OS X, Linux, BSD) with gcc.
-
Digi International embedded hardware platforms that use libdigiapix to control GPIO pins.
-
DOS using the OpenWatcom compiler.
-
Rabbit-brand microprocessors (using Dynamic C 10.70 or later)
-
Freescale HCS08 with CodeWarrior 10.x (part of Programmable XBee Dev Kit)
-
Freescale FRDM-KL25Z with mbed.org compiler (limited support at this time)
-
Silicon Labs SLSTK3701A Starter Kit with Gecko SDK Suite v1.1.1 or later with optional Micrium OS support.
For more information on this library and how to use it, refer to the XBee ANSI-C Library User Guide. |