Skip to content

Commit

Permalink
Merge branch 'pr2117' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tbnobody committed Jul 5, 2024
2 parents d09be3a + 1eab3ae commit 4fd0cab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/NetworkSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ void NetworkSettingsClass::init(Scheduler& scheduler)
WiFi.setScanMethod(WIFI_ALL_CHANNEL_SCAN);
WiFi.setSortMethod(WIFI_CONNECT_AP_BY_SIGNAL);

WiFi.disconnect(true, true);

WiFi.onEvent(std::bind(&NetworkSettingsClass::NetworkEvent, this, _1));
setupMode();

Expand Down Expand Up @@ -77,6 +79,7 @@ void NetworkSettingsClass::NetworkEvent(const WiFiEvent_t event)
MessageOutput.println("WiFi disconnected");
if (_networkMode == network_mode::WiFi) {
MessageOutput.println("Try reconnecting");
WiFi.disconnect(true, true);
WiFi.reconnect();
raiseEvent(network_event::NETWORK_DISCONNECTED);
}
Expand Down

0 comments on commit 4fd0cab

Please sign in to comment.