Setting up Mosquitto on Raspbian Jessie

In this post I’ll explore how to install Mosquitto (MQTT Broker) and test it is working.

Installing Mosquitto

The installation is pretty easy since Mosquitto is included in main repositories.

sudo apt-get install mosquitto

Test that Mosquitto is working

To test that Mosquitto is working, we’ll be sending a simple message to the broker and see if it is working. To do so, I use the Mosquitto clients.

On the same computer, or on another (we’re talking about network, aren’t we ?), install the clients :

sudo apt-get install mosquitto-clients

Then, we will register to receive all message:

mosquitto_sub -h -t "#" -v

Now let’s send a message to the broker from another terminal / machine:

mosquitto_pub -h -t "test" -m "Hello world!"

You will see the message appear on the mosquitto_sub screen.

Illustration from: Pratheep P S,,

One Reply to “Setting up Mosquitto on Raspbian Jessie”

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.