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

Light switch mesh client to server and vica versa RSSI value

hello,

i am using 3 nRF52840 boards to test mesh. i am using sdk nrf15.2.0 and sdk mesh 3.0.0.

my question:

1) how can i measure the rssi value from client to server and vice versa (heartbeat) ?

2) The rssi value which is printed out is this rssi from provisioner or ? i mean provisioner receive the rssi value from client and server with this function (heartbeat) ?

static void app_health_event_cb(const health_client_t * p_client, const health_client_evt_t * p_event)
{
switch (p_event->type)
{
case HEALTH_CLIENT_EVT_TYPE_CURRENT_STATUS_RECEIVED:
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Node 0x%04x alive with %u active fault(s), RSSI: %d\n", p_event->p_meta_data->src.value, p_event->data.fault_status.fault_array_length,
((p_event->p_meta_data->p_core_metadata->source == NRF_MESH_RX_SOURCE_SCANNER) ? p_event->p_meta_data->p_core_metadata->params.scanner.rssi : 0));
break;
default:
break;
}
}

Thank you very much

best regards

Parents
  • Hello,

    It is possible to check the RSSI value, but you should be aware that in Mesh, you don't necessarily receive the packet directly from the device that sent it. It may be several hops between the source and the destination of the packet. This is how mesh works to extend the range of the network, by retransmitting received packets.

    In the light_switch\server example you can check the RSSI the following way:

    In app_onoff.c there is already a line in the generic_onoff_state_set_cb() function that is printing "msg:  SET" in the log. If you paste this line below that, you will see the rssi of the received message:

    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "rssi: %d\n", p_meta->p_core_metadata->params.scanner.rssi);

    In addition, it may be a good idea to check the address. You can print this the following way:

        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "msg: SET: %d\n", p_in->on_off);
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "rssi: %d\n", p_meta->p_core_metadata->params.scanner.rssi);
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "addr %02x:%02x:%02x:%02x:%02x:%02x\n", p_meta->p_core_metadata->params.scanner.adv_addr.addr[0],
                                                                                    p_meta->p_core_metadata->params.scanner.adv_addr.addr[1],
                                                                                    p_meta->p_core_metadata->params.scanner.adv_addr.addr[2],
                                                                                    p_meta->p_core_metadata->params.scanner.adv_addr.addr[3],
                                                                                    p_meta->p_core_metadata->params.scanner.adv_addr.addr[4],
                                                                                    p_meta->p_core_metadata->params.scanner.adv_addr.addr[5]);
    

    Best regards,

    Edvin

  • Hello Edvin,

    I have found the app_onoff.c in nRF5_Mesh_SDK_v2.2.0 > examples > common > src, however if I made the changes, but I rebuild the project in examples > light_switch > thingy_provisioning_demo_generic_OnOff_Blink > light_switch_proxy_server_nRF52.emproject, the changes saved from the app_onoff.c won't have effect on the hex file generated by the .emproject file right?

    Best regards,

    WHui

Reply
  • Hello Edvin,

    I have found the app_onoff.c in nRF5_Mesh_SDK_v2.2.0 > examples > common > src, however if I made the changes, but I rebuild the project in examples > light_switch > thingy_provisioning_demo_generic_OnOff_Blink > light_switch_proxy_server_nRF52.emproject, the changes saved from the app_onoff.c won't have effect on the hex file generated by the .emproject file right?

    Best regards,

    WHui

Children
No Data
Related