How to use the health model of Bluetooth mesh

I am trying to use Health SRV and Health CLI to check if there are any errors in the nodes. I have successfully transmitted the fault codes, but there are still many questions that I cannot find answers to. For example, Health SRV has a function to periodically upload fault codes, but I have not successfully implemented this function and have not found any helpful information or examples.Or, there are 4 callbacks about error codes in bt_mesh_health_srv_cb, but I can't trigger fault_get_cur no matter what. I don't know if it's a problem with my usage or if this callback has no meaning in the first place? Because it seems similar to fault_get_reg

Is there any detailed example code to demonstrate the various details of the entire health model?
  • Hello,

    I will look into this and get back to you.

    Regards,

    Swathy

  • Thank you for your prompt reply. Additionally, I am using ncs2.9.1

  • Hi SwRa

    I have browsed through the code and now found the method to trigger fault_get_cur, and have implemented the function of reporting fault codes periodically in the health srv model.

    On a node that has implemented the health cli model, use bt_mesh_cfg_cli_mod_pub_set to set the node's reporting period and other parameters. Then, it will start reporting fault codes at regular intervals, and the fault_get_cur will be automatically called.And fault_get_reg is triggered when nodes implementing the health cli model actively read fault codes.So these two callback functions are basically the same, just one active and one passive

    However, I still think that if NCS can provide a complete example code about the health model, it will be of great help to development

  • Hello,

    I checked with the team regarding this.. Unfortunately, we don't have an example specifically demonstrating the health model. 

    There are several Bluetooth Mesh samples in NCS (such as light, light switch, sensor, and DFU samples) include the Health Server model as part of their composition data, mainly for provisioning and attention callbacks (e.g., LED blinking during provisioning). These samples can serve as a starting point to see how the Health Server is integrated, but they are not focused examples of the health model itself. For example, the Bluetooth Mesh: Sensor observer and Bluetooth Mesh: Light samples both include the Health Server in their model composition, but their main functionality is not health model demonstration.

    Regards,

    Swathy

Related