Some of Stef's Stuff

Mosquitto on Raspberry Pi

by Stefano on 2013.12.27, one comment

Want create site? Find Free WordPress Themes and plugins.

Lately I’ve been playing around with Raspberry Pi to get comfortable with this piece of electronics. Now it’s time to add some features and test some ideas. MQTT has been around for some time now and is gaining more and more popularity with the IoT growth. So, got the server, let’s make it a MQTT broker.

This is old news and many tutorials are already available on the topic. Two among them

Both cover the basics of Mosquitto installation on Raspberry Pi; the second one go further on some configuration specific for the ones who want to setup a broker for MQTTitude.


At the moment I’ve been able to install Mosquitto and start it manually. Otherwise start the service at boot time keep on failing. See this post.


Default Mosquitto installation do not use any mosquitto.conf configration file. The broker run using default parameters (see man page for the values) and in particular with persistance disabled. Considering the replies to this post I assume that no default persistance is why no mosquitto.db file was written in the first place.

The use of a properly configured mosquitto.conf file and a service reload solved my issue.

All parameters in configuration file are well documented and self-explanatory. Change/uncomment parameters in the file to have something like this:

Save the configuration file and reload the service, then start a subscriber to cause some change on the broker side; based on the configuration made, the added client should induce the broker to persist its status to the mosquitto.db file.

Reboot the Raspberry Pi. This reveals that Mosquitto daemon is now correctly started on boot.


Did you find apk for android? You can find new Free Android Games and apps.

One thought on “Mosquitto on Raspberry Pi

  1. This problem was caused by a missing file (the config file) in the debian package. It’s now fixed in the packages.

Leave a Reply

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