Installing and using MQTT Lens with Mosquitto

In this post I will try to outline how to use Mqtt Lens an useful chrome extension developed by Sanndro which can help you test the installation done as per my previous post Mosquitto broker installation. MqttLens Chrome Extension

MQTT Lens is a Chrome Extension available to use along with Chrome Browser for the purpose of connecting to a MQTT Broker and test with publish/subscribe scenarios of MQTT Messages. This is a very useful tool to check the connectivity to the MQTT broker and to check various scenarios of publishing and subscribing messages. I have tested this tool myself with Mosquitto and RabbitMQ+Mqtt Plug in scenarios.

In this post we will go through step by step on how to install and configure Mqtt Lens and use it 10 simple steps.

Step 1: Make sure you have chrome browser installed and have internet connectivity.

Step 2: You can click the URL here to go to the extension or chrome app instantly alternatively you can approach the method outline in the the github page of sandro-k (This post will give notes based on the URL provided for chrome extension installation)

Step 3: Once you have the extension installed by clicking the Install or Launch App as given in this blog post

Step 4: Once you have installed it navigate to Chrome App Launcher which would probably in the Windows Task bar as shown in the picture on to your right.Chrome App Launcher

Step 5: Once you click the Mqtt Lens Icon from the chrome app launcher you will see the following screen.

MqttLens Startup screen

Step 6: Before you add the connection ensure the broker is running. For this you might need the information about the broker and make sure the broker service is already running in the Windows with port 1883. You can check this using netstat -an.

Step 7: Now you need to add the Connection. For this you might need the IP address or Hostname, in this example I have provided the IP Address which will be most important parameter and click create connection.

MqttLens add new connection

Step 8: Now once you click create connection you will be taken to the screen where in you will need to provide the publish and subscribe information to test the broker or to work with the broker.

MqttLens Publish Subscribe Example Sensor

Step 9: In the above example you could realize that the # symbol in the Subscribe input box helps you to subscribe to all the content available in the queue to the available. You can look at the data in both Json format or plain text message

Step 10: Information on the message can be obtained by clicking the information button on the right hand side of the message. Screenshot given below:

MqttLens Message Details

You can add more connections and play with Mqtt Messages. Thanks. Please share your view and comments on this post.


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 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:



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.