Hello,
I’m new to this forum.
I’m using two Xbee pro serie 2 (XBP24-BWIT-004 revD).
I’m having two of them at this time but I will have 6 at the end of the project.
I have configure them with x-ctu and a sprakfun xbee usb explorer (http://www.sparkfun.com/products/8687).
Here is the screen capture of the settings of the coordinator
and the screen capture of the router/end device
Actually the communication works but there is strange behaviour : there is a very variable latency, and sometimes the network seems to be broken for a while (the rss led on the sparkfun explorer is not green). I have check on the router device that the ATSM returns 0. So the xbee is on a “no sleep mode”.
I’m using the xbee modules with an arduino with this code
int x = 0; // a place to hold pin values
int ledpin = 13;
void setup()
{
Serial.begin(57600);
digitalWrite(13,HIGH); ///startup blink
delay(600);
digitalWrite(13,LOW);
pinMode(13,INPUT);
}
void loop()
{
if (Serial.available() > 0){ // Check serial buffer for characters
if (Serial.read() == 'r') { // If an 'r' is received then read the pins
x = analogRead(0); //read the value on analog 0
sendValue (x);
}
Serial.println(); // Send a carriage returnt to mark end of pin data.
delay (100); // add a delay to prevent crashing/overloading of the serial port
}
}
}
void sendValue (int x){ // function to send the pin value followed by a "space".
Serial.print(x);
Serial.print(32, BYTE);
}
Here is a very schematic representation of my setup
On one side I have this arduino with this program connected with the router xbee. It’s replying to ‘r’ message and sends the value of the analog input 0 (I have attached a potentiometer to it). On the other side I have an xbee (the corrdinator) on an usb explorer connected to the computer. I’m using a Max program on the computer that sends ‘r’ message to the serial port.
It works with a very variable latency (from 500 ms to 3 seconds) and
sometimes I see that the router seems to sleep (the rss led is not green).
Is it the correct configuration for the xbee ?
I didn’t manage to get the api mode work on it and I thought that AT mode was a correct way to go for that kind of network.
Any advice will be appreciated