From 10940de51638d804c475f5706d911635d2592ed4 Mon Sep 17 00:00:00 2001 From: lbernstone Date: Wed, 10 Jun 2020 13:32:38 -0600 Subject: [PATCH 1/2] Update CaptivePortal.ino Illegal SSID used for SoftAP --- libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino b/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino index 717d3c39c6b..83364d057fe 100644 --- a/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino +++ b/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino @@ -16,7 +16,7 @@ void setup() { WiFi.mode(WIFI_OFF); //added to start with the wifi off, avoid crashing WiFi.mode(WIFI_AP); WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0)); - WiFi.softAP("DNSServer CaptivePortal example"); + WiFi.softAP("ESP32-DNSServer"); // if DNSServer is started with "*" for domain name, it will reply with // provided IP to all DNS request From 022270af9f81654b79ff4f9f01ff24e544b6cb6a Mon Sep 17 00:00:00 2001 From: Larry Bernstone Date: Wed, 10 Jun 2020 14:36:34 -0600 Subject: [PATCH 2/2] Fixed ordering problem. Now actually works --- .../DNSServer/examples/CaptivePortal/CaptivePortal.ino | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino b/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino index 83364d057fe..9221af1eaa2 100644 --- a/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino +++ b/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino @@ -2,7 +2,7 @@ #include const byte DNS_PORT = 53; -IPAddress apIP(192, 168, 1, 1); +IPAddress apIP(8,8,4,4); // The default android DNS DNSServer dnsServer; WiFiServer server(80); @@ -12,11 +12,9 @@ String responseHTML = "" "be redirected here.

"; void setup() { - WiFi.disconnect(); //added to start with the wifi off, avoid crashing - WiFi.mode(WIFI_OFF); //added to start with the wifi off, avoid crashing WiFi.mode(WIFI_AP); - WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0)); WiFi.softAP("ESP32-DNSServer"); + WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0)); // if DNSServer is started with "*" for domain name, it will reply with // provided IP to all DNS request