Metadata-Version: 2.4
Name: diagtui
Version: 2026.11.28
Summary: Terminal front end for Qualcomm modem DIAG logging: find a modem, read it, pull its qdb, record logs
Author: Luke Jenkins
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/lukejenkins/diagtui
Project-URL: Source, https://github.com/lukejenkins/diagtui
Keywords: diag,modem,cellular,baseband,lte,5g,capture,tui,curses
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console :: Curses
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Telecommunications Industry
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Communications
Classifier: Topic :: System :: Hardware
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: pyserial
Requires-Dist: diagmunge>=2026.11.28
Requires-Dist: diaggrok>=2026.11.28
Requires-Dist: diaggulp>=2026.11.28
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: license-file

# diagtui

> Part of the **[cellular `diag*` toolkit](https://github.com/lukejenkins/cellular#the-diag-toolkit)**: start there for how the capture/decode pieces fit together.

A terminal app for people who know cellular modems: pick a modem plugged into
this computer, read its details, download its qdb, and record DIAG logs while
you reproduce a problem.

diagtui is only a screen. Everything it does is an ordinary Python function in
the `diagmunge`, `diaggrok` and `diaggulp` packages, which a script can call
directly without diagtui.

## Install

```sh
pip install diagtui
diagtui            # open the screen
diagtui --resume   # reopen the modem and item you were on
```

It needs Python 3.11 or newer and runs on Linux. macOS support, through a DIAG
serial bridge, has not been tried on a real Mac yet. Reading a modem's ports usually needs root or membership of the
group that owns the serial devices (`dialout` on most Linux systems).

## What it does

- **Finds modems** on USB and PCIe and probes each serial port with read-only
  queries (AT, a DIAG version request, NMEA sentences) to learn what it is. A
  port that does not answer gets nothing more.
- **Reads the modem's details**: identity, SIM state, registration, signal. Raw
  answers are shown after their meaning, e.g. `registered, roaming  [0,5]`.
- **Downloads the qdb**: every file the modem's DIAG file server offers. The qdb
  is what turns the modem's terse debug messages into text.
- **Records DIAG logs** with a preset: everything, signalling only, signalling
  plus debug messages (often ten times the size), debug messages only, or GNSS.
  When a capture stops, the logging it turned on inside the modem is turned back
  off and checked. While logging, it shows the data rate, free disk space and the
  time left, and it stops a capture before the disk fills.
- **Checks a finished capture**: which log codes and versions it holds, and
  which of them the installed decoders can read.

Everything is saved under `~/diagtui/<Vendor>_<Model>_<serial>/<session>/`
(set `DIAGTUI_HOME` to change it), including an activity log of what was done.

## How it looks

A dark, keyboard-only screen in the style of an old DOS utility: arrow keys,
Enter, Esc and letter keys; one tree from modems to what each modem has; the
commands on the bottom line. Nothing asks a question away from the cursor, and
slow work shows its progress in place.

## Tests

```sh
pip install "diagtui[test]"
pytest
```

The tests use fake serial ports and fake device trees; no modem is needed.

## License

Apache-2.0. See `LICENSE` and `NOTICE`.
