Skip to content

Commit f30edd0

Browse files
authored
Update CaptivePortal.ino (#4080)
* Update CaptivePortal.ino Illegal SSID used for SoftAP * Fixed ordering problem. Now actually works
1 parent b7c5e50 commit f30edd0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Diff for: libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <DNSServer.h>
33

44
const byte DNS_PORT = 53;
5-
IPAddress apIP(192, 168, 1, 1);
5+
IPAddress apIP(8,8,4,4); // The default android DNS
66
DNSServer dnsServer;
77
WiFiServer server(80);
88

@@ -12,11 +12,9 @@ String responseHTML = ""
1212
"be redirected here.</p></body></html>";
1313

1414
void setup() {
15-
WiFi.disconnect(); //added to start with the wifi off, avoid crashing
16-
WiFi.mode(WIFI_OFF); //added to start with the wifi off, avoid crashing
1715
WiFi.mode(WIFI_AP);
16+
WiFi.softAP("ESP32-DNSServer");
1817
WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
19-
WiFi.softAP("DNSServer CaptivePortal example");
2018

2119
// if DNSServer is started with "*" for domain name, it will reply with
2220
// provided IP to all DNS request

0 commit comments

Comments
 (0)