This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SignalK to MQTT reporting [object object] for postion
#4
(2019-11-22, 08:30 PM)tkurki Wrote:
(2019-11-22, 06:22 PM)craig Wrote: Debug output from local MQTT broker on Openplotter where the payload is [object object]

TL;DR: I just published version 1.3.1 that should fix it.


Code:
$ mosquitto_sub -h localhost -t vessels/self/navigation/position
{"longitude":23.5094,"latitude":60.058233333333334}
{"longitude":23.50935,"latitude":60.0582}


Position in Signal K is an object valued property: since it consists of latitude and longitude that should not be handled separately they are handled as a single object with two properties. 

The conversion to something useful was missing, [object Object] is what you get if you convert an object to text naively.

With the new version all object valued properties are published in JSON format as text when publishing to the local, embedded server.

Just wanted to confirm that worked an absolute treat. Solved a problem I've been facing for months. 

Thank you very much for helping, I just wanted to say thank you very much.
Reply


Messages In This Thread
RE: SignalK to MQTT reporting [object object] for postion - by craig - 2019-11-23, 03:01 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)