MQTT is a low level messaging protocol which can be used to bind services together. It is typically used in a sensor network to send sensor data from a device such as an Arduino or a Raspberry Pi which has been configured to send out this data, there are many tutorials on the setup of either of these devices which can be found here for Arduino: and here for Raspberry Pi: http://rasspberrypi.

Before we can use the MQTT server on the disk image we must first install what is called an MQTT client. This is a program which can either publish messages or subscribe to topics. Think of a topic as a postbox for your messages. To get a client we have to follow some different instructions depending upon what operating system you are using.

For more information on MQTT please visit:

Installing Clients


Windows is unfortunately the hardest of the 3 systems to configure, you will first need to grab the 2010 Visual C++ redistribute and install that from Microsoft. You may already have it installed but chances are you won’t. Head on over to: to download the necessary files and install them.

Once the Redistribute is installed you have to install the Mosquitto Windows Client from the downloads page http: // The direct link is: 2.3-install-win32.exe however chances are this will change with time. Once installed you’re all set.

To run the program you will have to open a command prompt. Click Start and type cmd then enter. A black box will pop up and you need to type this to get to the program:


This is slightly different to the other systems as you have to write the whole command not just the end bit, remember this when you follow the usage instruction.


On Mac it is a pain to install mosquitto. If you already have apple developer tools installed it’s pretty easy but the need for the dev-tools is a real pain. To test if you need the developer toolchain open your terminal (Type terminal into spotlight) and type gcc and press enter. if it gives a bash error then you will need the dev-toolchain, if not then you probably already know what to do from here.

To install the dev-toolchain you will need an Apple account (free) and be signed up as a developer. Login (or Register) here:

Once you are logged in you need to download and install the command line tools for your platform. 

When this is ready you can move on to homebrew. You will first have to install homebrew with this command in the Terminal. To open terminal type Terminal into Spotlight and hit enter. Once there enter:

Once homebrew is installed you just have to install mosquitto like this:


Linux users have by far the easiest install here, to install mosquitto simply type:

BOOM, Done.

Usage of MQTT Client

Now we have the clients installed we can finally get round to sending and receiving some messages. First things first, open 2 terminal windows on your computer, one will be a publisher and one will be a subscriber.

In the first window type:

In the second window type:


With any luck (Assuming you connected to the correct server), you should now have Test Message written on your second terminal. You have now sent a message via the internet between two machines. This is a simple concept but is very powerful. You could make your own chat client with this or link it with Node-Red later to have the machine send a text message everytime you send a message. The full power of MQTT comes however from linking it up to a platform such as Arduino or Raspberry Pi which would automate the sending of these messages. You can get the Arduino to send sensor values every 2 minutes and then code a flow where for example if a sensor was triggered a text could be sent alerting you to the presence of a burglar in your house. Now you can begin to understand the power of this technology in releasing Open Data from systems which previously were not accessible.