Hello Everyone,
Are there any examples for connecting to a websocket server from ESP-32 IDF? There's numerous examples of running a websocket server on the ESP-32, just can't seem to find the inverse.
Thank you,
Nick
Socket.io (Websocket) Client Example
Re: Socket.io (Websocket) Client Example
I'm really interrested in this as well!
Re: Socket.io (Websocket) Client Example
Imagine the question was being asked in a "Linux" environment. What libraries/tools/technologies would you consider to be the one(s) you would want to use? If we (community) can find an API on Linux, then we can perhaps undertake a task to attempt the goal in the ESP32 environment.
What sub platforms of ESP32 would be desired to be supported?
* ESP-IDF
* C++ using ESP-IDF
* C++ using Arduino
* Other languages ...
What sub platforms of ESP32 would be desired to be supported?
* ESP-IDF
* C++ using ESP-IDF
* C++ using Arduino
* Other languages ...
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Socket.io (Websocket) Client Example
Socket.io actually has a C++ client example here:
https://github.com/socketio/socket.io-client-cpp
Perhaps it can work on ESP32?
https://github.com/socketio/socket.io-client-cpp
Perhaps it can work on ESP32?
Re: Socket.io (Websocket) Client Example
I was looking through some docs on Mongoose networking. This is a library which is known to work fine with ESP32 ESP-IDF. Reading the docs, it seems to have outbound WS support. See:
https://docs.cesanta.com/mongoose/maste ... ect_ws.md/
https://docs.cesanta.com/mongoose/maste ... ect_ws.md/
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
-
- Posts: 64
- Joined: Tue Jan 10, 2017 1:09 pm
Re: Socket.io (Websocket) Client Example
Hi
just note that websocket and socket.io are different things... you cannot connect to a socket.io server using a "generic" websocket client:
https://en.wikipedia.org/wiki/Socket.IO
so if your goal is to implement a connection from ESP32 to a Socket.IO server you have to implement the full "socket.io" protocol... some clients (including a C++ and java implementation) are available in the official repo:
https://github.com/socketio
just note that websocket and socket.io are different things... you cannot connect to a socket.io server using a "generic" websocket client:
https://en.wikipedia.org/wiki/Socket.IO
so if your goal is to implement a connection from ESP32 to a Socket.IO server you have to implement the full "socket.io" protocol... some clients (including a C++ and java implementation) are available in the official repo:
https://github.com/socketio
Re: Socket.io (Websocket) Client Example
I am actually looking for something similar: I need a socket.io-server in cpp for the ESP32.
I wrote an automation controller in NodeJS using Socket.IO. Kind of a large project, with multiple other clients already written in JavaScript. The thing is, though, the system expects the ESP32 to have its own socket.io server, and the nodejs server connects to it as the client. In this way, the ESP chip becomes a very flexible open-source device with less configuration requirements that may support multiple programming projects by providing its own socket server.
Unfortunately, all I can find online is a socket.io-client, and a number of other websocket implementations that do not natively work with socket.io.
Does anyone have any ideas or recommendations? Right now, I am thinking the solution is to find a supported websocket-client on the ESP32, and build an alternative client implementation on the nodejs side specifically for devices that do not support socket.io. It's a big pain in the ***, as a socket.io server should not be that complex to implement a basic light-weight version, especially considering the dual-core 240Mhz processor of the ESP32.
Thanks
I wrote an automation controller in NodeJS using Socket.IO. Kind of a large project, with multiple other clients already written in JavaScript. The thing is, though, the system expects the ESP32 to have its own socket.io server, and the nodejs server connects to it as the client. In this way, the ESP chip becomes a very flexible open-source device with less configuration requirements that may support multiple programming projects by providing its own socket server.
Unfortunately, all I can find online is a socket.io-client, and a number of other websocket implementations that do not natively work with socket.io.
Does anyone have any ideas or recommendations? Right now, I am thinking the solution is to find a supported websocket-client on the ESP32, and build an alternative client implementation on the nodejs side specifically for devices that do not support socket.io. It's a big pain in the ***, as a socket.io server should not be that complex to implement a basic light-weight version, especially considering the dual-core 240Mhz processor of the ESP32.
Thanks
Who is online
Users browsing this forum: No registered users and 177 guests