Best comm protocol for home automation using ESP8266 flashed with Arduino Sketch

Hello everyone,

I'm brand new to this forum, let me know if there are known threads delving in the same topic. I am working on a home automation project involving the use of ESP8266 and ESP32 flashed with Arduino sketches. I want the ESP8266 to communicate to ESP32 and the ESP32 to communicate to a cloud server. The ESP8266 would transmit sensor data to ESP32 and in turn ESP32 relay the info in encrypted mode to the server, the server returns data to ESP32 and ESP32 delivers message to ESP8266.

My question is: what is the more robust communication platform to implement for these devices?

I've heard about web-sockets, mosquito (MQTT) and GET/POST stuff, REST, etc. but I am not sure which protocol to pick for the project. I want to implement a protocol that can support encryption, can be loaded on ESP8266 (not eating to much memory) and is robust enough for commercial applications. I know I might be asking too much, but let me know if there are options out there that meet these requirements (even commercial protocols are welcome)

Thanks in advance for your support


You do realize that the ESP32 also has a EPS8266.

I don't understand the need for two wifi modules.

Sorry ieee488, I did not had the warnings/alerts on for messages, my bad.
The only reason to use 2 ESP’s is because it is easier for me to use one chip for communications rather than having a single chip doing both functions, also the idea is to communicate several esp8266 to a ESP32 working as a bridge. At the time, the protocol of choice is MQTT and a lot of detail has been added to the project.


I have the same dilemma with my project. Mine is not so much about home automation as about remote configuration and I initially tried to use http with get/post but the ESP32 has a somewhat different architecture to the ESP8266. The supporting Libraries are also very different when it comes to https. In addition, running a https on an ESP is very resource hungry and horribly slow. I found it to be actually slower on the ESP32. For these reasons I am starting to lean towards MQTT. In my preliminary tests I found it to be quite fast although I haven’t yet looked into the security aspects. I have still some way to go with my research and much will depend on what I find. Any responses to your post will be of interest.