Re: ESP8266 with easy webconfig
Posted: Sun Jul 26, 2015 5:42 am
OK had a quick trawl and apart from the "application" code added by Ridge, the following seems to be the extent of the changes to the original code (as at 26/7/15). For the time, being, I think we will have to manually apply the following fixes for now (and maybe others I've missed?)
Irrigation_3 compared to ESP_WebConfig_Master
Original (Proteus74)
server.on ( "/admin.html", []() { Serial.println("admin.html"); server.send ( 200, "text/html", PAGE_AdminMainPage ); } );
server.on ( "/config.html", send_network_configuration_html );
server.on ( "/info.html", []() { Serial.println("info.html"); server.send ( 200, "text/html", PAGE_Information ); } );
server.on ( "/ntp.html", send_NTP_configuration_html );
server.on ( "/general.html", send_general_html );
// server.on ( "/example.html", []() { server.send ( 200, "text/html", PAGE_EXAMPLE ); } );
server.on ( "/style.css", []() { Serial.println("style.css"); server.send ( 200, "text/plain", PAGE_Style_css ); } );
server.on ( "/microajax.js", []() { Serial.println("microajax.js"); server.send ( 200, "text/plain", PAGE_microajax_js ); } );
Changed To (Ridge)
server.on ( "/admin.html", []() { Serial.println("admin.html"); server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(PAGE_AdminMainPage )); } );
server.on ( "/config.html", send_network_configuration_html );
server.on ( "/info.html", []() { Serial.println("info.html"); server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(PAGE_Information )); } );
server.on ( "/ntp.html", send_NTP_configuration_html );
server.on ( "/general.html", send_general_html );
// server.on ( "/example.html", []() { server.send ( 200, "text/html", PAGE_EXAMPLE ); } );
server.on ( "/style.css", []() { Serial.println("style.css"); server.send ( 200, "text/plain", reinterpret_cast<const __FlashStringHelper *>(PAGE_Style_css )); } );
server.on ( "/microajax.js", []() { Serial.println("microajax.js"); server.send ( 200, "text/plain", reinterpret_cast<const __FlashStringHelper *>(PAGE_microajax_js )); } );
PAGE_NetworkConfiguration.h
Original (Proteus74)
server.send ( 200, "text/html", PAGE_WaitAndReload );
Changed To (Ridge)
server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(PAGE_WaitAndReload ));
Page_Root.H
Original (Proteus74)
server.send ( 200, "text/html", PAGE_Root );
Changed To (Ridge)
server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(PAGE_Root) );
example.h
Original (Proteus74)
server.send ( 200, "text/html", PAGE_example );
Changed To (Ridge)
server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(PAGE_example));
Irrigation_3 compared to ESP_WebConfig_Master
Original (Proteus74)
server.on ( "/admin.html", []() { Serial.println("admin.html"); server.send ( 200, "text/html", PAGE_AdminMainPage ); } );
server.on ( "/config.html", send_network_configuration_html );
server.on ( "/info.html", []() { Serial.println("info.html"); server.send ( 200, "text/html", PAGE_Information ); } );
server.on ( "/ntp.html", send_NTP_configuration_html );
server.on ( "/general.html", send_general_html );
// server.on ( "/example.html", []() { server.send ( 200, "text/html", PAGE_EXAMPLE ); } );
server.on ( "/style.css", []() { Serial.println("style.css"); server.send ( 200, "text/plain", PAGE_Style_css ); } );
server.on ( "/microajax.js", []() { Serial.println("microajax.js"); server.send ( 200, "text/plain", PAGE_microajax_js ); } );
Changed To (Ridge)
server.on ( "/admin.html", []() { Serial.println("admin.html"); server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(PAGE_AdminMainPage )); } );
server.on ( "/config.html", send_network_configuration_html );
server.on ( "/info.html", []() { Serial.println("info.html"); server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(PAGE_Information )); } );
server.on ( "/ntp.html", send_NTP_configuration_html );
server.on ( "/general.html", send_general_html );
// server.on ( "/example.html", []() { server.send ( 200, "text/html", PAGE_EXAMPLE ); } );
server.on ( "/style.css", []() { Serial.println("style.css"); server.send ( 200, "text/plain", reinterpret_cast<const __FlashStringHelper *>(PAGE_Style_css )); } );
server.on ( "/microajax.js", []() { Serial.println("microajax.js"); server.send ( 200, "text/plain", reinterpret_cast<const __FlashStringHelper *>(PAGE_microajax_js )); } );
PAGE_NetworkConfiguration.h
Original (Proteus74)
server.send ( 200, "text/html", PAGE_WaitAndReload );
Changed To (Ridge)
server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(PAGE_WaitAndReload ));
Page_Root.H
Original (Proteus74)
server.send ( 200, "text/html", PAGE_Root );
Changed To (Ridge)
server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(PAGE_Root) );
example.h
Original (Proteus74)
server.send ( 200, "text/html", PAGE_example );
Changed To (Ridge)
server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(PAGE_example));