Presenting the way I learnt it.

Step by step installing and configuring Mosquitto with Windows 7

Mosquitto is a MQTT (MQ Telemetry Transport) broker used for handling lightweight data transfer protocol. This broker is based on open source which implements MQTT v 3.1 and v3.1.1 as I write this post. This Post would be useful for someone who would like to configure Mosquitto in Windows 7 and test it.

Step 1: Download mosquito from the Download section of Mosquitto.org. In this example we will go through the use of the first link which would be native build applicable for Windows Vista and above.

Step 2: It will take you to the Eclipse repository with mirror options through which you can download the exe file.


Step 3: Double clicking the downloaded exe will throw you with the following screen through you might need to download the OpenSSL and pThreads.

Quick Links:

pThreads: ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/dll/x86/

OpenSSL: http://slproweb.com/products/Win32OpenSSL.html

Step 4: Download the Win32 OpenSSL v1.0.2c Light setup file and install it. We need to get couple of DLL files from this installation which we will see it in the subsequent steps.

Pthreadvc2.dll will be found as given below which can right click and save it to the folder you need.

Step 5: The next step would be asking if you want to install the service too, select it and click next

Step 6: Select install location as given below

Step 7: Installation will get progressed once you press Install as given below

Step 8: Now the installation is done, we need to make sure the following files are copied to the folder where Mosquitto is installed.

Dependencies – win32

Required DLLs: libeay32.dll ssleay32.dll (Look for these files in the OpenSSL-Win32 or OpenSSL-Win32\Bin folder)

Required DLLs: pthreadVC2.dll

Important Note: Please ensure that the required DLLs are on the system path, or are in the same directory as the mosquitto executable.

Step 9: You need to reinstall Mosquitto so that it will also configure the windows Services as shown below as it has the necessary pre-requisites now in the folder C:\Program Files (x86)\mosquitto.

Step 10: How to check if Mosquitto broker has started and running? use the command netstat -an from the command prompt

In another post we will see how we can test the Mosquitto on MQTTLens using Chrome Extensions, mosquitto_pub and mosquitto_sub.

82 responses to “Step by step installing and configuring Mosquitto with Windows 7”

  1. jual gamis pria Avatar
    jual gamis pria

    excellent post, very informative. I’m wondering why the other specialists of this sector do not
    notice this. You must continue your writing. I am confident,
    you have a great readers’ base already!

    Like

  2. methaq Avatar
    methaq

    Hi,
    I install mosquitto 1.5.7 on win 7 and make subscribe and publish successfully in local host but mosquitto failed to make connection to ubidot the publish (mosquitto_pub -h “things.api.ubidots.com” -t “/v1.6/devices/plc” -u “9NUybJdaPXDnuujb4DFcZDXsySn5dS ” -p 1883 -q 1 -m ‘{“water level”: 17}’ ) give the result
    “Unable to connect (Lookup error.).” and when tring “mosquitto -c configfile” the result is
    ” Error: Unable to open config file
    Error found at configfile:0.
    Error: Unable to open configuration file”
    I need to connect MQTT to opc server for connect my plc to IoT.
    When make mosquitto -v I get this messges:
    C:\Program Files\mosquitto>mosquitto -v
    1550907715: mosquitto version 1.5.7 starting
    1550907715: Using default config.
    1550907715: Opening ipv6 listen socket on port 1883.
    1550907715: Error: Only one usage of each socket address (protocol/network address/port) is normally permitted.
    I need help.

    Like

  3. mosquitto 64bit 版を Windows にインストールする | コーヒー飲みながら仕事したい Avatar
    mosquitto 64bit 版を Windows にインストールする | コーヒー飲みながら仕事したい

    […] Step by step installing and configuring Mosquitto with Windows 7sivatechworld.wordpress.com […]

    Like

  4. Naveen Kumar Avatar
    Naveen Kumar

    I am getting this error

    PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\\xampp\\php\\ext\\mosquitto.dll’ – The specified module could not be found.\r\n in Unknown on line 0

    Like

  5. Arduino und MQTT – Einstieg ins Internet der Dinge (IoT) – Arduino Tutorial

    […] steiniger. Man muss nämlich neben dem eigentlichen Installer einige dll-Dateien hinzufügen. In diesem Tutorial ist die Installation aber sehr anschaulich […]

    Like

Leave a comment