async websocket

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
KrisRevi
Posts: 7
Joined: Wed Jul 01, 2020 6:45 pm

async websocket

Post by KrisRevi » Mon Jul 06, 2020 9:50 pm

Does anyone have a good reference to start with for implementing an async websocket server on the ESP32? I already looked at https://github.com/danni/uwebsockets but that is still a "blocking" socket, not using uasyncio...

I also had a look at https://github.com/jczic/MicroWebSrv but this has only a websocket server implementation (a very good one, using threads). The official micropython-lib has the famous "uasyncio.websocket.server" https://github.com/micropython/micropyt ... ket.server which is used for the web REPL, but again no official asynchronous websockets client module...
Any async specialist that has implemented this before or any beginner tips?

User avatar
mattyt
Posts: 410
Joined: Mon Jan 23, 2017 6:39 am

Re: async websocket

Post by mattyt » Mon Jul 06, 2020 11:08 pm

You might want to take a look at microdot, a lightweight webserver with asyncio support.

Peter's excellent async tutorial also touches on socket programming.

I'm not an expert on the subject but that's where I'd start looking. :)

beyonlo
Posts: 58
Joined: Thu Nov 26, 2015 8:03 pm

Re: async websocket

Post by beyonlo » Sat Jan 15, 2022 5:45 pm

Hello @KrisRevi

Did you success with that? I would like a simple example of uasyncio WebSocket Server (secure - with SSL)

Thank you!

Post Reply