Hi
Is there any way to connect to an MQTT broker using websockets instead of the normal TCP?
this would make it easier to connect to MQTT brokers in networks where only HTTP or HTTPs is open. At the moment I’m connecting using the async-mqtt-client library and everything is working for a normal MQTT connection over 8883 or 1883 but using the websocket will be much easier when using containers as MQTT brokers
Thanks
Regards
Pedro
Hi Pedro.
We don’t have any tutorials about that subject.
There’s support for the ESP32 using ESP-IDF: https://github.com/espressif/esp-mqtt
https://www.youtube.com/watch?v=yFD7yfuMfY0
I’ve found these libraries for ESP8266 for Arduino IDE (maybe they also work with ESP32 with a few changes):
- https://github.com/tuanpmt/ESP8266MQTTClient
- https://github.com/tuielectronics/ESP8266-mqtt-over-websocket
I’m sorry that I can’t help much.
Regards,
Sara