Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » Problem subscribe Kura / Mosquitto
Problem subscribe Kura / Mosquitto [message #1777541] Thu, 30 November 2017 08:15 Go to next message
ermanno porporato is currently offline ermanno porporatoFriend
Messages: 26
Registered: November 2017
Junior Member
Hi

I am sendig to mosquitto the following:

mosquitto_pub -t Initoken/clientid/heater/data -m {"sentOn":1511970625597},"metrics":{"temperature":55}

(in a dos window),

and while the subscribe is running in eclipse (method doSubscibe(), ..)

The message arrive, but I have the following exception:

com.eclipsesource.json.ParseException: Expected name at 1:1

what is wrong in the string pub ??

I have added the timestamp to the json sent, but I don't know if are necessary other
info in the message to send

thanks a lot

Re: Problem subscribe Kura / Mosquitto [message #1777581 is a reply to message #1777541] Thu, 30 November 2017 14:01 Go to previous messageGo to next message
ermanno porporato is currently offline ermanno porporatoFriend
Messages: 26
Registered: November 2017
Junior Member
OK, I answer to myself, the correct string is:

mosquitto_pub -t Initoken/clientid/heater/data -m {\"sentOn\":1511970625597},\"metrics\":{\"temperature\":55}

with escape to the quotes.......
Re: Problem subscribe Kura / Mosquitto [message #1777582 is a reply to message #1777541] Thu, 30 November 2017 14:01 Go to previous message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 423
Registered: July 2015
Location: Italy
Senior Member
Hello,
I'll suggest to have a look at the following document that describes the expected format for the simple JSON: https://github.com/eclipse/kapua/wiki/K-Payload-JSON-Format#simple-json-encoding

Best regards,
Matteo
Previous Topic:Unable to access Kura Web UI on browser
Next Topic:cannot find the configurable component example
Goto Forum:
  


Current Time: Wed Sep 25 11:37:06 GMT 2024

Powered by FUDForum. Page generated in 0.03189 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top