kamilfb / mqtt-spy

Please use the new Eclipse Paho GitHub repo instead.
https://github.com/eclipse/paho.mqtt-spy/wiki
345 stars 68 forks source link

publishing with scripts - problem with reply #72

Closed gatovelho closed 8 years ago

gatovelho commented 8 years ago

Hello,

I am using a simplereply2.js script for auto feedback/callback on a message topic. It is being declared in the connection manager, in the subscriptions/topic/script entry tab, by complete name (including .js)

This script, apparently, is not called/executed when it resides in the configuration/scripts directory , to where the scripts are saved by default, but is properly executed when located in the current mqtt-spy directory.

Besides being used as a callback, it publishes log in a /log topic I have defined.
All goes well from the application directory, but not from the publishing script directory.

Best regards, Carlos

kamilfb commented 8 years ago

@gatovelho, are you getting any exceptions logged in the mqtt-spy log file?

gatovelho commented 8 years ago

Clean log.

mqtt-spy.zip

For this log, the reply script was put in the publish directory (the fail case)

If you want I can also send log for the other setup (w/simplereply2 on the app dir)

kamilfb commented 8 years ago

Thank you! I will take a look...

gatovelho commented 8 years ago
Log when the script is on the app directory:

 ...
2016-04-04 12:59:06,162 INFO  [JavaFX Application Thread     ]
[MqttConfigurationUtils        ]  - Auto-complete for server URI
(192.168.1.3:1883 -> tcp://192.168.1.3:1883)
2016-04-04 12:59:08,701 INFO  [JavaFX Application Thread     ]
[BaseScriptManager             ]  - Adding script simplereply2.js
2016-04-04 12:59:08,983 INFO  [JavaFX Application Thread     ]
[NewSubscriptionController     ]  - Subscribing to 

...

gatovelho commented 8 years ago
OK found a solution:
the script name (simplereply2.js) must be entered with full path in  Subscriptions:

(be4)           

(after)           <Subscription createTab="true" qos="0" topic="/mcu/rgbled_status/" scriptFile="C:\Users\Ulisses\mqtt-spy\simplereply2.js"/>

gatovelho commented 8 years ago

I just removed some of the content that I believe was not being useful

kamilfb commented 8 years ago

Many thanks for the info - I'll add checking if the scripts exists when setting it up (in the location mqtt-spy thinks it should be in) and also if it is a relative path, looking for it in the configured script directory.

gatovelho commented 8 years ago

Okay. And I just removed my config file. Probably not useful for anyone. Regards!

kamilfb commented 8 years ago

Hi - I've added checks to warn the user if the script does not exist. When you type in the name of the script and submit it, it gives you a warning when the path is incorrect. Available in the latest beta.

gatovelho commented 8 years ago
Thank you for your care.
I will gladly check it. 

Best Regards,

Carlos

Às 20:07 de 13-05-2016, Kamil
  Baczkowicz escreveu:

  Hi - I've added checks to warn the user if the script does not
    exist. When you type in the name of the script and submit it, it
    gives you a warning when the path is incorrect. Available in the
    latest beta.
  —
    You are receiving this because you were mentioned.
    Reply to this email directly or view
      it on GitHub

-- 

I’m open to any suggestions, I’ve been wrong before.

kamilfb commented 8 years ago

This is now available in 0.5.1. Let me know if you find any further issues!