|
Post by gb0101010101 on Mar 30, 2019 23:23:26 GMT -8
I am just learning Arduino programming in C++ and using EEPROM to save data between reboots. I have a few concerns about saved data management and integrity when using EEPROM in current implementation. I may be way off here so please let me know.
- EEPROM Write on boot - Every time I reboot OurWeather board I see "Writing EEPROM
" message in Serial output. Should this be happening? Surely writes to EEPROM should only happen when data has changed and not every boot?
- Utils.h function writeEEPROMState() seems to write ALL values even if they have not changed. Is this limiting lifespan? Should saved data be compared before writing to EEPROM to save write cycles?
- EEPROM Read/Write is using fixed addresses. Each write is limited by lifespan of Address and can be greatly extended using Address Rotation. Is there any Address Management or Rotation to maximize lifespan? If not should it be implemented?
|
|
|
Post by SDL on Apr 2, 2019 5:48:49 GMT -8
All reasonable observations. However, you aren't going to exceed the lifespan of the EEPROM just by having a reboot once in a while. If you are rebooting 10 times a day, then maybe.
Dealing with the EEPROM with the lack of a preferences library available for the ESP8266 is a touchy business.
BP
|
|
|
Post by gb0101010101 on Apr 12, 2019 7:14:12 GMT -8
|
|
|
Post by SDL on Apr 13, 2019 10:16:25 GMT -8
Awesome library! Does just what you need!
BP
|
|