on demand example fixed

This commit is contained in:
Alex Tudorache
2016-01-09 18:28:23 +02:00
parent b05dff34b7
commit 90bac5d580
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -137,7 +137,7 @@ boolean WiFiManager::startConfigPortal(char const *apName, char const *apPasswo
connect = false;
setupConfigPortal(apName, apPassword);
DEBUG_WM("start loop");
while (timeout == 0 || millis() < start + timeout) {
//DNS
dnsServer->processNextRequest();
@@ -169,7 +169,7 @@ boolean WiFiManager::startConfigPortal(char const *apName, char const *apPasswo
server.reset();
dnsServer.reset();
DEBUG_WM("end loop");
return WiFi.status() == WL_CONNECTED;
}
@@ -22,7 +22,7 @@ void setup() {
int pinState = digitalRead(4);
//if gpio 4 is high startup config mode
if (pinState == LOW) {
if (pinState == HIGH) {
//WiFiManager
//Local intialization. Once its business is done, there is no need to keep it around
WiFiManager wifiManager;
@@ -42,8 +42,8 @@ void setup() {
//here "AutoConnectAP"
//and goes into a blocking loop awaiting configuration
//WITHOUT THIS THE AP DOES NOT SEEM TO WORK PROPERLY
WiFi.mode(WIFI_STA);
//WITHOUT THIS THE AP DOES NOT SEEM TO WORK PROPERLY WITH SDK 1.5 , update to at least 1.5.1
//WiFi.mode(WIFI_STA);
if (!wifiManager.startConfigPortal("OnDemandAP")) {
Serial.println("failed to connect and hit timeout");