From dd7879431104ed120d77f283940f94e4169eb548 Mon Sep 17 00:00:00 2001 From: DanielLester83 <56115710+DanielLester83@users.noreply.github.com> Date: Mon, 20 Jan 2020 08:04:21 -0600 Subject: [PATCH] Update CaptivePortal.ino (#3628) Small change to insure wifi starts off and avoid crashing --- libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino b/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino index ceab0da9..717d3c39 100644 --- a/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino +++ b/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino @@ -11,7 +11,9 @@ String responseHTML = "" "

Hello World!

This is a captive portal example. All requests will " "be redirected here.

"; -void setup() { +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("DNSServer CaptivePortal example");