From f30edd040eccb367104f8e646749e8d54588391a Mon Sep 17 00:00:00 2001 From: lbernstone Date: Wed, 30 Sep 2020 06:26:15 -0600 Subject: [PATCH] Update CaptivePortal.ino (#4080) * Update CaptivePortal.ino Illegal SSID used for SoftAP * 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 717d3c39..9221af1e 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.softAP("ESP32-DNSServer"); WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0)); - WiFi.softAP("DNSServer CaptivePortal example"); // if DNSServer is started with "*" for domain name, it will reply with // provided IP to all DNS request