Re: #bluetoothmesh Help for sending and receiving messages through mesh #bluetoothmesh
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).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 126.96.36.199 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.