discover()

Use this function to perform a network discovery, which is equivalent to issuing the ND command. The timeout for the discovery is determined by the N? command.

xbee.discover()

This function accepts no parameters, and returns an iterator yielding a dictionary for each discovered node.

Note xbee.discover() returns immediately, but querying the resulting iterator will block execution until a response is available or the discovery times out (as determined by N?). See the xbee.discover() examples for more information.

Discovered node dictionaries can contain the following fields:

Note Some of these fields may be excluded depending on what protocol the XBee device is running.

Example output on a Zigbee network:

{
  'rssi': -20,
  'node_id': ' ',
  'device_type': 1179648,
  'parent_nwk': 65534,
  'sender_nwk': 41334,
  'sender_eui64': b'\x00\x13\xa2\x00\x92w%`',
  'node_type': 1
}

Example output on a 802.15.4 network:

{
  'rssi': -20,
'node_id': ' ',
'sender_nwk': 41334,
'sender_eui64': b'\x00\x13\xa2\x00\x92w%`',
}

Example output on a DigiMesh network:

{
  'rssi': -20,
  'node_id': ' ',
  'device_type': 1179648,
  'sender_eui64': b'\x00\x13\xa2\x00\x92w%`',
  'node_type': 1
}