Configuring My First XBee Radios

by January 25, 2012 05:36 AM

XBee Radios

These are my first three XBee radios. Two of them are already connected to SparkFun XBee Explorers and the one in the middle is tagged with a note to remind me which one is configured as the coordinator (I did the connecting and tagging of course - they don't come like that).

If you don't know already, a ZigBee network consists of exactly one coordinator and any number of routers and end devices. Get the book or read about it on Wikipedia if you want the full story - my aim isn't to reveal everything the book has to offer, but rather document my personal journey into embedded devices.


The first step according to the book is to use a program called X-CTU (free from Digi) to ensure the firmware is up to date. So one at a time, I used the xbee explorer to connect the radios to my computer via USB. All three were already configured with the latest firmware so that was easy.

Time to configure and do the first test

X-CTU Configuration

The next step is to choose a terminal program that I can use to connect to the radios and issue AT commands to configure them. Since Windows no longer ships with a terminal program, I chose to just use the terminal tab in X-CTU. The author suggested picking a stand alone terminal program for various good reasons, but I just wanted to get to the good stuff.

The idea for the initial configuration and test is to set up two of the radios such that they can talk to each other wirelessly. This means putting both radios on the same network, or setting the PAN address (PAN = Personal Area Network), and then setting each radio's destination address as the other radio. The PAN is a number between 0 and 0xFFFF that you arbitrarily pick. A radio's address however is globally unique and printed directly on the xbee (or you can type ATSH/ATSL to get the high and low parts of the address from within the terminal program).

In the image you can see my configuration for the coordinator. I had already configured the router (using the information from ATSH and ATSL in the screenshot). The "+++" is how you enter into command mode where you can issue AT commands. Outside of that everything you type is sent directly to the radio and transmitted wirelessly. Notice how I had to type ATDL twice? That's because I took too long between issuing the ATDH command and issuing the first ATDL command. Basically the radio times out after 10 seconds and returns to transparent mode where it transmits everything typed instead of looking for commands. I knew it had timed out on me when it didn't return the red "OK". So I typed "+++" again and then reissued the ATDL command followed by the ATWR command to save the configuration permanently.

After that I waited until it timed out and then typed that last line. And sure enough, when I turned around and looked at my laptop (where the router was plugged in), there was the sentence that I had typed on my PC. Super basic and easy but still very cool!

What's Next

Like I said in my first post, I've already devoured the book. Instead of following along in order, I'm going to skip the doorbell and romantic lighting projects and jump to something I find more interesting: Simple Sensor Network (remote temperature sensors). I currently have three radios, so I'll have one connected to my PC as the coordinator and will put the other two at various points around the house. Exciting stuff!

Tags: , , ,