As part of my ongoing project to let LiveCode programs control Arduino-based physical devices, I want to "cut the cord", replacing a USB cable with an XBee wireless link.
My first attempt (they're "plug & play", so just stick them in and start talking, right?) failed utterly: no bytes sent in either direction, using an XBee shield on the Arduino and an XBee USB dongle on my laptop.
After several hours of hair-pulling and F-bombing the #$%^& hardware, I learned a painful lesson:
The Xbee shield and the USB interface on the Arduino are high allergic to each other and must NOT be used simultaneously. I had been loading the Arduino sketch (just a simple-minded read-a-byte/echo-the-byte loopback test) with the shield in place, thinking that if the IDE talked to the Arduino happily, that all was well.
It appears that if the XBee radio is in place while the USB connection is used, then the radio goes into an unresponsive state. Simply unplugging the USB cable was not enough: I had to disconnect and power everything down, then start over, programming the Arduino first, then removing the USB cable before inserting the shield and testing.
This may be obvious to some readers, but it can cost you a lot of frustration if it's not. User beware!
ps: Yes, the "correct" solution is probably to toggle the tiny switch on the XBee shield that selects UART vs other-digital-line for the XBee to talk over. But my goal is to run an existing third-party sketch that DOES expect to talk on the default (UART) interface, and it seemed like too much work to consider hacking that to use an alternate pair of I/O lines...