From 4c00f57a85e1f144592d4d35c5fdd55a10ec8045 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Mon, 25 May 2026 12:01:39 +0200 Subject: [PATCH] readme: document main.py CLI usage and project file format Co-Authored-By: Claude Sonnet 4.6 --- readme.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/readme.md b/readme.md index 74ecc50..66645a7 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,64 @@ +# Usage + +## main.py + +``` +python main.py [--project FILE] [--save FILE] + [--network NAME HOST PORT] ... + [--serial NAME DEVICE BAUD] ... + [--file PATH] ... + [--log-dir DIR] [--delay SECS] +``` + +| Option | Default | Description | +|--------|---------|-------------| +| `--network NAME HOST PORT` | — | Add a TCP/IP source | +| `--serial NAME DEVICE BAUD` | — | Add a serial port source | +| `--file PATH` | — | Add a log file for replay | +| `--log-dir DIR` | `./log` | Directory for recorded frame logs | +| `--delay SECS` | `1.0` | Inter-frame delay for file replay (0–10 s) | +| `--project FILE` | — | Load config from a JSON project file | +| `--save FILE` | — | Save current config as a JSON project file | + +Multiple `--network`, `--serial` and `--file` options can be combined freely. + +### Examples + +```bash +# Two network receivers +python main.py --network neo-f9p 192.168.22.93 8721 \ + --network zed-x20p 192.168.22.93 8731 + +# Save config to project file +python main.py --network neo-f9p 192.168.22.93 8721 --save project.json + +# Load from project file +python main.py --project project.json + +# Replay a recorded log at 0.5 s per frame +python main.py --file log/2026_05_25_11_05_19_neo-f9p.log --delay 0.5 + +# Mix live network source with file replay +python main.py --network zed-x20p 192.168.22.93 8731 \ + --file log/2026_05_25_11_05_19_neo-f9p.log +``` + +### Project file format (JSON) + +```json +{ + "log_dir": "./log", + "delay": 1.0, + "sources": [ + {"type": "network", "name": "neo-f9p", "host": "192.168.22.93", "port": 8721}, + {"type": "serial", "name": "gps1", "device": "/dev/ttyUSB0", "baudrate": 115200}, + {"type": "file", "path": "log/2026_05_25_11_05_19_neo-f9p.log"} + ] +} +``` + +--- + # NEO-F9P ## Data sheet https://content.u-blox.com/sites/default/files/documents/NEO-F9P-15B_DataSheet_UBX-22021920.pdf?utm_content=UBX-22021920