I'm having a problem with my ESP-WROOM-32. I have a web app that worked fine in my mobile phone until a page with contact information was added. This contact information page has 7 images in .png format.
The curious thing that is happening is that when I load the app from my phone, the page waits for a certain time, and after that the ESP chip resets itself.
The message it sends through the serial port is the following:
E (25998) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (25998) task_wdt: - async_tcp (CPU 0/1)
E (25998) task_wdt: Tasks currently running:
E (25998) task_wdt: CPU 0: IDLE
E (25998) task_wdt: CPU 1: loopTask
E (25998) task_wdt: Aborting.
abort() was called at PC 0x400e5e4d on core 0
Backtrace:0x4008364d:0x3ffbe9ec |<-CORRUPTED
ELF file SHA256: 0000000000000000
Rebooting...
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13132
load:0x40080400,len:3036
entry 0x400805e4
After this last line my program starts again and connects again, and I can access the web app until I try to load the contact page, then it doesn't load all the images and resets itself again.
NOTE: this only happens when I load the web app from my cellphone, it doesn't happen when I load the web page from my computer.
So, what could be happening here?
UPDATE 03/01/2023-7:00p.m.: I just tested the app with a phone whose Android version is version 9 and it worked perfectly, then I put my phone on the side of the other, I loaded the page from my phone and the ESP32 restarted again. I suppose it has something to do with the Android version, but I don't know.
UPDATE 04/01/2023 at 8:30a.m.
In order to complement the information with @nanofarad asked I ran the application again, this time I put debug messages on console on every request response from the server when it loads the content of the "contact" page and its images (this is the page where the problem happens) and the following was obtained
Entrando a página Contacto.
Cargando logo-empresa
Cargando logo-venapp
Cargando logo-whatsapp
Cargando logo-facebook
Cargando logo-youtube
E (20176) task_wdt: Task watchdog got
triggered. The following tasks did not reset
the watchdog in time:
E (20176) task_wdt: - async_tcp (CPU 0/1)
E (20176) task_wdt: Tasks currently running:
E (20176) task_wdt: CPU 0: IDLE
E (20176) task_wdt: CPU 1: loopTask
E (20176) task_wdt: Aborting.
abort() was called at PC 0x400e5f01 on core 0
Backtrace:0x4008364d:0x3ffbe9ec |<-CORRUPTED
ELF file SHA256: 0000000000000000
Rebooting...
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13
(SPI_FAST_FLASH_BOOT)configsip: 0,
SPIWP:0xee
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13132
load:0x40080400,len:3036
entry 0x400805e4
Entrando a configuración de aplicación
Inicializado el Sistema de archivos.
Conectado a la red TP-LINK_D6BF4E
Dirección IP asignada: 192.168.1.101
Saliendo de configuración de aplicación
Cargando logo-linkedin
I also have a screenshot of the loaded page and looks like follows
if looked carefully then can be seen than in the screenshot none of the images is completely loaded when the ESP32 resets itself, then in the log can be seen by the phrase "Cargando logo-..." when the program makes any of the query's, the server supplies 6 logos if the header logo is accounted and apparently after the fifth of the social networks logos are called then the ESP32 resets, after the reset is completed, the system initializes again too and loads the Async server then the following social network logo called logo-facebook (the seventh) is called/loaded, in this moment is the instagram logo that isn't loaded and the previous logos doesn't completely loads. Note that I don't know why the logo-facebook image is loaded after the reset. I can only supose that the web browser keeps waitin until the server respond to make the remaining requests.
But important: of the three devices with which I'm testing the app, only fails with my cellphone which has installed chrome apk version 108.0.5359.128, the other too works fine.
I also readed this post and found that the ESP32 can open one socket a time so I think may be this browser tries to open more than one socket and it doesn't closes it on time so the ESP resets itself because of that.
Right now I'm researching how to print the request/response to/from the Async server.
UPDATE 04/01/2023 at 2:49p.m.
I apparently found the the explanation of whats happening in this other post from several possible solutions:
- One solution is to load 5 files maximum on a page and I was loading at least 8 files, that is because apparently SPIFFS library only supports 5 files open/sent at a time. I reduced the amount of files loaded and the web app worked well at all times and in at the three devices.
- To augment the Async TCP event queue number of events because apparently my web page in some browser generates a lot of events that the ESP32 can't handle because of the event queue limit, this event limit is set by default to 32 and in the post the person who solved the problems changed the max number of events to 256; is not mandatory to use that number but is a way to ensure some degree of freedom to load files from the file system.
- Some other options goes from compress several files and give instructions to the web browser through the response callback the browser to manage the descompression and uses of the files by itself.
So I applied the second options and now my web app works fine, i'll see if it doesnt fails in future.
And Thanks again for the help.
put my phone on the side of the other
\$\endgroup\$