Internal EEPROM ESP8266

ESP8266 have 512 bytes of internal EEPROM, it is useful when you want to store some settings, such as IP address of server, WEP key, SSID of WiFi.

In this lesson we will see writing data to EEPOM and reading from EEPROM

To write byte to EEPROM we need two commands

To read single byte from EEPROM

We have only read and write bytes commands, for writing String, Integer and other data types we have to split data into bytes first and rejoin it while reading.

Write data to EEPROM

We write some characters and String to EEPROM, This program only writes data to EEPROM we read it using another program. Bytes ABC are stored at address 0x00,0x01,0x02 respectively and string is stored from 0x0F.

Remember that ESP requires EEPROM.commit(); command. Without this data will not be saved to EEPROM.

Read data from EEPROM

Now let’s read data from EEPROM and show it on serial monitor. You can combine these two programs as per your need.

String is array of characters.

Results

You will see what we have written to the EEPROM will appear on Serial terminal. ESP always sends some garbage to serial monitor when you reset it, skip first line.

In this example we have taken how to write String and read String from EEPROM.

Leave a Reply