Xbee problems, arduino resets

Hi,

I have a problem with my Xbee (series 2), I let 2 arduinos communicate with 2 Xbee modules and it works, I mean, there is a serial link and the program starts but then the arduino resets itself.

I don't know why, I've used several very simple programs that send serial data (one way and two ways), even with one arduino sending to the Xbee who is connected to the serial monitor, data starts flowing and then stops, sometimes after ten seconds, sometimes after three or somtimes even after a minute or two.

The only time it doesn't stop is when I set the jumpers on de Xbee shield to USB (so that the program sends it serial data directly to the serial monitor) or when one of the Xbees is off, then the program keeps running, most of the time and definitely for longer periods.

Could this be with a buffer size/overflow in the Xbee or something, or do I need to clear something in the program for it to keep running? (i've found that when I use a long delay between serial prints it takes longer for the arduino to reset)

some sample code i used:

// Alternate sending '1'/'0' over XBee

void setup()
{
  Serial.begin(9600);       // XBee
}

void loop()
{
  Serial.print('1', BYTE);
  delay(500);

  Serial.print('0', BYTE);
  delay(500);
}

and the receiver:

// Toggle LED on LEDPIN depending on '1'/'0' received
// serially over XBee

#define LEDPIN  13
byte val;

void setup()
{
  pinMode (LEDPIN, OUTPUT);
  Serial.begin(9600);       // Start talking to XBee
}

void loop()
{
  if (Serial.available()) {
    val = Serial.read();
    if (val == '1') {
      digitalWrite(LEDPIN, HIGH);
    } else if (val == '0') {
      digitalWrite(LEDPIN, LOW);
    }
  }
}

The led blinks three times (sometimes two times) and then stays on or of for a few second (the sending arduino is resetting), and then it starts blinking again. (but only two or three times)

If someone could help me, please, this is really an annoying problem >:(

Thanks

Anyone an idea that i could try?? :-/

I've updated the firmware for the two Xbee modules --> same problem

I've also removed the Xbee modules and used a wire to connect Tx/Rx and then the program works perfect so there has to be something wrong with the Xbees.

Is there a way to update the firmware with a terminal? not with X-CTU read and write cause thats giving me a lot of errors and only after a couple of tries it uploads the firmware.
(I know how to read and change the values with +++ and ATid but updating the firmware??)

Thanks

Ok,

I think I've found the problem,

The firmware for the Xbees wasn't right, I've uploaded in one Xbee:
ZNET 2.5 COORDINATOR AT
and the other one:
ZIGBEE ROUTER/END DEVICE AT

and now I've uploaded:
one: ZNET 2.5 COORDINATOR AT
and one: ZNET 2.5 ROUTER/END DEVICE AT

I have a series 2 Xbee, and the ZNET 2.5 firmware works but I've tried using
one:ZIGBEE 2.5 COORDINATOR AT
and one: ZIGBEE ROUTER/END DEVICE AT

And they do communicate but not for long (the arduino resets itself) just like when I had one right and one wrong.

It has been nice talking to myself :smiley:

I am having similar problems. I am using two xbee 2.5 modules that are loaded with the ZIGBEE ROUTER/END DEVICE AT and ZIGBEE COORDINATOR AT firmware. With this firmware the radios reset the arduino just like your are stating.

I wanted to try to uses the ZNET firmware as I am using it on another pair of radios for another project and it works great. The problem is I cannot get the ZNET firmware uploaded to the new radios. I connect the radio to the computer using the interface and use the X-Ctu software to select the new firmware. When i try to upload the firmware it says the firmware is not compatable with the radio. These radios are identical to the other radios I have and I had no problem uploading the firmware to them.

Eluxiver do you have any suggestions from your experiences today?

Eluxiver

I also just answered my own question. I was trying to modify parameters and upload new firmware at the same time. When I just uploaded the firmware it worked. I now have an arduino that will communicate with my PC.

For anyone else out there. Why does the Zigbee firmware reset the arduino?

Thanks

Jim

Hi,

I to had difficulty trying to upload new/other firmware with the X-CTU and indeed it goes better when you just upload firmware or just the AT settings.

I tried it together (firmware+settings) and when you push the reset button on the right moment (...Waiting for modem to reset) it sometimes works