Getting zigbee device RSSI/LQI value of all network device

How can we retrieve all network devices RSSI/LQI value?

Is there option to subscribe value for LQI ?
We just want to showcase LQI/RSSI on server so user be aware if device are placed in proper range or not. 

Parents
  • void zb_zdo_mgmt_lqi_cb(zb_uint8_t param)
    {
        zb_buf_t *buf = ZB_BUF_FROM_REF(param);
        zb_zdo_mgmt_lqi_resp_t *resp = (zb_zdo_mgmt_lqi_resp_t*)ZB_BUF_BEGIN(buf);
        zb_zdo_neighbor_table_record_t *record = (zb_zdo_neighbor_table_record_t*)(resp + 1);
        for (zb_uint8_t i = 0; i < resp->neighbor_table_entries; i++)
        {
            if (record->device_type == ZB_ZDO_DEVICE_TYPE_ROUTER)
            {
                ZB_LETOH64(record->ext_addr);
                TRACE_MSG(TRACE_APS3, "Router found: " TRACE_FORMAT_64,
                          (FMT__A, TRACE_ARG_64(record->ext_addr)));
            }
            record++;
        }
        zb_free_buf(buf);
    }
    void get_router_list(void)
    {
        zb_zdo_mgmt_lqi_param_t *req;
        zb_buf_t *buf = zb_buf_get_out();
        req = ZB_BUF_GET_PARAM(buf, zb_zdo_mgmt_lqi_param_t);
        req->start_index = 0;
        req->dst_addr = 0x0000;  // Coordinator address
        zb_zdo_mgmt_lqi_req(ZB_REF_FROM_BUF(buf), zb_zdo_mgmt_lqi_cb);
    }

    Its not able to know if its router or end device both gives similar value most of the cases

  • Hello,

    Great to see that you were able to find out how to get the LQI values with zb_zdo_mgmt_lqi_resp_t.

    Dhaval Dalvadi said:
    Its not able to know if its router or end device both gives similar value most of the cases

    The zb_zdo_neighbor_table_record_s struct does not have a device_type parameter directly, so you need to go through the type_flags parameter and get the device_type with ZDO_RECORD_GET_DEVICE_TYPE like this:

    zb_uint8_t device_type = ZB_ZDO_RECORD_GET_DEVICE_TYPE(record->type_flags);

    Best regards,

    Maria

  • Hi Maria 
    I found the standard ZigBee device which I am using is smart plug 
    I found from the answer you suggested it returns as router

    Is it possible device can be in router and also have application like smart bulb or plug in ZigBee?

Reply Children
Related