MQTT: mosquitto client di Ubuntu 18.04

From OnnoWiki
Jump to: navigation, search

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"