Skip to content

feat: Multi-GPS antenna position configuration#2399

Draft
dirkwa wants to merge 7 commits intoSignalK:masterfrom
dirkwa:gps-position-preferences
Draft

feat: Multi-GPS antenna position configuration#2399
dirkwa wants to merge 7 commits intoSignalK:masterfrom
dirkwa:gps-position-preferences

Conversation

@dirkwa
Copy link
Contributor

@dirkwa dirkwa commented Mar 3, 2026

Summary

Implements #2396 (Option A: Source-to-Sensor Linking) — each GNSS source gets its own sensor instance with individual antenna offsets.

Note: This PR is based on the source-priority-ux branch and should be merged after that PR lands.

What changed

Backend

  • GET/PUT /skServer/gpsSensors — per-source antenna offset configuration stored in settings.json
  • GET /skServer/positionSources — returns all sourceRefs currently providing navigation.position (NMEA 2000, NMEA 0183, and plugins)
  • POSITION_SOURCES and GPS_SENSORS server events for live UI updates
  • Offsets written into the SK data model at sensors.gps.<sensorId>.fromBow/fromCenter so external consumers (chart plotters, autopilots) can read them
  • Migration from legacy single-GPS sensors.gps.fromBow/fromCenter config
  • fromCenter sign convention follows the SK spec: positive = port, negative = starboard

Frontend

  • New GPS Antenna Positions card under Data → Preferences with a table showing detected and configured GPS sources
  • Draggable SVG boat schematic for visual antenna placement (bidirectional with the table)
  • Warning badge on the Preferences nav item for unconfigured GPS sources
  • Renamed "Unit Preferences" to "Preferences" (old URL redirects)
  • Removed GPS fields from Server → Settings → Vessel Configuration

Testing done

  • Two Furuno GPS receivers (NMEA 2000 via YDEN02) detected and configured with individual offsets
  • Verified offsets persist across server restarts in both settings.json and the SK data model (sensors.gps.* in data browser)
  • Confirmed fromCenter sign convention matches the SK spec after migration
  • Verified GET /vessel backward compatibility still returns gpsFromBow/gpsFromCenter
  • Warning badge appears for unconfigured sources and clears once offsets are set
  • SVG drag updates table values, table input moves dots — bidirectional sync works
  • Offline source detection: configured sensor with disconnected device shows as offline, config persists

Images

image image image

Fixes: #2396
Fixes: #1285
Relates to: #987

dirkwa added 7 commits March 6, 2026 06:17
Replace unstable N2K source addresses with CAN Name — a globally unique
identifier derived from the device's ISO Address Claim (PGN 60928). The
$source field for N2K devices now uses the format connectionName.canName
(e.g. can0.Furuno_SCX-20) instead of connectionName.address (e.g.
can0.22), making source priority configuration and ACLs stable across
bus topology changes.
…, sourcePolicy, and N2K device discovery

Extend the source priority system with global source ranking, preserve
all source data in the delta cache regardless of priority configuration,
and add sourcePolicy (preferred/all) for WebSocket subscriptions and
plugin subscriptions.

Server-side changes:
- DeltaCache: ingest all deltas before priority filtering, track
  multi-source paths, persist sources cache to disk, emit live
  MULTISOURCEPATHS events via serverevent
- DeltaPriority: add source ranking with timeout-based fallback and
  disabled source support (timeout=-1)
- StreamBundle: add unfilteredDelta channel for all-source subscribers
- SubscriptionManager: add sourcePolicy parameter support
- WebSocket: pass sourcePolicy query parameter to subscriptions
- NMEA 0183: add talker group configuration for grouping talker IDs
  into named source groups
- N2K Discovery: auto-discover devices via ISO Request (PGN 59904),
  support instance editing via PGN 126208, detect instance conflicts
- REST API: add endpoints for sourceRanking, sourceAliases,
  multiSourcePaths, ignoredInstanceConflicts, N2K discovery/config
… management

Reorganize the Data menu with dedicated pages for Source Priority,
Source Discovery, Meta Data, and Data Browser. Add Source Ranking UI
for global source priority ordering with drag-and-drop, timeout
configuration, and disable toggle. Add path-level override UI for
per-path source priority configuration.

UI changes:
- Source Priority page: global source ranking with drag-reorder,
  per-path overrides with add/remove, live sidebar badge showing
  unconfigured multi-source paths
- Source Discovery page: N2K device table with sortable columns,
  inline instance editing (device/data/battery/DC), installation
  description editing, PGN list, instance conflict detection with
  filtering and ignore capability
- Data Browser: add source view toggle, source priority filter toggle,
  extract Meta Data to dedicated page
- Shared infrastructure: sourceLabels utility for resolving source
  references to human-readable labels using N2K device data, source
  alias hooks, WebSocket handlers for live server events
- Talker group configuration UI in NMEA 0183 provider settings
Remove $source and source properties from alarm notification values
before storing them in the data model. These properties are internal
routing metadata that should not appear in the notification value
itself, where they cause confusion when inspecting alarm state.
… docs

Add comprehensive documentation for new features:
- Source Priority guide: source ranking, path-level overrides, priority
  resolution, REST API endpoints
- N2K Device Management: device discovery, CAN Name identification,
  instance editing (device/data/battery/DC), installation descriptions,
  instance conflict detection and resolution
- Developer docs: sourcePolicy subscription parameter for plugins and
  WebSocket clients
- Breaking changes: CAN Name source identification, all-source data
  preservation
- Configuration: document Data menu pages
…Source Discovery

Track which N2K devices respond to discovery sweeps via a separate
discoveredAddresses set, expose status through GET /n2kDeviceStatus,
and show Online/Offline badges in the UI.

Add DELETE /n2kRemoveSource endpoint for full device cleanup
(sourceDeltas, FullSignalK sources tree, aliases, channel labels)
with a Remove Device button in the expanded device detail area.

Deduplicate devices by canName both on write (setSourceDelta) and
on cache load (loadSourcesCache) to handle address 254 claim cycling
where the same physical device appears under multiple bus addresses.
Support multiple GPS receivers with individual antenna offsets,
replacing the single fromBow/fromCenter in Vessel Configuration.

Backend: add GET/PUT /gpsSensors and GET /positionSources endpoints,
detect all sources providing navigation.position (N2K, NMEA 0183,
plugins), emit POSITION_SOURCES and GPS_SENSORS server events, migrate
legacy single-GPS config, and write offsets into the SK data model at
sensors.gps.<sensorId>.fromBow/fromCenter.

Frontend: add GPS Antenna Positions card with table editor and
draggable SVG boat schematic, rename Unit Preferences to Preferences,
show warning badge for unconfigured GPS sources, remove GPS fields
from Vessel Configuration.

The fromCenter sign convention follows the Signal K specification:
positive = port, negative = starboard.
@dirkwa dirkwa force-pushed the gps-position-preferences branch from 481c516 to a163815 Compare March 5, 2026 18:17
@dirkwa
Copy link
Contributor Author

dirkwa commented Mar 7, 2026

Underlying PR set to draft, this follows.

@dirkwa dirkwa marked this pull request as draft March 7, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant