MQTTLens - HiveMQ MQTT Toolbox
Written by Sandro Kock
Category: MQTT Toolbox MQTT
Published: March 2, 2016
|Operating Systems||Windows, Linux & MacOSX|
|Website||Chrome Webstore: MQTT Lens|
During the Google Summer of Code 2014 I had the opportunity to work for the Eclipse Paho project, the result is MQTTLens. At the beginning I had a lot of very good ideas on how the ultimate MQTT utility should look like - with an integrated MQTT broker to script and emulate different IoT application scenarios. At the end the focus was put on simplicity. With one click - MQTTLens can be installed via the Google Chrome Web Store. Making it easy and convenient to get started.
|MQTT over TCP|
|MQTT over Websockets|
MQTTLens is started via the Chrome App Launcher
|A new connection can be added via the symbol in the top left corner.|
The screenshots below show the necessary steps to connect to the iot.eclipse.org MQTT-broker, with the following credentials:
- Connection name: e.g. MQTT Dashboard or iot.eclipse.org
- Protocol: tcp:// (default)
- Hostname: iot.eclipse.org
- Port: 1883 (default)
Optionally a color scheme can be assigned to every connection.
With a click on CREATE CONNECTION  the connection is saved and automatically established.
After a new connection is added to MQTTLens the connection and its status is displayed on the left. On the right subscriptions to topics can be added and messages can be send via the connection.
Subscriptions can be established to any topic , wildcards like + and # are supported. Depending on the support by the MQTT-broker, the QoS  can be set to 0, 1 or 2. With a click on the »Subscribe« button, the subscription is made at the MQTT-broker. Messages to subscribed topics are displayed below the »Subscriptions« heading. Each message that was received and matched to a subscription is displayed below the topic. By default MQTTLens displays the last five messages received to a subscription, to show more ore less messages the – or + icon can be clicked. When MQTTLens receives a message a timestamp of the local machine is saved with the message and displayed in addition to the topic, QoS and message payload.
Currently the payload of a message is parsed to a UTF-8 String by default. If the message is a JSON-Object, the output is formatted, to make is easy to read the message.
To publish a message to a topic - the topic , QoS  and the message  can be set. With the current MQTTLens version that is available via the Chrome Store it is not supported to retain a message at the MQTT-broker. A beta version of MQTTLens is available at Github that can be installed manually in Chrome, that supports retained messages. But it is planed to publish that version soon!
For every click on Publish  a MQTT-message is send to the MQTT-broker.
MQTTLens supports to connect with the Last-Will-and-Testimony (LWT) set in the MQTT-connect packet. When creating a new connection, the LWT can be set in the »Last-Will« section, by expanding the view with a click on the (v) icon in the connection wizard. The LWT topic , message payload , QoS  and retain flag  can then be set before creating the connection.