Skip to content

Conversation

@coreywagehoft
Copy link
Collaborator

  • Adds support for GPS integrations with OpenMANET
    • GPS is activated on Seeed Studio Wio-WM6108
    • Position data is shared between nodes for future features
    • Position data is streamed via UDP to ATAK EUDs
    • If no device is connected to an OpenMANET node, the node publishes an ATAK CoT message via multicast with the radio's
  • (BETA) OpenMANET API
    • OpenMANET nodes now have a GRPC/REST API Available
    • The API is read-only for now to provide information for any future integrations. The ability to change or update settings will be added in the future.

Copilot AI review requested due to automatic review settings January 30, 2026 02:52
@coreywagehoft coreywagehoft self-assigned this Jan 30, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR integrates GNSS (GPS) support into OpenMANET, exposes node position via the API, and adds flexible GNSS configuration and telemetry output (NMEA and CoT), along with some refactors and connection-pool tuning.

Changes:

  • Introduces a new gpsd package with a reconnecting GPSD client, TPV/SKY parsing, NMEA generation and forwarding, and CoT generation for EUDs and multicast, plus extensive unit tests.
  • Refactors PTT runtime state to be instance-scoped, adds SQLite connection pool tuning, and wires GNSS data into the OpenMANET API status endpoint and configuration (gnss.* keys).
  • Regenerates API protobufs to add a Position message to ServiceStatus, updates Go module dependencies (gRPC, modernc sqlite, etc.), and switches GPS enablement to GetEnableGNSS.

Reviewed changes

Copilot reviewed 28 out of 29 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
proto Bumps the proto submodule to a new commit that likely contains GNSS-related API changes.
internal/util/logger/logger.go Adds a shared zerolog.ConsoleWriter to reduce allocations and reuses it across loggers.
internal/ptt/ptt.go Encapsulates PTT runtime state in a PTTRuntime struct tied to PTTConfig instead of package-level globals.
internal/ptt/comms.go Updates PTT comms to use the new PTTRuntime fields and methods on PTTConfig.
internal/openmanet/server/server.go Wires a GPS service into the API server so handlers can expose GNSS data.
internal/openmanet/server/handlers/status.go Extends status handler to include GNSS position from gpsd.GPSService in ServiceStatus.Position.
internal/openmanet/openmanet.go Switches to GetEnableGNSS(), passes config into gpsd.NewGPSService, and only closes GPS when GNSS is enabled.
internal/gpsd/types.go Defines GNSS domain types (PositionReport, TPVReport, SKYReport, and GPSService struct fields).
internal/gpsd/test_helpers.go Adds a mock GPSD TCP server and NMEA checksum helper for GPSD-related tests.
internal/gpsd/position_test.go Tests position update logic, satellite info merging, and getter methods on GPSService.
internal/gpsd/position.go Implements TPV/SKY update logic and position/NMEA getter methods on GPSService.
internal/gpsd/nmea_test.go Tests NMEA formatting, checksum calculation, NMEA storage, and configuration-driven NMEA forwarding.
internal/gpsd/nmea.go Implements NMEA GGA sentence formatting, checksum, and UDP distribution of raw NMEA to active DHCP clients.
internal/gpsd/gpsd_test.go Refactors GPSD integration tests to the new constructor signature and focuses this file on integration/concurrency tests.
internal/gpsd/cot_test.go Adds tests for CoT generation, device activity checks, and error handling paths.
internal/gpsd/cot.go Implements CoT sending to EUDs and ATAK multicast and ARP-based device liveness checks.
internal/gpsd/constants.go Centralizes GNSS-related constants (ports, multicast address, TTL, rate limits, etc.).
internal/gpsd/connection_test.go Tests GPSD connection handling, reconnection limits, and JSON message processing paths.
internal/gpsd/connection.go Implements GPSD connection management, reconnection, and JSON/NMEA message dispatching.
internal/database/db.go Configures the SQLite connection pool (max open/idle connections) for better behavior under load.
internal/config/config_test.go Updates tests for GetEnableGNSS and adds tests for new GNSS output configuration flags.
internal/config/config.go Adds GNSS configuration fields (EnableGNSS, GNSSSendAsNMEA, GNSSSendAsCoT) and their getters; makes defaults typed.
internal/api/openmanet/service/v1/status_vtproto.pb.go Extends vtproto-generated code with Position support (clone, equal, marshal/unmarshal).
internal/api/openmanet/service/v1/status.pb.go Extends the service status proto with a Position message and wires it into ServiceStatus.
go.sum Updates dependency checksums for new/updated modules (protovalidate, grpc, sqlite, mdlayher/arp, etc.).
go.mod Bumps several dependencies (gRPC, sqlite, protovalidate) and adds new ones (mdlayher/arp, ethernet, packet, etc.).
example_config.yml Migrates GPS config to a gnss block and shows both NMEA and CoT external GNSS source options enabled.
.dev_config.yaml Updates the dev config to use the new gnss configuration structure with GNSS disabled.
Comments suppressed due to low confidence (2)

internal/openmanet/server/handlers/status.go:1

  • If GNSS is disabled, GPS will be nil in StatusService, so s.GPS.GetPosition() will panic when the status endpoint is called. Consider guarding the access with a nil check (e.g., only populate Position when s.GPS != nil and optionally when the fix is valid), and set Position to nil otherwise.
package handlers

internal/database/db.go:1

  • The comment on SetConnMaxLifetime(0) is misleading: a value of 0 means connections are reused indefinitely (no maximum lifetime), not that they're closed sooner. Either adjust the comment to match the actual behavior (no lifetime limit) or set a finite duration if the intent is to periodically recycle connections.
package database

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coreywagehoft coreywagehoft merged commit 99a9996 into main Jan 30, 2026
10 of 12 checks passed
@coreywagehoft coreywagehoft deleted the gpsd-updates branch January 30, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants