The Cap's GPS moves the node, and is no longer offered as a companion

The Cardputer Zero's Cap carries a GPS on the header's UART, which the
device screen listed as "~ n/a" (pyserial's name for a port with no USB
identity): a companion to connect to, and with nothing remembered, the
lone port a command-line connect would pick. A wiring now names its
board's GPS (`gps_port`, `gps_baud`; the Cap's is /dev/serial0 at
115200), and wherever that radio is listed, its GPS port is not: the
device screen, `meshterm devices`, and autodetect.

The radio node reads it the way MeshCore companion firmware reads a
board's GPS: `gps` (off until switched on, remembered in prefs.json)
and `gps_interval` (0, every fix, once a second), reported and set as
custom variables, which is where Device config already shows them. A
valid RMC or GGA fix becomes the node's position, the one its
self-info reports and, with Share location on, its adverts carry. The
last fix is saved as the node shuts down. Standard library only, as
the node's contract asks; NMEA checksums are checked.

On MeshTerm's side, our own self-info is now refreshed behind the
answer after a minute, like the contacts, so screens opened after the
node moves show where it is; and the connect-time settings offer no
longer flags a position the running GPS moved.

Checked on the Cardputer: the ttyS0 row is gone from `meshterm
devices`; `config custom gps 1` opens the port, is saved, and reads
back on; the real-terminal test passes there.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jean-Pierre MartineauandClaude Opus 5.5 committed 2026-10-05 22:02:05 -04:00
1 parent c78a802ac6
commit 49d3eff212
14 files changed
+790 -34

No files matched your search

+26 -1
View File
@@ -172,4 +172,29 @@ A new node starts on MeshCore's US/Canada settings (910.525 MHz). Anywhere else,
them on **Device config** before you send anything. The node's key, contacts, and channels
are kept in `~/.meshterm/radio/spidev0.1/`.
The Cap also carries a GPS. MeshTerm doesn't read it yet.
#### The Cap's GPS
The Cap also carries a GPS, and MeshTerm can keep your node's position up to date from it.
It's off until you switch it on, the same as on MeshCore firmware. To switch it on:
1. Open **Device config**.
2. Under **Custom variables**, set **GPS** to on.
3. Apply.
Once the GPS has a fix, it becomes your node's position. Out in the open, the first fix
usually takes about a minute. Indoors, it may never come.
Two things don't change:
- **Whether your adverts include your position is still up to you.** That's the **Share
location** setting on Device config. With it off, the GPS still moves your node on
MeshTerm's own map, but nobody else sees where you are.
- **Moving your node on the map by hand doesn't stick while the GPS is on.** The next fix
puts it back where the GPS says you are. Switch the GPS off first.
**GPS interval** sets how often the position is updated, in seconds. It's 0 to start with,
which means every fix, about once a second. MeshTerm remembers your last fix when it quits,
so the next start begins where you were.
The GPS talks to the Cardputer over a serial port, the way a companion on a USB cable
does. It isn't a companion, though, so the device screen doesn't list it.
+1
View File
@@ -288,6 +288,7 @@ en_pins = [27] # the AIO v2 needs this
| `use_dio2_rf`, `use_dio3_tcxo` | `true`, `true` | Whether DIO2 drives the RF switch and DIO3 a TCXO (both on for the AIO). |
| `is_waveshare` | `false` | The Waveshare HAT's wiring quirks, which the radio library knows about. |
| `python` | `""` (empty) | An interpreter to run the node under, when the one MeshTerm would find on its own isn't the one you want. Empty lets MeshTerm look. |
| `gps_port`, `gps_baud` | `""`, `9600` | A GPS receiver on the same board: its serial port (empty for none) and its speed. The node runs it the way MeshCore firmware runs a board's GPS, switched on from Device config's **GPS** row, and the device screen stops listing the port as a companion. The Cardputer Zero's Cap needs no profile, but this is what one would say: `"/dev/serial0"`, `115200`. |
An unknown key, or one of the wrong type, stops MeshTerm at startup with the profile
named — a misspelt pin is never silently ignored.