s00500 / ESPUI

A simple web user interface library for ESP32 and ESP8266

Home Page:https://valencia.lbsfilm.at/midterm-presentation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trying to add OTAUpdate

Atorcha opened this issue · comments

Describe the bug
I have add the library https://github.com/programmer131/ESP8266_ESP32_SelfUpdate/blob/master/esp32_ota/esp32_ota.ino to update it self by pressing a button in webui, but I get an error and restart. The example works good but I think that there is a problem of incompatibility.

To Reproduce
When I call the fuction to update a get this error:

FIRMWARE UPDATE
E (32195) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (32199) task_wdt: - async_tcp (CPU 0/1)
E (32199) task_wdt: Tasks currently running:
E (32199) task_wdt: CPU 0: ipc0
E (32199) task_wdt: CPU 1: loopTask
E (32199) task_wdt: Aborting.
abort() was called at PC 0x40164c9c on core 0

ELF file SHA256: 0000000000000000

Backtrace: 0x40088810:0x3ffbf8e0 0x40088a8d:0x3ffbf900 0x40164c9c:0x3ffbf920 0x40086f4d:0x3ffbf940 0x40084c09:0x3ffb9d60 0x400876ed:0x3ffb9d80 0x40084987:0x3ffb9da0 0x40089a9e:0x3ffb9dc0

Rebooting...

Expected behavior
It could donwload the new firm

Desktop (please complete the following information):

  • OS:windows 11
  • Browser [CHROME
  • Version [e.g. 22]

Additional context

Read this to understand what is going on.

I can only guess, because I am not familiar with that library and you should probably be asking them, but I would assume the issue is that you are triggering a long-running operation from a critical section. ESPUI callbacks happen in an interrupt context so you should ensure they are quick. If you want to trigger some long-running thing do something like this:

volatile bool doAThing = false;

void loop() {
	if(doAThing) { ... 
}

void longOperationCallback(Control *sender, int type) {
	if(type == B_UP) {
		doAThing = true;
	}
}