[SOLUTION provided] Xbee w Arduino shield probs: resetting, network config, etc.

Problem has been solved, and VARIOUS SOLUTIONS to this and other problems provided on Reply#5 in this thread (http://arduino.cc/forum/index.php/topic,53971.msg392881.html#msg392881).

I'm using: --Arduino Uno --a pair of Xbee Pro Series 2-B modules --the first Xbee connected to the Arduino via an Xbee shield --the second Xbee connected to the computer's USB port via a USB "explorer" board

GOAL When I Serial.print something in an Arduino program, I want it to transmit via the 1st/node Xbee sitting on the Arduino shield, so that the information is printed on the Serial output for the 2nd/coordinator Xbee (...and vice versa).

What I've done

I have got everything configured using X-CTU/terminal software, and the 2nd/coordinator Xbee even recognizes the 1st/node Xbee (as tested by ATND command), so no problems there at all.

Then I uploaded a simple program in the 1st-Xbee-connected Arduino (COM3) that outputs "ABC" on the serial output. Then I opened a separate terminal for the 2nd-Xbee-connected USB explorer board (COM4).

PROBLEM

I cannot get ANY serial output in the terminal for the 2nd/coordinator Xbee, matching the Arduino IDE serial output transmitted via the 1st/node Xbee. Seems basic, but I think I'm missing something! Anyone gotten this to work?

Based on what I read in what some people have written, I think the problem might be with the RX, TX pins/crossover, OR with the USB-versus-Xbee jumper selection on the Xbee-Arduino shield. But both of them are confusing me. Could anybody clarify?

Side-observation Perhaps related to above... I've also noticed that when I load the code onto just the Arduino by itself, then the serial output in the Arduino IDE terminal is fine (it's a simple Serial output program). But when I then insert the Xbee shield on top, and then open the Arduino IDE terminal again, suddenly the IDE freezes!

First question that comes to mind is which shield are you using?

Second question is why did you buy mesh network XBees for point-to-point use?

PaulS: First question that comes to mind is which shield are you using?

Second question is why did you buy mesh network XBees for point-to-point use?

probably for the same reason I got two myself, and trying to do the same thing.. seeing what's locally available, (local cable/connectors/electronics store had 2 Libelium Shields w/2 Xbee Series-2 modules.) Seemed easy til I realized the incompatibilities.

I since bought the Parallax USB adaptor, and Adafruit's adaptor (converts the +5V to +3V, handles interfacing, could be connected to USB to RS-232 (FTDI) cable.).. and the two Libelium shields sit back in a box. (since they chew-up space over the ICSP, lower Digital, and Analog pins, leaving no room for the upper (8-13) digital, and the voltage pins. (+3.3, +5, GND,GND,Vin)

I am tempted, reading a note on how to pull the main ATmel chip from the Duemilinove, and use the on-board FTDI chip to talk to the XBEE, but haven't gotten adventurous yet.

I too, have been reading the Series-1 will go point to point easier..

I have been working with series 2 Xbee pros and although it has taken a while to get this all working I am getting there. If you are getting correct feedback when you ATND one of the xbees then that is most of the way there. If it finds the other xbee you just need to troubleshoot why you are not getting serial out of the other xbee.

The way I troubleshooted this was to NOT use the arduino at first as that leads to another series of issues to troubleshoot. I would recommend using a jumper wire between the reset pin and ground on the arduino allowing you to use the arduino as a USB xbee explorer with the xbee on the shield without having to take out the atmel chip which is good as it reduces the chances of bending any of the pins.Once this is done make sure the jumpers on the shield are set to USB.

This means in a serial terminal such as cornflake you can connect both xbees to one computer and have separate terminal windows for each of the xbees and that way you can configure them at the same time and make sure the settings match.

I would setup one xbee as a coordinator & one as a router both in AT mode. You then need to set the destination address to match the opposite xbee. So the destination address for the coordinator is the router and vice versa. Once this is all done and checked you should have a serial connection from one xbee to the next.

If you want to learn how to use xbee series 2's I can't recommend enough Building Wireless Sensor Networks by Robert Faludi as it cuts out a load of the guess work of setting xbees up and what is best practice.

Anyway hope this helps and let us know if you had any success. Cheers Steve

Thanks for the tips guys! Things are working out (at least for my case); was a combination of RX and TX on the shield, as well as some AT commands for the Xbee. I'm preparing a small note that I'll put up some time this weekend (when I'm free from classes!)... with a general layout of steps to use for this kind of setup, for permanent reference.

Here is the promised note, based on problems I solved over the last week as well as other problems, hoping it might help someone. Nothing is guaranteed to be perfect theory; just my thoughts/readings!

1) Problem: Is serial transmission via Xbee not working after you upload code to the Arduino on which the XBee is sitting? Or, instead, is code not uploading to Arduino when the Xbee is sitting on the Arduino via a shield? Solution: If you use a typical Arduino Xbee shield, you need to set the two jumpers toward the label "USB" when you're UPLOADING code to Arduino, and you need to set the jumpers toward the label "Xbee" when you're using the Xbee to transmit data. This is related to the RX-TX configuration. More about this here: http://www.arduino.cc/en/Main/ArduinoXbeeShield

2) Problem: Does transmission from router to coordinator keep Resetting and/or going back to re-start? Solution: Also, if you use a typical Arduino Xbee shield, the CTS (clear-to-send) line of the xbee will in most cases be connected to the Reset of the arduino. This will affect things in various ways; one simple example is, if you send out an incrementing array of numbers from your Router (situated remotely on Arduino shield) to your Coordinator (let's say situated on a USB explorer-type connection to your PC), to be read on your PC's serial terminal for the Coordinator's serial port. You will see that the array of numbers will print out well, but then after a set amount of time, it will restart from the beginning. This will happen repeatedly. The Arduino is being reset by the CTS line of the xbee. Either physically cut off the connection between Arduino's reset via the shield to the DIO7 CTS pin of Xbee. Or easier, while setting the Xbee command sequence, via the terminal, let's say in X-CTU, turn that functionality off by simply typing "ATD7 0".

3) Problem: Is the Router not sending information to Coordinator, even after you set up both Xbee modules and configured them on X-CTU? Solution: A good method to follow, apart from setting common PAN ID, etc., to ensure that the network is matched up is to begin the configuration via terminal, of the Router Xbee, and then type "ATNR0", which sort of resets the network but does something important: it equates the PAN ID and something else called "operational PAN ID" to match that of the coordinator. While you're configuring the Router XBee as such, just ensure of course that the Coordinator Xbee is also powered and active, let's say on a separate port, on a powered Arduino via a shield, or via battery, whatever.

Feel free to ask here or shoot me a message if you have problems.

giantsfan3: Thanks for the tips guys! Things are working out (at least for my case); was a combination of RX and TX on the shield, as well as some AT commands for the Xbee. I'm preparing a small note that I'll put up some time this weekend (when I'm free from classes!)... with a general layout of steps to use for this kind of setup, for permanent reference.

thanks for the notes !

my setup: 1 - sparkfun xbee explorer usb + xbee znet 2.5 2 - sparkfun xbee arduino shield + xbee znet 2.5 (arduino duemilanove)

node 2 is the coordinator i could transmit from 1 to 2 but not vice versa :roll_eyes: also I couldnt succesfully use the unchipped arduino to program the xbee with x-ctu software =(

@luky83.. the first one might be pretty straightforward. tell me: 1) what are the destination addresses that you set on the coordinator and on the router? they should complement each other. also, the PAN ID, the channel number, etc. should match but these are probably fine if it's already working one-way but do check. Run "ATNR0" on the router's X-CTU terminal to synchronize its network info with that of the coordinator (while of course keeping the coordinator powered at the same time). 2) what do you mean by "transmit" - what exactly are you sending from one to the other, and how are you reading it?

Had the problem of sketch uploading OK, but running for only about one second. On power-up/reset, sketch loads, but works for only a small fraction of a second. Radios working fine when plugged in USB adapters or grove boards. XBee shield from "funduino.com" (site dead), that came with Digi's Arduino Xbee kit.

In all cases, the "L" led (D13?) kept pulsing, like when the bootloader is running.

Thanks for the solution, spend the good part of two hours trying to solve this.

giantsfan3: 2) Problem: Does transmission from router to coordinator keep Resetting and/or going back to re-start? Solution: Also, if you use a typical Arduino Xbee shield, the CTS (clear-to-send) line of the xbee will in most cases be connected to the Reset of the arduino. This will affect things in various ways; one simple example is, if you send out an incrementing array of numbers from your Router (situated remotely on Arduino shield) to your Coordinator (let's say situated on a USB explorer-type connection to your PC), to be read on your PC's serial terminal for the Coordinator's serial port. You will see that the array of numbers will print out well, but then after a set amount of time, it will restart from the beginning. This will happen repeatedly. The Arduino is being reset by the CTS line of the xbee. Either physically cut off the connection between Arduino's reset via the shield to the DIO7 CTS pin of Xbee. Or easier, while setting the Xbee command sequence, via the terminal, let's say in X-CTU, turn that functionality off by simply typing "ATD7 0".