ESP32 Mesh functionality on MQTT

amehta
Posts: 22
Joined: Sat Feb 17, 2018 11:14 am

ESP32 Mesh functionality on MQTT

Postby amehta » Fri Aug 31, 2018 1:19 pm

Hi,

I couldn't find anything related to esp32 mesh functionality based on ESP-IDF with MQTT. Can someone please confirm that it is either under development and there is a probable release date associated with it or is it already there?

Thanks

eagi223
Posts: 16
Joined: Fri Mar 02, 2018 4:46 pm

Re: ESP32 Mesh functionality on MQTT

Postby eagi223 » Wed Sep 05, 2018 10:44 pm

I'm not sure that I fully understand the question, but I'll take a stab at it.

https://docs.espressif.com/projects/esp ... sh_proto_t
If you look at the v3.1 ESP-IDF documentation, there is a function for the esp mesh API to send data between nodes using esp_mesh_send(const mesh_addr_t *to, const mesh_data_t *data, int flag, const mesh_opt_topt[], int opt_count).

The mesh_data_t type is defined as an struct that has a member of type mesh_proto_t which holds the protocol of the data. It's defined as an enum and can be encoded as MQTT, JSON, HTTP, or Binary. So you can definitely send data in the MQTT protocol among nodes in the mesh network with the intention of posting the data to your MQTT broker once the data reaches the Access Point.

If you're asking if you can use the MQTT publish/subscribe protocol for nodes to communicate among each other within your mesh network, then no, the mesh API doesn't give you that ability. But you probably wouldn't want to do that anyway, because all your nodes are connected to each other in the mesh network anyway. You can have the root receiving all the data that it is subscribed to then passing it to the relevant node(s) in the mesh, then posting any data they give back to the MQTT broker. At least that is my understanding of it anyway.

Who is online

Users browsing this forum: Bing [Bot] and 81 guests