Using send_msg Function in esp_ble_mesh

rrwatt
Posts: 19
Joined: Mon Jan 01, 2024 3:13 am

Using send_msg Function in esp_ble_mesh

Postby rrwatt » Sun Mar 31, 2024 9:31 pm

Hi guys,

I am relatively new to esp-idf. I have a network of esp32 based devices, and I would like them to be able to talk to each other (i.e. send messages via flooding). I believe that this must be easily possible with the framework used in the examples, but I cannot seem to make sense of the code. I see the "esp_ble_mesh_client_model_send_msg" function coming up as a way to transmit messages in the network. How do I use this to send my own custom messages between nodes if possible? Any help is greatly appreciated. Thanks

-rrwatt

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: Using send_msg Function in esp_ble_mesh

Postby chegewara » Tue Apr 02, 2024 5:03 am

https://docs.espressif.com/projects/esp ... s-of-nodes

Usually you want to send message to unicast or group address.

rrwatt
Posts: 19
Joined: Mon Jan 01, 2024 3:13 am

Re: Using send_msg Function in esp_ble_mesh

Postby rrwatt » Thu Apr 04, 2024 6:26 pm

Thanks for your reply. I want to constantly (every few seconds) send sensor data from each server node to the client node. Should I use esp_ble_model_publish with the device_role as a node or esp_ble_server_model_send_msg? Also, how does the message opcode param work?

-rrwatt

Who is online

Users browsing this forum: Baidu [Spider], Majestic-12 [Bot] and 93 guests