AGG Software Forums

Online Help Center => Data loggers and plug-ins => Topic started by: ccdr on August 09, 2018, 09:50:44 AM



Title: If MQTT publishing the escape character?
Post by: ccdr on August 09, 2018, 09:50:44 AM
Hello
I was using the following expression
M_READ_DEVICE = '{"READ_DEVICE":"' + 'DUMMY_RESULT' + '"}'
and got following parsed result
M_READ_DEVICE[8]="{\"READ_DEVICE\":\"DUMMY_RESULT\"}"
It seems that the Expression plugin already automatically added the escape character of \ in front of " for me.
I was wondering if the MQTT will publish this escape character together within the whole string.
Thanks.


Title: Re: If MQTT publishing the escape character?
Post by: Arthur Grasin on August 09, 2018, 10:05:22 AM
Hello,

1. The Expressions plugin does not escape any characters.
2. The logger escapes this string value on its screen only.
3. The MQTT plugin will export unescaped string.


Title: Re: If MQTT publishing the escape character?
Post by: ccdr on August 09, 2018, 10:09:28 AM
I was publishing M_READ_DEVICE.
Why does Data logger suite keep prompting me that "MQTT. Data have been processed successfully." with "MQTT. Client exception occurred. [Unable to Publish.]?
In last post, you suggested that "This error may mean that the plugin cannot convert a value to a string."
But this parsed result is of pure string type. How could this happen?


Title: Re: If MQTT publishing the escape character?
Post by: Arthur Grasin on August 09, 2018, 10:28:39 AM
Did you try to connect to this MQTT server using another MQTT client?


Title: Re: If MQTT publishing the escape character?
Post by: ccdr on August 09, 2018, 10:31:52 AM
Did you try to connect to this MQTT server using another MQTT client?

No. The Data logger suite is the only MQTT client.
In fact, I've got successful publishing one hour ago with unintentional wrong Expression.
Then I fixed the wrong Expression.
However, now I'm not able to reproduce that wrong case.


Title: Re: If MQTT publishing the escape character?
Post by: ccdr on August 09, 2018, 11:13:38 AM
Did you try to connect to this MQTT server using another MQTT client?

I just tried mosquitto_pub client publishing message of {"READ_DEVICE":"DUMMY_RESULT"}.
It succeeded.
But using Data logger suite MQTT export plugin publishing M_READ_DEVICE which equals '{"READ_DEVICE":"DUMMY_RESULT"}' in Expression plugin.
It keeps prompting "Unable to publish."
I also tried to use Data logger suite to publish plain 'test' string it still failed.
So weird.


Title: Re: If MQTT publishing the escape character?
Post by: ccdr on August 10, 2018, 05:55:28 AM
Just installed the latest release of MQTT plugin, i.e.  4.0.8 build 727.
Unfortunately, the problem persists.
Any error log file that I can refer to so that more clues could be found?


Title: Re: If MQTT publishing the escape character?
Post by: ccdr on August 10, 2018, 06:58:26 AM
The MQTT plugin export functionality seems NOT to work at all.
I was using local host, i.e. 127.0.0.1:1883 with QoS of 0 and Retain option unchecked.
Even you try it with plain text string that is made up in Expression plugin, say 'test_string'.
It still fails and tells you "MQTT client exception occurred. Unable to publish."
Whereas I try the same config. with mosquitto_pub.exe, it just works.


Title: Re: If MQTT publishing the escape character?
Post by: Arthur Grasin on August 30, 2018, 07:27:43 AM
Hi,

What MQTT broker do you use? Could you please test the latest version released yesterday?


Title: If MQTT publishing the escape character
Post by: mrRandallmib on December 31, 2019, 02:34:48 PM
Tried playing with MQTT tonight and I couldnt get anything to work... MQTT broker wouldnt work, Arduino MQTT library wasnt wanting to work. Couldnt get Visual Studio working with MQTT either...


Title: Re: If MQTT publishing the escape character?
Post by: Arthur Grasin on December 31, 2019, 05:18:08 PM
Hello.

Does this question relate to our software? If yes, could you show screenshots with your settings?