Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 7 additions & 19 deletions src/ESPAsync_WiFiManager-Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,18 +412,9 @@ void ESPAsync_WiFiManager::setupConfigPortal()
else
channel = _WiFiAPChannel;

if (_apPassword != NULL)
{
LOGWARN1(F("AP Channel ="), channel);
LOGWARN1(F("AP Channel ="), channel);

//WiFi.softAP(_apName, _apPassword);//password option
WiFi.softAP(_apName, _apPassword, channel);
}
else
{
// Can't use channel here
WiFi.softAP(_apName);
}
WiFi.softAP(_apName, _apPassword, channel);

delay(500); // Without delay I've seen the IP address blank

Expand Down Expand Up @@ -872,6 +863,9 @@ bool ESPAsync_WiFiManager::startConfigPortal(char const *apName, char const *apP
}
#endif // ( USING_ESP32_S2 || USING_ESP32_C3 )

// yield before processing our flags "connect" and/or "stopConfigPortal"
yield();

if (connect)
{
TimedOut = false;
Expand Down Expand Up @@ -914,14 +908,14 @@ bool ESPAsync_WiFiManager::startConfigPortal(char const *apName, char const *apP

if (stopConfigPortal)
{
TimedOut = false;

LOGERROR("Stop ConfigPortal");

stopConfigPortal = false;
break;
}

yield();

#if ( defined(TIME_BETWEEN_CONFIG_PORTAL_LOOP) && (TIME_BETWEEN_CONFIG_PORTAL_LOOP > 0) )
#if (_ESPASYNC_WIFIMGR_LOGLEVEL_ > 3)
#warning Using delay in startConfigPortal loop
Expand Down Expand Up @@ -1832,9 +1826,6 @@ void ESPAsync_WiFiManager::handleWifiSave(AsyncWebServerRequest *request)
LOGDEBUG(F("Sent wifi save page"));

connect = true; //signal ready to connect/reset

// Restore when Press Save WiFi
_configPortalTimeout = DEFAULT_PORTAL_TIMEOUT;
}

//////////////////////////////////////////
Expand Down Expand Up @@ -1888,9 +1879,6 @@ void ESPAsync_WiFiManager::handleServerClose(AsyncWebServerRequest *request)
stopConfigPortal = true; //signal ready to shutdown config portal

LOGDEBUG(F("Sent server close page"));

// Restore when Press Save WiFi
_configPortalTimeout = DEFAULT_PORTAL_TIMEOUT;
}

//////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions src/ESPAsync_WiFiManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,12 @@ typedef struct
////////////////////////////////////////////////////

#ifndef TIME_BETWEEN_MODAL_SCANS
// Default to 30s
// Default to 120s
#define TIME_BETWEEN_MODAL_SCANS 120000UL
#endif

#ifndef TIME_BETWEEN_MODELESS_SCANS
// Default to 60s
// Default to 120s
#define TIME_BETWEEN_MODELESS_SCANS 120000UL
#endif

Expand Down