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

Ble mesh heartbeat example

Hello,

The BLE mesh spec says the following:

Heartbeat is used to monitor nodes on a network and discover how far nodes are apart from each other.

Is there an example that demonstartes this feature?

Thx,

Parents
  • No, there is unfortunately no "real" mesh sdk example to demonstrate this feature. However, one of the application engineers in the support team has created an example which should work. Just download the mesh sdk v2.1.1 & place the provisioner - HeartBeat & server - Heartbeat folders in the light_switch folder of the mesh sdk. Then, open the provisioner & client Segger Embedded Studio projects, go to Tools -> Options ... -> Building -> Global Macros & make sure the SDK_ROOT & MESH_SDK point to the correct paths. They might be similar to this:

    SDK_ROOT=C:/NordicSemi/SDKs/nRF5_SDK_15.0.0_a53641a
    MESH_ROOT=C:/NordicSemi/SDKs/nrf5_SDK_for_Mesh_v2.1.1_src

    Make sure to keep the path quite short like I have done, otherwise you might get some path errors that are common in Windows (if you are using Windows).

    light_switch_heartbeat.rar

    Here is a description from Hung Bui who created the example:

    "Attached is a modified version of the lightswitch example to show how to configure heart beat. Please have a look at the node_setup.c file in the provisioner. In the example we will configure the light switch client to send heart beat to address 0xFFFF (all nodes) and the server 1, 2 will subscribe to the client address (0x100) and destination (0xFFFF). The server will print it out as RTT log in mesh_event_cb() in main.c

    If you want to have RSSI (of the last forwarded packet) you would need to nrf_mesh_rx_metadata_t in heartbeat_opcode_handle() to send the RSSI value to mesh_event_cb as NRF_MESH_EVT_HB_MESSAGE_RECEIVED event."

    Hope that helps!

  • I looked at the example and it very helpful. But I have a question about the RSSI. How exactly can I forward the RSSI value to the mesh_event_cb()?

Reply Children
No Data
Related