Difference between revisions of "MQTT: mosquitto client di Ubuntu 18.04"

From OnnoWiki
Jump to: navigation, search
(Created page with "==Instalasi== apt update apt install mosquitto-clients")
 
 
Line 3: Line 3:
 
  apt update
 
  apt update
 
  apt install mosquitto-clients
 
  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"

Latest revision as of 09:45, 14 November 2019

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"