Closed ptsneves closed 1 year ago
Hi,
This cannot work and has to end in an crash.
Please have a look at the documentation: https://nodemcu.readthedocs.io/en/dev/lua-developer-faq/
It is especially this part:
The main impacts of the ESP8266 SDK and together with its hardware resource limitations are not in the Lua language implementation itself, but in how application programmers must approach developing and structuring their applications. As discussed in detail below, the SDK is non-preemptive and event driven. Tasks can be associated with given events by using the SDK API to registering callback functions to the corresponding events. Events are queued internally within the SDK, and it then calls the associated tasks one at a time, with each task returning control to the SDK on completion. The SDK states that if any tasks run for more than 15 mSec, then services such as WiFi can fail.
So you can start a timer that does your loop while giving enough resources to the SDK so ESP8266 feels fine.
Let's close the issue.
Thanks Lukáš
I expected it to keep working indefinitely. Unfortunately it works for some time and then crashes after some time. Changing the characters to read from 1 to 0 did not lead to any improvement.
NodeMCU startup banner
Hardware
Regular Lolin ESP8266
Let me know if you need further help. I suspect there is some kind of interrupt inside the callback. Is there a way to busy poll the uart without interrupts?