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.