WebSocket Server

keithco
Posts: 13
Joined: Fri Jun 17, 2022 8:17 pm

WebSocket Server

Postby keithco » Mon Aug 21, 2023 12:19 pm

I found some websocket server example code that includes this library file "esp_websocket_server.h" but it doesn't find it. I am running IDF v5.0.1. My web searches have not been successful as well. I have working code using the "esp_http_server.h" library but the state of any of the GPIO upon a web page refresh is reset. It is my understanding, that I should be using websocket server code in ordering for states to be updated with the actual state??

ESP_Sprite
Posts: 9730
Joined: Thu Nov 26, 2015 4:08 am

Re: WebSocket Server

Postby ESP_Sprite » Mon Aug 21, 2023 1:17 pm

esp_websocket is now a component. See https://components.espressif.com/compon ... ket_client . You can run 'idf.py add-dependency "espressif/esp_websocket_client" ' to add it to your project.

keithco
Posts: 13
Joined: Fri Jun 17, 2022 8:17 pm

Re: WebSocket Server

Postby keithco » Tue Aug 29, 2023 12:22 pm

Hello ESP_Sprite,
Thank you for your response. I enabled notifications to me email but I did not get notified.
I saw that esp_websocket is a component. My understanding is that the client is not the same as a server.
I'll need to do some more research on this....

MicroController
Posts: 1708
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: WebSocket Server

Postby MicroController » Tue Aug 29, 2023 3:24 pm

keithco wrote:
Mon Aug 21, 2023 12:19 pm
the state of any of the GPIO upon a web page refresh is reset. It is my understanding, that I should be using websocket server code in ordering for states to be updated with the actual state??
Not sure I fully understand what states need to be updated where, but you can check the IDF websocket server example, or consider server-sent events.

keithco
Posts: 13
Joined: Fri Jun 17, 2022 8:17 pm

Re: WebSocket Server

Postby keithco » Wed Aug 30, 2023 12:27 pm

Let me look at the websocket server example. Thank you!

Who is online

Users browsing this forum: No registered users and 109 guests