Advertisement
Guest User

Untitled

a guest
Dec 27th, 2018
16,482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.83 KB | None | 0 0
  1. 1. Install Mosquitto
  2. sudo apt-get install mosquitto -y
  3. sudo apt-get install mosquitto-clients
  4.  
  5. 2. Configure Mosquitto.
  6. a. Run the following
  7. sudo nano /etc/mosquitto/mosquitto.conf
  8.  
  9. b. Paste the following:
  10. # Place your local configuration in /etc/mosquitto/conf.d/
  11. #
  12. # A full description of the configuration file is at
  13. # /usr/share/doc/mosquitto/examples/mosquitto.conf.example
  14.  
  15. pid_file /var/run/mosquitto.pid
  16.  
  17. persistence true
  18. persistence_location /var/lib/mosquitto/
  19.  
  20. log_dest file /var/log/mosquitto/mosquitto.log
  21.  
  22. allow_anonymous false
  23. password_file /etc/mosquitto/pwfile
  24. listener 1883
  25.  
  26. 3. Setup Mosquitto credentials
  27. sudo mosquitto_passwd -c /etc/mosquitto/pwfile TYPE_YOUR_USERNAME_HERE
  28.  
  29. 4. Test the Mosquitto by subscribing to a topic
  30. mosquitto_sub -d -u MOSQUITTO_USERNAME -P MOSQUITTO_PASSWORD -t dev/test
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement