MQTT Payload Invalid JSON?
Posted: 27 Mar 2019, 13:52
Hello,
wondering if someone has had a similar issue or any suggestions,
I'm am publishing to MQTT Mosquito broker on the RevPi.
All seems to be working correctly and I can see the message when I subscribe in NODERED. However when I try to use Kepware MQTT client to subscribe to the same message I get and warning error which is filling up log when there are thousands of messages. (Although Im definitely getting the message and can parse it to get values.
The Kepware suggestion is to "Reconfigure the payload to be valid JSON" I have no control what comes out of the DIO to the MQTT broker as far as I can see.
Unexpected token found while looking for the end of the MQTT payload. |
Channel = '<channel>', Topic = '<topic>', Line = <line>, Col = <col>.
Error Type:
Warning
Possible Cause:
Unexpected token while looking for the end of the document.
Possible Solution:
Reconfigure the payload to be valid JSON
In the MQTT example we see output such as
pi @ raspberrypi: ~ $ mosquitto_sub -t "#" -v
revpi8143 / io / temp_heater 215
revpi8143 / io / temp_outside 227
I believe the JSON that Kepware is expecting contains brackets delimiters etc and not what is output from RevPI. In the example the format is so
Is there a way to have this message reformatted to something like perhaps revpi8143/io/ {"tst":1470825369,"topic":"greeting","qos":0,"retain":0,"payload":"hello world"}?
Im not sure. Assistance much appreciated.
Thank you
Alan
Any assistance appreciated
wondering if someone has had a similar issue or any suggestions,
I'm am publishing to MQTT Mosquito broker on the RevPi.
All seems to be working correctly and I can see the message when I subscribe in NODERED. However when I try to use Kepware MQTT client to subscribe to the same message I get and warning error which is filling up log when there are thousands of messages. (Although Im definitely getting the message and can parse it to get values.
The Kepware suggestion is to "Reconfigure the payload to be valid JSON" I have no control what comes out of the DIO to the MQTT broker as far as I can see.
Unexpected token found while looking for the end of the MQTT payload. |
Channel = '<channel>', Topic = '<topic>', Line = <line>, Col = <col>.
Error Type:
Warning
Possible Cause:
Unexpected token while looking for the end of the document.
Possible Solution:
Reconfigure the payload to be valid JSON
In the MQTT example we see output such as
pi @ raspberrypi: ~ $ mosquitto_sub -t "#" -v
revpi8143 / io / temp_heater 215
revpi8143 / io / temp_outside 227
I believe the JSON that Kepware is expecting contains brackets delimiters etc and not what is output from RevPI. In the example the format is so
Is there a way to have this message reformatted to something like perhaps revpi8143/io/ {"tst":1470825369,"topic":"greeting","qos":0,"retain":0,"payload":"hello world"}?
Im not sure. Assistance much appreciated.
Thank you
Alan
Any assistance appreciated