A Friendly Introduction to XBee

Digi XBee radios sure are handy for wireless communication in embedded systems, so let’s take a look from a newbie perspective at how to get two of ‘em talking to each other quickly.

This tutorial can be applied generically to any setup with any two XBee radios, so long as you have them plugged in and ready to work with a serial port. That being said, this is a list of parts used in this tutorial:

As far as software goes, we’re going to need to use the one and only Xbee programming tool, XCTU from Digi (Windows, Mac OS, and Linux). Although, I suppose if you were hardcore, you could program using raw AT commands at the console, but I doubt that’s a path you’re willing to take at this time!

We’ll start with installing the software, configuring the XBee radios, installing them, and finally get them talking to each other.

Digi XCTU Software

Installation of the Digi XCTU software should be straightforward enough. Head over to the XCTU download page, download it for your platform, and follow the install instructions.

When you’ve installed it, open it up. Here’s what you should see:

Okay! Now, we’ll move onto hooking up the XBee radios using the XBee explorer breakout board and configuring them using our newly installed XCTU program.

Configuring the XBee Radios

Here’s where the rubber meets the road, so to speak! We’re going to break out the SparkFun XBee Explorer and program both of the XBee radios so they can talk to each other. All we need here is a USB Mini-B cable to connect the XBee Explorer in with our computer with XCTU installed. Grab one of the XBee radios and install it into the XBee explorer, then plug the XBee explorer into the USB cable connected to the computer.

 

 

 

Once you’ve made the connections, open XCTU (if you haven’t already) and click on the “Discover devices” button. From here, you just have to scan for your device plugged into the XBee Explorer.

 

Now, before we continue, there are a couple of concepts and some terminology we’ll need to be familiar with.

With an XBee network like we’re setting up, there needs to be a coordinator and an end device. You can almost think about it as having a router and a computer.

  • With an XBee network like we’re setting up, there needs to be a coordinator and an end device.  You can almost think about it as having a router and a computer.
  • We need both of the radios to be on the same channel and network, or PAN in this case.
  • Every option is abbreviated with a two letter key.  The ones we’re concerned with for this guide are:
    • CH – Channel
    • ID – PAN ID
    • MY – 16-bit Source Address
      • This is the address of the current device and can be any 16 bit number.
    • DL – Destination Address Low
      • DL is the address of the device you want to talk to, it can be any other 16 bit number other than MY.
    • CE – Coordinator Enable
    • BD – Interface Data Rate (Optional)
    • CT – AT Command Mode Timeout (Optional)
  • The XBee radios are programmed using AT commands over serial console.  The XCTU program makes programming the XBee incredibly easy as it takes care of running all the AT commands transparently in the background.

Pro Tip: Save yourself some headaches and label your XBee radios in order to tell them apart. A piece of tape or tiny post-it note and permanent marker will do just fine. Label one with “C”, for “Coordinator” and the other with “ED”, for “End Device”. You could also write the MY, 16-bit Source Address, for extra clarity.

Program the Coordinator

Okay, let’s take our first XBee radio, which we’ll designate as our Coordinator (and will ultimately be installed in the TS-7553-V2), and open the “Configuration” window in XCTU. This is what you should be looking at:

Pro Tip: XCTU is pretty well designed, with handy little UI gems like a blue ‘dog ear’ triangle to mark which settings have changed from defaults. Firmware updates, updating individual settings, and more come in pretty handy. Be sure to familiarize yourself once you’re ready.

Here’s what we’re going to set on our coordinator:

These two configuration changes are optional, but if you do change them, make sure to set the same on both XBee radios. We found these additional settings make things run smoother and more responsive.

Once you’ve set these configurations, make sure to click on the “Write” button to save the changes to the XBee radio. Once it’s finished writing, go ahead and unplug the XBee Explorer and take out the XBee radio.

Installing the Coordinator

This is where our TS-7553-V2 comes into play. This guide is going to assume you’re already familiar with getting the TS-7553-V2 powered on and ready for development. If you’re not there yet, you can take a look at the “Practical Guide to Getting Started With the TS-7553-V2”. There’s a XBee socket on the TS-7553-V2 that shows up under the /dev/ttymxc7 serial device.

Before we can plug in our XBee radio, we need to remove or bend pin 8 of the XBee radio in order to avoid conflicts (to be fixed in a later revision).

Then, plugin the XBee radio we’ve designated as the coordinator like this:

Pro Tip: Make sure that the flat end of the XBee radio is facing back towards the USB and Ethernet connectors. Otherwise, you may do permanent damage to the XBee radio.

Then, let’s be sure that the XBee radio is powered on and ready to communicate. First, issue the command to make sure it’s turned on (it should be by default):

Then, let’s open a serial connection with the XBee radio using picocom, making sure that the baud rate is set to the same value as BD, Interface Data Rate on the XBee radios.

Perfect! Now, we’re ready for the next step.

Program the End Device

Now, we’re going to install the second XBee radio into the XBee Explorer and then plug in the XBee Explorer into the computer. We’re going to designate this radio as our End Device. Do the same thing as before and click on the “Add devices” or “Discover devices” buttons to find your device and load up the “Configuration” window, like so:

Here’s what we’re going to set on our end device:

And again, these are optional, but they must be the same on both devices.

Great! Now, we’re going to leave this one plugged into the XBee explorer for the next step.

Time to Start Talking!

Now, the exciting part, communicating wirelessly over a serial port provided by the XBee radio. We start off by going back to our XCTU program where we left off and open the “Console” window, like so:

We’re now going to send a packet to the coordinator installed in our TS-7553-V2 from our end device. Click on the plus icon (+) next to the “Send packets” field. Here, type in your ASCII message. Something as simple as “Testing” will work. Save the packet once finished. Then, select the new packet and click on the “Send selected packet” button. Head over to the TS-7553-V2 picocom session we opened earlier and you should now see “Testing” written on the screen! Start typing in picocom, like “Testing back!”, and you should see the message being written in the Console log field of the XCTU program!

Congratulations on setting up your wireless serial console connection! You’re well on your way to creating something awesome using XBee radios!

Conclusion and Next Steps

In this guide, we walked through what it took to install, configure, and wireless transfer data over two XBee radios. Now that you have the basics out of the way, it’ll be time to dive into a wireless XBee world with different topologies and configuration options.

If you have any further questions, or feel like we’ve forgotten to mention anything, please let us know in the comments below!

Practical Guide to Getting Started with the TS-7670

This practical guide gives us an opportunity to take a relaxed approach to getting started with the TS-7670 single board computer. We’re going to take a look at how to make our first connections, and setup the network. These are usually the first things we do before starting development. In the grand scheme of things, this is just a friendlier extrapolation from the official TS-7670 manual, so be sure to keep it handy for more advanced topics and specific details. The only assumption being made is that you’ve purchased the TS-7670 with a development kit, including the pre-programmed microSD card. Right then, let’s get started!

Continue reading “Practical Guide to Getting Started with the TS-7670”

Getting Started with GPS on the TS-7670

One big draw to the TS-7670 is the GPS receiver feature. When paired with a wireless network, such as through WiFi or cellular, it becomes a powerful tool in asset tracking or geo surveying. In this quick guide, we’re going to go through what it takes to get GPS working and how to read the data.

Continue reading “Getting Started with GPS on the TS-7670”

Hot Off the Press: Working with I2C Sensor Devices

Nuts and Volts has published the article “Working with I2C Sensor Devices” in the July 2017 issue.  It walks you through how to interface with an I2C device using a single board computer.  Be sure to visit your local bookstore and pick up a copy while they’re available!

http://www.nutsvolts.com/magazine/article/working-with-i2c-sensor-devices

http://nutsvolts.texterity.com/nutsvolts/201707/?folio=36&pg=36#pg36

 

 

Practical Guide to Getting Started With the TS-7553-V2

 

This practical guide gives us an opportunity to take a relaxed approach to getting started with the TS-7553-V2 single board computer. We’re going to take a look at how to make our first connections, and setup the network. These are usually the first things we do before starting development. In the grand scheme of things, this is just a friendlier extrapolation from the official TS-7553-V2 manual, so be sure to keep it handy for more advanced topics and specific details. The only assumption being made is that you’ve purchased the TS-7553-V2 with a development kit, including the pre-programmed microSD card and enclosure with 128×64 px LCD and 4 button keypad. Right then, let’s get started!

Continue reading “Practical Guide to Getting Started With the TS-7553-V2”

Example C Code for Reading ADC Inputs on i.MX28 Based Embedded Systems

Let’s take a quick look at what it takes to read from the ADC inputs of a i.MX28 based embedded system using example C code provided by Technologic Systems. Now, while this can be generically applied to many i.MX28 based embedded systems, we’ll be working with a TS-7680. Right, let’s get started!

Continue reading “Example C Code for Reading ADC Inputs on i.MX28 Based Embedded Systems”

Practical Guide to Getting Started with the TS-7600

This practical guide gives us an opportunity to take a relaxed approach to getting started with the TS-7600 single board computer paired with the TS-ENC750 enclosure with TS-752 baseboard. We’re going to take a look at how to make our first connections, talk about the Linux environment, and setup the network. These are usually the first things we do before starting development. In the grand scheme of things, this is just a friendlier extrapolation from the official TS-7600 manual, so be sure to keep it handy for more advanced topics and specific details. The only assumption being made is that you’ve purchased the TS-7600 with a development kit, including the pre-programmed microSD card and TS-ENC750 and TS-752 baseboard. Right then, let’s get started!

Continue reading “Practical Guide to Getting Started with the TS-7600”

Practical Guide to Getting Started with the TS-TPC-7990

Introduction

The goal of this practical guide is to get you through the basic steps of getting your TS-TPC-7990 up and running so you can begin development. It’s mostly an extrapolation of the official TS-TPC-7900 Manual, but provides a more practical and casual approach in setting up connection, networking, and general development environment.

Continue reading “Practical Guide to Getting Started with the TS-TPC-7990”

Practical Guide to Getting Started with the TS-7400-V2

Introduction

This guide aims to get you through the basic steps of getting your TS-7400-V2 up and running so you can begin development. It’s mostly an extrapolation of the official TS-7400-V2 Manual, but provides a more practical and casual approach in setting up connections, networking, and general environment.

Continue reading “Practical Guide to Getting Started with the TS-7400-V2”

How To Compile the Mainline Linux Kernel v4.9 for TS-4900

embedded-linux-ts-board

Here’s a quick how-to guide straight from one of our engineers on how to compile the mainline Linux Kernel v4.9-rc1 and install it on the TS-4900. Support for the TS-4900 in the mainline kernel image (v4.9 and up) is a pretty big deal for us, and we’re excited about it. A big shout out to our friends at Savoir-faire Linux for their hard work in making this happen!

Step 1: Install the Toolchain

We need to install the toolchain from Ubuntu or Debian Jessie by running the following command:

Continue reading “How To Compile the Mainline Linux Kernel v4.9 for TS-4900”