Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update HTML in CaptivePortal examples for better mobile device viewing ... #7227

Merged
merged 2 commits into from
Apr 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ DNSServer dnsServer;
ESP8266WebServer webServer(80);

String responseHTML = ""
"<!DOCTYPE html><html><head><title>CaptivePortal</title></head><body>"
"<h1>Hello World!</h1><p>This is a captive portal example. All requests will "
"be redirected here.</p></body></html>";
"<!DOCTYPE html><html lang='en'><head>"
"<meta name='viewport' content='width=device-width'>"
"<title>CaptivePortal</title></head><body>"
"<h1>Hello World!</h1><p>This is a captive portal example."
" All requests will be redirected here.</p></body></html>";

void setup() {
WiFi.mode(WIFI_AP);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -140,4 +140,3 @@ void loop() {
//HTTP
server.handleClient();
}

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ void handleRoot() {

String Page;
Page += F(
"<html><head></head><body>"
"<!DOCTYPE html><html lang='en'><head>"
"<meta name='viewport' content='width=device-width'>"
"<title>CaptivePortal</title></head><body>"
"<h1>HELLO WORLD!!</h1>");
if (server.client().localIP() == apIP) {
Page += String(F("<p>You are connected through the soft AP: ")) + softAP_ssid + F("</p>");
Expand Down Expand Up @@ -43,7 +45,9 @@ void handleWifi() {

String Page;
Page += F(
"<html><head></head><body>"
"<!DOCTYPE html><html lang='en'><head>"
"<meta name='viewport' content='width=device-width'>"
"<title>CaptivePortal</title></head><body>"
"<h1>Wifi config</h1>");
if (server.client().localIP() == apIP) {
Page += String(F("<p>You are connected through the soft AP: ")) + softAP_ssid + F("</p>");
Expand Down Expand Up @@ -130,4 +134,3 @@ void handleNotFound() {
server.sendHeader("Expires", "-1");
server.send(404, "text/plain", message);
}