Hi,
I've start a new topic on the digi forum two weeks ago, but it seems to be quiet, so I'm wondering if someone can helps me here.
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 them configured with x-ctu and a sprakfun xbee usb explorer (SparkFun XBee Explorer USB - WRL-11812 - SparkFun Electronics).
Here is the screen capture of the settings of the coordinator and 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".
What I can't do with this setup is having a constant flow of data from my arduino. I have a value and 1 second (or two, or 750 ms) later an other one, ...
Changing the delay at the end of the code below change nothing.
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 return to mark end of pin data.
delay (5); // 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. The xbee connected to the computer use the xbee explorer from Sparkfun.