-->
Page 1 of 1

number of writes to spiffs

PostPosted: Mon Nov 02, 2020 2:41 pm
by h16bill
I am running a temperature logging program that writes 18 bytes of data to a csv file every two minutes. After the data file reaches 16kb I start overwriting older entries in the file. I am running on an esp-01 with 1mb flash. I also have OTA enabled and files stored to support the web page.
How good will the write leveling work under these circumstances? I am wondering how long before it becomes a brick.
16k/18 * 10,000 = ~9 million writes @ 30/hour = 34 years
or is it:
1mb/18 * 10,000 = ~582 million writes @ 30/hour = 2,216 years

Re: number of writes to spiffs

PostPosted: Mon Nov 16, 2020 9:40 am
by h16bill
Is this too hard a question for newbie corner?

Re: number of writes to spiffs

PostPosted: Wed Nov 18, 2020 6:29 pm
by davydnorris
Either way, 30+ years is plenty long enough for your device - I wouldn't worry.

The key thing is that the wear occurs when you erase, not when you write, so minimise the erases and do a block at a time. If you have a look in the advanced topic I uploaded my storage library which implements a journal file system type of storage with wear levelling