detect network disconnect faster

This commit is contained in:
MichaelDvP
2026-08-17 11:36:18 +02:00
parent 0defebfdb6
commit 822096b635
+4 -5
View File
@@ -268,6 +268,10 @@ void Network::loop() {
reconnect_pending_ = false; reconnect_pending_ = false;
reconnect(); reconnect();
} }
// already have a connection: verify it's still alive
if (network_ip_ != 0 || last_disconnect_reason_ != 0) {
checkConnection();
}
// if we already have a Wifi or Ethernet connection then re-check every NETWORK_RECONNECTION_DELAY_LONG, otherwise NETWORK_RECONNECTION_DELAY_SHORT // if we already have a Wifi or Ethernet connection then re-check every NETWORK_RECONNECTION_DELAY_LONG, otherwise NETWORK_RECONNECTION_DELAY_SHORT
const unsigned long currentMillis = uuid::get_uptime_ms(); const unsigned long currentMillis = uuid::get_uptime_ms();
@@ -281,11 +285,6 @@ void Network::loop() {
startWIFI(); // WiFi startWIFI(); // WiFi
startAP(); // Captive Portal (AP) startAP(); // Captive Portal (AP)
// already have a connection: verify it's still alive
if (network_ip_ != 0 || last_disconnect_reason_ != 0) {
checkConnection();
}
findNetworks(); // detect any new network connections findNetworks(); // detect any new network connections
} }