Skip to main content
Joan Duran
Associate II
Feb 17, 2025 4:07 PM UTC
Question

Zigbee coordinator network management

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

This topic has been closed for replies.

3 replies

Senior III
Feb 17, 2025 4:23 PM UTC

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
Feb 17, 2025 4:54 PM UTC

Which is the best way to trigger a table refresh?

Roger SHIVELY
ST Employee
Feb 19, 2025 7:20 PM UTC

Hello @Joan Duran 

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

Regards,

Roger