EnigmaIOT
0.9.8
Secure sensor and gateway platform based on ESP8266 and ESP32
|
MQTT Gateway example includes plain Arduino OTA mechanism. OTA is protected using network key selected during initial configuration.
On nodes, OTA updates are transferred using the same mechanism. Firmware is sent over MQTT using a Python script. Then gateway selects the appropriate node and send this binary data over ESP-NOW.
As ESP-NOW restricts maximum payload to 250 bytes per message firmware is splitted in chunks. Every chunk is 212 bytes long, so that it fits together with message headers and is multiple of 4. This splitting work is done by EnigmaIoTUpdate.py
script.
A requirement is to have installed Python3 in the computer used to do the update.
In order to run the update, you need to install paho-mqtt
library. To do that you can follow instructions here.
An example of this command could be like this:
Notice that using ESP-NOW, device address correspond to MAC address of your ESP8266 or ESP32 node.
It is very important to configure user and password on you MQTT broker. Besides, if it is going to be accessed from the Internet you should activate TLS encryption and a certificate.