Giter Club home page Giter Club logo

paho.mqtt-spy's Introduction

Welcome to the Eclipse Paho mqtt-spy source code repository.

For more information on the available functionality, see the project's wiki at https://github.com/eclipse/paho.mqtt-spy/wiki.

The branching model aims to be as follows*:

  • master branch - where all the official releases live; tag for each release
  • development branch - where all the work is actually taking place
  • feature and release branches - used when required; for experimenting with new features and for major releases respectively

* - this has been heavily influenced by http://nvie.com/posts/a-successful-git-branching-model/.

paho.mqtt-spy's People

Contributors

der-ambi avatar icraggs avatar jpwsutton avatar kamilfb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

paho.mqtt-spy's Issues

Amazon IOT with certificates fails with NullPointerException

Version : 0.5.4 (build 52)
java 8 : OpenJDK 64-Bit Server VM (build 25.111-b16, mixed mode)

Trying to use certificate authentication on Amazon IOT fails with error :

pl.baczkowicz.spy.exceptions.ConfigurationException: Invalid configuration parameters
	at pl.baczkowicz.mqttspy.connectivity.MqttConnectionDetailsWithOptions.<init>(MqttConnectionDetailsWithOptions.java:91)
	at pl.baczkowicz.mqttspy.connectivity.MqttRuntimeConnectionProperties.<init>(MqttRuntimeConnectionProperties.java:34)
	at pl.baczkowicz.mqttspy.ui.MqttConnectionViewManager.openConnection(MqttConnectionViewManager.java:152)
	at pl.baczkowicz.mqttspy.ui.controllers.EditMqttConnectionController$6.run(EditMqttConnectionController.java:461)
	at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$null$5(GtkApplication.java:139)
	at java.lang.Thread.run(Thread.java:745)
Caused by: pl.baczkowicz.spy.exceptions.SpyException: Cannot create TLS/SSL connection
	at pl.baczkowicz.spy.security.SecureSocketFactoryBuilder.getSocketFactory(SecureSocketFactoryBuilder.java:106)
	at pl.baczkowicz.mqttspy.connectivity.MqttConnectionDetailsWithOptions.populateMqttConnectOptions(MqttConnectionDetailsWithOptions.java:175)
	at pl.baczkowicz.mqttspy.connectivity.MqttConnectionDetailsWithOptions.<init>(MqttConnectionDetailsWithOptions.java:87)
	... 10 more
Caused by: java.lang.NullPointerException
	at pl.baczkowicz.spy.security.SecureSocketUtils.getKeyManagerFactory(SecureSocketUtils.java:198)
	at pl.baczkowicz.spy.security.SecureSocketFactoryBuilder.getSocketFactory(SecureSocketFactoryBuilder.java:99)
	... 12 more

But it works fine with the same certificates (and key) using mosquitto_pub or MQTT.fx.
Settings look like this on MQTT-spy
capture d ecran de 2017-01-16 10-28-05

The same files (certificates and key) used on MQTT.fx are working fine
capture d ecran de 2017-01-16 10-16-12

Hex encoder formatting strange behavior

When I use Hex Encoder, it doesn't read properly some bytes. I looks like it doesn't read well bytes greater then 0x7F.

Please, refer to the screen below. I'm publishing 7e 7f 80 81 82. See the subscription result.
2016-12-07 14_25_44-mqtt-spy

Last Will data length inconsistency

Brought over from kamilfb/mqtt-spy#118

mqtt-spy v1.0.0 on macOS Sierra.

If I set the Last Will data for a Connecting in the Connection List to be, say, "88" (Plain) then it shows "Data (0B)". If I set it to "888" then it changes suddenly to "Data (3B)". If I then delete one "8", back to "88", then it shows "Data (2B)".

It should probably show "Data (2B)" in the first instance.

I have a saved Connection that has "88" in the Data field but shows "Data (0B)" when loaded fresh (by selecting it in the Connection List).

LWT Encoding issue in data field

Using MQTT Spy version 1.0.0 build 3 on macOS high sierra + java version "1.8.0_152"

  • select LWT checkbox
  • select PLAIN in the dropdown
  • check retain = true
  • enter target topic name
  • specify in the Data field the corresponding message payload "OFFLINE"

Result:
In the target topic the encoding is incorrect:
"OFFLINE" results in "8QK ?"

Unable to run any example code without changes

Hi guys,

Thanks for the response on Twitter, I've setup mqtt-spy on Ubuntu server 16.04, using my existing Java which I have installed and working for other apps. Everything is pretty much defaulted or has been but no matter what I try, it doesn't like any script. Java version is reported as below:

root@jupiter:~/mqtt-spy# java -version
openjdk version "1.8.0_121"
OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-0ubuntu1.16.04.2-b13)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)

The actual errors I'm seeing are:

root@jupiter:~/mqtt-spy# java -jar mqtt-spy-daemon-0.1.0.jar "/root/mqtt-spy/daemon-configuration.xml"
2017-02-22 11:14:39,999 INFO  [MqttSpyDaemon                 ]  - #######################################################
2017-02-22 11:14:40,004 INFO  [MqttSpyDaemon                 ]  - ### Starting mqtt-spy-daemon v0.1.0 (build 80)
2017-02-22 11:14:40,004 INFO  [MqttSpyDaemon                 ]  - ### If you find it useful, see how you can help at http://kamilfb.github.io/mqtt-spy/
2017-02-22 11:14:40,004 INFO  [MqttSpyDaemon                 ]  - ### To get release updates follow @mqtt_spy on Twitter 
2017-02-22 11:14:40,004 INFO  [MqttSpyDaemon                 ]  - #######################################################
2017-02-22 11:14:40,045 INFO  [ConfigurationUtils            ]  - Auto-complete for server URI (localhost -> tcp://localhost)
2017-02-22 11:14:40,099 INFO  [ReconnectionManager           ]  - Starting connection mqtt-spy-daemon-2@tcp://localhost
2017-02-22 11:14:40,152 INFO  [SimpleMqttConnection          ]  - Successfully connected to mqtt-spy-daemon-2@tcp://localhost
2017-02-22 11:14:40,692 INFO  [BaseScriptManager             ]  - Adding script /root/mqtt-spy/script1.js
2017-02-22 11:14:40,701 INFO  [BaseMqttConnection            ]  - Subscribed to pa340037001547353236343033/#
2017-02-22 11:14:40,725 INFO  [BaseScriptManager             ]  - Adding script /root/mqtt-spy/script1.js
2017-02-22 11:14:40,943 ERROR [ScriptRunner                  ]  - Script execution exception
javax.script.ScriptException: ReferenceError: "receivedMessage" is not defined in <eval> at line number 4
        at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:470)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:454)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:406)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:402)
        at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:150)
        at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249)
        at pl.baczkowicz.spy.scripts.ScriptRunner.runScript(ScriptRunner.java:138)
        at pl.baczkowicz.spy.scripts.ScriptRunner.run(ScriptRunner.java:99)
        at pl.baczkowicz.spy.scripts.BaseScriptManager.runScript(BaseScriptManager.java:387)
        at pl.baczkowicz.spy.scripts.BaseScriptManager.runScript(BaseScriptManager.java:358)
        at pl.baczkowicz.mqttspy.connectivity.BaseMqttConnection.subscribe(BaseMqttConnection.java:304)
        at pl.baczkowicz.mqttspy.daemon.connectivity.SimpleMqttConnectionRunnable.run(SimpleMqttConnectionRunnable.java:92)
        at java.lang.Thread.run(Thread.java:745)
Caused by: <eval>:4 ReferenceError: "receivedMessage" is not defined
        at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
        at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319)
        at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291)
        at jdk.nashorn.internal.objects.Global.__noSuchProperty__(Global.java:1441)
        at jdk.nashorn.internal.scripts.Script$Recompilation$1$24$\^eval\_.publishReply(<eval>:4)
        at jdk.nashorn.internal.scripts.Script$\^eval\_.:program(<eval>:11)
        at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
        at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
        at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:449)
        ... 11 more
2017-02-22 11:14:40,947 INFO  [BaseScriptManager             ]  - No setup function present

With the following configuration:

<?xml version="1.0" encoding="UTF-8"?>
<mqttspydc:MqttSpyDaemonConfiguration xmlns:mqttspydc="http://baczkowicz.pl/mqtt-spy/daemon/configuration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

	<Connection>

		<ServerURI>localhost</ServerURI>

		<ClientID>mqtt-spy-daemon-2</ClientID>

		<UserCredentials>
			<Username>[removed]</Username>
			<Password>[removed]</Password>
		</UserCredentials>

		<CleanSession>true</CleanSession>
		<ConnectionTimeout>10</ConnectionTimeout>
		<KeepAliveInterval>10</KeepAliveInterval>

		<ReconnectionSettings>
			<RetryInterval>5000</RetryInterval>             
			<Resubscribe>true</Resubscribe>
		</ReconnectionSettings>

		<MessageLog>XML_WITH_PLAIN_PAYLOAD</MessageLog>

		<Subscription topic="pa340037001547353236343033/#" qos="0" scriptFile="/root/mqtt-spy/script1.js"/>
    
		<RunningMode>CONTINUOUS</RunningMode>
		
	</Connection>

</mqttspydc:MqttSpyDaemonConfiguration>

As mentioned, script1 contains the default demo code so:

function publishReply()
{
    mqttspy.publish(
            "/reply", "<simpleReply><topic>" + receivedMessage.getTopic() + "</topic>" 
            + "<payload><![CDATA[" + receivedMessage.getMessage() + "]]></payload>"
            + "</simpleReply>", 0, false);

    return true;
}

publishReply();

If i simplify the script then it runs but only once, MQTT messages are logged in the backend but it doesn't appear to react to them.

This is while running mqtt-spy-daemon 0.1.0.

Thanks, Steve.

Mac OS High Sierra with Java SDK 9

I am unable to start the program.

This is what I get when I am trying to launch mqtt-spy :

Exception in Application start method
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:473)
	at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:372)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:945)
Caused by: java.lang.RuntimeException: Exception in Application start method
	at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:973)
	at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:198)
	at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
	at pl.baczkowicz.mqttspy.configuration.MqttConfigurationManager.<init>(MqttConfigurationManager.java:69)
	at pl.baczkowicz.mqttspy.Main.start(Main.java:63)
	at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:919)
	at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(PlatformImpl.java:449)
	at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417)
	at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
	... 8 more
Exception running application pl.baczkowicz.mqttspy.Main

Chart problem adding/deleting entry

There is a bug on release 56 of 6.0 Beta in the chart functionality. If I add a 2nd (or more) entry to the chart and then remove it, it doesn't get fully removed.

test cases cannot be loaded from the GUI

On Windows 10 using mqtt-spy-1.0.0.jar with Java 8 with an empty profile (without any connection defined):
In the "Test cases" window loading test cases from the context menu only throws an exception.
A similar exception is thrown while opening that window.
Also the window never opens the first time, a second click in the "Window" menu entry is needed.

I can provide more details if reproducing the problem proves difficult.
BTW:

  • mqtt-spy-0.5.4-jar-with-dependencies.jar also had the same problem
  • my test cases run otherwise fine with mqtt-spy-damon-1.0.0.jar.

Can we run different publishing scripts simultaneously ?

I've just got a question. Is there any way we can run multiple simulation scripts on mqtt-spy concurrently? Suppose, I write 5 Scripts to publish some values to 5 different topics; instead of starting them one by one, is there any way I can start (run) all the scripts at the same time?

Thanks in advance.
Regards,
Biswa

mqtt-spy can not be start

Hello

i hop i am on the right place here, because i find no forum. I get alwys this in my terminal. Can you hel me?

root@MQTT:~# cd /home/pi
root@MQTT:/home/pi# java -jar mqtt-spy1.jar
2017-06-24 22:28:41,074 ERROR [BaseConfigurationUtils ] - Invalid number format
2017-06-24 22:28:45,157 DEBUG [MqttViewManager ] - Selected perspective = DEFAULT
2017-06-24 22:28:45,171 ERROR [MqttStatsFileIO ] - Cannot read the statistics file from /root/mqtt-spy/mqtt-spy-stats.xml
java.io.FileNotFoundException: Cannot load the file from /root/mqtt-spy/mqtt-spy-stats.xml
at pl.baczkowicz.spy.xml.XMLParser.loadFromFile(XMLParser.java:359)
at pl.baczkowicz.mqttspy.ui.stats.MqttStatsFileIO.loadStats(MqttStatsFileIO.java:57)
at pl.baczkowicz.spy.ui.stats.StatisticsManager.loadStats(StatisticsManager.java:298)
at pl.baczkowicz.mqttspy.ui.controllers.MqttSpyMainController.init(MqttSpyMainController.java:154)
at pl.baczkowicz.mqttspy.ui.MqttViewManager.createMainWindow(MqttViewManager.java:151)
at pl.baczkowicz.mqttspy.Main.start(Main.java:90)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
at com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:92)
at com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:51)
at java.lang.Thread.run(Thread.java:748)
2017-06-24 22:28:48,527 INFO [MqttViewManager ] - Default configuration file present (/root/mqtt-spy/mqtt-spy-configuration.xml) = false
2017-06-24 22:28:48,529 DEBUG [BaseConfigurationManager ] - Creating root group called 'All connections'
2017-06-24 22:28:50,886 DEBUG [ControlPanelController ] - Retrieved version info = pl.baczkowicz.spy.ui.generated.versions.SpyVersions@964cca[releaseStatuses=pl.baczkowicz.spy.ui.generated.versions.ReleaseStatuses@f3f644[releaseStatus={pl.baczkowicz.spy.ui.generated.versions.ReleaseStatus@d05085[fromVersion=0.5.1-42, toVersion=0.5.1-42, updateTitle=Bugs have been found in this release!, updateDetails=Best to update to version 0.5.4 (build 52)., updateStatus=CRITICAL],pl.baczkowicz.spy.ui.generated.versions.ReleaseStatus@1205f43[fromVersion=0.5.1-44, toVersion=0.5.1-44, updateTitle=Bugs have been found in this release!, updateDetails=Best to update to version 0.5.4 (build 52)., updateStatus=CRITICAL],pl.baczkowicz.spy.ui.generated.versions.ReleaseStatus@11ea671[fromVersion=0.5.2-46, toVersion=0.5.3-50, updateTitle=Almost there!, updateDetails=Download version 0.5.4 (build 52) and get the edge again!, updateStatus=UPDATE_RECOMMENDED],pl.baczkowicz.spy.ui.generated.versions.ReleaseStatus@3dc0[fromVersion=0.5.4-52, toVersion=0.5.4-52, updateTitle=Living on the edge!, updateDetails=You're on the latest release - [version]., updateStatus=ON_LATEST],pl.baczkowicz.spy.ui.generated.versions.ReleaseStatus@a216fd[fromVersion=0.6.0-beta-26, toVersion=0.6.0-beta-51, updateTitle=Living in the stone age!, updateDetails=There is a new experimental release - 0.6.0 beta (build 52)., updateStatus=UPDATE_RECOMMENDED],pl.baczkowicz.spy.ui.generated.versions.ReleaseStatus@1d592ed[fromVersion=0.6.0-beta-52, toVersion=0.6.0-beta-99, updateTitle=Living on the edge!, updateDetails=You're on an experimental beta release - [version]., updateStatus=ON_LATEST]}], latestReleases=pl.baczkowicz.spy.ui.generated.versions.LatestReleases@16c9d08[latestRelease=]]

best regards
Werner

Custom Config Location

can you specify a configuration file from the command line to keep the config file in the same folder as the jar?

Feature request: support for proxies

When I'm behind a corporate proxy, mqtt-spy cannot reach out and connect to the internet. There might be some way to specify proxy settings when one is behind an outbound firewall, but I haven't found any reference in the documentation.

I've tried starting it with the following options, to no avail:

java -jar mqtt-spy-1.0.0.jar -Dhttp.proxyHost=my-proxy-host -Dhttp.proxyPort=8080 -Dhttps.proxyHost=my-proxy-host -Dhttps.proxyPort=8080

And the result is that connection is not successful:

Unable to connect to server (32103) - java.net.ConnectException: Connection timed out: connect
        at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:79)
        at org.eclipse.paho.client.mqttv3.internal.SSLNetworkModule.start(SSLNetworkModule.java:86)
        at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:650)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection timed out: connect
        at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
        at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
        at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
        at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
        at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:70)
        ... 3 more

Messages in a list

The message browser pane only allows to see one message at a time for a given topic or group of topics (see below):
12 - first pub received - selection

In order to see messages as a list, you have to perform a search (by clicking on the search button shown above), and enable auto-refresh (see below):
13 - search

Ideally, this kind of list view would be available from the subscription/message browser pane rather than having to do a search.

Raspbian Jessie Pixel Problem

Hi,
I downloaded the Beta to my windows 10 machine and followed your Youtube tutorial no problem, however when I download the Beta to my raspberry pi 3 running the latest raspbian Jessie Pixel, I check the Java version which is: Java(TM) SE Runtime Environment (build 1.8.0_65-b17) , now the icon in the download folder for the mqtt-spy app is for an archive file and when you double click on it the Xarchiver app opens, does it need to be associated with something else ?

Thanks
Stuart

problem with subscriptions

In "manage connections", in the "subscriptions" tab, I cannot add a topic. It is automatically replaced by the /sampleSubscription/ topic. Since I am new to MQTT, I may be missing something.

Saving the session

Hi,
Is there a way to save the complete session - specially the charts?
& thanks for the great work

Exception when removing custom formatter

Hi,

I created a custom formatter for testing purposes in v1.0.0. But removing it doesn't work.

`2017-11-23 19:06:24,572 ERROR [SpyUncaughtExceptionHandler ] - Thread Thread[JavaFX Application Thread,5,main] failed with java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1774)
at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1657)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Node.fireEvent(Node.java:8413)
at javafx.scene.control.Button.fire(Button.java:185)
at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:182)
at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:96)
at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:89)
at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3757)
at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:381)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$354(GlassViewEventHandler.java:417)
at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:416)
at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
at com.sun.glass.ui.View.notifyMouse(View.java:937)
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.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.reflect.misc.Trampoline.invoke(Unknown Source)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.reflect.misc.MethodUtil.invoke(Unknown Source)
at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1771)
... 48 more
Caused by: java.lang.NullPointerException
at pl.baczkowicz.mqttspy.configuration.MqttConfigurationManager.removeFormatter(MqttConfigurationManager.java:287)
at pl.baczkowicz.spy.ui.controllers.FormattersController.deleteFormatter(FormattersController.java:322)
... 58 more`

Disconnect (keep tab) -> Reconnect -> no messages

Hello,

if you connect with mqtt-spy to a broker and disconnect via right-click on the tab (keep tab),
no messages are received after a reconnect.

It is necessary to close the tab to receive messages again.

Best regards

Fail to create a new connection

image
environment: Windows 7, 32 bit operating system, J
operation:

  1. I use cmd windows to execute the mqtt-spy-0.5.4-jar-with-dependencies.jar
  2. Click second window to create a new connection, but there is no response
  3. Click menu Connections=>Manage Connections, but there is no response.

And I attach the log.
mqtt-spy.log.zip

Pretty Json display pane only displays 2 lines

Pretty Json is a nice way to see complex JSON but the display pane only shows 2 1/2 rows and will not resize forcing the user to use the scrollbars.

Please make Pretty Json pane bigger or resizable

ClientID longer than 23 characters

MQTT-spy currently doesn't seem to allow the user to specify Client IDs longer than 23 characters. I recognize this is the MQTT standard, but at least one cloud IOT provider seems to require specific Client IDs that are around 35-40 characters long.

Any way to have MQTT-spy allow longer Client IDs?

Amazon AWS connection

I am unable to get any type of connection established to an AWS broker.

I have tried various security configurations.

Any help would be great.

'Retained' on received message not indicated correctly

If publish a message with 'retained' enabled, the GUI does not indicate the message is 'Retained'. The published message however does behave as a retained message, so it must be set correctly during publish from the GUI.

Max Topic column width should be greater

In "Received messages summary" data grid:

As we have quite long MQTT topic names in our project, we cannot make the topic column width big enough to see the whole topic name.

Used V 1.0

Export Msgs, wrong format?

When I copy an individual msg to the clipboard or export a single msg to the clipboard, the message is in text.

If, however, I export "all browsed messages" to clipboard, the format is in binary:

<MqttMessage id="33" timestamp="1501833753500" topic="RFX/Lights/undefined/0x001145/2" qos="0" retained="true" encoded="true">eyJzdGF0dXMiOnsicnNzaSI6M30sInRpbWVzdGFtcCI6IjIwMTctMDgtMDNUMDk6MjE6NDEuODE0WiIsIm1zZ0tleXMiOlsic3RhdHVzIiwidG9waWMiLCJfbXNnaWQiLCJ0aW1lc3RhbXAiXX0=</MqttMessage>

That doesn't look right and isn't terribly helpful. Could it be fixed?

AutoSave suggestions

I consider mqtt-spy a very useful tool but often find myself having to retype publish messages or resubscribe to topics that I added yesterday from the front page but did not save in connections, manage connection,, subscriptions, add topic ( too much work!)

Requests:
Adding subscription with New button auto saves it to connection. Simple and fast

Publishing data to a topic will add both to 'recent' lists, also auto saving to connection:

  • Clicking Publish Topic dropdown will display last 10 topics Published for this connection

  • Clicking Publish Data dropdown ( new button) will display last 10 messages published for the selected topic. If selected Topic is not in the recent list - user typed in a new one or still blank, then display unfiltered last 10 messages for any topic

Thanks

Bill

Version 1.0.1 beta (build 9) connection problem

I am running mqtt-spy-1.0.1-beta-b9-jar-with-dependencies.jar in order to use the fix for the 'plotting JSONPath' problem in 1.0.0 (build 3)

I'm using an iMac with macOS High Sierra v10.13.3 with:
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

I have a Mosquitto MQTT broker running on a Raspberry Pi 2 and an rsmb MQTT-SN broker running on a Raspberry Pi 3

Using MQTT-SPY v1.0.0 I can successfully connect and subscribe to both. However with 1.0.1 beta (build 9) using the same connection configuration I'm unable to connect to the rsmb MQTT-SN broker running on a Raspberry Pi 3. When I try to connect using Connections | Manage connections | select Rasp3_02 MQTT-SN and click Open connection I jump to the Control Panel which shows a button labeled "Open Rasp302 MQTT-SN. Clicking this button does not bring up a connection tab i.e. does nothing.

MQTT-SPY is simply wonderful!

Topic ellipsis on the left side / beginning of topic

In "Received messages summary" data grid:

As we have quite long MQTT topic names in our project, it would be nice to have an option to show the ellipsis on the left side (cut off beginning of topic).

Example: ...ent/Status instead of xy/abc/current/St...

Can't add publications/subscriptions before connecting

Whenever i try to add publications/subscription before connecting, then press "+Add topic",the topic twists to the default "/samplePublication/" or "/sampleSubscription/".
image

I have tried both versions 0.5.4 and (beta) 0.6.0, and both have the same problem.

Enhancement Request: Save subscriptions layout/format

Hi, really nice to see mqtt-spy going from strength to strength.

One of the things I find myself doing a lot now is changing the layout for a subscription tab. It would be really nice if each pre-defined subscription remembered both the layout and the format.

Universal Messaging broker (Software AG) doesn't support underscores in ClientID

According to the specification (MQTT 3.1.1) the ClientID allows only the following characters:
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"

mqtt spy (0.5.3) generates a default ClientID that contains a "" (underscore).
It generates it in the form of:

This seems to be against the specification and stops you from connecting to e.g. "Universal Messaging" broker (from Software AG).

http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html
3.1.3.1 Client Identifier

Unable to connect to rabbitmq broker in another PC

I am using Mqttspy GUI. If I give localhost or 127.0.0.1 I am able to connect to Rabbitmq without any issues. But if I give system IP address or if RabbitMQ is in another PC I am not able to connect through Mqttspy

client ID max length

Is there a way to increase the maximum length for clientID? The limit of 23 characters is actually a soft limit according to the specs, and I'm hoping there's a configuration variable someplace that allows limit increase.

Memory leak

I am facing a memory issue when live plotting data. RAM usage goes up and up as data arrives until it eventually freezes my whole computer.
I'm running on Ubuntu 16.04 using mosquitto as my mqqt message broker. I tried using both 0.5.4 and 0.6.0 versions with no luck.

stacktraces from scripts lack the script filename => debugging tedious

Replacing in ScriptRunner.java

lastReturnValue = script.getScriptEngine().eval(new InputStreamReader(FileUtils.loadFileByName(script.getScriptFile().getAbsolutePath())));

with the following should fix that (according to https://stackoverflow.com/questions/2885120/replace-unknown-source-in-java-rhino-jsr223-with-actual-file-name/24559495#24559495, untested):

ScriptContext scriptContext = script.getScriptEngine().getContext();
scriptContext.setAttribute(ScriptEngine.FILENAME, script.getScriptFile().getAbsolutePath(), ScriptContext.ENGINE_SCOPE);
try {
    lastReturnValue = script.getScriptEngine().eval(new InputStreamReader(FileUtils.loadFileByName(script.getScriptFile().getAbsolutePath())));
} finally {
    scriptContext.removeAttribute(ScriptEngine.FILENAME, ScriptContext.ENGINE_SCOPE); 
}

(See also https://docs.oracle.com/javase/8/docs/api/javax/script/ScriptContext.html).

Also scripts on classpath might need to be special-cased.


On a related note maybe __FILE__ and __DIR__ (Reference: https://wiki.openjdk.java.net/display/Nashorn/Nashorn+extensions#Nashornextensions-Extensionproperties,functionsinglobalobject) would work with these changes.

Maximum height for panes too less

When collapsing or hiding the "Scripted publications" pane, a grey area appears at the bottom of the application.
This is only visible when you:

  • are connected to a broker
  • have subscribed to at least one topic
  • have a monitor with โ‰ฅ1080px in height

screenshot 2018-01-07 22 52 31
screenshot 2018-01-07 22 52 35

test cases' GUI panes for a given connection are hard to find

On Windows 10 using mqtt-spy-1.0.1-beta-b11-jar-with-dependencies.jar with Java 8 with an open connection:
In the "Test cases" window running a test case which does mqtt.subscribe throws a null pointer exception.
On manual inspection of the code it looks like the connection object is null on that call.

I do not get how to make the GUI use the currently open connection for tests.
It seems related to the fact that the menu entry used to access this window always says "Test cases (no connection)", which looks like it is hardcoded in the GUI code (?!?).

The same test runs fine from the daemon (v1.0.0).
A dummy test which uses no MQTT connection also runs fine.
I can provide more details if reproducing the problem proves difficult.

mqtt-spy looses messages on a subscription ?

Hi,

I'm testing our implementation of sending messages to a mosquitto broker using the paho client library. In that testing I'm using mqqt-spy to check whether all sent messages actually arrive at the broker.

What I seem to have noticed is that mqqt-spy (0.5.4) misses messages on the subscription, where the mosquitto_sub client does not miss any messages on the same subscription.

For testing I'm sending 1000 messages in very quick succession. QoS=1

1000 messages actually arrive at the mosquitto_sub client.
Less than 1000 messages arrive at the mqtt-spy client (subscription also set to QoS=1). This varies per run of the test. I've also seen all messages arrive, but also 50 or more messages missing.

Any idea ? Has this been noticed before ?

Regards,
Maarten

Charts - JSONPath error

The following JSON formatted messages is being published on topic = home/environment on test.mosquitto.org.

{
"humidity": 53.57,
"pressure": 29.96,
"temperature": 77.38,
"timestamp": "Tue Sep 26 10:14:02 2017"
}

I am creating a Chart by selecting the topic from the Received messages summary, selecting Charts, then Show payload values for this topic.
I change Type = Payload to Type = JSONPath
I edit the Value expression = $.temperature

Response:
I get no plotted values.
I get a "java.lang.ClassCastException:java.lang.Double cannot be cast to [C" error.

Attachments:

Windows 10:

java version

Settings: (ignore cursor at end of series name)

settings

Error:

error

Can not start UI

I tried to start mqtt-spy 1.0 running java -jar mqtt-spy-1.0.0.jar however it did not work:

Error: Mainclass pl.baczkowicz.mqttspy.Main could not be found or loaded

Am I missing something?

Advanced scripting help - reading file into array

I'm not sure where else to ask this question so please forgive if this is the wrong place.

I'm trying to modify a script I found https://github.com/kamilfb/mqtt-spy/issues/116 for bulk clearing retained messages. I would like to modify it to load a list of topics from a text file but I'm running into errors with the examples I'm finding online. I understand mqtt-spy uses Nashorn JS but I get a "readFully" is not defined error or fs.readFileSync is not a function. It works when I use the array. Here's what I have.

// Delete a bunch of retained messages
// Wrap the script in a method, so that you can do "return false;" in case of an error or stop request
function publish() {
	var Thread = Java.type("java.lang.Thread");
		
	var fs = "";
	//var text = readFully("topiclist.txt");
	var text = fs.readFileSync("D:/Matt/Dropbox/MQTT-Spy/mqtt-spy-userprofile/topiclist.txt").toString('utf-8');
	var topics = text.split("\n")

	// Define an array for topics we want to process
//	var topics = [
//		'test/msg',
//		'test/status'
//	];

	// Loop through each topic
	topics.forEach(function(topic) {
    
		// Publish blank payload with retain false
		// removes retained messages
		mqttspy.publish(topic, 'test', 0, false);	// topic, payload, qos, retained

		// Add some sleepy time and allow
		// mqtt_spy to interrupt if needed
		try {
			Thread.sleep(100);
		} catch(err) {
			return false;
		}
	});
  
	// This means all OK, script has completed without any issues and as expected
	// return false if needed
	return true;
}
publish();
//EOF

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.