2021-02-16 | Apps | Running MQTT on IBM Cloud
IBM has a free MQTT service with limited bandwidth. Set up a broker by creating a device type:
A device:
And an API key:
Say that:
U = your account
V = Device Type
W = Device ID
X = Device Authentication Token
Y = API Key
Z = API Authentication Token
If you want to subscribe to "dvd" events, use this command:
mosquitto_sub -p 8883 -u "Y" -P "Z" -i "a:U:papp" -t "iot-2/type/V/id/W/evt/dfd/fmt/text" -h U.messaging.internetofthings.ibmcloud.com
To publish messages to "dfd" events, use this command:
mosquitto_pub -p 8883 -u "use-token-auth" -P "X" -i "d:U:V:W" -t "iot-2/evt/dfd/fmt/text" -h U.messaging.internetofthings.ibmcloud.com -m "hello"