Comments (28)
I would like to clarify - the program is truly WONDERFUL - but it really would
be nice to be able to read the xml file in the likes of Notepad - and to store
subscriptions
Original comment by [email protected]
on 3 Jan 2015 at 8:14
from mqtt-spy.
1) Editing XML - yes, you should be able to manually define subscriptions by
editing the XML. If you attach the XML file you're trying to use I could help.
Please also attach the mqtt-spy.log, which will probably contain more
information about the problem you're experiencing. You can also define the
subscriptions you use from the UI - go to 'Connections -> Manager connections',
and for the connection you want, go to the Subscriptions tab and add the
subscriptions you need - when ready, hit apply and that should save them to the
configuration file. I'll try to make it easier, so watch this space... ;-)
2) Formatting - unfortunately JAXB (which mqtt-spy uses for XML marshalling)
doesn't do nice formatting. For that, I use a Notepad++ plugin to do XML
formatting - it's very good (I don't remember now whether it is a separate
plugin or comes with Notepad++ though).
Original comment by [email protected]
on 3 Jan 2015 at 8:51
from mqtt-spy.
I've created Issue 22 to make saving subscriptions easier - this should make it
to a release soon.
Original comment by [email protected]
on 3 Jan 2015 at 9:12
from mqtt-spy.
HI
I tried XML tools in Notepad++ - didn't seem to do anything... any chance the
XML file in future could contain line breaks so it's readable? Can't be any
harm in that? Other XML files appear formatted?
I tried the Connections/subscriptions as per your suggestion but no matter
what I did I ended up with a /samplesubscription/ instead of the one I was
trying to put in. Am I doing something wrong or does that not work?
Original comment by [email protected]
on 4 Jan 2015 at 12:41
from mqtt-spy.
1) Formatting XML - OK, I'll look into that further...
2) Predefined subscriptions - when you go to the Subscriptions tab and use the
provided button to add a topic, you can then double click on the created topic
(i.e. /sampleSubscription/) in the table row to edit it. When happy with the
new topic string, hit Enter to submit and then use the Apply button to save to
config. Let me know if it worked for you.
Original comment by [email protected]
on 4 Jan 2015 at 4:17
from mqtt-spy.
I've created Issue 23 to address the formatting of XML. Should make it to a
release soon...
Original comment by [email protected]
on 4 Jan 2015 at 4:26
from mqtt-spy.
Thanks for the responses above - I look forward to being able to edit the XML
easily - and as for subscriptions - you are right of course - they work a
treat. This is a great program.
If I might say, the instructions for scripted items - I don't understand at all.
I want the program to send a script to "/time" every minute with the time in
it. I feel sure this is possible but cannot figure it out from the instructions.
Original comment by [email protected]
on 4 Jan 2015 at 4:45
from mqtt-spy.
I've added a sample script for publishing current time to the Scripting wiki -
try if it works for you and then modify it to suit your needs.
Any problems - let me know...
Original comment by [email protected]
on 4 Jan 2015 at 5:22
- Changed state: Accepted
- Added labels: Type-Other
- Removed labels: Type-Defect
from mqtt-spy.
FYI - the latest beta (0.1.5 beta build 26) should have the XML formatting
sorted. Let me know if it works for you. Thanks for raising it!
Original comment by [email protected]
on 4 Jan 2015 at 6:11
from mqtt-spy.
The XML configuration on the 0.1.5 beta looks lovely - thank you. Will the
same happen to the log file which is also xml?
Original comment by [email protected]
on 4 Jan 2015 at 8:31
from mqtt-spy.
Thanks for help - see comment on wiki page. I understand the time script - but
have no idea how to tell mqtt-spy about it - I assume one makes a text file
with the script in it - I tried to enter the directory I put it in - under
connection list - publications - but /samplepublication/ appears in the topic
box regardless. Need simpler instruction.
Original comment by [email protected]
on 4 Jan 2015 at 8:43
from mqtt-spy.
Glad to hear the formatting works fine. Which log file do you mean? The
mqtt-spy.log is a standard text file, with one line per log entry.
I replied to your comment on the wiki - all was good apart form the script
file's extension - this needs to be ".js". Simply populate the publication
script directory field and hit Apply to save the changes, and then reopen the
connection. You should see your script on the list in Scripted publications
pane.
Original comment by [email protected]
on 4 Jan 2015 at 9:08
from mqtt-spy.
Sorry I meant to say STATS. Here's what my MQTT-SPY-STATS.XML file looks like.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:MqttSpyStats
xmlns:ns2="http://baczkowicz.pl/mqtt-spy-stats"><ID>-2863844191502908376</ID><St
artDate>2014-12-30T18:17:28.720Z</StartDate><Connections>27</Connections><Subscr
iptions>16</Subscriptions><MessagesPublished>131</MessagesPublished><MessagesRec
eived>82</MessagesReceived></ns2:MqttSpyStats>
As you can see a little formatting would help.
Ok, I've renamed the script to "thetime.js". I've put it in a directory under
desktop (where my mqtt-spy file is) called "spyscripts". under connection list
- publication what exactly do I put in there?
Original comment by [email protected]
on 4 Jan 2015 at 9:17
from mqtt-spy.
Yes, the stats file should be formatted nicely too - restarting mqtt-spy should
do it hopefully ;-)
I'm just updating the wiki on scripting - I agree it's not very
straightforward... - will let you know when ready. But I've just realised there
is an easier way to do it: clear the configured directory in the Publications
tab (or leave it blank), and place your script file (thetime.js) in the
mqtt-spy's home directory - where your configuration and stats files are. It
should then pick it up on opening the connection tab.
Original comment by [email protected]
on 4 Jan 2015 at 10:11
from mqtt-spy.
Wiki updated - hopefully a bit better now. Let me know how you got on - sooner
or later we'll get it working... ;-)
Original comment by [email protected]
on 4 Jan 2015 at 10:42
from mqtt-spy.
To be clear on this - the XML files generally, despite the program being on the
desktop, seem to be in USERS/PETER/MQTT-SPY - I didn't choose that -they just
ended up there - could make sense to make this configurable. Also - why is the
LOG file on my desktop instead of in USERS/PETER/MQTT-SPY - surely best to keep
them in one place wherever that might be.
Right, testing now - I put my thetime.js script in USERS/PETER/MQTT-SPY.
Close connection, re-open - nothing - nothing showing in connections - I'm
subscribed to /time/ nothing happening.
But then if we do it that way how would it know which connection to work with?
Also under connection list it is still not untuitive to add topics though I did
manage it last night. Under subscribe I hit the +ADD topic - and
/samplesubscription/ appeared. I changed that to /time/ and hit APPLY. Didn't
work - /samplesubscription/ reappeared. Tried again - it worked. something I'm
missing here.
Original comment by [email protected]
on 5 Jan 2015 at 5:17
from mqtt-spy.
Something here... erm, having put the script file where it now suggests CLEARLY
in the WIFI (good one) - I opened the BETA of MQTT-SPY - nothing - no sign of
my script which is merely your example in a file called thetime.js
A potential problem? When I tried instead to open the NON-beta of MQTT-SPY - it
"can't process the configuration file" - presumably because of the slight
changes to the format of the XML. Not a problem as long as we're aware of it.
But no - I put the THETIME.JS file (included here) into the same directory as
the two XML files - and... nothing....
Original comment by [email protected]
on 5 Jan 2015 at 5:26
from mqtt-spy.
I meant WIKI...
Original comment by [email protected]
on 5 Jan 2015 at 5:28
from mqtt-spy.
1) Scripting
Please try the following:
a) put the script to your mqtt-spy's home directory (e.g. USERS/PETER/MQTT-SPY)
b) delete all connections
c) create a new connection
d) open the connection
e) expand the Scripted publications pane
And let me know what you can see there.
2) Location of mqtt-spy.log is defined in log4j.properties inside the jar -
this can be edited; it defaults to the current directory of where you start the
app; I'll see if there is an easy way to change that...
3) Adding publication and subscription topics to the tables
From what you wrote it seems you missed hitting the Enter button to tell JavaFX
you are happy with the new value in the table.
When you hit the "Add topic" button, "/sampleSubscription/" or
"/samplePublication" will appear - you double click on it, change it, and then
press Enter to submit - this is how JavaFX knows to keep the new value. Then,
to save the changes to the config file, hit Apply.
4) Can't process the configuration file
0.1.5 beta has got a new configuration parameter, so any previous versions
won't understand it. If you want to go back to a previous version, either
delete the configuration file or restore a default one from the app's menu.
Original comment by [email protected]
on 5 Jan 2015 at 7:24
from mqtt-spy.
Hi there
Just to prove I am not going nuts.....
A very short video
https://www.youtube.com/watch?v=9aJDpkfDzuA
:-)
Original comment by [email protected]
on 5 Jan 2015 at 8:08
from mqtt-spy.
Spotted something else to do with scripted publications - main panel - scripted
publications... doesnt open and close properly - you have to click OFF the
window for it to update..
HOWEVER... when it DOES - it shows my PUBLISHTIME!!! And it WORKS...
So - why on the main panel do you have to click off the panel (ie somewhere
else on the Windows desktop) for the display to update.
and - why doesn't this show under the connections/publications window...
finally - when I CLOSE MQTT-SPY - and re-open - the scripted publications do
not restart automatically... can you make this happen? Maybe on a button that
says start at start up or something.
This is REALLY looking good but for these little issues!!!
Original comment by [email protected]
on 5 Jan 2015 at 8:24
from mqtt-spy.
Many thanks for the video - I think we're getting there.
So... now go to the connection tab and there you have 4 collapsible panes:
1) Publish message
2) Scripted publications (by default it is collapsed)
3) Define new subscription
4) Subscriptions and received messages
Expand the second one (Scripted publications). Is there anything in there?
The table on the Publications tab you were showing on the video is for
predefining publication topics, which appear in the publication topic drop down
for the "Publish message" pane.
Original comment by [email protected]
on 5 Jan 2015 at 8:27
from mqtt-spy.
Also, you might need to make the whole window bigger to see all expanded panes
properly.
Original comment by [email protected]
on 5 Jan 2015 at 8:28
from mqtt-spy.
Hi - I made another video - so very near...... but there are still some things
wrong... and a request... the publications don't appear to start automatically
when you run the program - for a time script this is essential don't you
think... please take a look at the new video - I promise it's short..
https://www.youtube.com/watch?v=1nWctj0mvgw
Pete.
Original comment by [email protected]
on 5 Jan 2015 at 8:32
from mqtt-spy.
I didn't see your last message before writing my response - I'm glad it is
working now. I'll reply later to discuss the other issues.
Original comment by [email protected]
on 5 Jan 2015 at 8:32
from mqtt-spy.
As I am sure we'll resolve this - if you want to do this by email so
screengrabs can be included -- by ALL means email me at pete AT scargill DOT org
I'm in this morning - off to meetings for a couple of days. It would be nice if
I could go away knowing the TIME script would keep on running even if my PC
reboots :-)
GREAT JOB..... this has to be becoming the best test client out there...
Original comment by [email protected]
on 5 Jan 2015 at 8:37
from mqtt-spy.
I've created issue 24 (auto-start for scripts) and issue 25 (scripted
publications pane).
Original comment by [email protected]
on 5 Jan 2015 at 2:12
from mqtt-spy.
Thank you for raising all these issues. I believe they all have been addressed
now or moved to separate issues.
Original comment by [email protected]
on 9 Jan 2015 at 9:01
- Changed state: Fixed
from mqtt-spy.
Related Issues (20)
- Integrate into operating systems apps list HOT 1
- Suggestion for docs: Deleting retained messages in bulk HOT 1
- Feature Request - Support for elliptic curves based keys (TLS) HOT 1
- Last Will data length inconsistency HOT 2
- Last Will received data has unexpected value HOT 1
- problem with subscriptions HOT 1
- UNICODE Replacement character when saving a message as script HOT 1
- typo within documentation HOT 1
- possible extension to Wiki HOT 1
- Feature request; message load chart for individual topics HOT 1
- problem with Message content chart HOT 1
- problem with Message content chart HOT 1
- Load script with common functions HOT 1
- Unsupported class version error HOT 1
- can't launch jar HOT 4
- timestamp of mqtt-spy-daemon.messages in readable format
- Message load chart: Message size plotting not working
- Exception in Application start method - OpenJDK 11 HOT 2
- Message Content Chart: JSONPath: Value Expression - ?() Filter expressions doesn't work
- Error: Could not find or loan main class pl.baczkowicz.mqttspy.Main
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mqtt-spy.