Page 1 of 1

WebSocket Server

Posted: Mon Aug 21, 2023 12:19 pm
by keithco
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??

Re: WebSocket Server

Posted: Mon Aug 21, 2023 1:17 pm
by ESP_Sprite
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.

Re: WebSocket Server

Posted: Tue Aug 29, 2023 12:22 pm
by keithco
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....

Re: WebSocket Server

Posted: Tue Aug 29, 2023 3:24 pm
by MicroController
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.

Re: WebSocket Server

Posted: Wed Aug 30, 2023 12:27 pm
by keithco
Let me look at the websocket server example. Thank you!