Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for details.

#include <Arduino.h>
#include <ArduinoOTA.h>
#include <AsyncJson.h>
#include <ESPAsyncWebServer.h>
#include <LittleFS.h>
Expand Down Expand Up @@ -476,6 +477,11 @@ void setup() {
// Initialize Watchdog Timer with 5 second timeout
esp_task_wdt_init(5, true);
esp_task_wdt_add(NULL); // Add current thread (loopTask) to WDT

// Disable WDT during OTA
ArduinoOTA.onStart([]() { esp_task_wdt_delete(NULL); });
ArduinoOTA.onEnd([]() { esp_task_wdt_add(NULL); });
ArduinoOTA.onError([](ota_error_t error) { esp_task_wdt_add(NULL); });
}

// This is called repeaedly when code is running.
Expand Down