user34671: I'm working on project which require to save some data into the EEPROM.
As I read online the ESP8266 has no real EEPROM, it use a section of FLASH just after the SPIFFS. Due to this read/write is quite different from standard Arduino, you need to call EEPROM.commit(). You also have to call EEPROM.begin(size) (I used size = 512) before start to use it.
I follow different tutorials online and I made some tests but it seems not working at all. When I try to save a value and then read it, values are different. I tried with
EEPROM.write(..)
...
EEPROM.read(..)

and with
EEPROM.put(..)
...
EEPROM.get(..)

but nothing change.
Is there any configuration on the board I need to set into Arduino IDE/Board Configuration?
EDIT: here's the code
void setup() 
{
    Serial.begin(9600);
    Serial.println();

    EEPROM.begin(512);
    EEPROM.write(0, 62);
    EEPROM.write(10, 103);
    //EEPROM.commit();
    EEPROM.end();
    Serial.print("Read at 0:"); Serial.println(EEPROM.read(0), DEC);
    Serial.print("Read at 10:"); Serial.println(EEPROM.read(10), DEC);
}

I always read 0 in the output.

user37622: You can read the emulated EEPROM only between begin and end. It works with memory image. 

begin allocates the in-memory image.
commit writes it to flash.
end commits and deletes the memory image.


34671: <p>I'm working on project which require to save some data into the EEPROM.
As I read online the ESP8266 has no real EEPROM, it use a section of FLASH just after the SPIFFS. Due to this read/write is quite different from standard Arduino, you need to call <code>EEPROM.commit()</code>. You also have to call <code>EEPROM.begin(size)</code> (I used size = 512) before start to use it.</p>

<p>I follow different tutorials online and I made some tests but it seems not working at all. When I try to save a value and then read it, values are different. I tried with</p>

<pre><code>EEPROM.write(..)
...
EEPROM.read(..)
</code></pre>

<p>and with</p>

<pre><code>EEPROM.put(..)
...
EEPROM.get(..)
</code></pre>

<p>but nothing change.</p>

<p>Is there any configuration on the board I need to set into Arduino IDE/Board Configuration?</p>

<p>EDIT: here's the code</p>

<pre><code>void setup() 
{
    Serial.begin(9600);
    Serial.println();

    EEPROM.begin(512);
    EEPROM.write(0, 62);
    EEPROM.write(10, 103);
    //EEPROM.commit();
    EEPROM.end();
    Serial.print("Read at 0:"); Serial.println(EEPROM.read(0), DEC);
    Serial.print("Read at 10:"); Serial.println(EEPROM.read(10), DEC);
}
</code></pre>

<p>I always read 0 in the output.</p>
 37622: <p>You can read the emulated EEPROM only between <code>begin</code> and <code>end</code>. It works with memory image. </p>

<ul>
<li><code>begin</code> allocates the in-memory image.</li>
<li><code>commit</code> writes it to flash.</li>
<li><code>end</code> commits and deletes the memory image.</li>
</ul>
