# ESP32 "Eeprom" (nvs) read/write

**URL:** <https://forum.xod.io/t/esp32-eeprom-nvs-read-write/5390>\
**Category:** XOD Programming Questions\
**Created:** [August 12, 2021, 3:54pm UTC](https://forum.xod.io/t/esp32-eeprom-nvs-read-write/5390 "2021-08-12T15:54:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mci-ryan](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@mci-ryan](https://forum.xod.io/u/mci-ryan)\
**Post date:** [August 12, 2021, 3:54pm UTC](https://forum.xod.io/t/esp32-eeprom-nvs-read-write/5390/1 "2021-08-12T15:54:37Z")

</div>

Hi All,

I’ve got an oled menu setup that has now outgrown the flash size of my arduino nano, and I’m looking to use an ESP32 to run the robotics + oled display/menu.

It looks like the available libraries for eeprom won’t function with the ESP32’s as the ESP32 has its own “eeprom.h” library that uses the chip’s nvs.

Is there anyone that has a node/wrapped library of the esp32 eeprom.h with simple byte write/read functions?

I’ve tried my best to create my own node to wrap the library into xod, but my lack of any coding talent is killing my progress.

I’ve (probably incorrectly) forked the library on Github and moved the “eeprom.h” file to the root folder for anyone that is feeling helpful enough to wrap the library?

> **[GitHub - Ryano12/arduino-esp32: Arduino core for the ESP32](https://github.com/Ryano12/arduino-esp32)**
>
> Arduino core for the ESP32. Contribute to Ryano12/arduino-esp32 development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![wayland](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/wayland/32/1590_2.png) [@wayland](https://forum.xod.io/u/wayland)\
**Post date:** [August 22, 2021, 8:40pm UTC](https://forum.xod.io/t/esp32-eeprom-nvs-read-write/5390/2 "2021-08-22T20:40:49Z")

</div>

Hi @mci-ryan,

For the ESP32, it appears that the preferences library ([arduino-esp32/libraries/Preferences at master · espressif/arduino-esp32 · GitHub](https://github.com/espressif/arduino-esp32/tree/master/libraries/Preferences)) is favoured over the eeprom library. I’ve wrapped the preferences library:  
[wayland/esp32-preferences — XOD](https://xod.io/libs/wayland/esp32-preferences/)

I’m in the process of writing a guide to the use of this library, which I will share soon. However, in the meantime I’m sure you’ll be able to figure it out from the example patches provided.

The library enables you to store and retrieve key-value pairs. Supported data types are: byte, number and string.

---

<div class="post-metadata">

**Author:** ![mci-ryan](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@mci-ryan](https://forum.xod.io/u/mci-ryan)\
**Post date:** [August 23, 2021, 1:13am UTC](https://forum.xod.io/t/esp32-eeprom-nvs-read-write/5390/3 "2021-08-23T01:13:38Z")

</div>

You’re an absolute legend! I’ll give it a go this afternoon

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/eb7348baa04192c2ef932d1db54d44f09f8a7888.png) [@system](https://forum.xod.io/u/system)\
**Post date:** [September 22, 2021, 1:14am UTC](https://forum.xod.io/t/esp32-eeprom-nvs-read-write/5390/4 "2021-09-22T01:14:15Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
