readme: document main.py CLI usage and project file format

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 12:01:39 +02:00
co-authored by Claude Sonnet 4.6
parent eba3a9dde9
commit 4c00f57a85
+61
View File
@@ -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 (010 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