How to Install The Mosquitto Broker Windows XP

install mosquitto icon From version 1.5 support for Windows XP was dropped. If you need to install the mosquitto MQTT broker (server) on Windows XP then you will need an older version of mosquitto.

Installing The Mosquitto Broker on Windows

There are two possibilities:

  • Quick Install
  • Standard Install

Quick Windows Install

The problem with the standard install is that there are certain dependencies that need to be installed before you do the mosquitto install.

This involves installing software and copying files from the install into the Mosquitto install folder.

However, if you have already installed Mosquitto on another windows machine e.g. XP and want to install it on another machine e.g. Windows 10 then you can just copy the directory containing the mosquitto files to the new machine.

I copied my windows XP install (32 bit) onto a windows 10 (64bit) machine and a Windows 7 machine and it worked OK.

I’ve created a zipped directory which I’ve used on Windows 10 and Windows 7.

You can download it below

Mosquitto install files for windows are here.

(Updated to Mosquitto version 1.4.14 on 14-jan-2018).

Just unzip it go to the directory and run the broker manually as covered below

Don’t forget to virus check it let me know if you have any problems with it.

Video – How to Install Mosquitto Broker on Windows

Standard Install On Windows XP -Version 1.4.14

As mentioned earlier the big problem with the Windows Install is that there are lots of dependencies that you also need to install or have installed.

However the advantage is that you can install Mosquitto as a service which starts automatically. This is not important for a test environment.

First you will need to download the Windows install files below

I used the cygwin version (not sure of the exact differences ).

Essentially you will run the install twice.

The first time you run it it will warn you of dependencies.

mosquitto-install-windows-errors

However it creates the mosquitto directory and copies files to it.

You then need to copy the additional files to the directory before you run the install again. (full list below)

The the second time you run it it should create the service entry and proceed without errors.

There are good detailed step by step install instructions for windows here.

It is important that you install the addition files, and copy them to the mosquitto directory, if you don’t then when you try to start mosquitto you will get an error message complaining about a missing dll.

mosquitto-windows-install-failed

In the above case it was the cygcrypto-1.0.0.dll.

When you have installed Mosquitto and copied the additional files then this is what the mosquitto directory looks like when finished.

mosquitto-folder-windows

Note 1: above screen shot is missing some files from cygwin as it was installed and the files were in the right path.

Note 2: there is readme-windows.txt file in the mosquitto install directory that you should read

Here is a complete list of additional files that you need:

cygcrypto-1.0.0.dll
cyggcc_s-1.dll
cygssl-1.0.0.dll
cygwin1.dll
cygz.dll
libeay32.dll
libssl32.dll
msvcr100.dll
pthreadVC2.dll
ssleay32.dll

Starting Mosquitto on Windows

If you have installed Mosquitto using the install .exe and ticked the start as service box then the mosquitto broker starts as a service.

This is what you want in a production environment but for testing you will want to start it manually.

To stop the mosquitto server if it is running as a service. go to control panel>admin tools>services.

mosquitto-windows-services

You can stop the broker and change the automatic startup settings so it doesn’t automatically start on Windows start up.

Note: On my install (on XP) it wouldn’t start as a service and gave error code 1053. This wasn’t a problem because I wanted to start it manually anyway.

To start the broker manually open a command prompt and go to the mosquitto install directory and type mosquitto.

mosquitto-windows-start-manual

You can also use various command line switches. Type

mosquitto -h

for help.

mosquitto-help

To start in verbose mode so that you can see console messages use the -v option:

mosquitto-start-verbose-windows

Testing The Install

To test it is running use command:

  • netstat -a

netstat-windows

You should see the Mosquitto broker running on port 1883 as shown in the screen shot above.

The Mosquitto.conf File

The configuration file (mosquitto.conf) that comes with the install is completely commented out, and the MQTT broker doesn’t need it.

However when Mosquitto runs as a service it uses this configuration file.

See Quick Guide to The Mosquitto.conf File With Examples

Mosquitto Logging

If you enable logging in the mosquitto.conf file then when Windows 10 runs as a service it creates this file with restricted permissions, and locks the file while the broker is running.

If you stop the broker you can change the permissions on the file to access it.

If you run the broker manually then again you will need to stop the broker before you can read the log file.

See Understanding and Configuring Logging on Mosquitto

 

Mosquitto Client Scripts

The windows install includes the client scripts.

There is a simple subscriber client

mosquitto_sub

and a publisher client

mosquitto_pub

Use

mosquitto_sub –help

They are useful for some quick tests. See Using The Mosquitto_pub and Mosquitto_sub Client Tools- Examples

Notes:

  • I didn’t get the scripts to work on Windows XP -Error not a vaild win32 application
  • On Windows 7 and 10 they gave an error regarding a missing msvcr100.dll file. I found the file on my system and copied it to the Mosquitto directory and they worked OK.

Mosquitto Configuration Tutorials

Other Related Articles and Resources:

Please rate? And use Comments to let me know more

3 comments

  1. I was wondering how to install The Mosquitto Broker Windows XP but was unable to do so. But, your blog has shown me the proper way of installation with steps and photo print given in it. I really appreciate your hard work and presence of mind.

  2. I would like to get _sub and _pub running on XP – did you ever manage to do this?
    I tried to go back a few levels from the old installs that are on the mosquito.org site, but I get an error invalid entry point into Kernel32 error.
    Thanks,
    Simon

Leave a Reply

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