What I would like to do is to stream data between the pico and a browser. The idea here is that I could then treat the websocket somewhat similar to what I do with usb serial, where I send json back and forth and use readline() to separate out the messages.
I've been playing around with the websocket made available in the web workflow, but that seems just to mirror the REPL stream (or is that just sys.sdtout?). What would be the recommended way to read that stream on the device? Can I use it similar to what I do with usb serial or am I way off the mark here?
WebSocket server on pico 2040 W?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- tannewt
- Posts: 3304
- Joined: Thu Oct 06, 2016 8:48 pm
Re: WebSocket server on pico 2040 W?
The webworkflow websocket is one serial stream that is muxed into sys.stdout and sys.stdin. `input()` should work with it. We don't currently have a way to read and write just that serial stream. (Like we do with usb_cdc for USB.)
- wonderlove
- Posts: 2
- Joined: Fri May 19, 2023 5:55 am
Re: WebSocket server on pico 2040 W?
Thanks for the clear answer :)
Please be positive and constructive with your questions and comments.