IoT - Internet of Things

IOT| mqtt command line

mosquitto_pub  -h localhost -t test_topic\topic1 -m "OFF"

mosquitto_sub  -h localhost -t test_topic\topic1



## Have Secure

$ sudo mosquitto_passwd -c /etc/mosquitto/passwd [MQTT USER]

$ sudo systemctl restart mosquitto

## edit config

$sudo vi /etc/mosquitto/conf.d/default.conf

allow_anonymous false

password_file /etc/mosquitto/passwd

##example

mosquitto_sub -h localhost -t test -u [MQTT USER] -P [MQTT PASS]

mosquitto_pub -h [MQTT SERVER]-t test -m "hello world" -u [MQTT USER] -P [MQTT PASS]

 

 

Tags