Loading...
Pages: [1]   Go Down
Author Topic: Issue with Programmable XBee Pro S2B and Wireless Shield  (Read 653 times)
0 Members and 1 Guest are viewing this topic.
Burnsville, MN
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I recently purchased the book Wireless Sensor Networks by Robert Faludi. I also purchased 3 of the programmable XBee Pro S2B with 32k flash. The radios sit on an Arduino Wireless shield on an Arduino Uno R3. I load an empty setup/loop sketch onto each Arduino. The shields are toggled to USB. The radios will communicate just fine. Opening the Serial Monitor thru the IDE allows me to "chat" with each radio. They are all connected via USB to my notebook.

Now I take it up a notch. I upload this sketch to two of the router radios:

const int ledPin = 13; // the pin that the LED is attached to
int incomingByte; // a variable to read incoming serial data into

void setup() {
// initialize serial communication:
Serial.begin(9600);
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
}

void loop() {
// see if there's incoming serial data:
if (Serial.available() > 0) {
// read the oldest byte in the serial buffer:
incomingByte = Serial.read();
// if it's a capital H (ASCII 72), turn on the LED:
if (incomingByte == 'H') {
digitalWrite(ledPin, HIGH);
}
// if it's an L (ASCII 76) turn off the LED:
if (incomingByte == 'L') {
digitalWrite(ledPin, LOW);
}
}
}

Then I upload this to the coordinator radio:

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

void loop()
{
Serial.print('H');
delay(1000);
Serial.print('L');
delay(1000);
}

I unplug the radios and switch the toggle from USB to Micro on the shield and replug them. Nothing happens. No led flashing.

I can use the IDE to manually flash the leds on the router radios thru the Serial monitor by sending H and L. I can use the IDE to see the H/L being sent on the coordinator radio thru the Serial monitor. They just aren't talking to each other at this point.

Any opinions, ideas, clues or support would be most appreciated.

Thanks!

Thomas
 
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 315
Posts: 35519
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Opening the Serial Monitor thru the IDE allows me to "chat" with each radio.
When you use the Serial Monitor to talk to the Arduino, the XBee on it is not involved at all.

Quote
The radios will communicate just fine.
You haven't proven that.

Quote
I unplug the radios and switch the toggle from USB to Micro on the shield and replug them. Nothing happens. No led flashing.
Looks to me like you do not have the XBees configured correctly. What did you set/change to what?
Logged

Burnsville, MN
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Using the Serial monitors I can chat between the three Arduinos.  I did this in the beginning to validate they are in fact connected and can see each other. 

The Xbees are configured as they should be.  If you are familiar with the Wireless Shield from Arduino,  it has a toggle switch to move between Micro and USB. 

This is the tutorial on arduino.cc for these radios.

Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 315
Posts: 35519
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
If you are familiar with the Wireless Shield from Arduino
If it is like the one from Sparkfun, I have one. Do you have a link to yours?

Quote
This is the tutorial on arduino.cc for these radios.
A link, please. I'll try this out with radios I KNOW talk to each other.
Logged

Burnsville, MN
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Shield http://arduino.cc/en/Main/ArduinoWirelessProtoShield
Tutorial http://arduino.cc/en/Guide/ArduinoWirelessShieldS2

I have the XBee Pro Series 2B with 32k Flash and 2k RAM

One is defined as a Coordinator AT and the other 2 are defined as Router AT.

Logged

Pages: [1]   Go Up
Print
 
Jump to: