From 822096b6357fa8200eab114b8a6b652b446c4b1e Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Mon, 17 Aug 2026 11:36:18 +0200 Subject: [PATCH] detect network disconnect faster --- src/core/network.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/network.cpp b/src/core/network.cpp index ebeacb6d5..cf3d9fd5a 100644 --- a/src/core/network.cpp +++ b/src/core/network.cpp @@ -268,6 +268,10 @@ void Network::loop() { reconnect_pending_ = false; 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 const unsigned long currentMillis = uuid::get_uptime_ms(); @@ -281,11 +285,6 @@ void Network::loop() { startWIFI(); // WiFi 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 }