Page 1 of 1

BLE MESH SENSOR MODEL - How to send/get data from 2 or more server-nodes?

Posted: Wed May 13, 2020 6:55 pm
by txrossi
Running this example : https://github.com/espressif/esp-idf/tr ... nsor_model

I'm trying to get data from 2 or more server-nodes, but I got it just from the last node connected. And I got the 2 followings "warnings" in terminal when the second node was been connected.

Code: Select all

␛[0;33mW (13345) BLE_MESH: Device already exists in queue␛[0m

and

␛[0;33mW (16875) BLE_MESH: Duplicate found in Network Message Cache␛[0m
I has changed the uuid from the servers, but when I do this, the node can't connect.

Re: BLE MESH SENSOR MODEL - How to send/get data from 2 or more server-nodes?

Posted: Wed Jul 22, 2020 2:25 am
by kairui
I also tested the example: only surport a client and a server. when power on the secend server node, the first one will disconnected with log:

Code: Select all

BLE_MESH: No matching TX context for ack
idf version:V4.1

Re: BLE MESH SENSOR MODEL - How to send/get data from 2 or more server-nodes?

Posted: Tue Aug 25, 2020 10:38 am
by abansal22
Hello,

Suppose you have the 2 sensor server named as the s1 and s2, and one client model named as c1. now you successfully tested the functionality between s1 and c1, and s2 and c1. now you want to get the data from the s1 and s2 simultaneously, and show on the screen. For this you have to make the subscriber publisher model of the ble mesh. For this make a publishing group with address 0xC000 ( you can choose any one ). Now set the publishing address of the sensor cilent model to 0xC000. Similarly set the subscribing address of the sensor server models s1 and s2 to the 0xC000. Now the callback you will received data with event in the sensor client callback function will be in "ESP_BLE_MESH_SENSOR_CLIENT_PUBLISH_EVT". You have to parse the data as you are doing in the "ESP_BLE_MESH_SENSOR_CLIENT_GET_STATE_EVT".

The trickiest part is to send the message to the address 0xC000. You have 2 options one is hard code this into the code. While sending the message just swap this with the unicast address. If you donot want to hard code it, then just assign an unsigned 16 bit variable for the publishing address, lets say the variable is pubadd. Now, when setting the publishing address in sensor client model, you will receive the event in the configuration server call back event and the event name is "ESP_BLE_MESH_MODEL_OP_MODEL_PUB_SET". In that event just do this pubadd= param->value.state_change.mod_pub_set.pub_addr; this will setup the publication address into the variable and you are good to go to send the message.

Please let me know if you need anything to clear it up. also I donot frequently check into the esp32 forum site so my replies will be late!

Re: BLE MESH SENSOR MODEL - How to send/get data from 2 or more server-nodes?

Posted: Tue Jun 22, 2021 10:24 am
by ask1432
please elaborate on how to make the subscriber publisher model of the ble mesh. can you send a sample code I am not able to get data from multiple nodes

Re: BLE MESH SENSOR MODEL - How to send/get data from 2 or more server-nodes?

Posted: Wed Mar 06, 2024 2:16 pm
by jadeco
I am also interested in how to implement it. Can you please share some code?