From 6f3a7628a32da25ee78fe1b137d397cf021bd81f Mon Sep 17 00:00:00 2001 From: M Hightower <27247790+mhightower83@users.noreply.github.com> Date: Sat, 18 Apr 2020 14:41:25 -0700 Subject: [PATCH] For example CaptivePortal, update HTML to pass HTML checker. Added meta viewport element for better mobile device viewing. For example CaptivePortalAdvanced, increased size of ssid and password array to hold maximums 32 and 64 charcter strings. Added missing HTML elments to main splash and wifi config. They should now pass an HTML checker. Also added meta viewport element for better mobile device viewing. --- .../DNSServer/examples/CaptivePortal/CaptivePortal.ino | 8 +++++--- .../CaptivePortalAdvanced/CaptivePortalAdvanced.ino | 5 ++--- .../examples/CaptivePortalAdvanced/handleHttp.ino | 9 ++++++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino b/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino index 53b159502b..b59cda2d92 100644 --- a/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino +++ b/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino @@ -8,9 +8,11 @@ DNSServer dnsServer; ESP8266WebServer webServer(80); String responseHTML = "" - "
This is a captive portal example. All requests will " - "be redirected here.
"; + "" + "" + "This is a captive portal example." + " All requests will be redirected here.
"; void setup() { WiFi.mode(WIFI_AP); diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino index 0f2553fbc2..e97dfbc0a4 100644 --- a/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino +++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino @@ -30,8 +30,8 @@ const char *softAP_password = APPSK; const char *myHostname = "esp8266"; /* Don't set this wifi credentials. They are configurated at runtime and stored on EEPROM */ -char ssid[32] = ""; -char password[32] = ""; +char ssid[33] = ""; +char password[65] = ""; // DNS server const byte DNS_PORT = 53; @@ -140,4 +140,3 @@ void loop() { //HTTP server.handleClient(); } - diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino index 1baac437d1..dc286c1840 100644 --- a/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino +++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino @@ -9,7 +9,9 @@ void handleRoot() { String Page; Page += F( - "" + "" + "" + "You are connected through the soft AP: ")) + softAP_ssid + F("
"); @@ -43,7 +45,9 @@ void handleWifi() { String Page; Page += F( - "" + "" + "" + "You are connected through the soft AP: ")) + softAP_ssid + F("
"); @@ -130,4 +134,3 @@ void handleNotFound() { server.sendHeader("Expires", "-1"); server.send(404, "text/plain", message); } -