From ce8427b0aad8c470debd9748a08a9688cfde97e3 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 28 Sep 2024 16:35:50 +0200 Subject: [PATCH] Handle fails more properly --- esp32_device/main/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esp32_device/main/main.c b/esp32_device/main/main.c index 4ca3965..d1f89d4 100755 --- a/esp32_device/main/main.c +++ b/esp32_device/main/main.c @@ -176,7 +176,7 @@ void app_main(void) if (!res) { fails += 1; - ESP_LOGE(TAG, "Failed to synchronise device!"); + ESP_LOGE(TAG, "Failed to synchronise device! (number=%d)", fails); // Safely turn off all relays after a given number of failures if (fails > 5) @@ -197,6 +197,8 @@ void app_main(void) continue; } + fails = 0; + // TODO : apply sync sync_response_print(res);