Skip to content

Commit

Permalink
feat(framework): upgrade to arduino core 3.0.5 / esp-idf v5.1.4+ via …
Browse files Browse the repository at this point in the history
…pioarduino
  • Loading branch information
tspopp committed Oct 13, 2024
1 parent 62b6f23 commit 900b71c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion AquaMQTT/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ lib_deps =
googletest

[env:arduino_nano_esp32]
platform = espressif32@6.8.1
platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.05/platform-espressif32.zip
board = arduino_nano_esp32
framework = arduino
test_framework = googletest
Expand Down
2 changes: 2 additions & 0 deletions AquaMQTT/src/handler/OTA.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "handler/OTA.h"

#include <ArduinoOTA.h>
#include <esp_task_wdt.h>

#include "config/Configuration.h"

Expand Down Expand Up @@ -36,6 +37,7 @@ void OTAHandler::setup() // NOLINT(*-convert-member-functions-to-static)
.onEnd([]() { Serial.println("\nEnd"); })
.onProgress([](unsigned int progress, unsigned int total) {
Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
esp_task_wdt_reset();
})
.onError([](ota_error_t error) {
Serial.printf("Error[%u]: ", error);
Expand Down
7 changes: 6 additions & 1 deletion AquaMQTT/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ OTAHandler otaHandler;
RTCHandler rtcHandler;
WifiHandler wifiHandler;

esp_task_wdt_config_t twdt_config = {
.timeout_ms = WATCHDOG_TIMEOUT_S * 1000,
.idle_core_mask = (1 << configNUM_CORES) - 1,
.trigger_panic = true,
};

void loop()
{
Expand All @@ -44,7 +49,7 @@ void setup()
Serial.println("REBOOT");

// initialize watchdog
esp_task_wdt_init(WATCHDOG_TIMEOUT_S, true);
esp_task_wdt_init(&twdt_config);
esp_task_wdt_add(nullptr);

// setup wifi
Expand Down

0 comments on commit 900b71c

Please sign in to comment.