Files
ESPGadget/ESPGadget.ino

45 lines
2.4 KiB
C++

/*
* ESP-SecureGadget by Florian Overkamp
* An ESP8266 based IoT/remote controlled gadget
* Design is modular so it can be used for things like Sonoff's but also for custom projects like Dex' Moon lamp
*
* Note that file ordering is important.
*/
// Done:
// Enable MQTT over SSL as per https://github.com/debsahu/ESP_MQTT_Secure/tree/master/ESP8266_MQTT_SSL/Arduino/ESP8266_PubSubClient_SSL
// Cooperative multitasking: Use timers always. Avoid delays where they can be avoided.
// Restructure mqtt topics a bit (report back with unique names for multiple fx lights, for instance)
// Implement versioning so that new firmware can be done OTA
// Todo:
// maybe: loading settings on SPIFFS or similar so we can create more generic firmware? https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html#flash-layout
// Stay on the lookout for watchdog crashes, see also https://www.sigmdel.ca/michel/program/esp8266/arduino/watchdogs_en.html#ESP8266_WDT_RECOV
// Keeps crashing after a few days. Dunno why. https://www.pieterverhees.nl/sparklesagarbage/esp8266/130-difference-between-esp-reset-and-esp-restart
// More on this subject https://github.com/esp8266/Arduino/issues/1017
// Implement more visual effects
// Implement speed controls for the visual effects
// Implement OTA https://www.bakke.online/index.php/2017/06/02/self-updating-ota-firmware-for-esp8266/
// Refactoring sources: https://www.arduinolibraries.info/architectures/esp8266
// Refactor String usage to minimize heap pollution. https://cpp4arduino.com/2018/11/21/eight-tips-to-use-the-string-class-efficiently.html
// Chec Michael Teeuw's MQTT/SSL workaround: https://github.com/MichMich/ESP8266-AWS/blob/master/src/main.ino
// More WDT fixing:
// https://www.sigmdel.ca/michel/program/esp8266/arduino/watchdogs_en.html
// (background: https://internetofhomethings.com/homethings/?p=396
// (background: http://iot-bits.com/esp8266/esp8266-reset-causes-rst-cause/
// Version history:
// v13: Refactored so config-settings are in config.h, move from Adafruit Neopixel to WS2812FX library
// v12: Refactored inbound commands to hook in to the modules (module_message function), completed assimilation of (never-published) Moon_Connected sketch
// v11: Simplified scheduler, back to cooperative looping
// v10: First 'production' run. MQTT over TLS, but no OTA support.
const int FW_VERSION = 14;
//
// Configuration settings
//
#include "config.h"