Comments on: ESP32 Save Data Permanently using Preferences Library https://randomnerdtutorials.com/esp32-save-data-permanently-preferences/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Wed, 12 Mar 2025 08:40:41 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Stefano https://randomnerdtutorials.com/esp32-save-data-permanently-preferences/#comment-1015810 Wed, 12 Mar 2025 08:40:41 +0000 https://randomnerdtutorials.com/?p=102041#comment-1015810 Great tutorial: really easier and faster than SPIFF that I used in past… many thanks!!

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-save-data-permanently-preferences/#comment-989206 Fri, 06 Dec 2024 10:28:03 +0000 https://randomnerdtutorials.com/?p=102041#comment-989206 In reply to Uwe.

Hi.
Thanks for noticing.
It’s fixed now.
Regards,
Sara

]]>
By: Uwe https://randomnerdtutorials.com/esp32-save-data-permanently-preferences/#comment-988789 Wed, 04 Dec 2024 20:38:40 +0000 https://randomnerdtutorials.com/?p=102041#comment-988789 Hi,
thanks for this very useful help.
There is a small typo:
gettULong64 instead of getULong64 in the “Get a Key Value (Read Value)” section.
Br
Uwe

]]>
By: Patrick https://randomnerdtutorials.com/esp32-save-data-permanently-preferences/#comment-972129 Tue, 15 Oct 2024 08:12:15 +0000 https://randomnerdtutorials.com/?p=102041#comment-972129 I would like to ask how much read/write cycle is ESP is capable of?

Because i am planning to make a product counter with ESP

daily count: 1800 pcs

trigger :1 million pcs

My concer is how to ensure the data is preserved

Thanks

]]>
By: Xylopyrographer https://randomnerdtutorials.com/esp32-save-data-permanently-preferences/#comment-917718 Fri, 24 May 2024 05:35:30 +0000 https://randomnerdtutorials.com/?p=102041#comment-917718 In reply to Allen Mulvey.

Preferences uses a portion of the on-board flash as its namespace. Thus when the flash is erased, so is the space used by the Preferences library. This is how it has always been.

For more detail, see the Resources section at the end of the Preferences Tutorial on the arduino-esp32 GitHub site at: https://docs.espressif.com/projects/arduino-esp32/en/latest/tutorials/preferences.html

]]>
By: Allen Mulvey https://randomnerdtutorials.com/esp32-save-data-permanently-preferences/#comment-916834 Mon, 20 May 2024 23:49:21 +0000 https://randomnerdtutorials.com/?p=102041#comment-916834 This article is a little old and these things change fast. Using the Arduino IDE and setting “Erase all flash before sketch upload” to enabled now (May 2024) deletes the preferences.

Thanks again for all your work.

]]>
By: jorge medina https://randomnerdtutorials.com/esp32-save-data-permanently-preferences/#comment-886800 Mon, 29 Jan 2024 10:29:27 +0000 https://randomnerdtutorials.com/?p=102041#comment-886800 Antes que nada gracias por todos sus aportes, siempre son el impulso suficiente para desarrollar proyectos con cada nueva tecnología que ocupo, asi que de nuevo muchas gracias!! Hoy recurro a ustedes para obtener ayuda respecto a la compilación de la biblioteca en VisualStudioCode, ya que no encuentro solución en ningún sitio. El problema es que al compilar aparece el error “For ESP32 devices, please use the native Preferences library”. Este error se presenta con la versión de biblioteca 2.1.0 y 2.0.0, las dos únicas versiones de esta. Tambien probé cambiar la version de framework, desde la 6.5 hasta la 4.4, y da el error con todas las combinaciones entre versiones de framework y biblioteca.

]]>
By: Bravo J. https://randomnerdtutorials.com/esp32-save-data-permanently-preferences/#comment-886430 Sat, 27 Jan 2024 07:42:05 +0000 https://randomnerdtutorials.com/?p=102041#comment-886430 Very nice tutorial.
I have one question: Do the stored data survive an OTA update where both the program and files stored in littleFS are updated?

]]>
By: Ilija Iliev https://randomnerdtutorials.com/esp32-save-data-permanently-preferences/#comment-874205 Sat, 25 Nov 2023 15:13:00 +0000 https://randomnerdtutorials.com/?p=102041#comment-874205 In reply to Mal Oldis.

Hello Mal Oldis,
When you use Arduino IDE, there is configuration options for the device. By default 4MB are splitted in 2 parts: for NVM and for code flash. Usually 1.5 MB is NVM emulation but you can extend or remove it depend on your needs. Also can burn bootloader, add OTA, etc.

]]>
By: Mal Oldis https://randomnerdtutorials.com/esp32-save-data-permanently-preferences/#comment-874121 Fri, 24 Nov 2023 22:44:25 +0000 https://randomnerdtutorials.com/?p=102041#comment-874121 Hi Sara and Roi. I have been using preferences extensively but am a bit concerned about it’s limits. How do I determine what the memory limits are? Also in your preferences guide, you mention the use of preferences.end();. I am not sure when to use it.
Thanks so much.

]]>