AGG Software Forums
December 03, 2024, 08:35:24 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome on our forum!
 
   Home   Help Search Login Register  

Pages: [1]
  Print  
Author Topic: If MQTT publishing the escape character?  (Read 39649 times)
ccdr
Jr. Member
**

Karma: +0/-0
Posts: 71


View Profile
« 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.
« Last Edit: August 09, 2018, 11:14:59 AM by ccdr » Logged
Arthur Grasin
Tech. Support
Administrator
Hero Member
*****

Karma: +0/-0
Posts: 806



View Profile WWW
« Reply #1 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.
Logged
ccdr
Jr. Member
**

Karma: +0/-0
Posts: 71


View Profile
« Reply #2 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?
Logged
Arthur Grasin
Tech. Support
Administrator
Hero Member
*****

Karma: +0/-0
Posts: 806



View Profile WWW
« Reply #3 on: August 09, 2018, 10:28:39 AM »

Did you try to connect to this MQTT server using another MQTT client?
Logged
ccdr
Jr. Member
**

Karma: +0/-0
Posts: 71


View Profile
« Reply #4 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.
Logged
ccdr
Jr. Member
**

Karma: +0/-0
Posts: 71


View Profile
« Reply #5 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.
« Last Edit: August 09, 2018, 11:38:55 AM by ccdr » Logged
ccdr
Jr. Member
**

Karma: +0/-0
Posts: 71


View Profile
« Reply #6 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?
« Last Edit: August 10, 2018, 06:13:53 AM by ccdr » Logged
ccdr
Jr. Member
**

Karma: +0/-0
Posts: 71


View Profile
« Reply #7 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.
« Last Edit: August 10, 2018, 07:00:34 AM by ccdr » Logged
Arthur Grasin
Tech. Support
Administrator
Hero Member
*****

Karma: +0/-0
Posts: 806



View Profile WWW
« Reply #8 on: August 30, 2018, 07:27:43 AM »

Hi,

What MQTT broker do you use? Could you please test the latest version released yesterday?
Logged
mrRandallmib
Newbie
*

Karma: +0/-0
Posts: 1


View Profile
« Reply #9 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...
Logged
Arthur Grasin
Tech. Support
Administrator
Hero Member
*****

Karma: +0/-0
Posts: 806



View Profile WWW
« Reply #10 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?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines