It is currently Thu Jul 24, 2014 3:01 pm

Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: Debugging tip: Arduino + XBee
PostPosted: Fri Jun 21, 2013 8:10 am 

Joined: Sun Oct 31, 2010 7:52 am
Posts: 11
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...

Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 1 post ]

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB