Skip to content

fix: Make the GPS serial port configurable (#82) - #88

Merged
cwill747 merged 2 commits into
mainfrom
fix-82
Aug 9, 2026
Merged

fix: Make the GPS serial port configurable (#82)#88
cwill747 merged 2 commits into
mainfrom
fix-82

Conversation

@cwill747

@cwill747 cwill747 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Fixes #82. Split out of #87 — the contributed patch bundled both issues into one commit.

Problem

GPS was hardcoded to /dev/ttyS0, which is where the AIO V2 board exposes it on CM4-based uConsoles. CM5-based units expose the same UART at /dev/ttyAMA0, so GPS silently never worked there.

Fix

  • Auto-detection now probes /dev/ttyS0 then /dev/ttyAMA0.
  • The port can be pinned explicitly via Settings > GPS Device or the MESHCORE_GPS_DEVICE env var, which wins over both auto-detection and gpsd — needed when gpsd is running but bound to the wrong device, the case reported in the issue.
  • An explicit device is accepted even if the node is absent at startup (e.g. a USB GPS plugged in later); start() surfaces the open error rather than falling back silently.
  • Changing the setting rebuilds the provider in place, so it takes effect without restarting the app.

The GPS provider is now constructed after the settings load rather than before, since it needs the configured path.

Credit

Based on the patch contributed by @educationalpurposes in #81. Unmodified apart from the split, a MESHCORE_GPS_DEVICE entry in the AGENTS.md env var table, and a comment tidy.

Verification

uv run pytest: 101 passed, 1 skipped. ruff check / ruff format --check clean. Not tested on CM5 hardware — I don't have a unit; the reporter confirmed the change fixes it for them.

🤖 Generated with Claude Code

cwill747 and others added 2 commits August 9, 2026 13:41
GPS was hardcoded to /dev/ttyS0, which is where the AIO V2 board exposes
it on CM4-based uConsoles. CM5-based units expose the same UART at
/dev/ttyAMA0, so GPS silently never worked there.

- Auto-detection now probes /dev/ttyS0 then /dev/ttyAMA0.
- The port can be pinned explicitly via Settings > GPS Device or the
  MESHCORE_GPS_DEVICE env var, which wins over both auto-detection and
  gpsd — needed when gpsd is running but bound to the wrong device, the
  case reported in #82.
- An explicit device is accepted even if the node is absent at startup
  (e.g. a USB GPS plugged in later); start() surfaces the open error.
- Changing the setting rebuilds the provider in place, so it takes effect
  without restarting the app.

The GPS provider is now built after the settings load rather than before,
since it needs the configured path.

Based on the patch contributed by @educationalpurposes in #81.

Closes #82

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cwill747
cwill747 merged commit 15ca25d into main Aug 9, 2026
9 checks passed
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.

GPS hardcoded to /dev/ttyS0

1 participant