MQTT: mosquitto client di Ubuntu 18.04

From OnnoWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Instalasi

apt update
apt install mosquitto-clients


Pemakaian

mosquitto_sub -h localhost -t test -u "your-user" -P "your-password"
mosquitto_pub -h localhost -t test -m "hello world" -u "your-user" -P "your-password"
mosquitto_sub -h mqtt.mydomain.com -t test -p 8883 --capath /etc/ssl/certs/ -u "your-username" -P "your-password"
mosquitto_pub -h mqtt.mydomain.com -t test -m "hello world" -p 8883 --capath /etc/ssl/certs/ -u "your-username" -P "your-password"