Skip to main content
Joan Duran
Associate II
February 17, 2025
Question

Zigbee coordinator network management

  • February 17, 2025
  • 2 replies
  • 807 views

We have a Zigbee network, working as a coordinator, and we want to know which devices are connected. In order to know which devices are connected, we use this code:

 

while (ZbNwkGetIndex(zigbee_app_info.zb, ZB_NWK_NIB_ID_NeighborTable, &neighbor, sizeof(neighbor), i++) == ZB_NWK_STATUS_SUCCESS)
{
	if (neighbor.relationship == ZB_NWK_NEIGHBOR_REL_CHILD)
	{
		neigbors.device[neigbors.length].mac = neighbor.extAddr;
		neigbors.device[neigbors.length].address = neighbor.nwkAddr;
		neigbors.length++;

		if (neigbors.length >= MAX_DEVICES)
			break;
	}
}

 

And in order to remove a device from the network, we use this code:

 

req.destAddr = device->address;
req.deviceAddr = device->mac;
req.flags = ZB_ZDO_MGMT_NWK_LEAVE_FLAG_REMOVE_CHILDREN;

status = ZbZdoLeaveReq(zigbee_app_info.zb, &req, NULL, NULL);

 

But several times, after remove a device, the device is still in the neighbor table.

What's wrong? We should handle the network in other ways? Which is the best way to know which devices are connected? And to remove a device?

 

Thank you!!

2 replies

Senior III
February 17, 2025

Devices that leave the network do not always disappear instantly from the neighbour table. You may need to wait for the entry to age out or explicitly trigger a table refresh.

Joan Duran
Associate II
February 17, 2025

Which is the best way to trigger a table refresh?

Roger SHIVELY
ST Employee
February 19, 2025

Hello @Joan Duran 

This post has been escalated to the ST Online Support Team for additional assistance.  We'll contact you directly.

Regards,

Roger