Raspberry Pi: installing Mosquitto MQTT broker

Environment
  • Raspberry Pi 3 Model B

Taken from: YouTube.

Installation
$ sudo apt-get update
$ sudo apt-get dist-upgrade
### Install mosquitto
$ sudo apt-get install mosquitto
### Install mosquitto clients
$ sudo apt-get install mosquitto-clients
Testing
### Console 1
$ mosquitto_sub -t "hellomosquitto"

### Console 2
$ mosquitto_pub -t "hellomosquitto" -m "Hello, Mosquitto!"

### Console 1 will print
Hello, Mosquitto!

 

Leave a Reply

Your email address will not be published. Required fields are marked *