Skip to content

Commit dd78794

Browse files
DanielLester83me-no-dev
authored andcommitted
Update CaptivePortal.ino (#3628)
Small change to insure wifi starts off and avoid crashing
1 parent 0607d36 commit dd78794

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ String responseHTML = ""
1111
"<h1>Hello World!</h1><p>This is a captive portal example. All requests will "
1212
"be redirected here.</p></body></html>";
1313

14-
void setup() {
14+
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
1517
WiFi.mode(WIFI_AP);
1618
WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
1719
WiFi.softAP("DNSServer CaptivePortal example");

0 commit comments

Comments
 (0)