Every single project of ESP8266/ESP32 I start with empty sketch, collecting there parts of written examples.
However, I noticed most of "features" are frequently used. And no one example sketch presented.
- Read the unit parameters from EEPROM and compare with default parameters (WIFI SSID, pass, hostname, NTP addr, IP config, etc.).
- If EEPROM matches default then run WIFI AP with "captive portal". Once user fills the details, Write the details to EEPROM and restart.
- Start WIFI. If not connected in reasonable time, do something
- If NTP set, get the local time.
- If MQTT defined, publish to it the unit details from EEPROM and boot time. (Similar for syslog, email, telegram, other reporting systems).
- In the loop, run server waiting for OTA. Receive and Apply new OTA image when request arrived. Report to MQTT and Reboot.
- In the loop, wait for GPIO 0 grounded for more than X seconds. When this happens, set EEPROM to default and reboot.
EasyESP, Espruino and Tasmota have some of these features. However, these frameworks are hard to change/customize.
Can you recommend simple framework or sketch which has these basic features implemented?