It is very likely that owing to my poor implementation of the uasyncio library, on an ESP32 WROOM32, that after a few minutes of running memory intensive tasks, bugs begin revealing themselves. All functions test well initially, but after a while seemingly random error is raised in the REPL:
Code: Select all
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ACT_v0b.py", line 1154, in <module>
File "uasyncio/core.py", line 109, in run_forever
File "ACT_v0b.py", line 1070, in ACT_Now_R
File "uasyncio/core.py", line 180, in run_until_complete
File "uasyncio/core.py", line 92, in run_forever
IndexError: empty
>>>
Put simply, is there a proper way to clean up after functions that are called using "create_task", which return immediately but may be called multiple times from different places? Example:
Code: Select all
loop = asyncio.get_event_loop()
loop.run_until_complete(json_get_settings())
loop.run_until_complete(wifi_connect())
loop.create_task(home_screen())
Thanks.