save string read from serial com into eeprom

sebasdt
Posts: 17
Joined: Fri Jul 24, 2020 8:18 am

save string read from serial com into eeprom

Postby sebasdt » Tue Feb 09, 2021 3:32 pm

hi espressif forum,

for a project of mine with an esp32, I would like to read a string (in mine case a mac address) from serial monitor and copy that into EEPROM.
once the esp32 reboots or starts up looks for this mac address in EEPROM and stores it in a var. so the esp32 could later send to that mac address.

I'm new to reading from serial and storing it for later retrieval.
where is a great place to start?
i already have experience with espnow so that isn't an issue.

Scott.Bonomi
Posts: 73
Joined: Mon Mar 09, 2020 7:36 pm

Re: save string read from serial com into eeprom

Postby Scott.Bonomi » Wed Feb 10, 2021 12:32 am

For my system, I started by including most of the nvs_rw_value example for initialization, and added functions to handle strings of variable sizes.
I believe you can also store MAC address in the E-fuze block if you want to, but if you expect it to be modified often then NVS may be appropriate.

Who is online

Users browsing this forum: No registered users and 93 guests