How to store sensor’s data on a ESP8266 Flash?
Posted: Sat Oct 16, 2021 4:12 am
i! I would monitor temperatures of a remote water system, there isn't wifi there so the only way I have is local storage. As the amount of data is few (about one read per minute for 2 sensors) I would get advance of the flash inside ESP8266 (4MB) to store datas, and read it them back hosting a web server which show a chart. I have some questions about ESP, I hope you can clear me them, thank you:
I read the EOF of flash cycles is about 10.000, so I need to care about reducing at maximum writes, may I address directly the Flash to point locations? I would keep in RAM the time value for the first location used, and calculate then all the next ones. When the last location is reached I proceed to overwrite. THis is ideal, there is a library for that? Which address I should start and end considering Sketch and OTA?
If not possible to address directly the Flash, and I shoud use the file system SPIFFS, how can I reduce the writes in the file table? I suppose every time I access a file to store a data it will change fomthing there, and soon it will fail. Maybe a chance to create a big file and access it to the next location and store data?
Thanks for you kind answers
I read the EOF of flash cycles is about 10.000, so I need to care about reducing at maximum writes, may I address directly the Flash to point locations? I would keep in RAM the time value for the first location used, and calculate then all the next ones. When the last location is reached I proceed to overwrite. THis is ideal, there is a library for that? Which address I should start and end considering Sketch and OTA?
If not possible to address directly the Flash, and I shoud use the file system SPIFFS, how can I reduce the writes in the file table? I suppose every time I access a file to store a data it will change fomthing there, and soon it will fail. Maybe a chance to create a big file and access it to the next location and store data?
Thanks for you kind answers