From 3104324a3077d362ea5d08d145e5f16cf4b2494d Mon Sep 17 00:00:00 2001 From: Junior Date: Tue, 10 Nov 2026 12:01:55 -0500 Subject: [PATCH] Move WiFiClient definition outside the board detection loop --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index d22cb38..34ff252 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,12 +28,12 @@ unsigned long lastStatusTime = 0; void sendActionMessage(bool state) { if ( DEBUG ) Serial.println("Action button triggered"); String msgURL = actionURL + (state ? "true" : "false"); + WiFiClient client; HTTPClient http; if ( BOARD == "ESP32" ) { msgURL = "http://" + hostAddress + ":" + String(hostPort) + msgURL; http.begin(msgURL.c_str()); } else { - WiFiClient client; http.begin(client, hostAddress.c_str(), hostPort, msgURL.c_str()); } http.GET();