Friends,
I've spent a few days looking around in google, youtube and forums, but have no luck to get a way to set up my xbee(s1) network. Could you suggest a simple step-by-step tutorial for a newbie like me?
What I wish is to connect an arduino board and my computer wirelessly with a pair of xbee. (I actually got 3 xbee... My ultimate goal is to control two arduino boards with my computer in an xbee network)
My stock of parts:
-
xbee S1 (1m chip, at the back it says xb24-ac1) x 3
-
Xbee Shields from Solarbotics x 2
-
USB explorer from Sparkfun x 1
-
arduino board duemilanove x 2
with 9v battery clipped in
Steps that I've taken:
(for now I only start with 2 xbee)
-
Configured each Xbee individually with XCTU via the spartfun USB explorer. I wrote the firmware either at modem config or by typing in the terminal mode.
-
Upload a simple sketch to each arduino board. The sender has serial.print. The receiver has serial.read(). Sketch is below.
-
Put the xbee chip on the shield and then the arduino. The pin mode is "XBEE".
So I assume that they start talking and blink the LED. However it doesn't work. I tried several different settings which are explained here in details:
Step 1: XCTU configuration:
I understand that Xbee S1 is different from S2. I've carefully avoided following instructions for S2 xbee.
I tried to configure the XBees with XCTU in winXp. I set it as XB24, with XBEE 802.15.4, version 10E8 as default. I tried many things while going from one tutorial to another.
I give the Xbee same ID, CH. I've tried setting DL and MY differently for "sender" and receiver", e.g. DL=1234 MY 5678 vs DL = 5678, MY = 1234. I also tried keeping them both default as 0.
I tried differet BAUD rates, setting them to 3 (9600) and 4 (19200). I also changed my arduino code for baud rate at the same time.
I also followed different tutorials to set other items. I remembered to restore the firmware everytime I went from one tutorial to another.
Step 2: Simple Arduino Code:
Sender:
void setup()
{
Serial.begin(19200);
}
void loop()
{
Serial.println('a');
delay(1000);
Serial.println('b');
delay(1000);
}
Receiver:
int ledPin = 13; // LED connected to digital pin 13
int val = 'a';
void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
Serial.begin(19200);
}
void loop()
{
val = Serial.read();
if (val=='a'){digitalWrite(13,LOW);}
if (val=='b'){digitalWrite(13,HIGH);}
}
Friends, do you have any clue that I made a critical mistake?
Or do you have any suggested tutorial that I should follow?
Thanks a lot for your help!