Losing packets with Xbee Series 2

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

Hi,

In general case, End Device to End Device Transmission is not a good idea. It may happen that while receiving the data from another end device, end device can go to sleep due to cyclic sleep and the End device would not transmit the same packet. Thereis the description for that in depth in the manual. But I don’t remember the exact figure. Here one thing need to take care, the transmit and receive buffer of the xbee module can take care upto two packets only. Thats why, if one end device is sending more than one packet in a short duration then it is possibility that the packets can be discarded.

In such case I would rcommand to use API mode at the end device who sends the data. So, when you use ZigBee Transmit request packet then it will provide the acknowledgment in the form of zigbee transmit status frame. This will let you know the sending side, whether packet is delivered or not. If not you can send the same packet again to make sure the successful delivery of the packets to the another end device. Even for unicast mode, you can specify the destination address in the frame it self. There would be no need to set dh and dl in that case.

Hi Shahrj,
thank you for this answer, this was useful…although I honestly was hoping to stay away from API mode.

Apologies for having taken so long to thank for you reply.

Cheers,
Luca