Page 1 of 1

Async Websocket client

Posted: Sun May 14, 2023 8:07 am
by sigma_shig
Hi

Can anybody recommend any library for async Websocket client? I know async websocket server (as a part of AsyncWebServer) and I know a Websockets library with client implementation (https://github.com/Links2004/arduinoWebSockets) but it is require a loop, but I'm trying to avoid using a loop and switch to the async callbacks/events.

Re: Async Websocket client

Posted: Mon May 15, 2023 3:25 am
by username

Re: Async Websocket client

Posted: Mon May 15, 2023 7:32 am
by sigma_shig
This module is a websocket server. I'm looking for Websocket client for Arduino platform. I don't want to work wit ESP_IDF.

Re: Async Websocket client

Posted: Mon May 15, 2023 6:58 pm
by lbernstone
AsyncWebserver is a polling loop under the covers, so your request is pretty meaningless.
Any async process is going to be prone to race conditions and tight timing windows. These are best solved with the FreeRTOS mutex and queue methods (https://github.com/espressif/arduino-es ... s/FreeRTOS). AsyncWebserver websockets has worked well for me and many others.

Re: Async Websocket client

Posted: Wed May 17, 2023 4:47 am
by sigma_shig
Sure, I understand, that websocket has a loop under cover. It is ok, but I would like to work with this high-level "cover" to avoid any low-level work which requires a lot of effort. The same as we are using Arduino-ESP32 framework which has FreeRTOS+ESP-IDF under cover (which also has a machine codes under cover).