Hello, I'm working on a project (with an ESP32-WROOM-32 board) that needs to entablish a connection and listen to a websocket, more specifically to get realtime data from the Binance websocket (not much data, only the latest prices of two or three pairs).
I found several examples and tutorials about how to code a websocket server, but almost none examples or code on how to connect as a client (in this case to the Binance websocket) and wait/listen for data from it.
Came across to this library: https://github.com/jczic/MicroWebSrv2
which looks great and have examples to code a webserver, but due to my lack of experience in websockets I cannot realize (or understand) how to connect to a websocket (as a client) with this library...or another one.
The websocket I want to connect to is: wss://stream.binance.com:9443
API Docs: https://binance-docs.github.io/apidocs/ ... et-streams
Can someone provide some example or give me some clue on how to do what I'm trying to do?
Thanks in advance.
Websocket client question.
Re: Websocket client question.
What's wrong with google ?
Asking for "websocket client" gives me e.g. in the 5th link https://github.com/websocket-client/websocket-client (not for microypython, but enough code to steal from).
Asking for "websocket client" gives me e.g. in the 5th link https://github.com/websocket-client/websocket-client (not for microypython, but enough code to steal from).
A few hours of debugging might save you from minutes of reading the documentation!
My repositories: https://github.com/karfas
My repositories: https://github.com/karfas
Re: Websocket client question.
Thanks karfas for your reply.
As you said, it's not for Micropython (I couldnt be able to install it). I searched A LOT in Google, found some libraries (like the one I posted in my original question) but none of them show how to use them as client. So I though that it could be something simple to do with the available Micropython websocket libraries...I'm starting to think that I was wrong.
Sorry if it is a very simple thing, I just can't find anything related.
Thank you.
As you said, it's not for Micropython (I couldnt be able to install it). I searched A LOT in Google, found some libraries (like the one I posted in my original question) but none of them show how to use them as client. So I though that it could be something simple to do with the available Micropython websocket libraries...I'm starting to think that I was wrong.
Sorry if it is a very simple thing, I just can't find anything related.
Thank you.