SignalK / freeboard-sk

Chartplotter implementation for Signal K servers
Apache License 2.0
39 stars 29 forks source link

AIS working in OpenCPN but not in Freeboard #82

Closed Jamos1988 closed 4 years ago

Jamos1988 commented 4 years ago

The weirdest thing, I have migrated to Openplotter 2 and everything is working including AIS. The UDP connection in SignalK to port 10110 has been added and since then OpenCPN gives AIS targets. However, Freeboard does not visualize the AIS targets, only self information.

Am I forgetting something?

panaaj commented 4 years ago

Some things to check:

  1. Make “vessels” are not hidden in Freeboard (... button, Show Vessels)
  2. Use SignalK server data browser (or a tool like SKwiz) to make sure that data is available at ./signalk/vj1/api/vessels for these vessels.

Freeboard relies on the vessel paths in point 2 above to display these vessels.

If the data for these vessels is available from the server then can you supply a sample of the data appearing at ./signalk/vj1/api/vessels.

Jamos1988 commented 4 years ago

Thanks:

  1. The button show vessels is not visible, I guess this is because there are no vessels to show
  2. The Data Browser doesn't show the AIS connection that I created (UDP 10110) and when checking the server activity there are no deltas/second

So strange, I guess that the SDR VHF plugin in OP2 works well, because OpenCPN receives the data at UDP 10110, but SignalK does not.

When opening your URL it says: Cannot GET /@signalk/vj1/api/vessels

Jamos1988 commented 4 years ago

I might have an idea why the data is not arriving in SignalK. It seems Op2 doesn't have the Kplex preconfigured. I don't know if SDR VHF sends the data by default to port 10110 or if I need Kplex for it.

panaaj commented 4 years ago

Sorry but I can’t help with that issue. Maybe send that one to the Signalk slack group

Jamos1988 commented 4 years ago

Yes, I understand, I'll do that! Thanks for pointing me in the right direction and keep up the great work! Freeboard is a great app with even more potential.

Jamos1988 commented 4 years ago

Some new information:

When the SignalK connection UDP 30330 is running, OpenCPN receives AIS. Without it, it doesn't. SignalK does seem to passthrough the data to OpenCPN, but this is not visible in the Data Browser.

I've discussed on the openmarine forum into detail about the Kplex plugin, but this doesn't seem to be the cause. With above tested I think we can narrow it down to SignalK or Freeboard.

Hope you can help me out considering this new information.

Kind regards

tkurki commented 4 years ago

You mean there is only self in Data Browser’s context menu? Have you tried maptracker webapp, does it show the ais vessels?

What about http://localhost:3000/signalk/v1/api/vessels/

Jamos1988 commented 4 years ago

The API says this:

{"urn:mrn:signalk:uuid:943fd5b9-ed14-4f26-8798-f9262882335f":{"uuid":"urn:mrn:signalk:uuid:943fd5b9-ed14-4f26-8798-f9262882335f","navigation":{"attitude":{"meta":{"description":"Vessel attitude: roll, pitch and yaw"},"value":{"roll":-0.006981317200000001,"pitch":-0.0038920843390000005,"yaw":null},"$source":"OpenPlotter.I2C.pypilot","timestamp":"2020-07-13T11:30:50.369Z"},"position":{"meta":{"description":"The position of the vessel in 2 or 3 dimensions (WGS84 datum)"},"value":{"longitude":5.030493333333333,"latitude":52.636755},"$source":"OPgps.GP","timestamp":"2020-07-13T11:30:50.000Z","sentence":"GGA"},"courseOverGroundTrue":{"meta":{"units":"rad","description":"Course over ground (true)"},"value":5.649281724145144,"$source":"OPgps.GP","timestamp":"2020-07-13T11:30:50.409Z","sentence":"VTG"},"speedOverGround":{"meta":{"units":"m/s","description":"Vessel speed over ground. If converting from AIS 'HIGH' value, set to 102.2 (Ais max value) and add warning in notifications"},"value":0,"$source":"OPgps.GP","timestamp":"2020-07-13T11:30:50.409Z","sentence":"VTG"},"magneticVariation":{"meta":{"units":"rad","description":"The magnetic variation (declination) at the current position that must be added to the magnetic heading to derive the true heading. Easterly variations are positive and Westerly variations are negative (in Radians)."},"value":0,"$source":"OPgps.GP","timestamp":"2020-07-13T11:30:50.000Z","sentence":"RMC"},"magneticVariationAgeOfService":{"meta":{"units":"s","description":"Seconds since the 1st Jan 1970 that the variation calculation was made"},"value":1594639850,"$source":"OPgps.GP","timestamp":"2020-07-13T11:30:50.000Z","sentence":"RMC"},"datetime":{"meta":{"description":"Time and Date from the GNSS Positioning System"},"value":"2020-07-13T11:30:50.000Z","$source":"OPgps.GP","timestamp":"2020-07-13T11:30:50.000Z","sentence":"RMC"},"courseOverGroundMagnetic":{"meta":{"units":"rad","description":"Course over ground (magnetic)"},"value":0,"$source":"OPgps.GP","timestamp":"2020-07-13T11:30:50.409Z","sentence":"VTG"},"headingMagnetic":{"meta":{"units":"rad","description":"Current magnetic heading of the vessel, equals 'headingCompass adjusted for magneticDeviation'"},"value":2.251614361926955,"$source":"OPpypilot.AP","timestamp":"2020-07-13T11:30:50.586Z","sentence":"HDM"},"gnss":{"methodQuality":{"meta":{"description":"Quality of the satellite fix"},"value":"DGNSS fix","$source":"OPgps.GP","timestamp":"2020-07-13T11:30:50.000Z","sentence":"GGA"},"satellites":{"meta":{"description":"Number of satellites"},"value":13,"$source":"OPgps.GP","timestamp":"2020-07-13T11:30:50.000Z","sentence":"GGA"},"antennaAltitude":{"meta":{"units":"m","description":"Altitude of antenna"},"value":28,"$source":"OPgps.GP","timestamp":"2020-07-13T11:30:50.000Z","sentence":"GGA"},"horizontalDilution":{"meta":{"description":"Horizontal Dilution of Precision"},"value":0,"$source":"OPgps.GP","timestamp":"2020-07-13T11:30:50.000Z","sentence":"GGA"},"differentialAge":{"meta":{"units":"s","description":"Age of DGPS data"},"value":0,"$source":"OPgps.GP","timestamp":"2020-07-13T11:30:50.000Z","sentence":"GGA"},"differentialReference":{"meta":{"description":"ID of DGPS base station"},"value":0,"$source":"OPgps.GP","timestamp":"2020-07-13T11:30:50.000Z","sentence":"GGA"}},"courseGreatCircle":{"activeRoute":{"href":{"meta":{"description":"A reference (URL) to the presently active route, in resources."},"value":null,"$source":"freeboard-sk-helper","timestamp":"2020-07-13T11:30:43.423Z"},"startTime":{"meta":{"description":"The time this route was activated"},"value":null,"$source":"freeboard-sk-helper","timestamp":"2020-07-13T11:30:43.423Z"}},"nextPoint":{"position":{"value":null,"$source":"freeboard-sk-helper","timestamp":"2020-07-13T11:30:43.423Z"}}}},"electrical":{"batteries":{"system":{"current":{"meta":{"units":"A","description":"Current flowing out (+ve) or in (-ve) to the device"},"value":1.8,"$source":"signalk-node-red","timestamp":"2020-07-13T11:30:49.765Z"},"power":{"value":13.41,"$source":"signalk-node-red","timestamp":"2020-07-13T11:30:49.767Z"},"voltage":{"meta":{"units":"V","description":"Voltage measured at or as close as possible to the device"},"value":7.45,"$source":"signalk-node-red","timestamp":"2020-07-13T11:30:49.761Z"}},"ups":{"state":{"value":1,"$source":"signalk-node-red","timestamp":"2020-07-13T10:39:50.400Z"}}},"power":{"reset":{"button":{"value":0,"$source":"signalk-node-red","timestamp":"2020-07-13T10:39:50.439Z"}}}},"environment":{"outside":{"temperature":{"meta":{"units":"K","description":"Current outside air temperature"},"value":49.24,"$source":"signalk-node-red","timestamp":"2020-07-13T11:30:50.338Z"},"pressure":{"meta":{"units":"Pa","description":"Current outside air ambient pressure"},"value":1027.77,"$source":"signalk-node-red","timestamp":"2020-07-13T11:30:50.339Z"}},"inside":{"humidity":{"meta":{"description":"This regex pattern is used for validation of the identifier for the environmental zone, eg. engineRoom, mainCabin, refrigerator"},"value":24.25,"$source":"signalk-node-red","timestamp":"2020-07-13T11:30:50.340Z"}}}}}

And maptracker shows only my self / own position

The Data Browser menu doesn't show the AIS connection at all, you can choose the self context but I leave this blanc so it will show everything.

panaaj commented 4 years ago

Looks like only data for one vessel is available at the vessels path.."urn:mrn:signalk:uuid:943fd5b9-ed14-4f26-8798-f9262882335f"

tkurki commented 4 years ago

The default output in OpenPlotter 2 SDR VHF is UDP 10110, so the only connections you should have are

Signal K forwards all NMEA0183 data as TCP server on port 10110, so that is what OpenCPN is connecting to.

Including Kplex and gpsd in your system creates more possibilities for misconfiguration, so don't use them unless there's a clear need and you know what you are doing.

Jamos1988 commented 4 years ago

Ok, both Kplex and GPSD are now completely disabled. Even with only connections SignalK and SDR VHF, no AIS data visible on any maps, only in OpenCPN.

After disabling the SignalK connection for SDR VHF, OpenCPN stops receiving AIS objects. When enabling it starts receiving them again. I really am starting to think that the connections are OK because I've narrowed it down to only the connections you proposed.

The only other thing I can imagine is that I've previously had AIS working with this instruction: https://pysselilivet.blogspot.com/2020/05/ais-reciever-for-raspberry-pi-2-channel.html#more

However, I've completely disabled the service from systemd, so this service is not running anymore. Also, I've tried re-installing SDR VHF with all dependencies to exclude any missing packages.

It's weird... maybe I can try enabling the old service, see if SignalK starts to receive it again in the old way and that it is a SDR VHF plugin bug... I'll try that

Jamos1988 commented 4 years ago

I can confirm that the old AIS instruction when enabled has the exact same behaviour as when the official SDR VHF plugin is used. OpenCPN OK, SignalK plugins like maptracker and freeboard: not working

tkurki commented 4 years ago

Then you must have more connections than tcp localhost 10110 in OpenCPN. There is no way that SK forwards the data to OpenCPN without the data being in SK itself.

Jamos1988 commented 4 years ago

In OpenCPN I only have:

TCP input 10110 UDP output 20220 (for pypilot, with filters)

SDR VHF plugin reports to port 30330 SignalK UDP listens on 30330, when active opencpn receives AIS, when disabled, opencpn does not receive AIS.

Weird huh... :( can't bend my mind around it. Usually I am fine with network routing stuff, but now...

tkurki commented 4 years ago

https://github.com/openplotter/openplotter-sdr-vhf/issues/4