Doubts Regarding Zigbee Coordinator, NRF52840

Hai,

I'm Developing a Zigbee coordinator using nrf52840 and sdk is nrf5_sdk_for_thread_and_zigbee_v4.2.0_af27f76.

I have few doubts, here is that

1. How to stop network steering Manually?

 I'm using bdb_start_top_level_commissioning(ZB_BDB_NETWORK_STEERING); to start network steering. for stop what api i have to use?

2. How to remove sub Devices?

 While removing time end device should be in transferring mode or even we can do it while end device in sleeping mode?

3. How to make coordinator into factory default mode?

 That means all sub-devices are deleted from coordinator. Any API or function to do that?

Best Regards

Bose

Parents
  • Hi Bose,

    1. How to stop network steering Manually?

    You can use zb_bdb_close_network() to stop network steering and close the network.

    2. How to remove sub Devices?

    You can send a leave request to the device you want to remove from the network, using zb_zdo_mgmt_leave_req_s and zdo_mgmt_leave_req(). This is the same as is used in the CLI command zdo mgmt_leave. Here is an example implementation:

    void leave_req(zb_bufid_t bufid, zb_uint16_t short_addr, zb_bool_t rejoin_flag)
    {
        zb_zdo_mgmt_leave_param_t * p_req = ZB_BUF_GET_PARAM(bufid, zb_zdo_mgmt_leave_param_t);
    
        ZB_MEMSET(req->device_address, 0, sizeof(zb_ieee_addr_t));
        req->remove_children = ZB_FALSE;
        req_param->rejoin = (rejoin_flag ? 1 : 0);
        req->dst_addr = short_addr;
        zdo_mgmt_leave_req(bufid, NULL);
    }

    3. How to make coordinator into factory default mode?

    The function zb_bdb_reset_via_local_action() will perform a factory reset. See Resetting to factory defaults with a local action Security for more information.

    Best regards,

    Marte

  • Haii  

    Thank you for your response.

    to close network steering, I tried zb_bdb_close_network() this function. But the MCU was reset from ZBOSS.

    is there is any rules to call this function?

    ZB_AF_SET_ENDPOINT_HANDLER(ZB_IAS_DEVICE_ENDPOINT, zb_zcl_ias_zone_cmds);

    Now I'm calling In zb_zcl_ias_zone_cmds handler.

    Logs: 

    00> <error> app: ZBOSS assertion in file: 297, line: 215
    00>
    00> <error> app: ZBOSS assertion occurred
    00>
    00> <error> app: Reset MCU from ZBOSS
    00>
    00> <info> app: Production configuration is not present or invalid (status: -1)
    00>
    00> <info> app: Zigbee stack initialized
    00>
    00> <info> app: Unimplemented signal (signal: 54, status: 0)
    00>
    00> <info> app: Start network steering

    Best Regards 

    Bose

  • Hi Bose,

    It should not reset. Where exactly are you calling it? You should make sure that the Zigbee stack has started before calling it, but other than that I am not aware of any considerations for calling this function.

    Best regards,

    Marte

  • Hai Marte,

    Thank you so much

    I solved all 3 problem.

    I have one difficult to implementation of coordinator.

    End devices are able to join and also it sending data also.

    I have only one end point handler.

    I'm getting all data in endpoint handler.

    how  can I classify the response data. like Read response, Report Response and Notification response. 

    Best Regards

    Bose

    zb_bool_t zb_endpoint_handler(zb_uint8_t param)
    {
      zb_bool_t processed = ZB_TRUE;
      zb_zcl_parsed_hdr_t cmd_info;
      zb_ret_t status = RET_OK;
      uint8_t *pin_payload;
    
      ZB_ZCL_COPY_PARSED_HEADER(param, &cmd_info);
    
      uint16_t adds_t = cmd_info.addr_data.common_data.source.u.short_addr;
    
      NRF_LOG_INFO(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Data From End device<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
    
      NRF_LOG_INFO("Address %x Command direction %x Cluater id %x CMD id %x sequence num %d is_common_command %x\n",adds_t,cmd_info.cmd_direction,cmd_info.cluster_id,cmd_info.cmd_id,cmd_info.seq_number,cmd_info.is_common_command);
    }

  • Hi,

    You can use the fields of cmd_info. All the fields can be found here: zb_zcl_parsed_hdr_s. To get the command ID use cmd_info->cmd_id.

    However, to figure out what kind of command it is you must first check whether it is a common command or not, using cmd_info-> is_common_command. If it is, that means the command is global and common to all clusters, and it should be one of the commands found here: ZCL commands shared by all clusters. If it is not, it will be a cluster command, so then you need to check the cluster ID (cmd_info->cluster_id). This is because the same command ID is used for different commands depending on if it is a common command or which cluster it is. For example for command ID 0x00 you have:

    • Common: Read attributes command
    • Basic cluster: Reset to factory defaults command
    • Identify cluster: Identify command
    • etc.

    Best regards,

    Marte

Reply
  • Hi,

    You can use the fields of cmd_info. All the fields can be found here: zb_zcl_parsed_hdr_s. To get the command ID use cmd_info->cmd_id.

    However, to figure out what kind of command it is you must first check whether it is a common command or not, using cmd_info-> is_common_command. If it is, that means the command is global and common to all clusters, and it should be one of the commands found here: ZCL commands shared by all clusters. If it is not, it will be a cluster command, so then you need to check the cluster ID (cmd_info->cluster_id). This is because the same command ID is used for different commands depending on if it is a common command or which cluster it is. For example for command ID 0x00 you have:

    • Common: Read attributes command
    • Basic cluster: Reset to factory defaults command
    • Identify cluster: Identify command
    • etc.

    Best regards,

    Marte

Children
Related