missing data packets


Actually I’m try to communicate over 2 xbee. so to check where i could able to receive all packets or not I’m sending increment count values from sender side and at the time of receiving i could able to receive only few packets. i.e., i have sent fro count 0 and its increment values but at the receiving i directly got 30th packets and 70th packets etc… etc… in between I’m missing all the packets. how can i resolve this issue?

#######xbee’s configuration:

API with escape

OS: ubuntu

receiving side code:

import serial
import time
from xbee import ZigBee, XBee
ser = serial.Serial(‘/dev/ttymxc0’, 9600,timeout = 2)
xbee = ZigBee(ser, escaped = True)
while True:
data = xbee.wait_read_frame()