From 3872bd7a086d49e0666e41028522eaad453aeb6e Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 13 Jul 2023 15:41:58 +0200 Subject: [PATCH] Force re-connect when losing WiFi Apparently the ESP32 does not auto re-connect to WiFi, so enforce it. --- src/mining.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mining.cpp b/src/mining.cpp index 5fe645f..656eea1 100644 --- a/src/mining.cpp +++ b/src/mining.cpp @@ -116,7 +116,9 @@ void runStratumWorker(void *name) { while(true) { if(WiFi.status() != WL_CONNECTED){ - vTaskDelay(1000 / portTICK_PERIOD_MS); + // WiFi is disconnected, so reconnect now + WiFi.reconnect(); + vTaskDelay(5000 / portTICK_PERIOD_MS); continue; }