Home/Support/Support Forum/Difference between Python XBee Library network methods: get vs. discover
New and improved user forum site going live on 12/6 (All users will need to reset their password when the new forum is active)
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

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

0 votes
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!

asked Aug 3, 2020 in Python by edunn106 New to the Community (25 points)

Please log in or register to answer this question.

1 Answer

0 votes
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.
answered Aug 3, 2020 by mvut Veteran of the Digi Community (15,515 points)