Facing issues in implementing a Bluetooth Mesh

I'm working on implementing a Bluetooth Mesh network where each node periodically sends messages containing a single float32 value or an array of float32 values (e.g., every 5 minutes). Additionally, each node should be able to receive messages and act as a relay for other nodes in the network.

I encountered several challenges in finding suitable mesh models for this use case. Most existing models, like the generic on/off server/client or sensor_srv/sensor_cli models, are designed for specific applications (e.g., sending on/off states or sensor data), which don't align with my requirements.

I also attempted to create a custom model but faced issues with provisioning the nodes or successfully sending/receiving data using the nRF Mesh Android application.

I'm looking for guidance or examples of a basic Bluetooth Mesh implementation that allows sending and receiving custom data (e.g., float32 values). I've already reviewed the Bluetooth Mesh Chat example but couldn't adapt it to my needs. Any advice or resources would be greatly appreciated!

Parents
  • Hi,

    I'm working on implementing a Bluetooth Mesh network where each node periodically sends messages containing a single float32 value or an array of float32 values (e.g., every 5 minutes). Additionally, each node should be able to receive messages and act as a relay for other nodes in the network.

    You can configure periodic publication for any Bluetooth Mesh model. This is done runtime, and is set up by configuring the device after it has been provisioned into the network.

    Nodes with the relay feature will act as relays and relay all messages. This is an integral part of the Bluetooth Mesh stack, so all you need to do is enable the relay feature for the node and messages will be relayed automatically. In Bluetooth Mesh you address messages by group or unicast address, and the message will get relayed and reach the intended recipient. You do not have to do anything special in the application to get this behavior, since it is handled by the Bluetooth Mesh stack.

    I encountered several challenges in finding suitable mesh models for this use case. Most existing models, like the generic on/off server/client or sensor_srv/sensor_cli models, are designed for specific applications (e.g., sending on/off states or sensor data), which don't align with my requirements.

    From your description of sending single values or arrays, of type float32, it does sound like the sensor model might be a good fit, but if you rather want to make your own model then that is of course also an option.

    I also attempted to create a custom model but faced issues with provisioning the nodes or successfully sending/receiving data using the nRF Mesh Android application.

    Using the nRF Mesh application with custom models might be a bit cumbersome, yes, since the app doesn't know the format of your custom (vendor specific) messages. In other words, you must format the messages correctly manually. One alternative may be to use the Bluetooth Mesh Shell application and a board (typically an nRF DK or Dongle), instead of  the nRF Mesh app. With that, it should be easier to customize and automate your messages, for testing purposes.

    I'm looking for guidance or examples of a basic Bluetooth Mesh implementation that allows sending and receiving custom data (e.g., float32 values). I've already reviewed the Bluetooth Mesh Chat example but couldn't adapt it to my needs. Any advice or resources would be greatly appreciated!

    We have documented in the SDK documentation how to create a new model. I highly recommend following the recommendations there, both reading and understanding the Bluetooth mesh concepts and following the walk-through of how the Chat Client model is implemented, for understanding the concepts and understanding how to implement the model that you need. The Vendor model development overview also provides a good overview of what is required for creating your own model.

    Regards,
    Terje

Reply
  • Hi,

    I'm working on implementing a Bluetooth Mesh network where each node periodically sends messages containing a single float32 value or an array of float32 values (e.g., every 5 minutes). Additionally, each node should be able to receive messages and act as a relay for other nodes in the network.

    You can configure periodic publication for any Bluetooth Mesh model. This is done runtime, and is set up by configuring the device after it has been provisioned into the network.

    Nodes with the relay feature will act as relays and relay all messages. This is an integral part of the Bluetooth Mesh stack, so all you need to do is enable the relay feature for the node and messages will be relayed automatically. In Bluetooth Mesh you address messages by group or unicast address, and the message will get relayed and reach the intended recipient. You do not have to do anything special in the application to get this behavior, since it is handled by the Bluetooth Mesh stack.

    I encountered several challenges in finding suitable mesh models for this use case. Most existing models, like the generic on/off server/client or sensor_srv/sensor_cli models, are designed for specific applications (e.g., sending on/off states or sensor data), which don't align with my requirements.

    From your description of sending single values or arrays, of type float32, it does sound like the sensor model might be a good fit, but if you rather want to make your own model then that is of course also an option.

    I also attempted to create a custom model but faced issues with provisioning the nodes or successfully sending/receiving data using the nRF Mesh Android application.

    Using the nRF Mesh application with custom models might be a bit cumbersome, yes, since the app doesn't know the format of your custom (vendor specific) messages. In other words, you must format the messages correctly manually. One alternative may be to use the Bluetooth Mesh Shell application and a board (typically an nRF DK or Dongle), instead of  the nRF Mesh app. With that, it should be easier to customize and automate your messages, for testing purposes.

    I'm looking for guidance or examples of a basic Bluetooth Mesh implementation that allows sending and receiving custom data (e.g., float32 values). I've already reviewed the Bluetooth Mesh Chat example but couldn't adapt it to my needs. Any advice or resources would be greatly appreciated!

    We have documented in the SDK documentation how to create a new model. I highly recommend following the recommendations there, both reading and understanding the Bluetooth mesh concepts and following the walk-through of how the Chat Client model is implemented, for understanding the concepts and understanding how to implement the model that you need. The Vendor model development overview also provides a good overview of what is required for creating your own model.

    Regards,
    Terje

Children
  • Hi Terje,

    Thank you for your detailed response. I’d like to share a few additional details about the application I am working on.

    In my use case, each node periodically sends:

    • 6–8 float32 values every 3 hours, and
    • An array of 2048 float32 values (~8 KB) every 6 hours.

    From your response, I understand that a custom model should work well for sending smaller data payloads. However, for the larger data (8 KB), I am exploring the best approach.

    I came across the Segmentation and Reassembly (SAR) mechanism, but it seems limited and may not work effectively for this size of data. I was considering the Bluetooth Mesh BLOB Transfer feature as a potential solution. However, I couldn’t find any examples or samples that demonstrate its use, and I’m unsure how to implement it in practice.

    Could you provide any advice or guidance on using BLOB Transfer for large data payloads, or suggest an alternative approach if this is not viable? Any resources or examples would be highly appreciated!

    Best regards,
    Rishabh

  • Hi,

    Regarding the custom model, a good starting point could be the Generic Level Server/Client models, where you can do appropriate changes such as change the data type to the required type, remove the delta and move messages, and change the model to a vendor model.

    Regarding BLOB Transfer, both the Client and the Server are used by Bluetooth Mesh DFU. For instance, the DFU Distributor, for which we have an implementation in nRF Connect SDK, acts both as BLOB Transfer Server and BLOB Transfer Client.

    Regards,
    Terje

Related