Presenting the way I learnt it.

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.

16 responses to “Installing and using MQTT Lens with Mosquitto”

  1. Step by step installing and configuring Mosquitto with Windows 7 | Sharing of tech stuff

    […] another post we will see how we can test the Mosquitto on MQTTLens using Chrome Extensions, mosquitto_pub and […]

    Like

  2. Mosquitto mqtt Message Broker auf der Synology | webdevign

    […] brauch es einen Client. Ich verwende die Chrome Erweiterung MQTTLens. Wie man damit umgeht, ist hier so gut beschrieben, dass ich dazu selber nichts schreiben […]

    Like

  3. Guest Avatar
    Guest

    thanks

    Like

  4. hermann Avatar
    hermann

    hello , thanks for the tutorial.

    i dont know why i am having a disconnected session.

    help please 😉

    Like

    1. vishal yadav Avatar
      vishal yadav

      yes, I have also disconnected session even in cmd its showing port 1883 is listening.
      and in my MQTTLENS there is no “hash password with Mdi” dialog box.

      Like

  5. Htet Myat Avatar
    Htet Myat

    Thank you so much…

    Like

  6. Emillio Avatar
    Emillio

    Hello Friend.
    Thanks a lot for this tutorial!
    I made all the steps above and now I’m able to subscribe and publish messages with the MQTT lens, but I also want to connect to the broker with my mobile phone using some App from the Play market. This is never working for me and I receive error connection failed on the App.
    Do I need to configure something else to make everything working?
    Thanks in advance!

    Like

    1. seesiva Avatar
      seesiva

      I’m not sure of the network you are in. Check if you have any firewall restriction going on.

      Liked by 1 person

  7. Amit Adhikaree Avatar
    Amit Adhikaree

    Why you set the broker address to 192.168.10.123 whereas your broker is listening at 0.0.0.0:1883 as per your previous tutorial.

    It is not working on my PC with both the address 192.168.10.123 or 0.0.0.0. Mosquittoo broker is running though.

    Like

    1. seesiva Avatar
      seesiva

      You need to check the ip address of the machine accordingly you need to set it up.

      Liked by 1 person

      1. Alex Avatar
        Alex

        Thank you Seesiva for all your interesting and useful tutorial.
        How can I change the 0.0.0.0 Mosquitto IP address to the mine PC’s one?
        Thank you in advance for your help!

        Like

      2. seesiva Avatar
        seesiva

        Ensure you have static ip with your system. Also evaluate if its listening in the port using netstat -an

        Liked by 1 person

  8. vishal yadav Avatar
    vishal yadav

    thanks for this blog but I have disconnected session even in cmd its showing port 1883 is listening.
    and in my MQTTLENS there is no “hash password with Mdi” dialog box.

    Like

  9. Manisha Sangle Avatar
    Manisha Sangle

    Thank for so easy to follow tutorial. Really helpful!
    Is there any tutorial showing how I can access my broker over internet since I need message at different location? port forwarding?
    Also can I have one client to publish the message and broker on same machine?

    Like

  10. Sohaib Avatar
    Sohaib

    Hello: I wrote my IP adress in the tcp but even it sazs disconnected. What could be the problem? Thanks

    Like

Leave a comment