Page 1 of 1

save string read from serial com into eeprom

Posted: Tue Feb 09, 2021 3:32 pm
by sebasdt
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.

Re: save string read from serial com into eeprom

Posted: Wed Feb 10, 2021 12:32 am
by Scott.Bonomi
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.