MQTT and the MBED Portenta

The MBED Software on the Arduino Portenta is just slightly different than other Arduino boards making everything basically frustrating. I am now trying to get various MQTT servers to read sensor data from my Portenta. This gives lots of levels of new frustration.

If anyone has any MQTT, publish, subscribe or full server examples running for the Portenta I would be interested in seeing them. I have some things running but nothing as good as I would like. I also do a lot of work with Javascript and MQTT should be able to work on a web page. Would be great for testing.

MQTT

MQTT is similar to HTTP but your Arduino can publish really small messages (only a few bytes) to an MQTT Broker ()often a local Raspberry Pi) that then forwards the messages to multiple subscribers, which could be cloud servers or your own open webpages etc.

MQTT is good for LoRaWan networks that send small amounts of information long distances (city ~2km, Country about 10 km), but could also be used for any Ethernet or Wifi connected device.

LoRaWan

For TTN (The Things Network). I have no gateways nearby and my 2 purchased "The Things Industries indoor gateways" don't seem to work yet with the new TTN V3.

For the Helium Cryptocurrency Network everything seems to be running well. I will eventually update my portenta-pro-community-solutions Library with examples.

MQTT Brokers

I have Adafruit.io working and ArduinoCloud. I appreciate the power that both these sites offer, however when things don't work I feel lost. Sometimes better to have your own simple Broker.

I know I can fire up my RPI3B and install Mosquito, but just haven't yet.

For anything cloud based I love the Dev site Gitpod.io but even there I can't seem to get any MQTT Brokers working. Here is a great list of everything Awesome-MQTT

I have even put in a Feature Request for the Portenta to be able to be used as a Broker here . Feel free to star or like that to get it some attention. Using the Portenta as a Broker would solve many headaches.

While writing this article I just found, so I think I will stop writing and have a look at it.https://www.arduino.cc/reference/en/libraries/mqtt-client/