ESP8266 Master to many Slaves broadcast
iVisionary opened this issue · 3 comments
Dears,
I've got fed up of searching over the internet on this - now I want a straight forward solution or guidance please.
My project simply is to have one ESP8266 connected to a host Microcontroller to be like a hub or master to establish a local private network no need to connect to the internet. On the other hand, I have many ESP8266 devices connected to the same network and receiving data from the master ESP8266 or the Microcontroller. These ESP slave devices will receive the message from the master and turn on/off a relay on one of the gpio pins and return a status feedback to the master. That's it!
Please guide me to the correct direction. I'm so confused right now and don't know what should I focus on! Thanks in advance!
The ESP has gone through a lot of transformation over the years, so it is understandable how confusing it could be when reading different ways to do things on the ESP.
IMHO, MQTT is the simplest way to go. While you can host your own MQTT server, using a public IoT hub such as adafruit.io is simpler. In case you're unfamiliar with MQTT, it is made up on one MQTT hub (server), and as many MQTT nodes as desired. Any node can publish a message to the hub, the hub would in turn send that message to all nodes subscribing to that message. That's it! No master, no slave, just nodes either subscribing, publishing messages, or both.
Here's a five minute video I did a while back. You can do it!
https://www.youtube.com/watch?v=MWebdJwr6ks
Dear @hwiguna thank you for your reply and clarification.
I checked your video and read about QMTT. Now, I have another simple question, is it possible to have a local MQTT server installed on microcontroller and to establish the network locally no need for a cloud service. Appreciate your help!
I'm unaware of MQTT servers running on a microcontroller. However, it pretty much runs on any computer (Raspberry Pi, old PCs). Here's an example of many articles on that topic:
https://www.baldengineer.com/mqtt-tutorial.html