# Packetloss at Receiver Side

**URL:** <https://forums.digi.com/t/packetloss-at-receiver-side/15641>\
**Category:** XBee - 802.15.4\
**Tags:** arduino-xbee, receive, packet, recieve, zigbee\
**Created:** [October 23, 2015, 8:00am UTC](https://forums.digi.com/t/packetloss-at-receiver-side/15641 "2015-10-23T08:00:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsnayak](https://avatars.discourse-cdn.com/v4/letter/b/f6c823/32.png) [@bsnayak](https://forums.digi.com/u/bsnayak)\
**Post date:** [October 23, 2015, 8:00am UTC](https://forums.digi.com/t/packetloss-at-receiver-side/15641/1 "2015-10-23T08:00:17Z")

</div>

My problem statement is very simple. I have one Arduino Uno and another Arduino Mega Board. Both have got Zigbee Shield mounted on them. One of them is working as Transmitter (Uno) and another (Mega) as a receiver.

Code for Tx:

```auto
 void setup() {
    Serial.begin(9600);
    }
    void loop() {
    Serial.println("High"); 
    delay(200);
    Serial.println("Low");
    delay(200);
    }

```

Code for Rx:

```auto
 char msg;
    const int led = 13; //led at pin 13
    void setup() {
    Serial.begin(9600);//Remember that the baud must be the same on both arduinos
    pinMode(led,OUTPUT);
    }
    void loop() {
    while(Serial.available() ) {
               msg=Serial.read();
               if(msg=='H') {
                   Serial.println("Message High");
               }
               if(msg=='L') {
                   Serial.println("Message Low");
               }
    delay(200);
    }
    }

```

On Tx side it is sending packets serially High Low

```auto
High
    Low
    High
    Low
    High
    Low
    High
    Low
    High
    Low
    High

```

However on the receiver side, I get some packets missing. It is like

```auto
Message High
    Message High
    Message Low
    Message High
    Message High
    Message High
    Message Low
    Message Low
    Message Low
    Message Low
    Message Low
    Message Low
    Message Low
    Message Low
    Message Low

```

I would expect that it should print

```auto
Message High
    Message Low
    Message High
    Message Low

```

How can i receive packets synchronously and How can i aware of any packetlos on the Rx side.

Thank you for your suggestions, corrections, comments!

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [October 23, 2015, 8:22am UTC](https://forums.digi.com/t/packetloss-at-receiver-side/15641/2 "2015-10-23T08:22:43Z")

</div>

First, add a delay between the packets. Next, don’t send the next till you send back an ACK from the remote side.
