From f08eafc07fe78cc0be75a0ed42c017471864ec80 Mon Sep 17 00:00:00 2001 From: fvanroie Date: Fri, 18 Jul 2025 22:22:55 +0200 Subject: [PATCH] Fix reconnects happens to quickly #919 --- platformio.ini | 4 ++-- src/sys/net/hasp_wifi.cpp | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/platformio.ini b/platformio.ini index 256e7a3e..bc91975f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -74,8 +74,8 @@ build_flags = ; -- Hasp build options ---------------------------- -D HASP_VER_MAJ=0 -D HASP_VER_MIN=7 - ;-D HASP_VER_REV=4 - -D HASP_VER_REV=0-rc15 + -D HASP_VER_REV=0.1 + ;-D HASP_VER_REV=0-rc15 ;-D HASP_VER_REV=4-rc1 ${override.build_flags} diff --git a/src/sys/net/hasp_wifi.cpp b/src/sys/net/hasp_wifi.cpp index 631f635d..57dba594 100644 --- a/src/sys/net/hasp_wifi.cpp +++ b/src/sys/net/hasp_wifi.cpp @@ -509,7 +509,7 @@ void wifiSetup() WiFi.setScanMethod(WIFI_ALL_CHANNEL_SCAN); wifiReconnect(); - WiFi.setAutoReconnect(false); // done in wifiEvery5Seconds + WiFi.setAutoReconnect(true); // done in wifiEvery5Seconds LOG_TRACE(TAG_WIFI, F(D_WIFI_CONNECTING_TO), wifiSsid); } #endif @@ -532,10 +532,11 @@ bool wifiEvery5Seconds() return true; } - if(wifiEnabled) { - LOG_WARNING(TAG_WIFI, F("No Connection... retry %d"), network_reconnect_counter); - wifiReconnect(); - } + // Issue #919 : Reconnects happens to quickly + // if(wifiEnabled) { + // LOG_WARNING(TAG_WIFI, F("No Connection... retry %d"), network_reconnect_counter); + // wifiReconnect(); + // } return false; }