SignalK / nmea0183-signalk

NMEA0183 to Signal K parser
Other
30 stars 48 forks source link

DSC Distress Alerts #217

Open TwoCanPlugIn opened 2 years ago

TwoCanPlugIn commented 2 years ago

Is SignalK meant to parse NMEA 183 DSC and DSE sentences ?

Sending the following sentences does not generate any SIgnalK nodes as far as I can tell:

$CDDSC,12,5031105200,,05,00,2380814428,1800,,,R,E6C $CDDSE,1,1,A,5031105200,04,1925241118

and the following error is logged.

Jan 03 21:55:07 signalk:streams:nmea0183-signalk [error] line is not defined +4h

TwoCanPlugIn commented 2 years ago

Some further observations.

BTW, Not sure what happened with the formatting of the NMEA 183 sentences above. Have now learnt to enclose as code.

The DSC Distress alert sentences were $CDDSC,12,5031105200,,05,00,2380814428,1800,,,R,E*6C $CDDSE,1,1,A,5031105200,04,19252411*18

When sent over TCP or UDP no other nodes/contexts (or whatever you call them) are generated.

Similarly for a DSC Position Report, using the following sentence, nothing is generated. $CDDSC,20,5031105200,08,21,26,2380814428,1800,,,B,E*77 $CDDSE,1,1,A,5031105200,04,19252411*18

Instead if a DSC Distress Alert Relay is sent, using the following sentence: $CDDSC,16,2350763930,12,12,00,2380814428,1800,5031105200,05,S,E*65 $CDDSE,1,1,A,5031105200,04,19252411*18

the following context is created with the following values:

`vessels.urn:mrn:imo:mmsi:235076393

navigation.position { "latitude": -38.13333333333333, "longitude": 144.46666666666667 }

notifications.epirb {"message":"DSC Distress Recieved! Nature of distress: epirb"}`

The values in this Distress Relay sentence should be interpreted as: Format Specifier 16 - All Ships MMSI Address - 235076393 (This is the MMSI Address of the relay vessel) DSC Category 12 - Distress First Telecommand 12 - Distress Relay Type of Communications 00 - F3E/G3E, All modes TP Vessel In Distress 503110520 (this is the actual vessel in distress) Nature of Distress 05 - Sinking

Obviously this is being parsed incorrectly, using the wrong MMSI address for the vessel in distress, and the wrong value for nature of distress (12 being interpreted as MOB).

This is just totally broken.

No need to describe its impact on OpenCPN.

tkurki commented 2 years ago

This is just totally broken.

🤦

Yes it is. I'll see about fixing it in a few days.

tkurki commented 2 years ago

Oh, DSC & DSE are not very well documented in the open and many parsers don't support them at all.

@TwoCanPlugIn can you point to any additional resources in addition to https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:opencpn_user_manual:advanced_features:nmea_sentences and the linked https://continuouswave.com/whaler/reference/DSC_Datagrams.html ? And what about sources for real world data captures?

Inspired by https://github.com/canboat/canboat/issues/265 I figured I could take Kaitai for a spin by creating an initial Kaitai description of DSVC & DSE. Could be a start to a language agnostic NMEA0183 definition, instead of everybody and their cousin writing their own parser, each differently buggy or incomplete...

tkurki commented 2 years ago

$CDDSC,12,5031105200,,05,00,2380814428,1800,,,R,E*6C

Why is the DSC category field empty or what am I missing?

TwoCanPlugIn commented 2 years ago

From my perspective, DSC & DSE are well documented.

The foundation for DSC/DSE can be found in Recommendation ITU-R M.493-15 and Recommendation ITU-R M.821-1 respectively.

I find the NMEA 183 DSC & DSE sentences to be well documented in the NMEA 183 standard.

Just need to follow the rules for parsing the fields, as some fields are overloaded depending on the Format Specifier and DSC Category. And similar to AIS VDM messages, the DSE sentences use a simple character encoding scheme

I think Kees has pretty much nailed the NMEA 2000 stuff in Canboat and there is an Addendum from NMEA specifically for PGN129808. The major problem is that similar to NMEA 183, some fields are overloaded, again depending on Format Specifier & DSC Category. IMHO NMEA screwed this up, they could have made it a lot easier if they had different PGN's for the different Format Specifiers and didn't mimic the same data fields as used by the NMEA 183 sentence. And just to make things more interesting, there's the usual smattering of fixed and variable length fields.

Agree that there are few parsers, Note that OpenCPN only supports NMEA 183 Distress Alerts and Position Reports. I'm working with Hakan to try and get the Distress Alert Relay supported as well as making the UI a little more meaningful.

And from what I can tell there is no OpenCPN parsing of SignalK DSC messages. (Not that it would work anyway)

Regards,


From: Teppo Kurki @.> Sent: 04 January 2022 20:43 To: SignalK/nmea0183-signalk @.> Cc: TwoCanPlugIn @.>; Mention @.> Subject: Re: [SignalK/nmea0183-signalk] DSC Distress Alerts (Issue #217)

Oh, DSC & DSE are not very well documented in the open and many parsers don't support them at all.

@TwoCanPlugInhttps://github.com/TwoCanPlugIn can you point to any additional resources in addition to https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:opencpn_user_manual:advanced_features:nmea_sentences and the linked https://continuouswave.com/whaler/reference/DSC_Datagrams.html ? And what about sources for real world data captures?

Inspired by canboat/canboat#265https://github.com/canboat/canboat/issues/265 I figured I could take Kaitai for a spin by creating an initial Kaitai description of DSVC & DSE. Could be a start to a language agnostic NMEA0183 definition, instead of everybody and their cousin writing their own parser, each differently buggy or incomplete...

— Reply to this email directly, view it on GitHubhttps://github.com/SignalK/nmea0183-signalk/issues/217#issuecomment-1005156591, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJZF5FKZ4CCAJ5ASM5LXWGDUUNLYNANCNFSM5LGC2EFQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.***>

TwoCanPlugIn commented 2 years ago

Why is the DSC category field empty or what am I missing?

If the Format Specifier is Distress, the DSC Category field is set to null, as per the standard. It is just assumed.