- MQTT Client Tools — The Seven Best Tools
- Written by The HiveMQ Team
- Category: MQTT MQTT Client
- Published: July 15, 2019
- MQTT.fx
- mqtt-spy
- MQTT Inspector
- MyMQTT
- HiveMQ Websocket Client
- MQTT Lens
- mosquitto_tools
- Others
- Summary
- About The HiveMQ Team
- mqtt-spy — HiveMQ MQTT Toolbox
- Written by Kamil Baczkowicz
- Category: MQTT Toolbox MQTT
- Published: January 11, 2016
- Short profile
- General information
- Design goals
- MQTT compatibility overview
- Unique features
- Usage
- Start Up
- First steps
- Connecting to an MQTT broker/server
- Simple subscription
- Simple publication
- Message browsing
- Message searching
- Topic summary
- Statistics
- Exporting data
- User interface customisation
- Charts
- Advanced configuration
- Eclipse Paho
- Contributions and UNICEF donations
- What’s next…
- About Kamil Baczkowicz
- Thanks for this guest blog post
MQTT Client Tools — The Seven Best Tools
Written by The HiveMQ Team
Category: MQTT MQTT Client
Published: July 15, 2019
Everybody from MQTT beginner to expert needs a handy tool to try out stuff or for debugging. A while ago we had already taken a look at such tools, but since then a lot of new tools have emerged, which definitely justifies an update on that topic. The goal of this blog post is to give a brief overview of the best MQTT client tools for different platforms and highlight special features.
We from HiveMQ are very active in spreading the word about MQTT at conferences in Germany & Europe and to the whole world over the internet. So we often demonstrate and explain how MQTT works and what its benefits are. Also during the further development of HiveMQ and when implementing IoT solutions for customers, we need tools to publish and subscribe to different topics easily. These are only 2 use cases out of many others where a MQTT client tool comes very handy and is often inevitable. Due to the particular suitability of MQTT for mobile devices, tools for mobile platform are as important as desktop versions.
So there’s definitely a right to exist for tools on different platforms and we will directly jump into our top 7 in no particular order.
The MQTT CLI is an open-source Java MQTT client tool that enables you to interact quickly and easily with any MQTT Broker in various ways. The CLI gives you a single compact tool for the most important client operations (PUBLISH and SUBSCRIBE). The CLI tool also provides an interactive and comfortable SHELL mode that enables you to work with multiple MQTT clients in parallel and supports connection handling. The MQTT CLI supports all MQTT features for MQTT Version 5 & 3.1.1. The tool uses the HiveMQ-MQTT client library, which is a fast, low-overhead, high-throughput, and modern MQTT library written in Java. The MQTT CLI comes in various binary packages that can be downloaded from the documentation homepage on GitHub.
HiveMQ has released the HiveMQ MQTT Client, a Java library that is available under the Apache license on GitHub. This new MQTT client is compatible with MQTT 3.1.1 and MQTT 5. It is designed for high-performance so it is very useful for server-side MQTT clients that integrate enterprise systems. The client features a reactive, blocking and non-blocking API. Download if for free from the HiveMQ Github repo.
MQTT.fx
(available for Win/MacOSX/Linux, MQTT.fx, free)
MQTT.fx — Broker status via $SYS-topics
MQTT.fx has been around since 2014 and built its fan base in our team. It comes with the portability of the Java VM and a quite impressive feature set. MQTT.fx is implemented with JavaFX, which is quite obvious, when opening the tool for the first time. Due to the native packaging available for JavaFX, there are binaries for Windows, MacOSX and Linux, which makes the installation a breeze. But lets have a look at the MQTT part. Besides standard publish/subscribe functionality it provides support for $SYS topics and connection profiles for connecting to different brokers. Especially the $SYS topic support is awesome, it helps to inspect the internals of the broker from time to time. We haven’t seen that kind of displaying in another tool. The connection profiles allow the configuration of connection options like client id, SSL/TLS, username/password and Last Will and Testament. Another functionality which has been introduced in one of the last releases is scripting. This makes the simulation of different sensors, etc. easily possible. Just for the record, there are also a few small things, which sometimes makes the user experience inconvenient. For example the publish/subscribe functionality is separated in two tabs, which results in constant switching the tabs. Update: It is possible to view publisher and subscriber at the same time by detaching one of the tabs. Also here and there small bugs occur. But regardless of these little things, the listed features makes it definitely one of the best choices, when experimenting with MQTT at the moment.
mqtt-spy
mqtt-spy publish/subscribe (source: github.com/eclipse/paho.mqtt-spy)
mqtt-spy has been around since 2014 and as of early 2016 is part of Eclipse Paho and Eclipse IoT. It ships as a JAR file and runs on top of Java 8 and JavaFX. MQTT-Spy has a very nice way of displaying the basic MQTT publish/subscribe mechanism. It makes it easy to publish and subscribe at the same time and there are different tabs for connections to several brokers. The different areas of the pub/sub window (publish, new subscription, subscription & messages) can be closed down to make room for the currently used ones. Its search functionality allows to find and filter the often heavy load of MQTT messages running through such a tool. Another handy feature is that it logs every published and received message in the standard output and also into a file. So it is easy to open the file in any text editor and make deeper analysis of the messages, which is often necessary when dealing with many MQTT messages. It also comes with advanced features like scripting, filtering & searching, decoding & formatting received messages and graphing/charts. It’s a sophisticated tool for the day-to-day usage.
MQTT Inspector
MQTT Inspector on iPad (source: jpmens.net/2013/11/19/mqtt-inspector-for-ios/)
The MQTT inspector is a really great tool for any iOS device. It is especially suited for power users. It is possible to create and store connection options, similar to most of the other tools. But this tool also allows to pre-configure publishes and subscriptions as templates. After connecting to the broker a simple click activates a subscription or triggers a publish. Therefore it is good to know beforehand to which topics MQTT Inspector should publish or subscribe to. Of course it is possible to change this during an open connection. As a power user tool it allows to switch between a simple message feed, a view grouped by topic and a low level view.The low level mode shows low-level MQTT command messages and some basic data plus its representation in hex. Another functionality allows to filter the message by their topic, attributes or payload. This is very handy when a lot of messages arrive and only some of them are of interest. As soon as you have understood the handling of MQTT inspector there’s no way it wouldn’t make it onto your iOS device.
MyMQTT
MyMQTT Android App (Picture from Google Play Store)
The Android App MyMQTT can be installed via the Google Play Store. It is a useful app that has basic publish and subscribe capabilities. A functionality which differentiates this app from others is its ability to store messages on the phone. These are shown in the menu under “Stored Messages”. The app is still under development and essential features like different quality of service levels, Last Will and Testament as well as retained messages are missing. However, the last update is almost one year old. So hopefully the announcement of the new MQTT standard this September will bring a new version of this useful app for Android.
HiveMQ Websocket Client
_HiveMQ Websocket Client_
The HiveMQ Websocket Client is a simple and clean tool made by us while implementing the native websocket support for HiveMQ. After websockets were introduced in HiveMQ, we decided to improve this app a little bit and made it available to everybody as open source. This application is also a perfect starting point to build your own app with the Eclipse Paho JavaScript library. It is a full-fledged MQTT client, which supports all common protocol features except persistent session. The visualization of the different subscription is colorized and the predefined defaults make it possible to publish and receive a message with 3 clicks and no input (Connect, Add new Topic Subscription, Publish). It can also connect to local brokers, when using a local IP address or hostname. The tool particularly comes handy when a MQTT connection over Websockets should be tested or a tool is needed without prior installation. Of course the HiveMQ websocket client works in every modern browser and on most operating systems, including iOS and Android.
MQTT Lens
MQTT Lens — pub/sub view
MQTT Lens is also a quite new project, which was developed during the Google Summer of Code 2014. It can be easily installed through the Google Chrome App Store. The tool has a pretty clean interface and supports all the available connection options from the MQTT spec, except persistent sessions. It accepts connections to more than one broker at the same time and colors them differently for easy association. The interface for subscribing, publishing and seeing all received messages is simple and easy to grasp. Sadly there is no possibility to publish retained messages. But although this app is installed via Chrome, it runs as standalone application and can also connect to brokers via the plain MQTT port 1883, which can’t be done by pure JavaScript Web clients. A nice feature is the display of JSON payloads in a pretty way. In summary, MQTT Lens is particularly well suited for people who need basic pub/sub functionality without having power user needs.
mosquitto_tools
Nowadays with all the fancy client tools, there’s still a place for the mosquitto publish and subscribe tools. They are still the best option on a headless server for verifying the correct installation of a MQTT broker and doing other MQTT tests. The feature set is complete and it is ideal for devops, power users or everybody else who loves to work with the console.
Others
There are also other tools, which we didn’t cover in this post, they can be found on the official MQTT website. The following have also been covered in our earlier post:
- MQTT.app (MacOSX)
- SimpleMessage (MacOSX)
Summary
To sum things up, since the last time we had a look at MQTT client tools, the MQTT tool landscape has changed a lot and there are some really great new tools to get started with MQTT and for everday use.
What’s your favorite tool out there? Did we miss your favorite MQTT tool in this top 7 list? Tell us in the comments!
About The HiveMQ Team
We love writing about MQTT, IoT protocols and architecture in general. Our experts are here to help, so reach out to us if we can help!
Contact us
mqtt-spy — HiveMQ MQTT Toolbox
Written by Kamil Baczkowicz
Category: MQTT Toolbox MQTT
Published: January 11, 2016
Short profile
General information
mqtt-spy is probably one of the most advanced open source utilities for publishing and monitoring activity on MQTT topics. It is aimed at two groups of users:
- innovators who need a tool for creating IoT prototypes or integration projects*
- power users who need an advanced utility for their work environments*
Hopefully after reading this and following blog posts (yes, there will be more!) you will be able to see if mqtt-spy is for you or you would be better off with one of the great alternatives out there.
Including this, there will be 3 blog posts about the “mqtt-spy” family:
this post gives an overview of the mqtt-spy GUI utility
the second post will cover mqtt-spy-daemon (the headless/console-based version of mqtt-spy) and its integration capabilities
the last post will cover some of the advanced features of both mqtt-spy and mqtt-spy-daemon, including:
advanced publications (scripting)
subscriptions and advanced processing capabilities (formatting, scripting, advanced searching)
message logging, replay and off-line browsing
automated testing & test cases
Design goals
The project was started in early 2014 with the aim of simplifying development and test activities for MQTT-based systems. Particularly those that generate at least a few hundred messages per second and use custom message envelopes with either encoded, signed and/or encrypted payloads.
The first design goal was to make it useful for debugging and fault investigation — to sieve through hundreds or thousands of messages arriving each second that spread across tens or hundreds of topics — and still being able to find the ones of interest.
The second design goal was to make mqtt-spy as much user-friendly as possible while retaining its advanced capabilities. To help you with finding your way around it there is an extensive wiki available on the project’ home page.
MQTT compatibility overview
Feature | Available |
---|---|
MQTT 3.1 | |
MQTT 3.1.1 | |
LWT | |
SSL/TLS | |
Automatic Reconnect | |
MQTT over TCP |
Feature | Available |
---|---|
QoS 0 | |
QoS 1 | |
QoS 2 | |
Authentication | |
Scripting | |
MQTT over Websockets |
Unique features
This brief section lists some of the unique features of mqtt-spy and what makes it different from other tools:
- Support for multiple concurrent connections
- Automatic reconnection and multiple server URIs
- Advanced TLS/SSL support with all common key store types: JKS, JCEKS, PKCS12 and BKS
- Summary of all topics & messages received for each of the subscriptions – with topic searching and filtering
- Browsing, searching and filtering on received messages – easily handling 100s of messages per second
- Message content formatting to support custom message envelopes (e.g. encoded, signed and/or encrypted payload)
- Message log – an audit file can be created for all received messages; this could be used for replay or off-line browsing and analysis
- Export of topics and messages, including support for large binary files
- Perspectives and customisable pane visibility (hidden, collapsed, expanded, detached to a separate window)
- Processing statistics – messages per second over 5s, 30s and 5m intervals, plus the overall number of topics and messages received
- Charts with pan and zoom – for message payloads and statistics
- Automated testing with test cases
Usage
Start Up
mqtt-spy is made available for download as an executable Jar file. This means it requires an appropriate version of the Java Runtime Environment to be installed on your operating system. Once downloaded, just double click on the Jar file and mqtt-spy should start.
It is also possible to start mqtt-spy through the command line, run it with a specific version of Java (not just the default) or run it with additional libraries — see Getting Started for more details.
First steps
Every time you open mqtt-spy you are going to see the control panel (see below). It gives you a quick summary of the configuration that’s been loaded (first two sections), the update status (checked at start-up) and some basic statistics about usage.
When using mqtt-spy for the first time, it is recommended you create a configuration file with sample content – this will give you a list of public MQTT brokers/servers to which you can just connect and start experimenting with. You can also re-create the configuration file at any point from the “Configuration” menu.
Click on the “No configuration file found” info to bring the configuration wizard (or do if from the “Configuration” menu):
For new connections or to charge configuration of the existing ones go to the “Connections” menu.
Connecting to an MQTT broker/server
When you have you connection configured, there two ways to connect to an MQTT broker/server:
- From the “Manage connections” window (Menu -> Configuration -> Manage connections), by clicking on the “Open connection” button
- From the “Control panel”, by clicking on the button with the name of your connection
Once opened, a new connection tab will appear.
To indicate secure connections, there are two icons available (if not enabled, they are not shown):
- User authentication enabled
- TLS/SSL enabled
Another important bit is the tab colour:
- Grey: no connection attempt yet
- Yellow: connecting
- Green: connected
- Red: couldn’t connect / connection lost
The connection tab’s tooltip gives additional information about your connection (where applicable): connection status, last update, number of connection attempts, last error, authentication status, TLS/SSL status.
The last important aspect of the connection tab is its context menu, giving you access to broker’s statistics and various UI settings.
Simple subscription
OK — now let’s take a look at subscriptions and how to receive messages. To create a subscription, put the subscription topic (can include wildcards like + or #) into the Topic field and either hit Enter or click the Subscribe button.
This should create a new subscription tab, in which you will see all received messages matching this subscription.
Again, the subscription tab has got a context menu, which gives you access to some of the key features like charts.
To select the QoS for the subscription, make sure you change to a detailed perspective (Menu -> Window -> Change Perspective).
Simple publication
With a subscription now in place, we can try publishing a message. Put your publication topic and the payload you want to send, and click the Publish button.
This should result in a message being published, and if it matches your defined subscription, you should see a message in the subscription tab.
To select the QoS for the publication, make sure you change to a detailed perspective (Menu -> Window -> Change Perspective).
Message browsing
mqtt-spy takes a different approach to message browsing. Rather than displaying the received messages as a graphical list, only one message is shown at a time. By default, the latest/newest message is shown – this gives you an insight into what’s going on on the browsed topic(s). You can disable showing the latest by deselecting the “Show latest” checkbox.
You can navigate to the message you want to see in a number of ways. You can either use the navigation buttons, mouse scroll when over the message index field or the navigation keys (up/down arrows, page up/down, home/end) when having focus on the index field. This is to allow you to look at messages in real-time, or messages received at certain points in time, even if you are receiving hundreds of them per second.
What is important to remember is that mqtt-spy keeps buffering the received messages so that you can inspect them at a later time. By default, this is the newest 5000 messages per subscription. This means that when you hit the limit, old messages are deleted, and newly arrived ones are added. The latest has always got the index of 1.
Note: in the future, there will be an alternative to the “one message at a time” — it will be possible to display received messages as a list — in a similar way to how the search results are displayed.
Message searching
Apart from just browsing the received messages, you can also search for them. To do this, click on the Search button, create a new “search tab”, and put it the text you want to find in the payload. You can make the search case sensitive, and enable auto-search, so that when new messages arrive, they will be matched against your search criteria. Once happy with the search options, hit Enter or click the Search button — this will trigger search results being displayed.
The 3rd blog post will cover the advanced search: with script files and inline search scripts.
Topic summary
Apart from the message browser, each subscription tab also has a summary of the received topics and messages. This summary is effectively a list of all topics matching the defined subscription. Each entry in the table also shows you the last message received, total number of messages currently stored for that topic, and time of last message.
The topic list also acts as a selection criteria to what messages to browse in the message browser pane. As an example let’s assume we are receiving messages on 3 topics that match a single subscription. If you are only interested in the first topic, you can deselect all other topics in the Browse column, and the message browser will then only show you the messages for the selected topic.
If you are not sure about what’s the exact topic string, you can search for it in the provided text field – this acts as a filter for the table, but doesn’t change your browsed topics.
The topic summary table also gives you access to more charts and browsing options via the context menu – right click on any of the topics to see all options.
Statistics
There are three types of statistics that mqtt-spy gives you access to:
- Aggregated processing statistics — available on the Control Panel – keep clicking on the panel to wiz through all stats
- MQTT broker statistics — accessible through the connection tab’s context menu – these depend on the specific MQTT broker (some brokers don’t offer this feature so you might see nothing)
- Real-time processing statistics referred to as “load” – this is available for each of the subscriptions, and for all subscriptions combined – you will find it in the right hand side of the “Received messages summary” pane title – provided as an average over the last 5, 30 and 300 seconds
Exporting data
There are three ways of exporting data from mqtt-spy:
- Copying individual elements like the payload or a topic to the clipboard * From the message browser window (by selecting and copying the values manually) * From the summary table (by using the context menu)
- Using the export functionality (Tools button -> Export), which allows you to export various lists of topics or messages * Current or all browsed messages (available options: clipboard, message log format, binary — could be used for (large) files, e.g. images) * Currently browsed topic, all browsed topics, all filtered/searched topics or all topics – all go to the clipboard — Message log (to be covered in the 3rd blog post)
User interface customisation
There are a few ways of customising the user interface to suit your needs or typical usage.
First — there are perspectives. These are pre-configured sets of visible panes or level of detail.
Second — each connection tab can be customised individually. Right click on the tab and select the View menu. This gives you access to all the options like switching between detailed and simplified views, making the message pane resizable, detaching the connection tab and hiding/showing the individual panes.
Third — you can manually resize the split between the message pane and summary pane. You can also hide/detach panes – see the small “settings” button in the right hand side of the pane title.
Worth a mention is that mqtt-spy will also automatically remember the size of the main application window, so the next time you run it — the size will be as you left it.
Charts
Charts are one of the unique features of mqtt-spy. There are two categories of charts available:
- Message processing charts (e.g. number of messages received, size, etc.)
- Message payload-based charts (e.g. plotting temperature readings on 3 topics)
Advanced configuration
mqtt-spy allows you to configure or enable the following features, independently for each connection. All can be changed by going to Menu -> Connections -> Manage connections:
Eclipse Paho
For all its MQTT connectivity, mqtt-spy uses the Eclipse Paho Java client – a rock-solid library allowing applications to connect to any MQTT-compliant broker.
As of January 2016, mqtt-spy & mqtt-spy-daemon are also part of Eclipse Paho & Eclipse IoT.
Contributions and UNICEF donations
All contributions to the project are very welcome! Whether it is a bug report, a feature request, a bug fix, a feature implementation or just a suggestion – they are all very much appreciated. Get in touch via the GitHub page or Twitter.
What’s next…
Next week the MQTT Toolbox will look at mqtt-spy-daemon, the headless (console/command line-based) version of mqtt-spy. You can subscribe below to get notified as soon as the next blog post is available.
About Kamil Baczkowicz
Thanks for this guest blog post
Kamil is a Technical Architect at Resonate. He’s been working with MQTT and other messaging technologies since 2009 as part of the IECC Scalable development programme — the leading railway signalling control system in the UK.
Website В В
Contact Us