I programmed an arduino nano ESP32 to save a token received over MQTT in the flash memory. This token is used later to open a door with an RFID card (If token is in the RFID card then open the door)
This is working pretty well, however i am worried about the writing cycle limit of Arduino.
In fact, my token is updated 9 times a day, so in 3 years i will kill the memory (10 000cycles limit)
I am writing today to have some ideas or input, do you think i will kill the memory ? it is 16 bytes string so not a lot.
Hello, @petitsacados. Use external FRAM for this purpose or save the token in SRAM and copy it to FLASH only in case of power loss. Besides why do you even save the token in FLASH since it is updated so often? Or is the microcontroller not constantly powered?
You could try writing to different locations of the NVS 9 times a day and erasing daily or weekly ( there is ~2K of storage ) that would increase the life span to over 28 years.
@ZX80 yes I think that this situation is ideal for NVS, even on a small partition the 16 byte token 9 or 10 times a day and erased daily or weekly then you wouldn't even have to think about wear leveling and it eliminates the need for additional hardware