diff --git a/src/LoRa_APRS_iGate.cpp b/src/LoRa_APRS_iGate.cpp index da05b99..4654d46 100644 --- a/src/LoRa_APRS_iGate.cpp +++ b/src/LoRa_APRS_iGate.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include "TaskAprsIs.h" #include "TaskBeacon.h" @@ -48,6 +49,8 @@ RouterTask routerTask(fromModem, toModem, toAprsIs, toMQTT); BeaconTask beaconTask(toModem, toAprsIs); void setup() { + esp_task_wdt_init(10, true); + esp_task_wdt_add(NULL); Serial.begin(115200); LoRaSystem.getLogger().setSerial(&Serial); setWiFiLogger(&LoRaSystem.getLogger()); @@ -137,6 +140,7 @@ void setup() { } } + esp_task_wdt_reset(); LoRaSystem.getTaskManager().setup(LoRaSystem); LoRaSystem.getDisplay().showSpashScreen("LoRa APRS iGate", VERSION); @@ -166,6 +170,7 @@ void setup() { volatile bool syslogSet = false; void loop() { + esp_task_wdt_reset(); LoRaSystem.getTaskManager().loop(LoRaSystem); if (LoRaSystem.isWifiOrEthConnected() && LoRaSystem.getUserConfig()->syslog.active && !syslogSet) { LoRaSystem.getLogger().setSyslogServer(LoRaSystem.getUserConfig()->syslog.server, LoRaSystem.getUserConfig()->syslog.port, LoRaSystem.getUserConfig()->callsign); diff --git a/src/TaskOTA.cpp b/src/TaskOTA.cpp index 08f90fa..7f2d2cd 100644 --- a/src/TaskOTA.cpp +++ b/src/TaskOTA.cpp @@ -1,4 +1,5 @@ #include +#include #include "Task.h" #include "TaskOTA.h" @@ -37,6 +38,9 @@ bool OTATask::setup(System &system) { error_str = "End Failed"; } system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_ERROR, getName(), "Error[%d]: %s", error, error_str.c_str()); + }) + .onProgress([&](unsigned int received, unsigned int total_size){ + esp_task_wdt_reset(); }); if (system.getUserConfig()->network.hostname.overwrite) { _ota.setHostname(system.getUserConfig()->network.hostname.name.c_str());