I've been researching and can't find an answer to this question that I understand: How can I write and read a struct (or other) to EEPROM with Arduino ESP8266?
I'm hoping there might be a library for this that is relatively easy to use. In my case, I have so many variables I need to store that I'm attempting to simplify the EEPROM read/write code by somehow grouping all the data into a single variable. I know Python, PHP, JavaScript et al but I don't really know C. Despite this I've been able to complete nearly everything except this problem of persisting data through a power outage.
I've seen so many examples, I can't get any of them to work. Did I even do it correctly? Here is my current "default" struct:
typedef struct {
char* APMode = "0"; // OPMode = 0, APMode = 1
char* id = "00000000"; // Device ID
char* businessName = "Joey Salads"; // Business Name
char* businessPhone = "(123) 123-4567"; // Support Phone Number
char* network = "12345678901234567890"; // OPMode SSID to connect to
char* password ="12345678901234567890"; // OPMode SSID Password
char* apSSID ="12345678901234567890"; // APMode SSID
char* APpass ="12345678901234567890"; // APMode SSID Password
char* frequency ="12000"; // How often to send data in ms
char* alarmThresh ="123"; // Alarm Threshold
char* serverProtocol ="http://"; // Server Protocol, HTTP or HTTPS
char* serverURL ="example.com/"; // Server URL
char* serverURI ="api/alarmMonitor.php"; // URL of data reporting
char* serverPort ="65535"; // Server Port: HTTP = 80, HTTPS = 443
} ltd attribute ((packed));
When the ESP8266 boots up I want to read this data out into a variable, be able to change this data during run time and at some points save or update the EEPROM with this data, which will be read back out into a variable upon next boot, etc.
I am open to using any data type that would support my desired result, json, etc.