# How to wait for and read ND response in Python?

**URL:** <https://forums.digi.com/t/how-to-wait-for-and-read-nd-response-in-python/12017>\
**Category:** Python\
**Tags:** response, nd, python, api, xbee\
**Created:** [October 1, 2013, 3:00pm UTC](https://forums.digi.com/t/how-to-wait-for-and-read-nd-response-in-python/12017 "2013-10-01T15:00:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alias\_neo](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@alias\_neo](https://forums.digi.com/u/alias_neo)\
**Post date:** [October 1, 2013, 3:00pm UTC](https://forums.digi.com/t/how-to-wait-for-and-read-nd-response-in-python/12017/1 "2013-10-01T15:00:11Z")

</div>

Hi. I’m working on an IoT project at home, with the intention of having a dynamic network. As devices are added and removed from the network, the hub, the database of devices on the network is updated.

So, I intend to have each device broadcast it’s presence when it joins a network, no problem, but I also want the coordinator to periodically issue an ND to update the database of devices on the network.

My question is, how would I go about waiting for the response from all networked devices when I perform the ND?

This is probably a more generic question than this particular situation, but essentially, I need to figure out how I “wait” and read responses, and how to know when to stop waiting so I can carry on doing something else.

My first thought is that I would set a time-out and wait for that period for a response, from each of the devices, and reset the timer each time a device responds.

Is there a more concrete way for me to know when the responses have finished from the ND?

If it helps, I’m using python-xbee with the coordinator in API mode, and all routers/nodes are in transparent mode.

Thanks.

---

<div class="post-metadata">

**Author:** ![16ksa23](https://avatars.discourse-cdn.com/v4/letter/1/aeb1de/32.png) [@16ksa23](https://forums.digi.com/u/16ksa23)\
**Post date:** [October 15, 2013, 6:28am UTC](https://forums.digi.com/t/how-to-wait-for-and-read-nd-response-in-python/12017/2 "2013-10-15T06:28:36Z")

</div>

You can use getnode() from the following link, [http://www.digi.com/wiki/developer/index.php/Module:xbee#get\_node\_list.28.29](http://www.digi.com/wiki/developer/index.php/Module:xbee#get_node_list.28.29)

---

<div class="post-metadata">

**Author:** ![alias\_neo](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@alias\_neo](https://forums.digi.com/u/alias_neo)\
**Post date:** [October 18, 2013, 6:10am UTC](https://forums.digi.com/t/how-to-wait-for-and-read-nd-response-in-python/12017/3 "2013-10-18T06:10:44Z")

</div>

Your response seems to indicate there is _another_ Python library? I@m using this one: [https://code.google.com/p/python-xbee/](https://code.google.com/p/python-xbee/)

The one you link doesn’t seem to have many of the features this one does and I’m not sure how it fits.
