XBee Computer -> Arduino Debugging

XBee projects like the adapter, xBee tutorials, tweetawatt/wattcher, etc. from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
smilinggoat1
 
Posts: 5
Joined: Tue Jul 07, 2009 6:16 pm

XBee Computer -> Arduino Debugging

Post by smilinggoat1 »

Hey gang,

I've hooked up two XBee Adapter Kits, One with the USB -> FTDI cable and the other to my Arduino. Following Ladyada's excellent instructions I've programmed the computer one to transmit and the arduino-side XBee to receive. Both modules and my Arduino 328 are running at 57600bps. Both XBees have the same PAN ID.

However, I do not need to program the Arduino wirelessly, I only need to send messages to it. So I did not wire the receiver to the Arduino's reset button. But I did solder the jumper between RTS and D3 on the transmitter.

My wiring from XBee Adapter Kit -> Arduino is:
  • +5 -> +5
  • Ground -> Ground
  • TX -> TX
  • RX -> RX
When I plug in the XBee to the FTDI cable, the green light pulses and I'm able to read and write to it via X-CTU, and send messages to it via a terminal. When I wire up the other XBee to the Arduino, the red power LED is solid, and the green LED pulses.

I've written a simple patch in Processing to turn an LED on and off on the Arduino. It works great when the Arduino is connected directly to the computer via USB, however when I try to send over the FTDI serial port, it does not work. I know I'm selecting the correct serial port in Processing thanks to its Serial.list() command.

Any ideas for debugging? I'm at a loss for where to proceed from here...
Thanks!

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: XBee Computer -> Arduino Debugging

Post by adafruit »

if you're not using the programming stuff, why did you solder in the jumper & pass the reset DIO line?
also, dont have it pass the DIO line, you're not using it and you're only making it harder to debug

smilinggoat1
 
Posts: 5
Joined: Tue Jul 07, 2009 6:16 pm

Re: XBee Computer -> Arduino Debugging

Post by smilinggoat1 »

Thanks for your extremely prompt response.

I de-soldered the jumper from DIO3 to RST and restored the firmware on each XBee to the default values for current firmware version 10CD. I then only changed the baud rate to 57600 and the PAN IDs to the same values.

Now when I first connect the XBee receiver to the Arduino, only the green LED is flashing. The red LED does not come on until I attempt to send data over the XBee serial line. So it seems like it's getting some sort of data. When I send data over the USB directly connected to the Arduino, that red LED on the XBee does not come on.

What I'm using for debugging is a very simple Arduino patch which listens for a char (capitol K) to switch on an LED. When it hears a different char (lowercase k) it switches off that LED. My Processing patch simply sends those chars over the serial line when I mouse-on or mouse-off a box.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: XBee Computer -> Arduino Debugging

Post by adafruit »

do you have some sort of drawing or photo of how your stuff is set up?

smilinggoat1
 
Posts: 5
Joined: Tue Jul 07, 2009 6:16 pm

Re: XBee Computer -> Arduino Debugging

Post by smilinggoat1 »

While looking through Digi's XBee Manual for various commands to test, I found the ND (Node Discover) command, which returns
Node Discover Response (AT command mode format - Transparent operation):
MY (Source Address) value<CR>
SH (Serial Number High) value<CR>
SL (Serial Number Low) value<CR>
DB (Received Signal Strength) value<CR>
NI (Node Identifier) value<CR>
<CR> (This is part of the response and not the end of command indicator.)
When I ran ATND, I received

Code: Select all

0
13A200
402DDC3C
28
Which corresponds correctly to the other node's MY, SH, SL correctly, and I'll assume that 28 is a fine DB strength.

Not realizing I left ATND running, I tried firing up my Processing patch over the USB cable directly connected to the Arduino. Low and behold, the X-CTU terminal started printing loads of capitol K's and lowercase k's according to my patch's serial signals! I was sending messages to the Arduino over USB, which the XBee attached to the Arduino was then sending back to my XBee attached to my computer!

I was definitely sending messages between the XBees, but they were just in the wrong direction. I've now flipped the RX and TX lines, and guess what? It works!

I wrote in my original post that I was sending RX -> RX and TX -> TX. What I needed to do instead was send RX -> TX and TX -> RX. I assumed the correct wiring was to wire "likes" to "likes" rather than as it is with MIDI, In to Out.

Just because I took it for this post before solving the problem, here's a photograph of my test bed:
Image
(Hi-Res Link)

I apologize for the state of my bread and perf boards, they're used for a bunch of different projects, so getting clean, easily viewable wires for photography is erm...just not going to happen ;)

BOOM! Solved! Thanks Ladyada, for your patience with people like me posting before trying out all other options. At least now someone else may avoid this problem in the future thanks to it being archived in the forums.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: XBee Computer -> Arduino Debugging

Post by adafruit »

asking people for photos solves the problem sometimes cause they have to look at it :)

Locked
Please be positive and constructive with your questions and comments.

Return to “XBee products (discontinued)”