mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
on demand example fixed
This commit is contained in:
+2
-2
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user