Home/Support/Support Forum/When you discover devices and organize them into a list.. is it indeed random or am I cray?

When you discover devices and organize them into a list.. is it indeed random or am I cray?

0 votes
When I dicover network and store network devices by their name into a list like so...
xnet = local_device.get_network()
remote_list = xnet.discover_devices(["ROUTER_00", "ROUTER_01"])
and then set a particular xbee's pin high or low like so ..

def a_0_on():

remote_list["ROUTER_00"].set_dio_value(IOLine.DIO0_AD0, IOValue.HIGH)

def a_0_off():

remote_list["ROUTER_00"].set_dio_value(IOLine.DIO0_AD0, IOValue.LOW)

.. then I put these functions into GUI button clicks...

anyways! I am getting different results per program Run.. sometimes my ROUTER_00 module is firing the particular pin ON/OFF.. other times the other module "ROUTER_01" is performing the action instead. Not cool. They have specific names for a reason lol. Why is this happening? When I discover the devices into the list, is it randomly locating them. So when I reference a specific location in the list i.e. remote_list[0].. I suppose what resides in location [0] is not going to be consistent with the order I originally intended i.e. remote_list = xnet.discover_devices(["ROUTER_00", "ROUTER_01"])

straighten out my understanding of this if ya could,

Thanks! :)
asked Jul 1, 2020 in RF Solutions and XBee by edunn106 New to the Community (25 points)

Please log in or register to answer this question.

1 Answer

+1 vote
Best answer
Its random and has been done for a purpose. During node discovery, random back-off time is used by each responding Router to avoid all of them responding at once which otherwise could result in data collision.

Digi Support
answered Jul 3, 2020 by mathur Veteran of the Digi Community (289 points)
selected Jul 3, 2020 by edunn106