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.
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.
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?
Hello,
Dhaval Dalvadi said:I found the standard ZigBee device which I am using is smart plug
I found from the answer you suggested it returns as router
Great!
Dhaval Dalvadi said:Is it possible device can be in router and also have application like smart bulb or plug in ZigBee?
Yes. In fact the ZigBee Light Bulb sample in nRF Connect SDK is configured as a router by default.
The role is configured in a configuration file (.conf) by setting one of the choices for CONFIG_ZIGBEE_ROLE: CONFIG_ZIGBEE_ROLE_END_DEVICE, CONFIG_ZIGBEE_ROLE_ROUTER or CONFIG_ZIGBEE_ROLE_COORDINATOR.
Best regards,
Maria