BENCHLAB PyTools is the main entry point for interacting with BENCHLAB telemetry devices using Python.
It provides a modular launcher to start different modes of operation, including:
- Interactive terminal TUI
- CSV logging for offline analysis
- Fast api server
- GUI graphing
- HWiNFO custom sensors
- MQTT publishing for remote dashboards
- VU analog-style dials and configuration
The launcher can operate in interactive mode or via command-line flags.
| Mode | Flag | Description | Notes |
|---|---|---|---|
| CSV Logging | -logfleet | Logs device data to CSV | Supports single-device and fleet logging. |
| Fast API | -fastapi | Access device telemetry through API calls | Supports multi-device |
| Graph | -graph | GUI graphing interface | Visualizes telemetry trends in real time. |
| HWiNFO | -hwinfo | HWiNFO export | Export telemetry as HWiNFO custom sensors |
| MQTT Publisher | -mqtt | Publishes telemetry to MQTT broker | Can connect to localhost or a remote broker. |
| TUI | -tui | Interactive terminal UI | Displays a live TUI for monitoring multiple devices. |
| VU Dials | -vu | Analog-style VU dials | Visual monitoring of device metrics. |
| VU Config | -vuconfig | VU configuration interface | Customize VU dials and settings interactively. |
BENCHLAB PyTools relies on Python 3.8+ and optional modules for each mode.
Install core dependencies:
pip install -r requirements.txt
Optional mode-specific dependencies are in:
/fastapi/requirements.txt/tests/requirements.txt/vu/requirements.txt
The launcher will attempt to install missing requirements for selected modes automatically.
Start without arguments:
python benchlab.py
- Presents a menu to select modes and features.
- Optionally installs requirements for selected modes.
- Allows selecting which mode to start immediately.
Run directly using flags:
python benchlab.py -fastapi
python benchlab.py -graph
python benchlab.py -hwinfo
python benchlab.py -logfleet
python benchlab.py -mqtt
python benchlab.py -vu
python benchlab.py -vuconfig
python benchlab.py -tui
python benchlab.py -info
Displays detailed mode descriptions and exits.
-
Mode Selection
- Interactive menu lists all modes with descriptions.
- User can select one or multiple modes.
- If
allis selected, launcher installs dependencies for all available modules.
-
Dependency Installation
- Checks for
/*/requirements.txtper mode. - Silently skips missing requirement files.
- Installs via pip if present.
- Checks for
-
Mode Execution
- Rewrites
sys.argvto dispatch to the selected mode. - Default behavior launches TUI if no flags are provided.
- Each mode is isolated; missing modules produce informative messages.
- Rewrites
MODESdictionary defines available modes, flags, requirements, and descriptions.launch_mode()handles CLI dispatching to mode-specific runners.- Default TUI mode uses
curses.wrapperfor terminal display.
- Add a new entry to the
MODESdictionary with:flag,reqs,desc,info.
- Implement a corresponding runner in
benchlab.<module>and import it inlaunch_mode(). - Optionally provide a
requirements_<tag>.txtfile.
- Clears the screen and shows mode selection.
- Supports comma-separated input (e.g.,
1,3,5) orall. - Supports an info view with detailed mode descriptions.
- Automatically installs requirements for selected modes if available.
- BENCHLAB core modules
- Individual module READMEs: