Closed maksimkurb closed 3 years ago
for 3: check https://github.com/esp8266/Arduino/blob/master/cores/esp8266/Esp.cpp#L94 software watchdog timers are not implemented at all in core, thats why we need to feed the dog sometimes.
For backups this is a good idea worth implementing
Another idea: postpone reboot (which is called via GET /reboot) if file is saving
Another idea: postpone reboot (which is called via GET /reboot) if file is saving
i dont think /reboot is called by any user so precisely :)) but anyway sinbce i'll start implementing this i for sure guard all writings to flash
please check build from https://github.com/CODeRUS/GyverLampCpp/pull/49
Should be implemented. Please reopen if issues.
I'm testing this firmware on my lamp and sometimes my lamp restarting by watchdog or if it crashed (my matrix can not display clock). If
settings.json
oreffects.json
were saving at this time, they get corrupted and I supposed to re-upload my settings.json and effects.json again to fix matrix/effects/mqtt/etc settings. I think that these files should be written on the flash in a more safe way.What came to my mind:
settings.json
andeffects.json
and ESP will use them in readonly mode. All updates will be saved tosettings.json.save
andeffects.json.save
. When lamp is booting up, it tries to read*.json.save
files, and if they get corrupted, we can restore them from corresponding*.json
originals. In this scenario, ESP should also delete*.json.save
file if new*.json
uploaded via web ui..bak
file every 60 seconds (if changed) for example, chance that both running-config and backup-config will be corrupted are lowerESP.wdtEnable(timeout_ms)
? For now, timeout is 0ms, but I can't understand why, can you please explain it?