Difference between revisions of "MQTT: install di Ubuntu 20.04 lebih simple"

From OnnoWiki
Jump to navigation Jump to search
(Created page with " ==Referensi== * https://www.arubacloud.com/tutorial/how-to-install-and-secure-mosquitto-on-ubuntu-20-04.aspx#HowtoinstallandsecureMosquittoonUbuntu20.04")
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
Instalasi
  
 +
sudo apt update -y && sudo apt install mosquitto mosquitto-clients -y
  
 +
Check & Start
  
 +
sudo systemctl status mosquitto
 +
sudo systemctl start mosquitto
 +
sudo systemctl enable mosquitto
 +
 +
Subscribe
 +
 +
mosquitto_sub -h address -t topic
 +
 +
Publish
 +
 +
mosquitto_pub -h address -t topic -m “message”
 +
 +
 +
 +
==Config==
 +
 +
password
 +
 +
sudo mosquitto_passwd -c /etc/mosquitto/passwd test
 +
sudo mosquitto_passwd -c /etc/mosquitto/passwd onno
 +
sudo mosquitto_passwd -c /etc/mosquitto/passwd mark
 +
 +
config
 +
 +
sudo vi /etc/mosquitto/conf.d/default.conf
 +
 +
 +
tambahkan
 +
 +
 +
# allow_anonymous false
 +
allow_anonymous true
 +
# password_file /etc/mosquitto/passwd
 +
 +
 +
Restart
 +
 +
sudo systemctl restart mosquitto
  
 
==Referensi==
 
==Referensi==
  
 
* https://www.arubacloud.com/tutorial/how-to-install-and-secure-mosquitto-on-ubuntu-20-04.aspx#HowtoinstallandsecureMosquittoonUbuntu20.04
 
* https://www.arubacloud.com/tutorial/how-to-install-and-secure-mosquitto-on-ubuntu-20-04.aspx#HowtoinstallandsecureMosquittoonUbuntu20.04

Latest revision as of 06:13, 4 April 2022

Instalasi

sudo apt update -y && sudo apt install mosquitto mosquitto-clients -y

Check & Start

sudo systemctl status mosquitto
sudo systemctl start mosquitto
sudo systemctl enable mosquitto

Subscribe

mosquitto_sub -h address -t topic

Publish

mosquitto_pub -h address -t topic -m “message”


Config

password

sudo mosquitto_passwd -c /etc/mosquitto/passwd test
sudo mosquitto_passwd -c /etc/mosquitto/passwd onno
sudo mosquitto_passwd -c /etc/mosquitto/passwd mark

config

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


tambahkan


# allow_anonymous false
allow_anonymous true
# password_file /etc/mosquitto/passwd


Restart

sudo systemctl restart mosquitto

Referensi