thingsboard / thingsboard-client-sdk

Client SDK to connect with ThingsBoard IoT Platform from IoT devices (Arduino, Espressif, etc.)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ESP32 OTA reset with TG1WDT_SYS_RESET

sirapol opened this issue · comments

Hello.
I using ESP32 Dev module.
Thingsboard client sdk version : 0.12.0 (lastest)
I try with example.
But, It reset like below code.
Something Progress around 80% then error same.

11:55:24.966 -> Connecting to AP ...
11:55:25.595 -> ......Connected to AP
11:55:28.078 -> Firmware=TEST
11:55:28.078 -> Version=1.0.0
11:55:28.574 -> Connecting to: (fluke-electronics.com) with token (oIm2qajxpUKCHGhGo5TD)
11:55:28.806 -> Connected
11:55:28.839 -> Firwmare Update...
11:55:31.420 -> [TB] Receive chunk (0), with size (4096) bytes
11:55:34.399 -> Progress 0.41%
11:55:34.995 -> [TB] Receive chunk (1), with size (4096) bytes
11:55:34.995 -> Progress 0.82%
11:55:35.590 -> [TB] Receive chunk (2), with size (4096) bytes
11:55:35.590 -> Progress 1.22%
11:55:36.186 -> [TB] Receive chunk (3), with size (4096) bytes
11:55:36.186 -> Progress 1.63%
11:55:36.782 -> [TB] Receive chunk (4), with size (4096) bytes
11:55:36.782 -> Progress 2.04%
11:55:37.378 -> [TB] Receive chunk (5), with size (4096) bytes
11:55:37.378 -> Progress 2.45%
11:55:37.973 -> [TB] Receive chunk (6), with size (4096) bytes
11:55:38.006 -> Progress 2.86%
11:55:38.569 -> [TB] Receive chunk (7), with size (4096) bytes
11:55:38.569 -> Progress 3.27%
11:55:39.165 -> [TB] Receive chunk (8), with size (4096) bytes
11:55:39.198 -> Progress 3.67%
11:55:39.761 -> [TB] Receive chunk (9), with size (4096) bytes
11:55:39.794 -> Progress 4.08%
11:55:40.389 -> [TB] Receive chunk (10), with size (4096) bytes
11:55:40.389 -> Progress 4.49%
11:55:40.952 -> [TB] Receive chunk (11), with size (4096) bytes
11:55:40.985 -> Progress 4.90%
11:55:41.581 -> [TB] Receive chunk (12), with size (4096) bytes
11:55:41.581 -> Progress 5.31%
11:55:42.176 -> [TB] Receive chunk (13), with size (4096) bytes
11:55:42.176 -> Progress 5.71%
11:55:42.772 -> [TB] Receive chunk (14), with size (4096) bytes
11:55:43.666 -> ets Jun 8 2016 00:22:57
11:55:43.699 ->
11:55:43.699 -> rst:0x8 (TG1WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
11:55:43.699 -> configsip: 0, SPIWP:0xee
11:55:43.699 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
11:55:43.699 -> mode:DIO, clock div:1
11:55:43.699 -> load:0x3fff0030,len:1344
11:55:43.699 -> load:0x40078000,len:13964
11:55:43.699 -> load:0x40080400,len:3600
11:55:43.699 -> entry 0x400805f0
11:55:45.055 -> Connecting to AP ...
11:55:45.684 -> ......Connected to AP
11:55:48.166 -> Firmware=TEST
11:55:48.166 -> Version=1.0.0
11:55:48.663 -> Connecting to: (fluke-electronics.com) with token (oIm2qajxpUKCHGhGo5TD)
11:55:49.126 -> Connected

The error that occurs is a TG1WDT_SYS_RESET. This is a Task Group 1 Watch dog Timer System Reset.

Basically it seems that the OTA process requires to much CPU overhead and you already have a lot of other tasks running.

There are multiple ways to resolve this issue either you can increase the Watchdog Timer Timeout, is more of a workaround than a real solution.

Or you can attempt to stop certain tasks while the OTA process is ongoing.

Can you tell me more about the amount of tasks running on your system and what the configuration of the OTA_Callback is. Especially interesting would be your loop() method if it doesn't already contain one a call to delay() with a value of 100 might fix that issue as well.

And to check that the aforementioned issue is actually the problem add this line for now esp_task_wdt_init() and see if it fixes the issue for now.

const esp_task_wdt_config_t config {
    .timeout_ms = 60 * 1000,
    .trigger_panic = true
};
esp_task_wdt_init(config);

@imbeacon Would be nice if this issue could be closed, because it seems to be stale.

@imbeacon Would be nice if this could be closed as stale. No response received for over 3 months.