auto: update RTK rover/base + config (2026-05-01 17:00:43)

This commit is contained in:
2026-05-01 17:00:43 +02:00
parent 50be327305
commit ec63cadd60
3 changed files with 216 additions and 1 deletions
+25 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys, time, struct, argparse, threading, os, sqlite3, uuid, select, termios, tty
import sys, time, struct, argparse, threading, os, sqlite3, uuid, select, termios, tty, json
from typing import Optional, Tuple, Dict
import serial
from serial.serialutil import SerialException
@@ -570,6 +570,8 @@ def main():
help="Start SQLite recording automatically on service start")
ap.add_argument("--record-note", default="auto",
help="Note stored in sessions table when --auto-record is used")
ap.add_argument("--cmd-file", default="/home/naue/rtk/rtk_rover_cmd.json",
help="Command file for web UI start/stop recording")
ap.add_argument("--site-log", action="store_true",
help="Enable construction-site FIX-only CSV/GeoJSON/status logging")
@@ -667,6 +669,28 @@ def main():
recorder.start(note="manual")
print(f"⏺️ Recording START (session={recorder.session_id})")
# Web/API command file: {"cmd":"start"} or {"cmd":"stop"}
try:
if args.cmd_file and os.path.exists(args.cmd_file):
with open(args.cmd_file, "r", encoding="utf-8") as f:
cmd = json.load(f)
try:
os.remove(args.cmd_file)
except Exception:
pass
action = str(cmd.get("cmd", "")).lower()
note = str(cmd.get("note", "web"))
if action == "start" and not recorder.is_recording():
recorder.start(note=note)
print(f"⏺️ Web Recording START (session={recorder.session_id})", flush=True)
elif action == "stop" and recorder.is_recording():
recorder.stop()
print("⏹️ Web Recording STOP", flush=True)
except Exception as e:
print(f"WEB CMD ERROR: {e}", flush=True)
f = read_ubx_frame(zed, timeout=0.05)
pvt = None
hpp = None