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

Lock and restart Zigbee Stack

Hello!

I'm using the nRF 52840 module for Zigbee applications.
I am implementing a Zigbee router and I need the time-limited commissioning on the device, such as the creation of a Zigbee network by a Coordinator. At the moment I can't find any API to do this. Is there a way to lock and restart the Zigbee stack without necessarily having to reset the device?

Thank you,

Raffaela

  • Hi Raffaela.

    At the moment, there is not a API for this. You could try to implement this yourself by sending two seperate ZDO requests.

    Best regards,

    Andreas

  • Hi Andreas,

    Thank you for your answer. Can you give me an example?

    Best regards,

    Raffaela

  • Hi Raffaela.

    Sorry for the late reply, I'm home with the flu.

    I don't really have an example for this, you could try something like this:

    void lock_network_cb(zb_uint8_t param)
    {
      NRF_LOG_INFO("Network is locked");
      zb_free_buf(ZB_BUF_FROM_REF(param));
    }
    
    void lock_network(zb_uint8_t param)
    {
      zb_buf_t *buf = ZB_BUF_FROM_REF(param);
    
      if (buf->u.hdr.status == 0)
      {
        zb_zdo_mgmt_permit_joining_req_param_t *req_param = ZB_GET_BUF_PARAM(buf, zb_zdo_mgmt_permit_joining_req_param_t);
    
        NRF_LOG_INFO("Device STARTED OK");
    
        /* ask coordinator not to accept more childs */
        req_param->dest_addr = 0;
        req_param->permit_duration = 0;
        req_param->tc_significance = 1;
    
        zb_zdo_mgmt_permit_joining_req(param, &permit_joining_cb);
      }
      else
      {
        NRF_LOG_INFO("Device started FAILED status %d", (int)buf->u.hdr.status);
        zb_free_buf(buf);
      }
    }

    And then start the network again by bdb_start_top_level_commissioning().

    Note,I have not tested this since I'm not in the office at the moment.

    Best regards,

    Andreas

  • Hi Andreas,

    I tried that approach that you advised to me. But it doesn't work. 

    I will explain to you better what I should do: since it is a multiprotocol system, I need that, when the BLE is active, the Zigbee in the router device is not active; so, if a Zigbee Coordinator tries to scan the network, it should not find my router device. But of course, I could turn off the BLE and reactivating the Zigbee so now I need the Zigbee Coordinator to find my device, following a scan.

    How to turn on or off the BLE is clear (I can start and stop the advertisement).

    Is it possible to do this in some way, without obviously having to do a reset the device and restart the stack?

    Thank you so much and best regards,

    Raffaela

Related