It’s possible to generate a network of ESP8266 and ESP32 using the MQTT protocol without using a RaspberryPI such as a broker.
On a ESP8266 is installed a micro broker called uMQTT-broker:https://github.com/martin-ger/esp_wifi_repeater/tree/uMQTT_broker
UPDATE=> A new version has been developed https://github.com/martin-ger/esp_mqtt with a dedicated Git.
This node could be considered the Master or the Server and it’s called Broker in the MQTT protocol.
The Server node is a Access Point (AP) with address 192.168.4.1 but also it is able to connect to a local Wifi network as a Station (STA).
The Server node shares together the MQTT messagges coming from the 2 networks.
The precompiled binaries are available at:
They can be flashed with:
esptool.py --port /dev/ttyUSB0 write_flash -fs 32m 0x00000 0x00000.bin 0x10000 0x10000.bin
esptool.py --port /dev/ttyUSB0 write_flash -fs 8m 0x00000 0x00000.bin 0x10000 0x10000.bin
The Server node could be configurated by the UART console or a telnet connection:
nc 192.168.4.1 7777
or using the local wifi network:
nc 192.168.xxx.yyy 7777
When the connection is started sending “help” is possible to see all the commands to log or set the server.
More details are available at:
A MQTT client for ESP8266 is:
The MQTT library for Arduino IDE is based on the Eclipse Paho projects
To test the MQTT broker on the PC I suggest MQTT-Spy GUI:
A more complex system could be built using a RaspberryPI (RPI) where is installed the Monsquitto MQTT broker:
Some instruction how to install Monsquitto on RPI:
Node-Red could run inside the RPI
Node-Red manages the MQTT messagges and generate actions between the IoT objects (RPI, ESP8266s. ESP32s, Arduinos, Telegram Bots..):
There is MQTT broker for Node-Red: