From b3dcebf1b3730fe83d1764ce4d4242a35071a10e Mon Sep 17 00:00:00 2001 From: DanielLester83 <56115710+DanielLester83@users.noreply.github.com> Date: Thu, 9 Jan 2020 14:58:07 -0600 Subject: [PATCH] Update CaptivePortal.ino 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 ceab0da984f..717d3c39c6b 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");