serverAsync.on("/Graphs", HTTP_GET, [](AsyncWebServerRequest * request) {
Serial.println("");
Serial.println("Graphs accessed");
accessLog();
AsyncWebServerResponse *response = request->beginResponse_P(200, "text/html", HTML3);
response->addHeader("Server","ESP Async Web Server");
request->send(response);
flag = 0;
});
Sends all four iframes; href does not get processed, since there is no processor3 referenced.
Adding processor3:
serverAsync.on("/Graphs", HTTP_GET, [](AsyncWebServerRequest * request) {
Serial.println("");
Serial.println("Graphs accessed");
accessLog();
AsyncWebServerResponse *response = request->beginResponse_P(200, "text/html", HTML3, processor3);
response->addHeader("Server","ESP Async Web Server");
request->send(response);
flag = 0;
});
Sends only one of the four iframes
HTML3:
//index2.h
const char HTML3[] PROGMEM = R"====(
<!DOCTYPE HTML>
<html>
<head>
<title>Graphs</title>
</head>
<body>
<br>
<h2>Graphed Weather Observations</h2>
<br>
<div>
<frameset rows="30%,70%" cols="33%,34%">
<iframe width="450" height="260" style="border: 1px solid #cccccc;" src="https://thingspeak.com/channels/290421/charts/1?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=60×cale=15&title=Temperature&type=line&xaxis=Date+and+Time&yaxis=Temperature++++%C2%B0++F."></iframe>
<iframe width="450" height="260" style="border: 1px solid #cccccc;" src="https://thingspeak.com/channels/290421/charts/2?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=60&title=Relative+Humidity&type=line&xaxis=Date+and+Time&yaxis=Relative+Humidity++%25"></iframe>
</frameset>
<br><br>
<frameset rows="30%,70%" cols="33%,34%">
<iframe width="450" height="260" style="border: 1px solid #cccccc;" src="https://thingspeak.com/channels/290421/charts/3?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=60&title=Barometric+Pressure&type=line&xaxis=Date+and+Time&yaxis=Pressure+++inHg"></iframe>
<iframe width="450" height="260" style="border: 1px solid #cccccc;" src="https://thingspeak.com/channels/290421/charts/4?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=60&title=Dew+Point&type=line&xaxis=Date+and+Time&yaxis=Dew+Point++++%C2%B0++F."></iframe>
</frameset>
</div>
<br><br>
<a href=http://%PUBLICIP%/Weather >Home</a>
<br>
</body>
</html>
)====";
Async Web Server documentation shows:
const char index_html[] PROGMEM = "..."; // large char array, tested with 14k
AsyncWebServerResponse *response = request->beginResponse_P(200, "text/html", index_html, processor);
response->addHeader("Server","ESP Async Web Server");
request->send(response);
Would this work to send all four iframes? How would this be applied?
William