Now you might want your project to be mobile. You'll at least want to disconnect it from the tether cable that you have been using to communicate with it to send control commands. In this chapter, you'll learn how to communicate wirelessly with your project. Depending on your choice of device, you'll be able to communicate across the room or across a distance of up to a mile.
In this chapter, you'll learn the following:
One of the most popular and well-documented ways of connecting to the Galileo via an RF connection is to use an XBee device. This device uses a technology called ZigBee and it is made for longer-range wireless communications. These types of devices can work up to a range of one mile. The ZigBee standard is built upon the IEEE 802.15.4 standard, a standard that was created to allow a set of devices to communicate with each other to enable low data rate coordination of multiple devices.
The other standard that you might hear about as you try to purchase or use devices such as these is XBee. This is a specific company's implementation, Digi, of several different wireless standards with standard hardware modules that can connect in many different ways to different embedded systems. They make some that support ZigBee. Here is an image of this type of device that supports ZigBee attached to a small, XBee-specific shield that provides a USB port:
The advantage of using this device is that it is configured to make it very easy to create and manage a simple link between two XBee series #1 devices. To make this work, you'll need four items:
Now let's get started with configuring your two devices to talk.
You'll need to configure both devices by plugging them into your host computer. Plug one of the devices into the small, XBee-specific USB shield and then connect the shield to your personal computer. Your computer should find the latest drivers for the device. If your computer does not find the device or is unable to correctly install the drivers, see http://ftp1.digi.com/support/images/Win7DriverInstall.pdf for help. You should see your device after you've selected Devices and Printers from the Start menu, like this:
The device is now available to communicate via the IEEE 802.15.4 wireless interface. You could set up a full ZigBee-compliant network, but you're just going to communicate from one device to another directly, so you'll just use the device as a serial port connection. Double-click on the device, select the Hardware tab, and you should see this:
Note that the device is connected to the COM20 serial port. You'll use this to communicate with the device and configure the device. You can use any terminal emulator program; I like to use PuTTY. If you don't have PuTTY, you can download it from www.chiark.greenend.org.uk/~sgtatham/putty/download.html. This will provide an executable that you can run to talk with and configure the devices.
Digi has recently introduced a new graphical tool for configuring XBee devices. It provides access to all the configuration settings on the XBee. If you would like to use this tool, see http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/xctu
Perform the following steps to configure the device:
COM20
port. Here is how to fill in the PuTTY window to do this:The OK response comes back from the device as you enter each command. The first device is now configured. Remove it from the small, XBee-specific shield and plug it into the Arduino XBee shield.
Now plug the second device into the small, XBee shield and then plug it into the PC. Note that it might choose a different COM port, go to the Devices and Printers option, double-click on the device, and select the Hardware tab to find the COM port. Follow the same steps to configure the second device, except there are two changes. Here is the terminal window for these commands:
The two devices are now ready to communicate.
Configuring the device using a Mac is very similar. Follow these steps to start a terminal connection with the device:
usbserial-XXXXXXXX
.Now you can configure your device as shown previously. If you are using Linux to configure your device, you will similarly open a terminal window, connect it to the proper USB serial port, and then configure the device.