Skip to main content

Cross-platform TUI for NMEA 2000 with canboat decoding and pluggable drivers

Project description

pgntui

Cross-platform TUI for NMEA 2000 with canboat decoding.

Read live N2K frames through pluggable drivers, decode them with the canboat PGN database, and route values into JSON-defined dashboards. Record sessions to .pgnlog and replay them later — no boat required.

Install

The easiest path is pipx:

pipx install pgntui

If your system Python is older than 3.11, point pipx at a newer interpreter:

pipx install --python python3.12 pgntui

Or run in a project venv:

python3 -m venv .venv && . .venv/bin/activate
pip install pgntui

Standalone single-file binaries for macOS (arm64, x86_64), Linux (x86_64) and Windows (x86_64) are attached to each GitHub release.

Quickstart

Scaffold the example workspace and launch:

pgntui --example      # writes the example workspace at the OS default location
pgntui                # opens the TUI; no driver yet, debug tab will be empty

Replay a recording:

pgntui replay path/to/session.pgnlog

Run with a real driver — pgntui picks the driver named in config.toml:

pgntui                # uses driver.name from <workspace>/config.toml

Workspace layout

pgntui reads everything from a workspace directory. By default the location follows platformdirs.user_config_dir("pgntui"):

OS Default workspace
Linux ~/.config/pgntui
macOS ~/Library/Application Support/pgntui
Windows %APPDATA%\pgntui

Override with --workspace <path> on the command line.

Layout:

<workspace>/
  config.toml            # driver + theme + paths
  signals/*.json         # signal definitions (PGN -> field -> widget)
  containers/*.json      # dashboard layouts (tab -> grid of signals)
  recordings/            # .pgnlog files written by the R hotkey
  logs/                  # CSV exports

Run pgntui --example to drop a working sample inside this directory.

Drivers

Built-in driver entry points (pgntui.drivers):

  • actisense-ngt1 — Actisense NGT-1 USB serial gateway (pyserial)
  • file-replay — replay an Actisense .pgnlog capture

Pick one in config.toml:

[driver]
name = "actisense-ngt1"
port = "/dev/tty.usbserial-XXXX"   # macOS / Linux
# port = "COM4"                    # Windows
baud = 115200

Third-party drivers can register additional entry points under the pgntui.drivers group.

Signal types

Signal JSON files declare how each PGN field renders:

  • analog_in — gauge / numeric readout (RPM, speed, depth, temperature)
  • digital_in — boolean lamp (alarm, anchor light, bilge pump state)
  • analog_out — write-back analog control (sends an outbound frame)
  • digital_out — write-back toggle (sends an outbound frame)

analog_out and digital_out need --enable-write on the CLI and app.write_enabled = true in config.toml; otherwise they render as read-only.

Themes

Six builtins ship in the wheel:

  • dark (default)
  • light
  • amber-crt
  • green-phosphor
  • mono-ascii
  • rainbow-disco

Custom themes are JSON files referenced from config.toml:

[app]
theme = "dark"

Replay

Replay an Actisense-format .pgnlog:

pgntui replay capture.pgnlog

The replay driver respects the original frame spacing. Press the R hotkey inside the TUI to start/stop recording the live stream to a new .pgnlog file under <workspace>/recordings/.

Hotkeys

Tab / Shift+Tab     next / previous container tab
D                   jump to Debug tab
R                   start / stop recording
Q / Ctrl+Q          quit immediately
?                   show help line in status bar

Layout sketch

+---------------------------------------------------+
|  pgntui                                           |
+---------------------------------------------------+
| [Main] [Engine] [Nav] [Debug]                     |
+---------------------------------------------------+
|  RPM     1450    Speed   6.8 kn   Depth 12.3 m    |
|  +----+         +----+           +----+           |
|  |####|         |##  |           |#   |           |
|  +----+         +----+           +----+           |
|                                                   |
|  Bilge OFF     Anchor Light ON                    |
+---------------------------------------------------+
| [Tab] Next  [D] Debug  [R] Rec  [Q] Quit          |
| status: idle                                      |
+---------------------------------------------------+

Status

Alpha. Reasonable to dogfood on a known-good boat or a bench rig.

  • Works: TUI shell, canboat decoder, signal routing, file replay, Actisense NGT-1 driver (read), recording.
  • Partial: NGT-1 write-back is wired but field-tested only against a tiny PGN subset.
  • Not yet: TwoCAN / Yacht Devices native drivers, more layout primitives, per-signal alarm thresholds in the UI.

Bug reports and patches welcome — file an issue at https://github.com/phobicdotno/pgntui/issues.

License

MIT. See LICENSE.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pgntui-0.3.1.tar.gz (225.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pgntui-0.3.1-py3-none-any.whl (175.5 kB view details)

Uploaded Python 3

File details

Details for the file pgntui-0.3.1.tar.gz.

File metadata

  • Download URL: pgntui-0.3.1.tar.gz
  • Upload date:
  • Size: 225.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pgntui-0.3.1.tar.gz
Algorithm Hash digest
SHA256 e0fbafe3291c2b4681a7d8c75fc7a53e37dff9d6a7b8fe5c626cadb2df5eb1f2
MD5 9dc57e2e02c5e8b5100362a8f1f12ecb
BLAKE2b-256 e40270387aabe589a2b347d82da8a39eb43b3bbdfffcb93721e749d70821cea4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgntui-0.3.1.tar.gz:

Publisher: release.yml on phobicdotno/pgntui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pgntui-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: pgntui-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 175.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pgntui-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2c0fbef034bfec96f99408c83335fc054940f74b65c2b41127d54fbde2e801d3
MD5 9ac0f5f8e346cac9af9c1f5f7432fd6b
BLAKE2b-256 11a0623b9aeae25b854ba0742a03da2b2acda801d9835c193a01777c8abd4ba3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgntui-0.3.1-py3-none-any.whl:

Publisher: release.yml on phobicdotno/pgntui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page