Mosquitto Broker Installation on Windows

Mosquitto on Windows

Eclipse Mosquitto is an open source (EPL/EDL licensed) message broker that implements the MQTT protocol versions 3.1 and 3.1.1. Mosquitto is lightweight and is suitable for use on all devices from low power single board computers to full servers.

The MQTT protocol provides a lightweight method of carrying out messaging using a publish/subscribe model. This makes it suitable for Internet of Things messaging such as with low power sensors or mobile devices such as phones, embedded computers or microcontrollers.

Installing Mosquitto

First we need to Download the latest binary and execute it:

Mosquitto MQTT

The Installer will ask to download and install the latest version of Win32OpenSSL and copy all .dll's to the Mosquitto install directory:

Mosquitto MQTT

Mosquitto MQTT

And the same with this pthread.dll:

Mosquitto MQTT

Testing the MQTT Server with MQTT.fx

Download MQTT.fx as a MQTT Client for MQTT testing/debugging. Install and start the program and connect it to our local MQTT server:

Mosquitto MQTT

Mosquitto MQTT

Mosquitto MQTT

We can test the MQTT Service by subscribing:

Mosquitto MQTT

Going back to the Publish tab and sending a message:

Mosquitto MQTT

The message should show up in the Subscribe tab:

Mosquitto MQTT

Troubleshooting

Make sure that the Mosquitto Service is running: During the installation of Mosquitto you were given the option to automatically run the server as a Windows Service. This option is checked by default. You can verify that the service is actually active in your Windows Task Manager:

Mosquitto MQTT

If you are running Mosquitto just for testing, you might have chosen to exclude the Windows Service during the installation step. In this case just run the mosquitto.exe from your Command Line (you might have to start CMD as Administrator):

Mosquitto MQTT

You know that Node-RED has detected the MQTT server, when your MQTT Nodes say that they are connected:

Mosquitto MQTT

MQTT Binding for OpenHAB

To be able to use the MQTT Protocol in OpenHAB, you need to install the MQTT Binding from the OpenHAB Paper UI:

Mosquitto MQTT