Task watchdog got triggered after MQTT disconnect

RichPiano
Posts: 123
Joined: Mon May 18, 2020 2:51 pm

Task watchdog got triggered after MQTT disconnect

Postby RichPiano » Mon May 10, 2021 1:35 pm

My app connects to a broker via MQTT as soon as wifi is established. Sometimes it happens that that uplink breaks (it's a raspberry pi after all) and the connection is lost for several minutes. After more than 1 minute trying to reconnect in 10 sec intervals, the following error appears:

Code: Select all

I (429259330) MQTTs: Other event id:7
    E (429259330) TRANS_TCP: [sock=54] connect() error: Host is unreachable
    E (429259330) MQTT_CLIENT: Error transport connect
    I (429259340) MQTTs: MQTT_EVENT_ERROR
    I (429259340) MQTTs: Last error code reported from esp-tls: 0x0
    I (429259350) MQTTs: Last tls stack error number: 0x0
    I (429259350) MQTTs: Last captured errno : 0 (Success)
    I (429259360) MQTTs: MQTT_EVENT_DISCONNECTED
    E (429263360) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
    E (429263360) task_wdt:  - IDLE (CPU 0)
    E (429263360) task_wdt: Tasks currently running:
    E (429263360) task_wdt: CPU 0: wifi
    E (429263360) task_wdt: CPU 1: IDLE
    E (429263360) task_wdt: Print CPU 0 (current core) backtrace


    Backtrace:0x400FD4BB:0x3FFB0810 0x40082769:0x3FFB0830 0x4011EF0E:0x3FFC3E00 0x4010F457:0x3FFC3E20 0x40120113:0x3FFC3E80 0x4011EB10:0x3FFC3EA0 0x4011EC0D:0x3FFC3EC0 0x400912F9:0x3FFC3EE0 0x4008AFF1:0x3FFC3F10
    0x400fd4bb: task_wdt_isr at C:/dev/esp/esp-idf/components/esp_common/src/task_wdt.c:189

    0x40082769: _xt_lowint1 at C:/dev/esp/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:1105

    0x4011ef0e: chm_set_current_channel at ??:?

    0x4010f457: ieee80211_update_channel at ??:?

    0x40120113: cnx_csa_fn_process at ??:?

    0x4011eb10: esp_wifi_skip_supp_pmkcaching at ??:?

    0x4011ec0d: ieee80211_timer_do_process at ??:?

    0x400912f9: ppTask at ??:?

    0x4008aff1: vPortTaskWrapper at C:/dev/esp/esp-idf/components/freertos/port/xtensa/port.c:168


    E (429263360) task_wdt: Print CPU 1 backtrace


    Backtrace:0x4008481D:0x3FFB0E10 0x40082769:0x3FFB0E30 0x4000BFED:0x3FFBD640 0x4008B2D2:0x3FFBD650 0x400FD75F:0x3FFBD670 0x400FD76B:0x3FFBD6A0 0x400D72AD:0x3FFBD6C0 0x40088E41:0x3FFBD6E0 0x4008AFF1:0x3FFBD700
    0x4008481d: esp_crosscore_isr at C:/dev/esp/esp-idf/components/esp32/crosscore_int.c:77

    0x40082769: _xt_lowint1 at C:/dev/esp/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:1105

    0x4008b2d2: vPortExitCritical at C:/dev/esp/esp-idf/components/freertos/port/xtensa/port.c:469

    0x400fd75f: esp_task_wdt_reset at C:/dev/esp/esp-idf/components/esp_common/src/task_wdt.c:336

    0x400fd76b: idle_hook_cb at C:/dev/esp/esp-idf/components/esp_common/src/task_wdt.c:88

    0x400d72ad: esp_vApplicationIdleHook at C:/dev/esp/esp-idf/components/esp_common/src/freertos_hooks.c:51 (discriminator 1)

    0x40088e41: prvIdleTask at C:/dev/esp/esp-idf/components/freertos/tasks.c:3835 (discriminator 1)

    0x4008aff1: vPortTaskWrapper at C:/dev/esp/esp-idf/components/freertos/port/xtensa/port.c:168
As far as google can help me the error is related to task loops not containing instructions which make them unmanageable (?). Anyhow, as far as my code is concerned, I can't really see where that is the case as all my tasks have more than 1 instruction. Any Ideas?

axellin
Posts: 196
Joined: Mon Sep 17, 2018 9:09 am

Re: Task watchdog got triggered after MQTT disconnect

Postby axellin » Tue May 11, 2021 3:31 am

This looks like the same as https://github.com/espressif/esp-idf/issues/6744 which was fixed in master tree.
Try upgrade your esp-idf to latest code.
If you still hit the issue with latest code, you need to report the issue to github.

RichPiano
Posts: 123
Joined: Mon May 18, 2020 2:51 pm

Re: Task watchdog got triggered after MQTT disconnect

Postby RichPiano » Wed May 12, 2021 11:17 am

Thanks I'll try!

Who is online

Users browsing this forum: ESP_Roland, Google [Bot] and 70 guests