If MQTT publishing the escape character?

Started by ccdr, August 09, 2018, 06:50:44 AM

Previous topic - Next topic

ccdr

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.

Arthur Grasin

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.
If you like my work, please take a few seconds and add feedback about our site or our software [here]

ccdr

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?

Arthur Grasin

Did you try to connect to this MQTT server using another MQTT client?
If you like my work, please take a few seconds and add feedback about our site or our software [here]

ccdr

Quote from: Arthur Grasin on August 09, 2018, 07:28:39 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.

ccdr

#5
Quote from: Arthur Grasin on August 09, 2018, 07:28:39 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.

ccdr

#6
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?

ccdr

#7
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.

Arthur Grasin

Hi,

What MQTT broker do you use? Could you please test the latest version released yesterday?
If you like my work, please take a few seconds and add feedback about our site or our software [here]

mrRandallmib

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...

Arthur Grasin

Hello.

Does this question relate to our software? If yes, could you show screenshots with your settings?
If you like my work, please take a few seconds and add feedback about our site or our software [here]