IotWebConf icon indicating copy to clipboard operation
IotWebConf copied to clipboard

Add method to get the last EEPROM index

Open jlgoasis opened this issue 5 years ago • 2 comments

In my things applications I need to save(write) and load(read) some parameters from Schedule/Alarms to the internal ESP EEPROM. Therefore I need to know the latest EEPROM index used in your library.

Add a method to obtain it will be welcome

jlgoasis avatar Feb 04 '20 17:02 jlgoasis

Instead of getting the last EEPROM address you could just provide an offset for the first parameter saved by IOTWEBCONF Open IotWebConf.h and look for this:

#ifndef IOTWEBCONF_CONFIG_START
# define IOTWEBCONF_CONFIG_START 0
#endif

The problem is how to properly define this value from your .ino file. :/

jsolla avatar May 24 '20 18:05 jsolla

Instead of getting the last EEPROM address you could just provide an offset for the first parameter saved by IOTWEBCONF Open IotWebConf.h and look for this:

#ifndef IOTWEBCONF_CONFIG_START
# define IOTWEBCONF_CONFIG_START 0
#endif

The problem is how to properly define this value from your .ino file. :/

This can easily be achieved at least under PlatformIO by adding

build_flags = -DIOTWEBCONF_CONFIG_START="YOUROFFSET"

to platformio.init. See the HackingGuide.md in the doc subdirectory

kscholty avatar Apr 30 '21 15:04 kscholty