lasselukkari / aWOT

Arduino web server library.
MIT License
283 stars 41 forks source link

Websocket server #138

Closed Sampozzo closed 2 years ago

Sampozzo commented 2 years ago

Hello, i can't find info on this topic...

Is it possibile to use aWOT library as a websocket server? If yes, can you provider an example please?

Thank you very much again.

lasselukkari commented 2 years ago

Hi. Unfortunately not.

As a side note websockets on these tiny microcontrollers become complicated really fast. It's easy when you have just one connected client at the time but once you open more connections the state management becomes complicated and it's easy run out of sockets. This is why I have personally preferred polling instead. It maybe isn't as sophisticated solution but starting from the same know state when a client makes a request and closing the connection after the request keeps things simple. I have used 50 ms interval for the polling on ESP8266 and ESP32 so the updates feel almost instant.

Sampozzo commented 2 years ago

Thank you very much @lasselukkari

Sampozzo commented 2 years ago

Hello, just in case someone else need info on this topic, i found this library that works great with aWOT:

https://github.com/skaarj1989/mWebSockets

This is the only one that works over ethernet too. Now i have a working project with aWOT for static files, websocket and ethernet connection.

lasselukkari commented 2 years ago

Thanks for the information!