Using the SPIFFS for long time sensor data logging

espforuandme
Posts: 2
Joined: Tue Apr 27, 2021 6:49 pm

Using the SPIFFS for long time sensor data logging

Postby espforuandme » Sat May 01, 2021 6:04 pm

Hi,

i want to log approx. 100 sensor measurings per day.
At the moment i use a SD Card reader for logging but i wonder if it would work using the SPIFFS for this job?

I read that with the ESP8266 only 10000 writing cycles are possible which would mean that i would reach this limit after 100 days.
In another forum i read about 100000 possible cycles which would be much better but still worse.

Is this limit the same on the ESP32?
What does this limit mean? if i reach the 10000 or 100000 cycles --> what exactly happens?
Will the ESP stop logging? Is the flash memory then unusable for all time or can it be "repaired" by flashing again?

Thanx for your reply

Daniel

ESP_Sprite
Posts: 9730
Joined: Thu Nov 26, 2015 4:08 am

Re: Using the SPIFFS for long time sensor data logging

Postby ESP_Sprite » Thu May 06, 2021 8:32 am

The flash chip capabilities are generally the same between ESP32 and ESP8266 boards. However, SPIFFS will do wear leveling: it will try to write to all sectors of the flash partition it is allocated evenly. (The amount of writes specified is per sector, so a write in sector 1 and then a write in sector 2 only counts as one write for both sectors.) So it's a bit hard to say, as it's also dependent on the size of the data you write and the amount of flash you can allocate to SPIFFS.

On what happens if the flash wears out: it effectively breaks, as in, you'll have some bits which either can't properly go from 0 back to 1 again, or bits that read out flaky. This is not fixable.

Who is online

Users browsing this forum: Basalt and 46 guests