Skip to content

Commit

Permalink
Fix: enable searching all aps and sorting by rssi prior using wlan st…
Browse files Browse the repository at this point in the history
…ation mode (tbnobody#618)
  • Loading branch information
jstammi committed Jul 17, 2023
1 parent d9ba88b commit c729cf8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/NetworkSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ void NetworkSettingsClass::raiseEvent(network_event event)
void NetworkSettingsClass::setupMode()
{
if (adminEnabled) {
WiFi.setScanMethod(WIFI_ALL_CHANNEL_SCAN);
WiFi.setSortMethod(WIFI_CONNECT_AP_BY_SIGNAL);
WiFi.mode(WIFI_AP_STA);
String ssidString = getApName();
WiFi.softAPConfig(apIp, apIp, apNetmask);
Expand Down Expand Up @@ -201,6 +203,8 @@ void NetworkSettingsClass::loop()
}
if (connectRedoTimer > WIFI_RECONNECT_REDO_TIMEOUT && forceDisconnection) {
MessageOutput.print("Enable search for AP... ");
WiFi.setScanMethod(WIFI_ALL_CHANNEL_SCAN);
WiFi.setSortMethod(WIFI_CONNECT_AP_BY_SIGNAL);
WiFi.mode(WIFI_AP_STA);
MessageOutput.println("done");
applyConfig();
Expand Down

0 comments on commit c729cf8

Please sign in to comment.