Arduino and XBee, HELP!

I've been playing with my Arduino for a while now, learned plenty as I go along. I have a simple little temperature logging device that works well, but I'd like to locate in a remote spot outside without an easy way of directly wiring to my PC to read the data. I immediately thought that a simple serial interface using XBee wireless chips was what I needed. I have no experience of using such things, but I took a guess and bought some bits.

I bought the following 2 x XBee 2mW Module with Chip Antenna (Series ZB) http://www.coolcomponents.co.uk/catalog/product_info.php?cPath=25_64&products_id=364 1 x XBee Explorer USB http://www.coolcomponents.co.uk/catalog/product_info.php?cPath=25_64&products_id=243 1 x XBee Shield http://www.coolcomponents.co.uk/catalog/product_info.php?cPath=50_76&products_id=116

From what I understood I'd just be able to plug the shield and XBee into the Arduino, and the Explorer USB and XBee into my PC, and then it'd work virtually the same as using the wired USB link, with virtually no changes.

But it doesn't work, not even close.

So, first question, was my basic assumption above wrong?

In an attempt to trouble shoot I uploaded the following very basic sketch:

void setup()
{
  pinMode(13,OUTPUT);
  // Wake up signal, so we know when the Arduino has finished booting
  digitalWrite(13,HIGH);
  delay(1000);
  digitalWrite(13,LOW);
  delay(500);
  digitalWrite(13,HIGH);
  delay(1000);
  digitalWrite(13,LOW);
  delay(500);
  digitalWrite(13,HIGH);
  delay(1000);
  digitalWrite(13,LOW);
  delay(500);

  Serial.begin(9600);
}

void loop()
{
  if(Serial.available() > 0)
  {
    digitalWrite(13,HIGH);
    delay(2000);
    digitalWrite(13,LOW);
    delay(1000);
    digitalWrite(13,HIGH);
    delay(2000);
    digitalWrite(13,LOW);
    Serial.flush();
  }
delay(100);
}

This shows a simple LED flashing on startup, and then a different flash anytime anything is received over the Serial port. It works as expected when communicating over the wired USB. However with the XBee shield and module installed, the sketch starts, then 4-5 seconds later, it restarts again, and again, and again. Even with nothing else trying to communicate (as far as I know) it does that. I've tried with powering the Arduino by both USB and a 6xAA battery pack (around 8v with freshly charged NiMHs), so I'm confident that it's not a power starvation issue. Oh, and yes, I have set the jumpers on the XBee shield to the XBee position.

So, second question, do I have faulty parts?

Question 3, what next?

Help.

*** EDIT *** Oh, I've also tried connecting to the XBee modules using X-CTU to see if they might need configuring with no luck. They only respond to the '+++' command roughly 1 in 10, and then nothing after that. It's strongly pointing to faulty XBee modules, but as I'm a complete newbie to them I can't be sure.

My PC is running Windows 7, I'm using Tera Term for my normal serial comms package, and Arduino 21 for the dev environment.

Couple of things come to mind... If you can't talk to the xbee's with just your pc, Explorer USB and two different xbees I would guess it's not the xbees but your pc setup and x-ctu.

Have you connected the rts and di03 pins together on the explorer? Both my explorers have this jumper so I can't check to see if xctu works without but I would guess that it does. So perhaps it is a baud rate setting. My xbees came with 9600 baud set but you should (must?) change the setting to 57600 baud (at least with the fio)

Have you set your pc's serial port to set rts on close?

Not sure if I have helped at all but one thing is for sure, don't go anywhere until your pc can talk to the xbees with x-ctu and that they are configured correctly... My only xbee experience is with fio's.

Kevin

OK, I've tried setting 57600kbps, tried RTS on Close, and tried jumpering the RTS and DI03 pins. X-CTU still reports it can't connect, and there is still no response to '+++' in any terminal windows.

When you launch x-ctu do you see the xbee in the "Select Com Port" window" (as a comXX)?

If so what happens when you hit the "Text /Query" button? If you don't see it as a com port then there is your problem...

Kevin

The above is in the PC setings tab of x-ctu It wouldn't hurt to make sure everything else connected to your usb ports have been disconnected so as to prevent confusion. Kevin

It shows up as a USB Serial Port (COM13). I have all other serial devices unplugged at the moment so the only other comm port is COM1 built into my mobo.

When I press Test/Query it sits there for a few moments and then gives me a message saying it can't communicate with modem, verify port, then try below actions and various things depending on device. For the XBee it suggests pressing the Reset Switch - of which there is none on the Explorer. It basically acts exactly the same as if no XBee module was plugged into the Explorer.

Just tried the same using my Arduino Duemilanove (chip removed) and the shield and it basically acts the same.

I'm wondering if this is a faulty batch of XBees, I think I'll have a word with the guys over at Cool Components.

One last thing you might try is to reinstall x-ctu. I still find it hard to believe that you have two dead xbees. Perhaps the explorer is dead or has a short. A pain which ever way you look at it.

BTW my x-ctu com port settings are: 9600 baud Flow control NONE Data 8 parity NONE Stop bits 1

the command character is: ascii "+" Hex "2B"

Good luck. Kevin

Yup, that's the settings I have in X-CTU. Given that it didn't work through the (known working in all other respects) Arduino board I think that rules out a problem with the Explorer board.

Do you see any data bouncing back and forth on the explorer's leds?

The TX LED flashes, but nothing else.