# Xbee S2 Zigbee latency problem

**URL:** <https://forums.digi.com/t/xbee-s2-zigbee-latency-problem/1002>\
**Category:** XBee - Zigbee\
**Created:** [February 1, 2013, 2:26pm UTC](https://forums.digi.com/t/xbee-s2-zigbee-latency-problem/1002 "2013-02-01T14:26:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![michelef87](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@michelef87](https://forums.digi.com/u/michelef87)\
**Post date:** [February 1, 2013, 2:26pm UTC](https://forums.digi.com/t/xbee-s2-zigbee-latency-problem/1002/1 "2013-02-01T14:26:40Z")

</div>

Hi!

I have to setup a star network, with a central PC (the coordinator) that sends commands to some Arduino’s (the end devices).

Each arduino has to control lights, manage scenic effects, and so I need the commands to be delivered to end devices as quickly as possible and possibly simultaneously to all the receivers.

I’ve 2 xbee modules (XB24-ZB) to test this setup, but unfortunately the result is far from being acceptable.

I’ve tried to configure the coordinator in AT mode and I’ve also set the DH and DL parameters in broadcast mode (0 and FFFF), but the performances were really poor (3-5 seconds delay and packets lost).

So I’ve configured everything in API mode:  
The coordinator is set as follows:  
XB24-ZB - ZIGBEE COORDINATOR API - 21A7  
Settings: All default, except AP:2

The End device is set as follows:  
XB24-ZB ZIGBEE END DEVICE API - 29A7  
All default, except:  
AP:2  
DL: address low of coordinator  
DH: address hight of coordinator

The delay between packets seems to be about 30ms.  
if I change the end device from ZIGBEE END DEVICE API to ZIGBEE ROUTER API the delay decreases to about 21-29ms (If you want I’ll post the code and more accurate results).

To sum this up, my application would benefit a lot from a 10ms delay or something like that, how can I achieve such a result?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![spastor](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@spastor](https://forums.digi.com/u/spastor)\
**Post date:** [February 6, 2013, 9:23pm UTC](https://forums.digi.com/t/xbee-s2-zigbee-latency-problem/1002/2 "2013-02-06T21:23:28Z")

</div>

Hello Michele,

Broadcast messages always take longer to propagate to the network because they are re-sent up to three times. Also, End Devices don’t receive their messages instantly, they poll their parent (in your case, the coordinator) periodically to know if it has pending messages for them.

I would try with routers and sending a unicast to each of them instead of a broadcast. Also, maybe ZigBee is not the best option here if speed is relevant (ZigBee migth add up to seconds due to Mesh network routing), XBee Series 1 (802.15.4) are faster than ZigBee and the configuration is similar if you want to deploy a star network.

Keep us up to date with this. Best regards,

---

<div class="post-metadata">

**Author:** ![rezareza](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@rezareza](https://forums.digi.com/u/rezareza)\
**Post date:** [April 17, 2014, 8:43am UTC](https://forums.digi.com/t/xbee-s2-zigbee-latency-problem/1002/3 "2014-04-17T08:43:17Z")

</div>

can you post your code here?i really confuse to show the delay between packets

---

<div class="post-metadata">

**Author:** ![rezareza](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@rezareza](https://forums.digi.com/u/rezareza)\
**Post date:** [April 17, 2014, 8:43am UTC](https://forums.digi.com/t/xbee-s2-zigbee-latency-problem/1002/4 "2014-04-17T08:43:15Z")

</div>

can you post your code here?i really confuse to show the delay between packets
