Hi together,
I have a problem with storing a single string in the EEPROM of my ESP8266 (I also tried another ESP8266). It seams to work without a reboot. But after a reboot, all the data is gone. I think I will lose my mind very soon. I am working on this for 2 days now... When I tried to use SPIFFS instead, I had the same problem.
Here is my example-code, that is not working. Can you tell me why, please?
#include <EEPROM.h>
void setup()
{
Serial.begin(9600);
EEPROM.begin(4095);
String value = "";
EEPROM.get( 0, value );
delay(200);
Serial.println("Value after reboot is: " + value);
Serial.println("Write new EEPROM-value");
value = "HelloWorld";
EEPROM.put( 0, value );
delay(200);
EEPROM.commit();
value = "";
EEPROM.get( 0, value );
delay(200);
Serial.println("Value after writing, without reboot is: " + value);
}
void loop()
{
}
Here is the result of the output:
Value after reboot is:
Write new EEPROM-value
Value after writing, without reboot is: HelloWorld
⸮⸮⸮⸮⸮D⸮⸮⸮$⸮⸮⸮Value after reboot is:
Write new EEPROM-value
Value after writing, without reboot is: HelloWorld