Share a self-reported position when no AIS transponder is available - #20
Merged
Conversation
The plugin builds class B position reports (60 s while the position changes) and static data (6 min) from Signal K, like @signalk/aisreporter, and publishes them as !AIVDO tagged s:self. Synthesis pauses for 5 min after any real !AIVDO. The server marks s:self events synthesized, keeping them out of the AISHub feed and tier accounting.
There was a problem hiding this comment.
Pull request overview
Adds a “self-reported own-ship” fallback so a Signal K instance with GPS but no AIS transponder can still publish AIS-like own-ship reports to aiscast, with server-side handling to mark these events as synthesized (synthesized: true) and keep them out of the AISHub feed and feeder-tier accounting.
Changes:
- Signal K plugin: synthesize and publish own-ship Class B position/static reports from Signal K data when enabled, tagged
s:self. - Server: treat
s:selfown-ship publishes as synthesized events; add coverage to prevent feeding to AISHub. - Docs/tests: add unit/integration tests and update user-facing documentation for the new Share setting and synthesized semantics.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| signalk-plugin/test/plugin.test.ts | Adds an integration test asserting s:self-tagged !AIVDO publishes occur when the fallback is enabled. |
| signalk-plugin/test/ownship.test.ts | Adds unit tests for synthesized own-ship AIS message construction and throttling rules. |
| signalk-plugin/src/ownship.ts | Implements own-ship AIS synthesis from Signal K position/static data. |
| signalk-plugin/src/index.ts | Wires new Share setting, dynamic uiSchema MMSI gating, and starts/stops own-ship synthesis. |
| signalk-plugin/src/downlink.ts | Reuses shared own-position helper and adjusts loop-guard ordering for self echoes. |
| signalk-plugin/README.md | Documents the new Share behavior and settings text. |
| signalk-plugin/CHANGELOG.md | Notes the new fallback setting and UI improvements. |
| server/pipeline.go | Marks s:self own-ship events as synthesized for downstream handling. |
| server/aishub_test.go | Adds a test ensuring self-reported own-ship is synthesized and excluded from AISHub feeding. |
| README.md | Updates top-level project docs to mention the plugin’s fallback behavior. |
| PLAN.md | Updates design/behavior documentation for own-ship fallback and config semantics. |
| docs/API.md | Extends synthesized semantics to include s:self own-ship GPS-built reports. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A boat with only a GPS can now appear on aiscast. When no
!AIVDOhas been heard for 5 minutes, the plugin builds class B position reports from Signal K (every 60 s while the position changes) and static data (name, callsign, size, every 6 min), the same thing@signalk/aisreporterdoes for MarineTraffic, and publishes them as!AIVDOtaggeds:self.The server marks
s:selfeventssynthesized: true. That keeps them out of the AISHub feed, whose terms forbid synthesized data, and out of a station's feeder-tier accounting. Consumers can tell them apart from VHF receptions by the flag.Settings
The Share section is three checkboxes, each explained below its label. Fallback to self-reported AIS position is checked by default when the config form is saved. Configs saved before the setting existed stay off until re-saved, so an upgrade never starts publishing on its own. Without an MMSI in Vessel settings the checkbox is disabled with a note (
uiSchemais a function, so the check runs on each config-page load).Nothing is sent without a fix or while the GPS sits at Null Island, and an unchanged position is not repeated. SOG, COG, and heading use the AIS "not available" sentinels when Signal K lacks them; heading falls back to magnetic plus variation.