MQTT Client on Arduino

The wiki has a useful generic step-by-step guide to implement MQTT client.
However, following the steps described there I was unable to connect an Arduino Nano 33 IoT to OpenRemote using MQTT. I have also addressed firewall issues creating rules for ports 1883 and 8883 and used the command shown here and here to lauch OpenRemote:

cmd /C “set KEYCLOAK_FRONTEND_URL=https://192.168.1.5/auth && docker-compose -p openremote up”

Note that in the tutorial kindly shared by Tomas above, I was not able to connect MQTT Explorer to OpenRemote using port 1883. It would be useful to know how this could be achieved.

After a lot of reading and digging, I could not find a single example of a successful implementation of a MQTT device on Arduino with complete code.

I suspect it would not be too difficult for someone with more experience to create a couple of examples of a real MQTT implementation on a widelly used platform such as the Arduino.

I would suggest that, if there is anyone with the required experience, to create simple examples using the Nano 33 Iot (and perhaps also the ESP32, just to cover two different wifi libraries), using ports 1883 and 8883.

Hi,

A few users and customers have had success connecting ESP32 boards to our MQTT broker; you need to be aware of potential issues with Letsencrypt root certificate expiry which occurred a few months ago (it is discussed in other forum issues); hopefully the Arduino and/or ESP32 SDKs now use an up-to-date CA cert DB, if not you might want to try including the full cert chain in your code.

As for MQTT Explorer IIRC it is built using Electron and this didn’t have an up-to-date CA cert DB (maybe that’s been fixed recently but I don’t know); I use MQTTBox on Windows without issue.