# Difference between Python XBee Library network methods: get vs. discover

**URL:** <https://forums.digi.com/t/difference-between-python-xbee-library-network-methods-get-vs-discover/21619>\
**Category:** Python\
**Tags:** mac-address, device-discovery, library, node-discovery, python\
**Created:** [August 3, 2020, 11:46am UTC](https://forums.digi.com/t/difference-between-python-xbee-library-network-methods-get-vs-discover/21619 "2020-08-03T11:46:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![edunn106](https://avatars.discourse-cdn.com/v4/letter/e/dc4da7/32.png) [@edunn106](https://forums.digi.com/u/edunn106)\
**Post date:** [August 3, 2020, 11:46am UTC](https://forums.digi.com/t/difference-between-python-xbee-library-network-methods-get-vs-discover/21619/1 "2020-08-03T11:46:06Z")

</div>

So I am have this code that, from a flashed MicroPython script on a router XBee module, sends a message to the coordinator in the network through autostart (PS = 1). The point of the message is the delivery of the router’s MAC address to the coordinator. The coordinator then pushes that info into my Python script… therein the router is reassigned a Node Identifier (NI). To do this I first used variablename = xnet.get\_device\_by\_64(_MAC Address_) method from the Python XBee library. Then I say variablename.set\_node\_id(‘newNI’). Then I said  
newvariablename = xnet.discover\_device(‘newNI’)

So I guess my question is as follows:

since I used the .get\_device\_by\_64() method… does that mean that the router was already somehow in the network cache or whatever?..

So then when I follow up with a .discover\_device() that may be redundant and all I did was reassign my router into a second variable?

thanks. I am asking because, if I am correct in my understanding above, then in my MicroPython file I must’ve accidently added the device to the network cache lol and this would be good to confirm/deny.

Thanks in advance!

🙂

---

<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:** [August 3, 2020, 12:54pm UTC](https://forums.digi.com/t/difference-between-python-xbee-library-network-methods-get-vs-discover/21619/2 "2020-08-03T12:54:59Z")

</div>

I am not the best with the library you are working with but I would say yes. You are correct. The Get\_device is pulling it out of the address table where by discover\_device looks for that module within the table, and if not there, does a Node discovery to that 64bit address.
