Open antipole2 opened 11 months ago
Running openplotter on RPi using feed from OpenCPN/ShipDriver. Local network with another instance of OpenCPN on Windows. This app using JScript_pi:
{
"context": "vessels.urn:mrn:signalk:uuid:80eb056e-1b7a-4302-9c1a-96c05ba0e4d8",
"updates": [
{
"source": {
"talker": "II",
"label": "opencpn",
"sentence": "GLL",
"type": "NMEA0183"
},
"$source": "opencpn.II",
"timestamp": "2023-11-13T13:39:36.000Z",
"values": [
{
"path": "navigation.position",
"value": {
"latitude": 49.71504957,
"longitude": -3.5839755
}
}
]
}
]
}{
"context": "vessels.urn:mrn:signalk:uuid:80eb056e-1b7a-4302-9c1a-96c05ba0e4d8",
"updates": [
{
"source": {
"talker": "II",
"label": "opencpn",
"sentence": "VTG",
"type": "NMEA0183"
},
"$source": "opencpn.II",
"timestamp": "2023-11-13T12:51:05.808Z",
"values": [
{
"path": "navigation.courseOverGroundMagnetic",
"value": null
},
{
"path": "navigation.courseOverGroundTrue",
"value": 1.221730477
},
{
"path": "navigation.speedOverGround",
"value": 0
}
]
}
]
}{
"context": "vessels.urn:mrn:signalk:uuid:80eb056e-1b7a-4302-9c1a-96c05ba0e4d8",
"updates": [
{
"source": {
"talker": "II",
"label": "opencpn",
"sentence": "VHW",
"type": "NMEA0183"
},
"$source": "opencpn.II",
"timestamp": "2023-11-13T12:51:05.814Z",
"values": [
{
"path": "navigation.headingTrue",
"value": 1.221730477
},
{
"path": "navigation.speedThroughWater",
"value": 5.658890322
}
]
}
]
}result: undefined
In the next update to the User Guide JavaScript_plugin_user_guide- SK.pdf
It is desirable that the JavaScript plugin can be used to work with Signal K. Given the close relationship of both Signal K and JavaScript with JSON, this should be relatively easy to do and to use.
I do not have a Signal K set up and am away from my boat for the winter. So I am hoping SKS will work with me to establish this capability.
Receiving Signal K messages This should be possible with the existing JavaScript plugin release by using OCPN messaging. In future, it would be preferable to use the new streams interface but I think that is not yet complete in OCPN.
The following script should (not tested) receive three Signal K messages, parse them into a Javascript structure and then pretty -print them. Please someone copy the output to me.