From 13132edd9efa51f5d4b6f26d8e9c78704efdaecb Mon Sep 17 00:00:00 2001 From: tablatronix Date: Wed, 22 Jan 2020 09:02:02 -0600 Subject: [PATCH] Easier debugging autoconnect --- .../DEV/OnDemandConfigPortal/OnDemandConfigPortal.ino | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/DEV/OnDemandConfigPortal/OnDemandConfigPortal.ino b/examples/DEV/OnDemandConfigPortal/OnDemandConfigPortal.ino index 72f23eb..b08bb6b 100644 --- a/examples/DEV/OnDemandConfigPortal/OnDemandConfigPortal.ino +++ b/examples/DEV/OnDemandConfigPortal/OnDemandConfigPortal.ino @@ -70,8 +70,9 @@ void print_oled(String str,uint8_t size){ WiFiManager wm; // OPTION FLAGS -bool TEST_CP = true; // always start the configportal, even if ap found +bool TEST_CP = false; // always start the configportal, even if ap found bool TEST_NET = true; // do a network test after connect, (gets ntp time) +bool AUTOSTARTCP = false; // automatically start config portal is no wifi found // char ssid[] = "*************"; // your network SSID (name) // char pass[] = "********"; // your network password @@ -199,7 +200,7 @@ void setup() { // wm.setShowPassword(true); // set configrportal timeout - wm.setConfigPortalTimeout(120); + wm.setConfigPortalTimeout(40); // wm.startConfigPortal("AutoConnectAP", "password"); // wm.setBreakAfterConfig(true); @@ -210,7 +211,7 @@ void setup() { //and goes into a blocking loop awaiting configuration print_oled(F("Connecting..."),2); - if(!wm.autoConnect("WM_AutoConnectAP")) { + if(!AUTOSTARTCP || !wm.autoConnect("WM_AutoConnectAP")) { Serial.println("failed to connect and hit timeout"); print_oled("Not Connected",2); } @@ -235,6 +236,8 @@ void setup() { void loop() { + Serial.println((String)analogRead(A0)); + #ifdef USEOTA ArduinoOTA.handle(); #endif