Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3552

MicroPython • Re: uasyncio error

$
0
0
As said, I'm not familiar with 'asyncio', so I decided to try and implement a Pico W Web Server using that, taking your code as an example, using the original code as it appears to have been.

I tried to implement a Web Server alongside a flashing on-board LED program but soon discovered there appears to be an issue with -

Code:

  while True:    client, addr = await server.accept()    await asyncio.create_task(Handle(client, addr))
That '.accept()' line blocks both the Web Server and LED Flasher. When I try and connect from a browser the LED Flasher task proceeds but the Web Server doesn't, nothing is returned to the browser. Looks like I have more work to do.

I would also suggest you might want to get a basic 'asyncio' Web Server working before modifying it further. Do that incrementally so you can tell what's broken it if it does break.

Statistics: Posted by hippy — Mon Jul 15, 2024 2:03 pm



Viewing all articles
Browse latest Browse all 3552

Trending Articles