MQTT Protocol

Date Published:
Last Modified:


MQTT is a lightweight publish/subscribe communications protocol that uses TCP/IP (and other secondary transport mechanisms). It is designed for remote sensors to communicate with controlling devices. The specification is under a royalty-free licence. Interesting features of the protocol include the one-to-many messaging service (publish/subscribe), the Last Will/Testament feature, and the three qualities of service. You can read more about it here.

The MQTT logo. Image from, acquired 2021-03-30.

The MQTT logo. Image from, acquired 2021-03-30.


MQTT was initially released in a partnership between IBM and Arcom in 1998. As of 2021-03, the latest version is v5.0.

MQTT Brokers

Mosquitto is a very popular open-source MQTT broker.

Online test/sandbox brokers:

  • <>




Mosquitto can be installed on Windows by downloading the pre-compiled binaries. The x64 version will be installed in a path similar to C:\Program Files\Mosquitto. You will likely want to add that directory path to your system path so that you can call mosquitto from the command line.


If you have added the installation directory to your system path, you can invoke mosquitto with:


By default the above command will start a MQTT broker listening on port 1883. The broker will not run as a daemon, so you can stop the broker with Ctrl-C (or equivalent).

You can listen to all system topics by subscribing to $SYS/#.

If you are experiencing problems when running mosquitto, you might want to run in verbose mode -v to print debug information, as by default very little information is printed to the command-line:

$ mosquitto -v

MQTT Clients

Paho is a popular MQTT client.

Related Content:


comments powered by Disqus