Ble Mesh Pub/Sub Example

juanchu98
Posts: 3
Joined: Mon Mar 11, 2019 6:03 pm

Ble Mesh Pub/Sub Example

Postby juanchu98 » Fri Jun 19, 2020 12:44 pm

Hello everyone!
I have been testing ESP-BLE-MESH and, so far, i am doing good besides the complexity of the technology. I have tested all the examples on github and i still have lots of doubts. I want to create a bluetooth mesh based on sensor model clients and servers via publication/subscription process (NOT get, set messages).

I have modified the "sensor client" example of github to stop provisioning from code, to start provisioning with an APP of my phone. In particular, nRF Mesh. This APP lets me set some publish/subscribe parameters such as period or addresses via GUI.

What i do is to set the paremeters and, right after doing so, i get the following error in the serial monitor of both (client and server models):

Code: Select all

W (289861) BLE_MESH: No matching TX context for ack
E (292851) BLE_MESH: sdu_recv, Too short SDU + MIC
E (296321) BLE_MESH: sdu_recv, Too short SDU + MIC
I have already had this problem when using the led example and, looks like to start publishing messages they need a first SET Message to realize what is the actual state of the element. Is this right? There's no default state to start publishing?

If they need a first SET message as i said, then, if i really want to create my mesh, i need a client and server sensor model in each node in order to autoset some parameters and then start publishing some values.

May i get some help? Does anybody have an example using just Pub/Sub messages to interact with the mesh? Why am i getting this errors?


Thank you in advance,
Juanchu98

fkremer
Posts: 2
Joined: Thu Jun 25, 2020 10:52 am

Re: Ble Mesh Pub/Sub Example

Postby fkremer » Fri Jul 03, 2020 10:57 pm

Hello everyone, hello Juanchu98,

I'm on the same situation like Juanchu98.
Can someone explain the initial steps or provide an example for pub/sub in ble mesh?

Thank you in advance
Frank

abansal22
Posts: 105
Joined: Wed Apr 22, 2020 8:24 am

Re: Ble Mesh Pub/Sub Example

Postby abansal22 » Tue Aug 25, 2020 11:12 am

Hello,

I donot know what this error does "E (292851) BLE_MESH: sdu_recv, Too short SDU + MIC", but I am sure that you are not getting any message form the client or server due to the fact that your mesh is sitting idle.
The problem you are facing because there is no publish address function in the server model as it was in on_off model. Thus when you set the publishing address, the sensor client model will do nothing. for this you need to set the configuration server into the sensor client node. Thus when you set the publication event using the app, it will generate the event "ESP_BLE_MESH_MODEL_OP_MODEL_PUB_SET" then set the publication address into the variable like this pubadd= param->value.state_change.mod_pub_set.pub_addr; Now use the pubadd to send out the message get state with swapping with the unicast address. Now you will get the event in sensor client callback function is "ESP_BLE_MESH_SENSOR_CLIENT_PUBLISH_EVT". Parse the marshalled data and you are good to go. similarly set the subscribing address into the sensor server models . You did not need to touch the code of the sensor server nodes.

FlorianR
Posts: 28
Joined: Fri Mar 12, 2021 2:00 pm

Re: Ble Mesh Pub/Sub Example

Postby FlorianR » Wed Mar 31, 2021 7:55 am

Hi,
has someone an working example code for me? I need to broadcast sensor data from every node to every other node.
I am really stuck.
Best regards
Florian

ask1432
Posts: 5
Joined: Mon Apr 19, 2021 11:39 am
Contact:

Re: Ble Mesh Pub/Sub Example

Postby ask1432 » Tue Jun 22, 2021 10:41 am

I am working on ble sensor module . I want to get sensor data from multiple nodes .and want to the periodic publication of data to client.is it possible

Who is online

Users browsing this forum: Google [Bot], jtrose7 and 95 guests