This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to get Zigbee network disconnection event?

I am working on zigbee network.

I have seen that there is an event for network joining but could not find any event for network disconnection.

If I want to check that coordinator is there in the network or not, then how can I know, should I manually implement this or is there a way to check this, or to get the disconnection event?

Parents
  • Hi,

    If there's only one router on the network it will get a ZB_NWK_SIGNAL_NO_ACTIVE_LINKS_LEFT signal when the coordinator leaves the network, as this signal is used to inform the application that all links to other routers (and the coordinator) has expired. It's generated when none of the neighbor devices send a Link Status message for some time. However, this signal will not be generated if there are more than one router on the network.

    The coordinator repeatedly broadcasts a Link Status message, so you could check for this, but I believe the handling of this message is a part of the ZBOSS stack and not available to the user, so I'm not sure whether it's possible to use this. There are two other options, either to ping the coordinator or to send a match desc request. The first one is done in the CLI Agent example using zcl ping, where you ping a device of a given address. There's an explanation of this in the link, and you can also check out the function where this is handled, cmd_zb_ping, which can be found in components/zigbee/cli/zigbee_cli_cmd_ping.c (on line 840 in SDK v4.1.0). To use match desq request use the function zb_zdo_match_desc_req, and set the fields in zb_zdo_match_desc_param_s to correspond with your coordinator, such as 0x0000 as the nwk_addr. Remember to set number of input and output clusters as 0. This is also used in the CLI Agent example, though to discover devices depending on their profile ID, and you can find it in the part about Using CLI to control lighting devices.

    You would then have to implement some logic for when you don't receive a reply from the coordinator in any of these cases, preferably with some timeout.

    Best regards,

    Marte

Reply
  • Hi,

    If there's only one router on the network it will get a ZB_NWK_SIGNAL_NO_ACTIVE_LINKS_LEFT signal when the coordinator leaves the network, as this signal is used to inform the application that all links to other routers (and the coordinator) has expired. It's generated when none of the neighbor devices send a Link Status message for some time. However, this signal will not be generated if there are more than one router on the network.

    The coordinator repeatedly broadcasts a Link Status message, so you could check for this, but I believe the handling of this message is a part of the ZBOSS stack and not available to the user, so I'm not sure whether it's possible to use this. There are two other options, either to ping the coordinator or to send a match desc request. The first one is done in the CLI Agent example using zcl ping, where you ping a device of a given address. There's an explanation of this in the link, and you can also check out the function where this is handled, cmd_zb_ping, which can be found in components/zigbee/cli/zigbee_cli_cmd_ping.c (on line 840 in SDK v4.1.0). To use match desq request use the function zb_zdo_match_desc_req, and set the fields in zb_zdo_match_desc_param_s to correspond with your coordinator, such as 0x0000 as the nwk_addr. Remember to set number of input and output clusters as 0. This is also used in the CLI Agent example, though to discover devices depending on their profile ID, and you can find it in the part about Using CLI to control lighting devices.

    You would then have to implement some logic for when you don't receive a reply from the coordinator in any of these cases, preferably with some timeout.

    Best regards,

    Marte

Children
No Data
Related