ESPAsyncWebServer & WiFiClient (for HTTPUpdate)

g01d10x
Posts: 2
Joined: Sun Apr 01, 2018 8:19 pm

ESPAsyncWebServer & WiFiClient (for HTTPUpdate)

Postby g01d10x » Tue Jul 14, 2020 4:50 pm

Hello everyone,

I'm trying to find an example for my ESP32 to be connected to a WiFi network with access to the internet, and running a functioning ESPAsyncWebServer. BUT .. I would also like to have the ESP32 also connect to perform an HTTPUpdate with a .bin stored on my server.

I've tried the first HTTPUpdate example from [here](https://github.com/espressif/arduino-es ... e/examples) by itself and all works well, but when I add the same code into my project with the ESPAsyncWebServer, the WDT gets triggered from the async_tcp on CPU 1.

I've tried several implementations to have the server and a separate client coexist without a crash, but no luck. I am afraid the only way I might get this to happen is to have the whole program restart, then perform the HTTPUpdate process before the server.begin(), but this seems a little extreme so I'm hoping for help.

Otherwise the ESPAsyncWebServer from @me-no-dev seems to be a solid server for the rest of everyone's needs, but I can't figure out how to get it to play nicely when there's another client alive which is connecting out to the internet.

I've also tried adding all of these 4 lines before starting up the HTTPUpdate process in various combinations to no avail.
  1. server.end();
  2. disableCore0WDT();
  3. disableCore1WDT();
  4. disableLoopWDT();
Any help would be appreciated !

Backtrace info below:
  1. E (31237) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
  2. E (31237) task_wdt:  - async_tcp (CPU 1)
  3. E (31237) task_wdt: Tasks currently running:
  4. E (31237) task_wdt: CPU 0: IDLE0
  5. E (31237) task_wdt: CPU 1: async_tcp
  6. E (31237) task_wdt: Aborting.
  7. abort() was called at PC 0x400ebca3 on core 0
  8.  
  9. Backtrace: 0x4008c800:0x3ffbe170 0x4008ca31:0x3ffbe190 0x400ebca3:0x3ffbe1b0 0x40084b3d:0x3ffbe1d0 0x40168f8f:0x3ffbc2f0 0x400ed05a:0x3ffbc310 0x4008a72d:0x3ffbc330 0x40088f49:0x3ffbc350
  10.   #0  0x4008c800:0x3ffbe170 in invoke_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:707
  11.   #1  0x4008ca31:0x3ffbe190 in abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:707
  12.   #2  0x400ebca3:0x3ffbe1b0 in task_wdt_isr at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/task_wdt.c:252
  13.   #3  0x40084b3d:0x3ffbe1d0 in _xt_lowint1 at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/xtensa_vectors.S:1154
  14.   #4  0x40168f8f:0x3ffbc2f0 in esp_pm_impl_waiti at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/pm_esp32.c:492
  15.   #5  0x400ed05a:0x3ffbc310 in esp_vApplicationIdleHook at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/freertos_hooks.c:108
  16.   #6  0x4008a72d:0x3ffbc330 in prvIdleTask at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c:3507
  17.   #7  0x40088f49:0x3ffbc350 in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)
  18.  
  19. Rebooting...
Here's my hardware information
  1. Board:                  DOIT ESP32 Devkit V1
  2. Core Installation version:  Espressif 32 1.12.4
  3. IDE name:               PlatformIO & VS Code (Mac)
  4. Flash Frequency:            ?40Mhz?
  5.  
  6. PLATFORM: Espressif 32 1.12.4 > DOIT ESP32 DEVKIT V1
  7. HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
  8. DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
  9. PACKAGES:
  10.  - framework-arduinoespressif32 3.10004.200129 (1.0.4)
  11.  - tool-esptoolpy 1.20600.0 (2.6.0)
  12.  - tool-mkspiffs 2.230.0 (2.30)
  13.  - toolchain-xtensa32 2.50200.80 (5.2.0)
  14.  
  15. RAM:   [=         ]  13.3% (used 43528 bytes from 327680 bytes)
  16. Flash: [=======   ]  71.6% (used 938422 bytes from 1310720 bytes)
  17. Chip is ESP32D0WDQ6 (revision 1)
  18. Changing baud rate to 460800
Computer OS: Mac OSX

Who is online

Users browsing this forum: No registered users and 18 guests