I recently worked on a personal project where I wanted to connect multiple ESP32's to a web app. Previously I've used mqtt to do this and also done this in several work projects, but I decided to try something different and use websockets as ESP-IDF has a websocket client.
It worked really well and ended up in a much simpler setup, I didn't need an mqtt broker or a long running process listening to the broker, which meant it was much easier to deploy.
Previously I'd had to create a CA and generate self-signed certificates for each device, but with websockets this doesn't seem necessary and is handled transparently by the webserver.
A few other advantages are:
- it can have actual end-to-end confirmation, unlike MQTT which is only between client and broker
- port 443 won't be blocked
- much easier to develop and test locally
So my question is, is anyone else doing this at scale, is there something I haven't thought of?