-->
Page 1 of 3

can't find preferences.H building against ESP8266/ARDUINO

PostPosted: Wed Mar 11, 2020 11:47 am
by obiezboncak
Hi everyone!

I have some solid experience with the ESP32 running the Arduino core and have been using the Preferences library to store, you guessed it, preferences, to NVS on that platform. It is an easy and smooth process. https://autoclicker.me
I am trying to port my code to the 8266 running the Arduino core because I do not need most of the capabilities of the ESP32. I am having trouble finding the library though, and multiple web searches trying to figure out if the Preferences library is supposed to work have led me nowhere. As far as I can tell the 8266 does have NVS functionality (at least it has partitioning/FS support).

Anyway my build dies quickly with "fatal error: Preferences.h: No such file or directory". Tips on how to move forward from here? I believe I have solved all my other issues at this point.

Thanks.

Re: can't find preferences.H building against ESP8266/ARDUIN

PostPosted: Wed Mar 11, 2020 5:18 pm
by AcmeUK
"fatal error: Preferences.h: No such file or directory"

I think you will find that preferences.H lets you store data in the ESP32's EEPROM.
According to this post the ESP8266 does not have an EEPROM:-
https://forum.arduino.cc/index.php?topic=491469.0

Perhaps it will yield a solution to your quandry.

Re: can't find preferences.H building against ESP8266/ARDUIN

PostPosted: Sat Mar 14, 2020 8:26 am
by martinayotte
AcmeUK wrote:According to this post the ESP8266 does not have an EEPROM:-

ESP32 doesn't have EEPROM either ... :ugeek:

Preferences class is written on top of ESP32 NVS class, but unfortunately the NVS class isn't ported to ESP8266. Maybe it could be ported, or maybe emulated, but that would not be done easily ...
https://github.com/espressif/esp-idf/tr ... /nvs_flash

Re: can't find preferences.H building against ESP8266/ARDUIN

PostPosted: Thu Jan 21, 2021 5:16 am
by flisterfive
opening "%appdata%\local\arduino15\staging\packages\" and for each error downloading given in the arduino IDE, i downloaded the ZIP file manually, and copy to the above directory, after the fifth zip was copied. all was fine.