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


paul.leguennec@...
 

Hello,

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.

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 ?

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.

Thanks for your response.
Regards
Paul.


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


paul.leguennec@...
 
Edited

Hi Johan,
Thanks for your quick response.

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.
I already have gone through the mesh model spec, but I don't think there is a model that I could use to do what i want. I would like to send a message looking like this : UUID_A, UUID_C, RSSI_C.
I have not found a model that allows me to send a specific message (I might be wrong of course), so I don't know what model or at least what kind a model I could use.
EDIT : I think I will have to create a new model (a vendor model if I am right). I don't know if there is some kind of guide to do so, but there is a vendor model in the onoff_level_lighting_vnd_app that I could rely on it's implementation.

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.
I did not see this section, thanks for the info.

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?
I am using nRF Mesh to act as a provisioner right now.

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.
You did understood what I meant. I will look further into it once I will be able send a message in my mesh network.

Regards,
Paul.


paul.leguennec@...
 
Edited

Hi,

I am trying to implement two vendor models : one client and one server. I made a little specification of that model, and it just need two messages handlers : get and status. The client will send a get message to the server to receive a status response from the server.

To send periodically this message, as Johan Hedberg suggested me, I want to use periodic publishing.
Yet, I have trouble to see how I can use it. This is what I have add in my code :
/*
 * Client Configuration Declaration
 */

static struct bt_mesh_cfg_cli cfg_cli = {
};

static struct bt_mesh_cfg_mod_pub mod_periodic_pub = {
    .ttl     = 7,
    .period    = BT_MESH_PUB_PERIOD_SEC(7),

};
I don't believe it should be written like that. Could someone help me ?

EDIT
Also, for my Vendor Models I don't know if i should add a vendor_publish function, I just want to send a get message periodically to the server so it can respond with the status message.

Regards,
Paul.