Open fedekrum opened 2 years ago
Did You read this: https://github.com/me-no-dev/ESPAsyncWebServer#important-things-to-remember ?
That will justify the delay() for sure. Thanks But the problem still exists if you change it for the "for" loop as I suggested. Looks like the callback is time sensitive beyond the yield or the delay commands.
The problem is that the callback has to be shortest as possible - You can not hang there for too long time.
I wonder why? The technical explanation beyond it. May be the author can throw some light on this.
Well, the ESP8266 Arduino is built on NONOS_SDK so it does not contain any form of RTOS. Despite this there is some form of cooperative multitasking - internal task for handling WiFi and "user" task handling the Arduino code. This webserver is async so it uses AsyncTCP library which runs (read it as "its called from") in this internal task context (so the "problem" is inside AsyncTCP library and not the server). For more explanation you can read here https://github.com/me-no-dev/ESPAsyncTCP/blob/15476867dcbab906c0f1d47a7f63cdde223abeab/src/ESPAsyncTCP.cpp#L61 - I suggest you to give some time studying the AsyncTCP library to get more info.
For more explanation you can read here https://github.com/me-no-dev/ESPAsyncTCP/blob/15476867dcbab906c0f1d47a7f63cdde223abeab/src/ESPAsyncTCP.cpp#L61
That is strange:
The client sketch must always test if the connection is still up at loop() entry and after the return of any function call, that may have done a delay() or yield()
I've read docs and examples in ESPAsyncWebServer and ESPAsyncTCP -> there is nothing about "connection checking" anywhere in the loop()
s.
Simplest thing first - ask the original author for explanation ;-) ...
Simplest thing first - ask the original author for explanation ;-) ...
well, both libs are made / maintained (?*) by @me-no-dev, so I guess I am asking in the right place ;-)
*with last update a year ago and 64 pending PRs, I'm starting to think I shouldn't spend too much time trying to understand it all…
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
This code generates an exception 9 error
if I replace
delay(1)
withI get the same exception.
https://stackoverflow.com/questions/73127447/delay-instruction-generating-exception-9-error-on-esp8266-nodemcu-with-esp