How to streamline sensor data over Mesh

Hey DevZone Community and Nordic Engineers :)

I'm trying to configure a multiple sensors board to BLE Mesh / COEX Mesh & BLE (If the solution you'd offer to the regular Mesh is also relevant to the COEX case, it would be superb. Otherwise, I'll open a different ticket later).

As far as I tried, the examples on the SDK are mainly with the sensor library. My sensors are not part of the Sensor.h, and thus, I don't know what is essential and what is replaceable - and how.

I'm using NCS v1.9.1 with nRF52840/32 and sometimes nRF21540dk (52840 based).

As far as I noticed, all the tickets relating to Mesh are way old and irrelevant to my current setup.

What do I need to adjust at the mesh_sensor to a regular peripheral (i2c\spi\adc etc.) sensor(unsupported by NCS sensor.h)

Thanks for all the helpers :)

  • I've asked about integrating a peripheral sensor into the Mesh layout. I meant that the sensor's driver is already functional(I've made and tested it) - And I need to send its output over Mesh. Over regular BLE, everything works well - but I don't have any design reference for the Mesh equivalent. I don't want to harm the model handler on the mesh_server and mesh_clients to get silly errors, and I don't find any other way to do so.

  • Thank you for verifying. 

    What the Mesh team suggests is that you base your application on the existing sensor server/client sample for Mesh found in nRF Connect SDK. The samples should be pretty straight forward to use and to augment with the sensor server model if you've reached the point where you can receive data from your sensor board. I'm assuming you've already investigated them, but please correct me if I assume wrong.

    The sensor server sample showcases 4 different sensor types as well as different ways for the server to publish the data to the mesh network. It can be used together with the Mesh sensor observer to show the functionality.

    Can you explain a bit more about how far you've come in the process and/or point to any specific errors you are experiencing when attempting to integrate your sensor board together with the sample? Any logs/minimal code samples that reproduces any errors you have would be great for helping you find where any errors have occurred. 

    Kind regard,
    Andreas

  • As mentioned,, I know about the observer, client, server, and even the COEX and regular mesh LBS samples. I searched every existing solution possible before reaching out here. NONE IS VALID FOR MY CASE.

    I have tried the drivers with a regular BLE shell, and IT WORKS AND TRANSMITS!

    However, WHEN IT COME TO MESH, I DON'T KNOW ANY EXISTING SAMPLE TO DO THE SAME TRANSMITTING FUNCTION AS THE BLE BUT OVER MESH.

    The current samples deal with NCS native sensors and don't include anything parallel to non-NCS-supported sensors. Can you provide one who does?

  • Hi,

    Meh said:
    The current samples deal with NCS native sensors and don't include anything parallel to non-NCS-supported sensors. Can you provide one who does?

    Unfortunately we don't have any other samples illustrating how to use the Sensor server API other than what I supplied in my previous reply,

    The Sensor server sample contains function calls to bt_mesh_sensor_srv_publish which can be seen in model_handler.c, namely in the callback function "button_handler_cb", and in the function "end_of_presence".  Any callback function is typically connected to a button press, while the end_of_precense function is coupled with a timer. Depending on if you want your data to be triggered by a button or a timer, you should find what you need w.r.t function calls in these two functions. The sensor server documentation also contains an example for how you can initialize the sensor server with a bt_mesh_sensor.

    I know this is not the reply you want, but nonetheless it is what we have available at this point in time. I will however make a note that the sample/guide for how to do this with a non-NCS-supported sensors has been mentioned as a feature request.

    Kind regards,
    Andreas

  • Hey

    Although tutorials like the  BLE Custom Service series would be the perfect solution for this question, how do you define a custom data type outside the enum? Can simple #define do the trick, or is there something beyond it?

Related