Trouble with tinyweb asyncio (using pico 2040 (automation mini) examples)

Using the example code:

This is the result:

Connection successful!
IP: 192.168.0.231
Task exception wasn’t retrieved
future: coro= <generator object ‘_tcp_server’ at 2001fd90>
Traceback (most recent call last):
File “asyncio/core.py”, line 1, in run_until_complete
File “tinyweb/server.py”, line 621, in _tcp_server
File “asyncio/core.py”, line 1, in queue_read
File “asyncio/core.py”, line 1, in _enqueue
NameError: name ‘cur_task’ isn’t defined

I have found the same issue. I did the other examples and they all work OK
I also changed the code in main.py to reflect the use of the ‘Mini’ by removing the triple quotes.
I reflashed the u2f file to be certain I had the correct one installed. No change.

I would like to be included on any results posted by tech support. Thanks

I am sorry if I missed the answer here? I have the exact same errors. What was found for this to work?
Task exception wasn’t retrieved
future: coro= <generator object ‘_tcp_server’ at 2001e870>
Traceback (most recent call last):
File “asyncio/core.py”, line 1, in run_until_complete
File “/lib/tinyweb/server.py”, line 621, in _tcp_server
File “asyncio/core.py”, line 1, in queue_read
File “asyncio/core.py”, line 1, in _enqueue
NameError: name ‘cur_task’ isn’t defined

Might be worth trying an older MicroPython version if you haven’t already? Possible that some sort of bug or incompatibility with tinyweb has snuck into the latest version?

THANK YOU

I am very new to this, but you sent me the right direction. I downloaded v1.20.6 for the pico w and was able to get to the website on the board.

I hope you keep an eye out on this board because I have ZERO doubt I will be back with more questions while I build this project.

Thank you again

v1.21.0 moves from naming uasyncio to asyncio (among others) which tinyweb uses. I haven’t wrapped my head around how the aliases all work to make tinyweb work with either successfully for certain, but what worked for me on v1.21.0 and should still work on older versions is to adjust the tinyweb server file by:

Removing line 9: import uasyncio.core as asyncio.core
Adjusting line 650 to remove the “u” so it now reads: yield asyncio.core._io_queue.queue_read(sock)