Configuring XBees for API Mode

Picture of Configuring XBees for API Mode
XBee are popular wireless modules used by hobbyists and DIYers.  These wireless modules come in variety of styles and power ratings (distance ranges).  There are several tutorials even instructables for configuring XBees for point-point (P2P) communication.  P2P communication is restricted between two end-points and this is all you need if you only have two wireless devices in your setup.  What do you if you have multiple devices...say a network?  Perhaps we should start with a simpler set up.  

In this instructable, I will show you how to configure XBees for a point-to-multipoint mesh.  In this configuration, there will be one central COORDINATOR and multiple END DEVICES.  The END DEVICES will send and receive messages from the COORDINATOR and the COORDINATOR will have to sort which wireless packets came from which END DEVICE and send packets to the appropriate END DEVICE as well.  
Remove these adsRemove these ads by Signing Up

Step 1: Wireless Setup

The XBee modules can be configured in two ways: Transparent Mode (AT) and API Mode (API). In AT mode you are limited to point-to-point communication between two XBees. In API mode, we can trivally send and receive from both the COORDINATOR and many many XBees out in the world.  Additionally, API mode will expose a variety of additional information encoded in each packet. 

In a point-to-multipoint wireless configuration (see picture 1), multiple nodes (Router/End Devices) pictured in blue, send to and receive from a central coordinator (red).

Andrew Rapp wrote a great XBee Java API which can be found here:

Andrew also provides detailed instructions for integrating the XBee API with the popular IDE Eclipse. For my project (and for unknown reasons) I decided on using the Swing JAVA GUI library which, for me, was a little easier to develop for using NetBeans. Therefore, I will also provided instructions on how to setup the XBee JAVA API using Netbeans. But first we need configure the firmware on the XBee. 
doriole11 months ago
Step 4: XBee Java API
can you tell me why is this step needed?
UtBKY2 years ago


i'm trying to use netbeans. i added a project folder "TestXBeeJavaAPI".

i added C:\dev\libs\java\xbee-api-0.9\lib to libraries and C:\dev\libs\java\xbee-api-0.9\src\ to source packages, but i get many red exclamation marks. any ideas?
fpapi3 years ago
I'm sorry, but will this work for series 1 as well? Thks =D
quasiben (author)  fpapi3 years ago
Yes! But you will have to use the following settings:
Modem: XB24
Function Set: XBEE 802.15.4
Version 10E8 or higher
pigpenguin3 years ago
I spy a triforce on that xbee :P
hronist3 years ago