In the relative beginning of my program I of course establish connection with all the reouter devices in my network of many routers and a coordinator. I am wondering what the difference is between instantiating a remote xbee device object like so:
and discovering a remote xbee device via it’s Node Identifier (NI) like so:
Discover the remote device whose node ID is ‘SOME NODE ID’.
remote = xnet.discover_device(“SOME NODE ID”)
For the duration of my project I’ve been just discovering the remote devices in the network using the latter NI string identifier. However, now I have new design requirements and so I would like to discover the device by it’s MAC address. So, fundamentally I would like a better understanding of the two above things: instantiating via MAC vs discovering via NI.
if I instantiate, does that inherently discover the device behind the scenes? or would I have to discover the device separately…?
The NI does a discovery to a known ASCII value and resolves the 64 bit address off of that ASCII value for you. It is meant to be a user friendly way of discovering and setting a destination address.
“discovers” or establishes an official network connection… as does the NI discover… both, as standalone uses, establishes / discovers the network connection “equally”. how do I say, if I use either one, poof connection established right? lol
remote_2 = RemoteXBeeDevice(local_device, XBee64BitAddress.from_hex_string(jn_device_mac))
print('remote_2 before NI set: ', remote_2)
remote_2.set_node_id(‘TOWER_2’)
print('remote_2 after NI set: ', remote_2)
tower_2 = xnet.discover_device(“TOWER_2”)
the last line of xnet.discover_device(NI) would be redundant because I established connection via the MAC in the first line and then just gave it a new NI. so, connection established and using the discover via NI would be redundant?