Set up XBee using X-CTU

X-CTU is free software, provided by Digi (the manufacturer of XBee), which we use to configure and manage XBees, and test XBee networks.

If you haven’t already, head over to their website and download the latest release and follow their instructions to install the software.

Adding XBee’s

Before continuing on, make sure you’ve plugged an XBee (correctly) into your Explorer, and have the Explorer plugged into your computer. When you installed the drivers for your Explorer it should have been assigned port number. You’ll need that shortly.

After initially opening X-CTU, you’ll be presented with a window like this:

To add your XBee(s), click the “Add device” icon in the upper-left part of the window. That will prompt this screen to show up:

Select your communication port. If you’re lucky (or just don’t have a lot of stuff connected to your computer) you may only have one option here. Otherwise Windows users should look for the entry that says “USB Serial Port” and Mac users should look for something like “usbserial-XXXXXXXX”. (If you’re using a USB board, that is. If you’re using a Serial Explorer, pick the “Communications Port” option.)

This window also allows you to specify more specific serial characteristics like baud rate, data bits, and stop bits. Assuming this is the first time you’ve used your XBee, you can leave those settings alone. So make sure those values look just as they do in the image above and click Finish.

A “Discovering radio modules…” window will briefly scroll by, after which you should be presented with the original window, but with an addition to the “Radio Modules” section on the left. (If X-CTU failed to find a module, check out our troubleshooting page.)

Click that new module, and wait a few seconds as X-CTU reads the configuration settings of your XBee. You should then be presented with the entire configuration of your XBee.

As you can see by scrolling down the right half, there are a lot of configuration settings available. We’ll get to some of those later. For now, though, verify that the configurable settings visible in the screenshot above match those of your XBee (channel=C, PAN ID=3332, DH=0, DL=0, MY=0).

Do It Again

To test communication between your XBee’s you’ll need to connect your second XBee to a computer as well. That means doing the “Add device” dance one more time.

If you have another computer available, you can install X-CTU on that as well and perform the same set up. You can certainly perform this test with both XBees connected to the same computer as well, just make sure you select the correct port number when you’re adding the second XBee.

If you add a second XBee to the same computer, a second entry will be added to the “Radio Modules” list. Selecting either of those entries will show the configuration settings for that, specific XBee.

Note that there are two XBees in the list on the left. The configuration values shown are for the highlighted XBee.

If you’re ever unsure which XBee is which, try to match up the MAC numbers. These numbers are printed on a sticker on the bottom side of your XBee, and they’re also listed in XCTU. (It’s listed as the “Serial Number” high and low, and is un-modifiable.)

Each XBee has a unique MAC address, printed on a sticker in the highlighted area.

As with the last module, make sure all settings are defaulted (channel=C, PAN ID=3332, DH=0, DL=0, MY=0). That’ll make the next step possible.

Quick and Easy Test

Click the “Switch to Consoles” icon – – in the upper-right part of the window. This will switch from the configuration tab to the console. We can use the console to send characters to an XBee, which will route that character over-the-air to any other XBee it’s connected to.

If you have two XBees connected to your computer, you can switch between each radio’s console by selecting the device on the left.

First, open a serial connection on each device by clicking the connect icon – . The icon will change, and the border of the console will turn green.

Next, click into the left half of the console, and type a letter or number. You should notice that character echoed in a blue font (the hexadecimal digits on the right represent the ASCII value). Now click into the other XBee’s console. As long as it was open, you should see that same character, but red. Try typing a different character into the second XBee’s console, and you should see it work the other way.

If that worked, then your XBees are configured to talk to each other! If not, check out the troubleshooting page.

That your XBees can talk to each other out of the box is no real surprise. They’re all configured to, by default, be on the same network with the same addresses. That might be OK, but what if your neighbor is running an XBee-based robot control network, while you’re trying to automate your house? Every time they try to roll a bot forward, your garage door might open! To be safe, you should configure your XBees to operate on a unique network. Fortunately, that, and most other XBee settings are easy to change. On to the next page!

Configuring Networks

As we’ve mentioned, XBees are awesome because they’re highly – and easily – configurable. Most of the XBee configuration settings come down to controlling which other XBees it can talk to. On this page, we’ll show you how to configure three of the most important XBee settings there are: PAN ID, MY address, and destination address.

There are a few levels to XBee networks. First, there’s the channel. This controls the frequency band that your XBee communicates over. Most XBee’s operate on the 2.4GHz 802.15.4 band, and the channel further calibrates the operating frequency within that band. You can usually leave the channel setting alone, or at least make sure every XBee you want to have on the same network operates on the same channel.

The next level of an XBee network is the personal area network ID (PAN ID). The network ID is some hexadecimal value between 0 and 0xFFFF. XBees can only communicate with each other if they have the same network ID. There being 65536 possible ID’s, there’s a very small chance that your neighbor will be operating on the same network (as long as you change it from the default!).

Finally there are MY and destination addresses. Each XBee in a network should be assigned a 16-bit address (again between 0 and 0xFFFF), which is referred to as MY address, or the “source” address. Another setting, the destination address, determines which source address an XBee can send data to. For one XBee to be able to send data to another, it must have the same destination address as the other XBee’s source.

For example, if XBee 1 has a MY address of 0x1234, and XBee 2 has an equivalent destination address of 0x1234, then XBee 2 can send data to XBee 1. But if XBee 2 has a MY address of 0x5201, and XBee 1 has a destination address of 0x5200, then XBee 1 cannot send data to XBee 2. In this case, only one-way communication is enabled between the two XBee’s (only XBee 2 can send data to XBee 1).

We can use X-CTU to easily configure each of those settings. Here’s how:

Radio Configuration

After the last page, you should already have at least one XBee connected to X-CTU. If you’re still over in the console tab, click back over to the Configuration tab – . Take a peak at the very first handful of settings, and you should see some familiar acronyms: CH, ID, DH, DL, and MY. Beside each of those blocks is a text box – that’s where we’ll type in our new settings.