-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When SIgnalK has a lost GPS message, it is not reflected in UI or generated Autopilot Sentences #3804
Comments
The "no GPS" status is not reliable what I've seen. |
Hi Hakan, You have far more experience with SignalK than I, as far as I can tell, there is no other key to use, there is only navigation.gnss,methodQuality From my observations.
When your Simrad GS-25 has lost a fix, in addition to the "no GNSS" value, in PGN 129029, were lat and long set to ULLONG_MAX, meaning data unavailable? And I guess no one has tested O to make sure it exhibits the correct behaviour when receiving NMEA 2000 and generating and outputting NMEA 0183 APB, RMB and XTE sentences. |
My tests was not about the system handling the GNSS info, PGN or PGN->Signalk or N0183. Your discussion about continuing to transfer a active route data to a AP when the position flag is low I think is valid. We may inactivate a route if there's no own ship position? But I can't embrace all possible implications for the moment. .....? |
This issue relates to specific design behavior of available signalK servers. |
My testing involved sending SignalK Server various GGA sentences, with different values for field 6, the GPS Quality indicator. When a GGA sentence with a GPS Quaity Indicator vakue of 0 (No Fix) was sent to SignalK, it was parsed correctly resulting in the following delta: However OpenCPN generated incorrect APB, RMB and XTE sentences upon reception of that delta. I'm nowhere near my boat and without my SignalK server, so someone else should test this to verify my observations with a real GPS. The one omission on my part is that during my testing I may not have generated correct GGA sentences for a lost fix, I don't recall setting the lat & long values to null even though I set the GPS Quality Indicator field to 0. I can't confirm what values a NMEA 0183 GPS sends when it has lost a fix. I know from previous observations they are null until it has obtained a fix, but I don't know what happens when a fix is lost. Are lat & long null values and the GPS Quality indicator field also set to 0 (No fix). I'm also not sure what SignalK generates for navigation.position when NMEA 0183 GGA sentences contain null values for lat & long ? |
Without need to discuss what sK server does or does not do with GGA, we can say that if sK says "quality" = "no GPS" then O should not try to transmit Autopilot commands. |
Corrected response to "quality" = "no GPS". @hakan: |
I'm in the boat and can't reach the pot. :) Now we have both "braces and belt": Not sufficient number of satellites and "no GPS", good. If a device can report not enough satellites but still "GPS fix" the vice verse may happen as well. We are safe. |
I think we are done here. |
I could use the same "test harness" as before to get SignalK to transmit the appropriate deltas. At what stage does a low number of satellites affect OpenCPN ? If the user happens (or inadvertently) filters out all but GGA & RMC, neither of which indicate the number of satellites, what will OpenCPN do when the SignalK deltas indicate a GPS Fix, but no satellites? |
With satellite count = zero, OCPN 59 will honor "navigation.gnss.method" delta, and show a valid fix with green ball instead of multi signal bars. |
This has yet to make it to the nightly build ? I'm seeing no difference yet. One other aside. If O does not receive any deltas from SignalK, the autopilot sentences stop. Admittedly a decent autopilot will time out and behave properly (sound an alarm, disengage), but I would have assumed that O would continue to send autopilot sentences every second albeit with the status fields set to 'V' (Invalid) and the Mode Indicator field et to 'N' (Data not valid) until the navigation is halted. |
Your suggestion to trust an AP to read mode indication or GNSS quality data may be valid for modern APs. |
"This has yet to make it to the nightly build ?" |
It doesn't seem to work. This is sent to SignalK via NMEA 0183 over UDP
At 00:16:17 I "lost the GPS fix" This is the output from SignalK (filtering on navigation.position & navigation.gnss.gpsMethodQuality)
At 00:16:19 SignalK reports the subsequent No GPS. Here is the OpenCPN NMEA 0183 serial output with an Active Route. (Note that OpenCPN still shows 3 green bars for the GPS status) The Autopilot output does not reflect the lost GPS signal
Perhaps my "lab testing" is not indicative of the real world, or watching three scripts logging traffic is doing my head in. Or maybe there are too many moving parts. Also I'm not entirely sure that when the GPS has no fix whether the latitude & longitude fields should be null in the respective NMEA sentences nor how SignalK should behave. Maybe Hakan should perform the cooking pot test. Re @Hakansv
Totally agree, Maybe have a "Legacy Mode" checkbox. Just kidding... |
@TwoCanPlugIn void CommDecoder::updateItem(const rapidjson::Value &item, The way we set the "GPS Invalid" flag is this:
I tested this logic with a contrived setup, no real GPS. And it worked. Should be possible to catch some of this by setting some strategic breakpoints. |
"This is sent to SignalK via NMEA 0183 over UDP" So... how could a valid system both report 10 satellites, a position and "no GPS"? Troubled test data? GPGGA,001617,3811.00,S,14430.00,E,0,10,0.98,1113.0,M,-21.3,M,25,10*7F |
Without further comment or test results, closing this issue now. |
In between some fibreglass repairs and looking at Timo's NGT-1 fix..... Updated the NMEA0183 test script to simulate a lost GPS fix (null values for lat & long, satellites = 0 and the other flags to indicate a lost fix. SignalK appears to respond accordingly. OpenCPN stops sending autopilot sentences (ECRMB, EXAPB, ECXTE), which I guess keeps users of older autopilots happy (and probably by definition, possibly current autopilots), but it doesn't change the validity fields for these sentences. I personally would have expected that the generated RMB, APB and XTE sentences would correctly reflect that lost fix flags but if that is the design criteria, so be it and feel free to close. Note that the OpenCPN Satellite does turn red to indicate a lost fix. I also noted that the generated XTE sentence omits the FAA Mode Indicator field, but I think we've had that discussion before. Here are the three dumps.
The subsequent SignalK responses. (appears to correctly reflect the lost GPS signal)
and the NMEA 0183 autopilot output. (appeasr to be some delay, not sure if it is O or my stuff)
|
I think the delay is the 10 sec GPS timeout also seen in the log file? |
Closing as completed |
When SignalK is receiving position data from a NMEA 0183 GPS it reflects field 6 (GPS Quality Mode Indicator) in the delta message.
Eg.
{"updates":[{"source":{"sentence":"GGA","talker":"GP","type":"NMEA0183","label":"NMEA183-UDP"},"timestamp":"2024-04-09T22:45:34.000Z","values":[{"path":"navigation.position","value":{"longitude":144.5,"latitude":-38.18333333333333}},{"path":"navigation.gnss.methodQuality","value":"no GPS"},{"path":"navigation.gnss.satellites","value":10},{"path":"navigation.gnss.antennaAltitude","value":1113},{"path":"navigation.gnss.horizontalDilution","value":0.98},{"path":"navigation.gnss.differentialAge","value":25},{"path":"navigation.gnss.differentialReference","value":10}],"$source":"NMEA183-UDP.GP"}],"context":"vessels.urn:mrn:signalk:uuid:1cb1a66a-814c-4478-8b84-701eec9524bb"}
if OpenCPN has an Active Route it generates the following erroneous sentences
$ECRMB,A,0.000,L,001,002,3803.798,S,14444.997,E,13.847,58.596,0.000,V,A*62
$ECRMC,054105,A,3811.000,S,14430.000,E,0.000,0.000,100424,,,,A*5F
$ECAPB,A,A,0.000,L,N,V,V,58.596,T,002,58.596,T,58.596,T*06
$ECXTE,A,A,0.000,L,N*4F
Refer to #3452 for how the RMB, APB and XTE sentences should reflect the GNSS status
These are the SignalK deltas for each of the valid NMEA 0183 GPS Quality Mode Indicator values (0-8)
{"path":"navigation.gnss.methodQuality","value":"no GPS"}
{"path":"navigation.gnss.methodQuality","value":"GNSS Fix"}
{"path":"navigation.gnss.methodQuality","value":"DGNSS fix"}
{"path":"navigation.gnss.methodQuality","value":"Precise GNSS"}
{"path":"navigation.gnss.methodQuality","value":"RTK fixed integer"}
{"path":"navigation.gnss.methodQuality","value":"RTK float"}
{"path":"navigation.gnss.methodQuality","value":"Estimated (DR) mode"},{"path":"navigation.gnss.methodQuality","value":"Manual input"}{"path":"navigation.gnss.methodQuality","value":"Simulator mode"},
If the NMEA GGA sentence contains an invalid value for GPS Quality Mode Indicator (<0, >8), SignalK DOES NOT return navigation.gnss.methodQuality namespace (I don't know if that should be considered a bug in SignalK ?)
If the NMEA GGA sentence contains a null value for GPS Quality Mode Indicator , SignalK returns.
{"path":"navigation.gnss.methodQuality","value":"no GPS"}
pseudo code
GPS Status = Invalid
if root["navigation"]["gnss"].HasMember("methodQuality"))
if root["navigation"]["gnss"].[methodQuality"].AsString = GNSS or DGNSS
GPS Status is Valid
I don't know about Precise DNSS, or RTK, I've never seen these, so unsure how you should handle, presumably they are valid fixes.
Side note, the Satellite Icon does not reflect GPS status when receiving SignalK
The text was updated successfully, but these errors were encountered: