Re: #bluetoothmesh Help for sending and receiving messages through mesh #bluetoothmesh


Johan Hedberg
 

Hi Paul,

On 9 Apr 2019, at 17.14, paul.leguennec@... wrote:
I am working on a project using Mesh with nrf52 boards. I have 3 boards for now, two of them are in a mesh network (boards A and B) (I will have more later to hava a real mesh network), and the last one is a beacon (board C).
I want to collect C's data on board A, and then sending those data by sending a message to B. It must be done periodically.
I have a few questions.

1. Do I need to use a mesh model to send a message through the mesh ? If yes, how can I use it ? I'm asking this because I felt like I could do otherwise.
All application-level messaging with mesh is always in the context of models. I’d suggest familiarising yourself with the Mesh Model Specification to see if any of the standard models suits your needs.

2. It looks like I could use hearbeat message to send this message, but I'm not sure if I to use it. Could I have some explanation on how the heartbeat works, and on where it publish ?
The heartbeat is a mesh transport layer feature. You can find a description of it in section 3.6.7 of the Mesh Profile Specification. The sending and receiving of heartbeat messages is configured using the configuration model, however it sounds like this is not what you are looking for since the heartbeat message is not extensible with any additional payload.

Since you say you need periodic sending it sounds like periodic publishing for a model is what you are after (see section 3.7.6.1 in the Mesh Profile specification). Model publishing is also configured using the configuration model.

Zephyr doesn’t support acting as provisioner or a configuration client (except for local configuration), however many of the mesh apps available for phones can do this (e.g. nRF Mesh). Did you have something specific in mind to use as the provisioner and configuration client?

3. Is it possible for the beacon to be in BLE and not a part of the mesh network ? I mean that I don't know if I can use BLE and Mesh in one node (for A and B) in order to scan for beacons to collect data and then send a message with the data collected.
I’m not sure I understand your question, however it is possible for a Mesh node to listen for other advertising packets, such as those coming from a non-mesh beacon. At the moment we’re missing a clean API for it, so you’d need to modify the scan callback (bt_mesh_scan_cb function) in subsys/bluetooth/host/mesh/adv.c to handle any non-mesh advertisements.

Johan

Join devel@lists.zephyrproject.org to automatically receive all group messages.