Hi,
I have a configuration with two End Devices and a Coordinator all using AT firmwares.
I would like one of the End Devices to send the same string to both the Coordinator that is attached to a PC and to the second End Device that is a portable display I built.
Since I understand that broadcasting with Xbee Series 2 is not a good idea, I am programmatically changing the Destination Address using ATDH and ATDL commands. I set the address for the Coordinator first, do the transmission and set the Destination Address to the second End Device to perform the second transmission.
Here is the problem: although the Coordinator seems to receive the string with no problem, the receiving End Device keeps on loosing chunks of the string. This is an example of what the receiving End Device seems to receive:
0,0,0.00;
.0,0,0.00;
.0,0,0.00;
.#0,0,0.00;
.#0,0,0.00;
.0,0,0.00;
.0,0,0.00;
.#
This is how the Coordinator receives the same transmissions:
.0,0,0.00;
.0,0,0.00;
.0,0,0.00;
.0,0,0.00;
.0,0,0.00;
.0,0,0.00;
.0,0,0.00;
Notice that the transmitting End Device sleep for 10 minutes and does a transmission every 10 minutes. The receiving End Device uses all the default Sleep Mode values but SP = 64. SP = 64 is equal for all three devices.
I believe I got the Sleep Mode settings right, but If you would like to see my settings just let me know and I will post them.
The Arduino code that does the transmission is this:
boolean xbeeSetAddress(String hi, String low) {
boolean configured = false;
while(!configured) {
delay(1100);
Serial.print("+++");
configured = getAtResponse();
Serial.print("ATDH");
Serial.print(hi);
Serial.print("\r");
configured = configured && getAtResponse();
Serial.print("ATDL");
Serial.print(low);
Serial.print("\r");
configured = configured && getAtResponse();
Serial.print("ATCN\r");
configured = configured && getAtResponse();
}
return configured;
}
boolean getAtResponse() {
String okResponse = "OK\r";
String response = String("");
while (response.length() < okResponse.length()) {
if (Serial.available() > 0) {
response += (char)Serial.read();
}
}
return okResponse.equals(response);
}
Can somebody point me into the right direction? Could it be that I am overflowing the Packet Buffer of the Coordinator?
Thanks in advance for your kind answer,
Luca