diff --git a/platformio/stima_v3/stimawifi/src/stimawifi.ino b/platformio/stima_v3/stimawifi/src/stimawifi.ino index 01e9edc24..3ad3f7839 100644 --- a/platformio/stima_v3/stimawifi/src/stimawifi.ino +++ b/platformio/stima_v3/stimawifi/src/stimawifi.ino @@ -28,7 +28,7 @@ https://doc.rmap.cc/stima_wifi/stimawifi_v3/stima_wifi_howto.html#software */ #include "stimawifi.h" - +#include "web_resources.h" void print_reset_reason() { @@ -333,110 +333,78 @@ String Geo(){ return "KO"; } -// function to prepare HTML response -//https://lastminuteengineers.com/esp8266-dht11-dht22-web-server-tutorial/ - -String Data(){ - String str ="

StimaWifi Report

\n" - "
\n" - "
\n" - "\n" - "\n" - "\n" - "
\n" - "
Temperature
\n" - "
"; - str +=summarydata.temperature; - str +="°C
\n" - "
\n" - "
\n" - "
\n" - "\n" - "\n" - "\n" - "
\n" - "
Humidity
\n" - "
"; - str +=summarydata.humidity; - str +="%
\n" - "
\n" - - "
\n" - "
PM2.5
\n" - "
"; - str +=summarydata.pm2; - str +="ug/m3
\n" - "
\n" - - "
\n" - "
PM10
\n" - "
"; - str +=summarydata.pm10; - str +="ug/m3
\n" - "
\n" - - "
\n" - "
CO2
\n" - "
"; - str +=summarydata.co2; - str +="ppm
\n" - "
\n"; - - return str; -} // function to prepare HTML response main page // https://lastminuteengineers.com/esp8266-dht11-dht22-web-server-tutorial/ -String FullPage(){ - String ptr = " \n" - "\n" - "\n" - "StimaWiFI Report\n" - "\n" - "\n" - "\n" - "\n" - - "
\n"; - - ptr +=Data(); - - ptr +="
\n" - "\n" - "\n"; - return ptr; +String FullPage() { + return F("\n" +" \n" +" \n" +" StimaWiFI Report\n" +" \n" +" \n" +"\n" +"\n" +"

StimaWifi Report

\n" +"
\n" +"

Not Connected

\n" +"
--
\n" +"
--
\n" +"
--
\n" +"
--
\n" +"
--
\n" +"
\n"); } @@ -445,11 +413,6 @@ void handle_FullPage() { webserver.send(200, "text/html", FullPage()); } -// web server response callback function -void handle_Data() { - webserver.send(200, "text/html", Data()); -} - // web server response callback function void handle_Json() { webserver.sendHeader("Access-Control-Allow-Origin", "*", true); @@ -1615,7 +1578,6 @@ void setup() { // setup web server webserver.enableDelay(false); webserver.on("/", handle_FullPage); - webserver.on("/data", handle_Data); webserver.on("/data.json", handle_Json); webserver.on("/geo", handle_Geo); webserver.on("/archive.dat", handle_Archive);