MTET is a Typer-based CLI tool for orchestrating measurement runs, capturing data from multiple sources, and performing evaluations.
Each measurement source runs in its own multiprocessing.Process, writing results into a synchronized run directory.
- Multi-process capture for measurements and reference signals
- Tinkerforge Voltage/Current Bricklet V2 for current/voltage monitoring
- SerialProcess for reference markers (start/stop signals)
- PPK2 (Nordic Power Profiler Kit 2) for high-precision reference measurements
- Saleae Logic Analyzer for digital reference/trigger signals
- Consolidated output:
- Feather chunks per process
meta.jsonconfiguration- CSV/Parquet files for evaluation
scripts/
mtet.py # CLI entrypoint (Typer App)
mtet/
list.py # "list" subcommands (enums)
run.py # "run" subcommands (start processes)
eval.py # "eval" subcommands (evaluation)
dut.py # DUT-specific helper commands
tools/
helpers.py # Helper functions
final_eval.py # Final evaluation across runs
tf_plot_data.py # Plot helper for TF data
tf_run_eval.py # TF run evaluation
processes/
TinkerForgeProcess.py # Bricklet V2 current/voltage
SerialProcess.py # Reference via UART
PPK2MeasurementProcess.py # Nordic Power Profiler Kit 2
SaleaeLogicMeasurementProcess.py # Saleae Logic Analyzer
File: scripts/tools/processes/TinkerForgeProcess.py
- Connects to Tinkerforge Brick Daemon (
localhost:4223) - Configurable: Averaging, Conversion Time, Interval, UID
- Writes Feather chunks +
meta.json - Provides primary current/voltage measurement
File: scripts/tools/processes/SerialProcess.py
- Opens a serial port (e.g.,
/dev/ttyUSB0) - Reads time-critical DUT markers/trigger signals (start/stop events)
- Stores values in Feather format (
serial_measurements.feather) - Provides reference time base for aligning measurements
File: scripts/tools/processes/PPK2MeasurementProcess.py
- Interfaces with the Nordic Power Profiler Kit 2 (PPK2)
- Captures high-resolution current measurements
- Outputs Feather + metadata
- Acts as reference measurement to validate Tinkerforge results
File: scripts/tools/processes/SaleaeLogicMeasurementProcess.py
- Uses Saleae Logic API (local Saleae server) for digital capture
- Records DUT reference signals or trigger patterns
- Writes
saleae_logic.feather - Enables temporal synchronization of DUT activity with measurement data
cd praktium-measurement-evaluation
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txtRequirements:
- Python ≥ 3.10
- Brick Daemon (for Tinkerforge)
- Drivers/tools for PPK2, Saleae, serial device
python scripts/mtet.py --helpCommands:
list List available options (enums)
run Start capture processes
eval Evaluate captured data
dut DUT-specific helper commands
# Averaging enums
python scripts/mtet.py list AVG
# Conversion time enums
python scripts/mtet.py list TMultiple processes can run simultaneously. Example identifiers:
- 1 = TinkerForgeProcess
- 2 = SerialProcess
- 3 = PPK2MeasurementProcess
- 4 = SaleaeLogicMeasurementProcess
# Bricklet UID
TF_UID=21hK
# Create run folder
mkdir -p ./runs/run_2025-08-29
# Start all processes (TF + Serial + PPK2 + Saleae)
python scripts/mtet.py run all ./runs/run_2025-08-29 --tf-avg 0 --tf-ct 4 --tf-interval 0.0022 --tf-uid "$TF_UID" --serial /dev/ttyUSB0 --ppk2 auto --saleae localhost:10429Parameters:
--tf-uid <STRING>Bricklet V2 UID--tf-avg <INT>Averaging (enum value, seelist AVG)--tf-ct <INT>Conversion time (enum value, seelist T)--tf-interval <FLOAT>Measurement interval in seconds--serial <DEVICE>Serial device (e.g.,/dev/ttyUSB0)--ppk2 <MODE>PPK2 connection (e.g.,autoor device path)--saleae <HOST:PORT>Saleae Logic server (default:localhost:10429)
Output:
Each process writes to the shared run directory (meta.json, Feather chunks).
- Per-process data:
python scripts/mtet.py eval tf-data ./runs/run_2025-08-29
python scripts/mtet.py eval serial ./runs/run_2025-08-29
python scripts/mtet.py eval ppk2 ./runs/run_2025-08-29
python scripts/mtet.py eval saleae ./runs/run_2025-08-29- Final evaluation (combined):
python scripts/mtet.py eval final ./runs/run_2025-08-29The helper scripts (tools/tf_run_eval.py, tools/tf_plot_data.py, tools/final_eval.py) generate CSV/Parquet and plots, aligning signals from all sources.
- Always run all reference processes for robust timing.
- Use PPK2 to validate Tinkerforge readings.
- Use Saleae to correlate DUT activity with power consumption.
- SerialProcess provides reproducible timing markers.
- UID not found (Tinkerforge): Brick Daemon running? Correct UID?
- PPK2 errors: Device permissions?
nrf-ppkdrivers installed? - Saleae errors: Saleae Logic software running? Remote API enabled?
- Serial errors: Correct port? Access rights?
Saleae Logic needs to run in the background!
Headless start (see: here):
sudo xvfb-run /home/info-ls3/measurement-timing-evaluation/software/Logic-2.4.22-linux-x64.AppImage --no-sandbox --automation