The project involves the retrieval of option variable values saved in ESP32 flash
I have created an ESP32 Async Web Server https://github.com/me-no-dev/ESPAsyncWebServer
and I have successfully saved a couple of option variables in the flash inside a SPIFFS text file, using HTTP_GET and the input fields.
String processor(const String& var) {
if(var == "BROKER") {
Serial.print("broker");
Serial.println(broker);
return (broker);
}
...
}
...
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) {
if(!request->authenticate(http_username, http_password))
return request->requestAuthentication();
request->send(SPIFFS, "/index.html", "text/html", false, processor);
});
The HTML file includes field like this:
<input type="text" class="form-control" id="broker" name="broker" value = %BROKER%>
The next thing now is to recall these options from file, whenever the HTML page is loaded, and populate the fields with the values that are saved before.
How do I do this? Which HTML method do I use? How do I pass the values read from SPIFFS to the HTML ? Is there an simple example that may help me?