Table of Contents
Preface
How This Book Is Organized
About the Title
About the Examples
Conventions Used in This Book
Using Code Examples
Safari® Books Online
How to Contact Us
Acknowledgments
Chapter 1. Getting Ready
Buying an XBee Radio
Hardware
Antennas
Vendors
Buying an Adapter
Digi Evaluation Board
USB Adapters
Breakout Boards
Arduino Board Adapter Hack
What Are All Those Pins?
Choosing a Terminal Program
Firmware Update Software
X-CTU
Terminal Software for Configuring Settings
CoolTerm
HyperTerminal
Tera Term
ZTerm
screen
Others
Summary
Chapter 2. Up and Running
Radio Basics
Electromagnetic Spectrum
Inverse Square Law
Introduction to ZigBee
Network Topology
Addressing Basics
PAN Addresses
Channels
All Together Now
XBee Firmware Updates
Reading Current Firmware and Configuration
Configuring XBee
Settings
Connecting from Windows
Connecting from Macintosh
Command Mode and Transparent Mode
AT Commands (Are Your Friend)
Using AT Commands
Basic ZigBee Chat
Parts
Addresses
Coordinator
Router
Two Computers
One Computer
Chat
Troubleshooting
Success!
Chapter 3. Build a Better Doorbell
ZigBee and Arduino
About Arduino
Arduino Basics
Buying an Arduino
Don’t forget the cable
Downloading the software
Using the Arduino IDE
Selecting the board and port
Code structure
Buying electronics supplies
Connecting to Arduino
Doorbell Projects
Parts
Prepare Your Radios
Connect Power from Arduino to Breadboard
XBee Breakout Board
XBee Connections
Doorbell Introduction
Switch Input...
...and Buzzer Output
Configure Your XBees
Program the Arduino Doorbell
Troubleshooting
Feedback Doorbell
Feedback Light
Program the Arduino Feedback Doorbell
Extra: Nap Doorbells and More
Chapter 4. Ins and Outs
The Story of Data
Direct, Indirect, Subtext
I/O Concepts
Why XBee Direct?
XBee Direct Limitations
XBee I/O Features
AT Configuration I/O Commands
Advanced I/O Commands
Romantic Lighting Sensor
Basic Romantic Lighting Sensor
Parts
Prepare your coordinator radio
Prepare your router radio
Prepare the Sensor Board
Configure your router XBee
Connect power from battery to breadboard
Router XBee connection to battery
Photoresistor input
Prepare the Base Station
Connect power from Arduino to breadboard
Coordinator XBee connection to Arduino
Light output
Program the romantic lighting sensor base station
Troubleshooting
Romantic Lighting Sensor with Feedback
Add light output to the sensor
Configure your router XBee
Program the romantic lighting sensor with feedback base station
API Ahead
Chapter 5. API and a Sensor Network
What’s an API?
Protocols
Humans
Computers
Start bytes
Length byte
Contents ID
XBee API Protocol
Start Delimiter
Length Bytes
Frame Data Bytes
Checksum
API Frame Types
AT Commands
Frame type
Frame ID
AT command
Parameter value
Checksum
AT Responses
Frame type
Frame ID
AT command
Command status
Command data
ZigBee Transmit Request
64-bit destination address
16-bit destination network address
ZigBee Transmit Status
Transmit retry count
Delivery status
Discovery status
ZigBee Receive Packet
64-bit source address
16-bit source network address
Receive options
Received data
I/O Data Sample Rx Indicator
Number of samples
Digital channel mask
Analog channel mask
Digital samples
Analog samples
Remote AT Command Request
Remote command options
Remote Command Response
Using What You Need
Libraries
Simple Sensor Network
Parts
Prepare Your Coordinator Radio
Prepare Your Router Radios
Prepare the Sensor Boards
Connect voltage regulator circuit and power jack to breadboard
Router XBee connection to power
Temperature input
Second sensor board
Prepare the Base Station
Connect to computer
Program the Base Station
Simple Sensor Network display code in Processing
Troubleshooting
Yay!
Chapter 6. Sleeping, Then Changing the World
Sleep Mode
End Devices
Storing and forwarding
Constraints
Advantages
Configuring Sleep
Sleep Mode
Sleep Period
Time Before Sleep
Advanced commands
Easy Sleeping
Simple Sensor with Sleep Project
Parts
Prepare Your End Device Radios
Configure Your End Device XBees
Add sensor nodes...
...or replace sensor nodes
Direct Actuation
Direct Actuation Example
Parts
Prepare Your Coordinator Radio
Prepare Your Router Radios
Prepare the Actuator Boards
Configure Your Router XBees
Connect voltage regulator circuit and power jack to breadboard
Router XBee connection to power
Transistor and relay output
Second actuator board
PowerSwitch Tail A/C relay
Prepare the Base Station
Connect to your computer
Program the actuator network base station
Simple Actuator Node Code in Processing
Summary
Chapter 7. Over the Borders
Gateways
XBee as Embedded Gateway
Other Embedded Gateways
Internet Gateways
Internet Media
Computers Versus Dedicated Devices
ConnectPorts
Selecting a ConnectPort
Setting Up a ConnectPort
Troubleshooting
Configuring a ConnectPort
Remote Management
iDigi Connectivity Server
iDigi Features
Adding a ConnectPort
Viewing Configurations
Firmware Updates and Remote Reboot
Viewing an XBee Network
XBee Internet Gateway (XIG)
Installing and Configuring XIG
Testing XIG
XIG Example
XIG download example in PHP
Twitter Reader
Parts
Prepare Your ConnectPort with XBee Internet Gateway
Prepare Your Router Radio
Configure Your Router Radio
Prepare the Twitter Reader Board
Connect power from Arduino to breadboard
XBee connection to Arduino
Liquid crystal display (LCD) output
Program the Arduino
Installing the NewSoftSerial library
Twitter Reader code
Troubleshooting
Moving Forward
Chapter 8. More to Love
Advanced ZigBee
ZigBee Stack Layers
Application Support Layer
Profiles
Endpoints
Clusters
Next steps
Routing
Next steps
Security
Network and link keys
Technical details
Fast guide to turning on XBee network security
Using optional APS encryption
ZigBee Protocol References
Serial Flow Control
RTS and CTS
Sharing Data
Pachube
Simple Sensor Network with Pachube
API Key
Build the Simple Sensor Network in Chapter 5
Program the Base Station
Simple Sensor Network Pachube Code in Processing
Troubleshooting
The Future of ZigBee
Next Steps for You
Making Stuff
Sharing Your Work
Appendix. Resource Guide
Arduino Resources
Processing Resources
Python Resources
ZigBee Resources Online
Standards Organizations
Digi International Resources
Additional Online Resource Lists
Recommended Books
Sidewalk Telescopes
Troubleshooting
Common XBee Mistakes
XBee Arduino Mistakes
Reference Tables
Other ZigBee Modules
ZigBee Packet Sniffers
Digi XBee Radio Modules
XBee Connectors and Shields
Hex, Decimal, and Binary
ASCII Codes
XBee Command Reference
Index