MQTT Toolbox – MQTT.fx

Guest blog post by: Jens Deters

Short Profile

TypeGraphical user interface, JavaFX-based
LicenseApache 2.0 license
Operating SystemsMac OSX, Windows and Linux
Websitehttp://www.mqttfx.org/

General Information

MQTT.fx aims to be an quick and easy to use desktop tool for MQTT debugging and testing.
Since about 2 years it is continuously extended (and bug-fixed) by Jens Deters.

Recently version 1.0.0 was released, including:

  • Connection Profiles for different setup of MQTT broker connections
  • ad-hoc connections
  • publish / subscribe
  • username/password authentication
  • SSL/TLS support
  • clipboard for predefined messages
  • $SYS-Topics / Broker Status (HiveMQ & mosquitto)
  • proxy-support
  • stored history of last used topics (per profile)
  • Scripting support via Nashorn Engine
  • logging console
  • bundled installers for all platforms
  • update check
  • Free! (Apache 2.0 license)

MQTT.fx is the recommended tool for Amazon Web Services IoT quickstart.

Furthermore there is a tutorial by Lady Ada to use MQTT.fx as
Desktop MQTT Client for Adafruit.io.

Website: http://www.mqttfx.org/

Twitter: @mqtt_fx

Main Window

At the top of the main window you find the options to edit the broker connection profiles and to connect / disconnect to a broker based on the chooses method (ad-hoc or via profile).

mqttfx_gui_main

Each major use case has its own tab:
Publish, Subscribe, Scripts, Broker Status, Log.
The Tabs are detachable so each tab content can be separated in a window. So a „publish“ windows can be placed next to „subscribe/receive“. If you close such a window it is moving back as a tab at the former position.

mqttfx_detached_tabs

Connection Profiles

Different setups for re-usable broker connections can be defined (and stored). E. g. you can easily setup up different profiles for the same broker connection either with or without security settings.
Profiles can be edited and are identified by a unique chosen name.
The profile editor can be opened either via the menu entry „Extras/Connection Profiles“, via keyboard shortcut ( or the gears icon in the main window:

mqttfx_connectionprofiles_1

All kind of settings for broker connections can be defined here: „broker address“ and „broker port“, client id and common values like „clean session“ and the MQTT protocol version…

mqttfx_connectionprofiles_2

Broker Connection

To connect to a broker there are basically two options: ad-hoc or via the profile.
The ad-hoc connection allows to establish a broker connection by the entered host address and port to connect via profile the connection is made based on the chosen profile.

mqttfx_connect_profile

mqttfx_connect_ad-hoc

Publish

Messages are published via the „Publish“ tab.
Once the broker connection is established, the topic to publish can simply be entered in the drop-down field. The big text area contains the message body a click in „Submit“ sends the message to the broker.

mqttfx_publish_clipboard_1

Messages can also be stored by name on a clipboard for re-usage.
A stored message is then send my just a click on the named button.
Intro Clip

mqttfx_publish_clipboard_2

Subscribe

Topic subscriptions can be made via the „Subscribe“ tab. Like in the „Publish“ context, the wanted topics is to be entered in the drop-down-field and subscription is done via the „Subscribe“ button.

Subscribed topics are stored in the application configuration for later usage and can me chosen from the drop-dow list.
Registered topics are listed on the left in the „Subscribe“ tab and can be unsubscribed by click on the „-“ icon (or by being selected and a click on „Unsubscribe“).
For better identification a color can be set for each topic. Received messages are colored according to the chosen topic color.

mqttfx_subscribe

Scripts

MQTT.fx has a scripting interfaces to allow programmed MQTT message handling via the Java8 Nashorn JavaScript Engine. The scripting is dedicated to e.g. simulate published sensor data.
The current API of the provided „mqttManager“ supports publish(), subscribe(), unsubscribe(), Logging and output to the console.

mqttfx_scripting_3

mqttfx_scripting_2

mqttfx_scripting_1

Broker Status

Some brokers are supporting sending messages to a certain topic hierarchy stating with „$SYS“ to provide internal status information like via „$SYS/broker/version“ the broker version can be get or the broker uptime is provided via „$SYS/broker/timestamp“.
Currently MQTT.fx supports HiveMQ and mosquitto.

mqttfx_broker_status_1

Log

The „Log“ tab shows the logging console.
The same information is also written to the mqttfx.log file located in the application configuration folder.

mqttfx_log_1

Download and Installation

Bundled installation packages for Mac OSX, Windows and Linux are available at http://www.mqttfx.org.

mqttfx_mqttfxorg_1

“Bundled” means, the Java Runtime Environment to run the application is already included by the Installer, so no pre-installed JRE is needed. The bundles JRE is used only to run MQTT.fx. It is not installed on the System.

mqttfx_install_1

Updates

The application is checking for available updates during start-up and prompting the user:

mqttfx_updates_1

Loadable packages are listed, loaded and installed via the download dialog:

mqttfx_updates_2

Author Information

Jens_Deters_cc_profil_center_w250px
Jens Deters
Jens Deters started with (home-) computing about 25 years ago. During the last 15 years he owned several roles in the IT & Telecommunication sector (Software Developer, Trainer, Consultant, Project Manager and Product Manager).

His major passion is still developing software. Today he works as a Senior IT Consultant and at codecentric in Germany. He regularly blogs about his projects to contribute to the JavaFX- and IoT-Community www.mqttfx.org. Jens is also member of the NetBeans Dream Team.
  Website

5 comments

  1. Darshan BC says:

    Please post some example code to use mqtt.fx using Python

    1. If you’re looking for scripting possibilities for MQTT.fx, this blog post could help you out: http://www.hivemq.com/blog/mqtt-toolbox-mqtt-fx-extras

      Python is as far as I know not supported by MQTT.fx currently.

      Hope this helps,
      Dominik from the HiveMQ Team

  2. Bob Weber says:

    Hi. I installed MQTT FX on ubuntu 16.04, but it fails to run, with the error:
    Caused by: java.lang.NoSuchFieldException: TTF_PATH
    at java.lang.Class.getField(Class.java:1703)
    at de.jensd.fx.glyphs.GlyphsFactory.getPathToFontFromClass(GlyphsFactory.java:52)

    I’ll use it in a windows VM for now. Thanks.

    1. Symbls says:

      I also met the problem.
      My system version is ubuntu 16.04, and mqtt fx version is 1.3.1

  3. wangsir says:

    I met the same problem on win10 x64.
    java.lang.RuntimeException: java.lang.NoSuchFieldException: TTF_PATH
    at de.jensd.fx.glyphs.GlyphsFactory.getPathToFontFromClass(GlyphsFactory.java:55)
    at de.jensd.fx.glyphs.GlyphsFactory.(GlyphsFactory.java:39)
    at de.jensd.shichimifx.refuel.RefuelItemTile.init(RefuelItemTile.java:107)
    at de.jensd.shichimifx.refuel.RefuelItemTile.(RefuelItemTile.java:85)
    at de.jensd.shichimifx.refuel.UpdatePane$ItemListCell.updateItem(UpdatePane.java:108)
    at de.jensd.shichimifx.refuel.UpdatePane$ItemListCell.updateItem(UpdatePane.java:98)
    at javafx.scene.control.ListCell.updateItem(ListCell.java:471)
    at javafx.scene.control.ListCell.indexChanged(ListCell.java:330)
    at javafx.scene.control.IndexedCell.updateIndex(IndexedCell.java:116)
    at com.sun.javafx.scene.control.skin.VirtualFlow.setCellIndex(VirtualFlow.java:1957)
    at com.sun.javafx.scene.control.skin.VirtualFlow.getCell(VirtualFlow.java:1797)
    at com.sun.javafx.scene.control.skin.VirtualFlow.getCellLength(VirtualFlow.java:1879)
    at com.sun.javafx.scene.control.skin.VirtualFlow.computeViewportOffset(VirtualFlow.java:2528)
    at com.sun.javafx.scene.control.skin.VirtualFlow.layoutChildren(VirtualFlow.java:1189)
    at javafx.scene.Parent.layout(Parent.java:1087)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Scene.doLayoutPass(Scene.java:552)
    at javafx.scene.Scene.preferredSize(Scene.java:1646)
    at javafx.scene.Scene.impl_preferredSize(Scene.java:1720)
    at javafx.stage.Window$9.invalidated(Window.java:846)
    at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:109)
    at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:144)
    at javafx.stage.Window.setShowing(Window.java:922)
    at javafx.stage.Window.show(Window.java:937)
    at javafx.stage.Stage.show(Stage.java:259)
    at de.jensd.mqttfx.ui.StartApp.start(StartApp.java:108)
    at de.jensd.mqttfx.ui.MQTTFX.start(MQTTFX.java:28)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.NoSuchFieldException: TTF_PATH
    at java.lang.Class.getField(Unknown Source)
    at de.jensd.fx.glyphs.GlyphsFactory.getPathToFontFromClass(GlyphsFactory.java:52)
    … 40 more

Leave a Reply

Your email address will not be published. Required fields are marked *