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

Restart Zigbee stack

I'm using: Segger Embedded Studio 3.52, nRF52840-PreviewDK, nRF5_SDK_for_Thread_and_Zigbee_v3

Is it possible to restart the Zigbee stack without restarting the whole chip?

I can use: NVIC_SystemReset(); to restart the nRF52840 (and it restarts the Zigbee as well), but I would rather only restart the Zigbee stack. Is there a routine I can call to do that?

John Martin

Parents
  • Hi John,

    Sorry for the late answer here. I am not sure if this is possible but I have consulted with our Zigbee team. Currently some of them are on business travel so unfortunately I may need to wait until next week for an answer. Sorry for the inconvenience.

    Best regards,

    Marjeris

  • Hi Marjeris,

    Do you have any new information on this one? I'm still having to reset the nRF52840 when Zigbee is lost. But I can't realistically go to production with that method. There has to be a way to re-establish a Zigbee link without doing a system reset.

    Thanks, John

  • Hi John,

    We have a factory reset (stack + settings) routine implemented in the Zigbee CLI example ("bdb factory_reset" command), which performs "reset with a local action" procedure as described in the BDB specification, when calling zb_bdb_reset_via_local_action(). Is this something like you had in mind?

    If not, can you elaborate more about what is happening right before the reset, what do you mean when you say the "Zigbee is lost" and what is the state you want to reset the device to?

    Best regards,

    Marjeris

  • There are a lot of different scenarios, I'll describe one that is easily reproducible. I have a Zigbee Coordinator and a Zigbee Router:

    - They connect and start passing messages. Everything works as expected.

    - Then I take the Coordinator off-line (I power it down).

    - The Router disconnects (as expected) and I start to receive: ZB_NWK_SIGNAL_NO_ACTIVE_LINKS_LEFT from the zboss_signal_handler() routine. 

    - I then bring the Coordinator back on-line (I power it up).

    - The Router continues to receive: ZB_NWK_SIGNAL_NO_ACTIVE_LINKS_LEFT

    - The only way that I have found for the Router to reconnect to the Coordinator is to restart the Router (NVIC_SystemReset()).

    So, I theorized that if I can restart the Zigbee stack, I could do that periodically once I start to receive  ZB_NWK_SIGNAL_NO_ACTIVE_LINKS_LEFT. Is there a better way to reconnect to the Coordinator?

    Let me know if you have any questions. Thanks, John

Reply
  • There are a lot of different scenarios, I'll describe one that is easily reproducible. I have a Zigbee Coordinator and a Zigbee Router:

    - They connect and start passing messages. Everything works as expected.

    - Then I take the Coordinator off-line (I power it down).

    - The Router disconnects (as expected) and I start to receive: ZB_NWK_SIGNAL_NO_ACTIVE_LINKS_LEFT from the zboss_signal_handler() routine. 

    - I then bring the Coordinator back on-line (I power it up).

    - The Router continues to receive: ZB_NWK_SIGNAL_NO_ACTIVE_LINKS_LEFT

    - The only way that I have found for the Router to reconnect to the Coordinator is to restart the Router (NVIC_SystemReset()).

    So, I theorized that if I can restart the Zigbee stack, I could do that periodically once I start to receive  ZB_NWK_SIGNAL_NO_ACTIVE_LINKS_LEFT. Is there a better way to reconnect to the Coordinator?

    Let me know if you have any questions. Thanks, John

Children
  • Hi John,

    I tested this scenario using light_bulb and light_coordinator examples in the SDK. If the commissioning between the router and the coordinator has taken place sucessfully, the router will remain in the network even if you power off the coordinator. The router won't disconnect (it will still have it's panid and short address assigned by the coordinator).

    The signal ZB_NWK_SIGNAL_NO_ACTIVE_LINKS_LEFT notifies that the devices in the neighbour table haven't send a Link status message (the link with the coordinator is down) since a given time, and if you the only devices in your network were the one coordinator and the router then it makes sense you get this message.

    When you power the coordinator back ON again, the coordinator should send a permit join request to the network (given that the network parameters are saved in NVRAM, so zigbee_erase_persistent_storage has to be set to ZB_FALSE) and attach itself to the network again.

    I suspect that you are erasing the persistent storage each time the coordinator is reseted and that it then creates a new network instead of joining the existing one, and therefore you need to reset the router again to start the commissioning process all over again.

    I recommend you install the nRF Sniffer for 802.15.4 so you can better debug what is happening, it would be fantastic if you attach the logs here as well if something does not make sense. See if the coordinator tries to rejoin the network after powering back on or not.

    Example of the Permit join request send by the light_coordinator after powering ON again:

    Best regards,

    Marjeris

Related