All in the title...
Thanks
All except your code, that is.
But it does appear that there is no update() function. You'll just have to use put() and hope the wear levelling which update() did is incorporated in put().
I used :
if(data!=EEPROM.read(addr)){EEPROM.write(addr,data);}
but that doesnt explain the error...
After a journey through the net,
8266 has no EEPROM but a flash memory with a cache. Its necessary to use EEPROM.begin(size needed) to write in the cache and to use EEPROM.commit() to transfer the cache to the flash. EEPROM.write check if the data is different before writing the cache (I dont know how to verify that). EEPROM.end() do commit().
Data may be loosed if reset or power off before commit().
so... there is no update member...
Maybe the arduino reference need update ?
max777:
Maybe the arduino reference need update ?
The ESP is not an Arduino.
The ESP uses a different library (although possibly named the same).
So no, that's not going to happen.
update() wouldn't really make sense on ESP8266 since it's just writing to RAM until you call commit() or end(). They could have thrown in a dummy update() but you're not going to be able to use code written for the AVR EEPROM library on the ESP8266 without changes anyway so it wouldn't provide a huge benefit.
Although the ESP8266 core for Arduino does try to provide the same API as the standard Arduino hardware cores and thus piggyback on the official Arduino documentation, there are some differences so you should refer to the ESP8266 core's documentation first:
https://arduino-esp8266.readthedocs.io/en/latest/
which will tell you when there are differences, then use the Arduino documentation for the things that are the same.
Thanks
As I use Arduino IDE (and Arduino instructions) to program 8266 I didnt think to that...
Not yet very clear for me where is the border between Arduino software and third party software in the IDE
3rd party software is whatever the 3rd party wanted it to be. Hopefully they will try to be as consistent with the standard Arduino API as possible but this is certainly not guaranteed. In some cases (such as "EEPROM" on ESP8266), hardware differences make complete consistency impossible. As I said, you should always start with whatever documentation the 3rd party has been kind enough to provide. This consistency may end up being somewhat misleading. You should remember that from one board to another this familiar API may sit on top of very different code. When you switch from, for example, Tools > Board > Arduino/Genuino Uno to Tools > Board > WeMos D1 R2 and Mini you have just change to a completely different compiler, compilation recipes, uploader, core library, and bundled libraries. The only things that don't change are some libraries that are not architecture-specific and thus may be used for any board.
What's not obvious is that architecture-specific libraries like EEPROM are bundled with the hardware packages. So this means their example sketches (e.g. File > Examples > EEPROM) may change depending on the hardware package of the board you have selected from the Tools > Board menu. Those example sketches can be a useful form of documentation.
In some cases documentation will be absent or insufficient and you will just need to look at the source code.
Or a more hands on approach what is 3th arty or not:
Everything you have when you only downloaded the Arduino IDE isn't third party. Anything else you downloaded (being it just from the net, library manager or board manager*) is third party.
*Except updates from packages that came with the IDE and a few libraries.
Arduino SAMD Boards, Arduino SAM Boards, and Intel Curie Boards don't come with the Arduino IDE but they are not 3rd party. Of course the official Arduino documentation was originally written for Arduino AVR Boards and so you might even encounter situations where the official documentation is not correct for those packages, but that would definitely be considered an error rather than a consequence of using a 3rd party package.
There are some official Arduino libraries in Library Manager that don't come with the Arduino IDE.
Thanks
More clear now...
"Everything you have when you only downloaded the Arduino IDE isn't third party. Anything else you downloaded (being it just from the net, library manager or board manager*) is third party."
I'll try to remember that