mirror of
https://github.com/smittix/intercept.git
synced 2026-07-05 16:18:12 -07:00
fix: radiosonde config path and dependency detection
- Pass config file path (not directory) to auto_rx -c flag - Use absolute paths in generated station.cfg since auto_rx runs with cwd set to its install directory - Teach dependency checker about auto_rx.py at /opt install path so the "missing dependency" banner no longer appears Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -85,11 +85,13 @@ def generate_station_cfg(
|
||||
udp_port: int = RADIOSONDE_UDP_PORT,
|
||||
) -> str:
|
||||
"""Generate a station.cfg for radiosonde_auto_rx and return the file path."""
|
||||
cfg_dir = os.path.join('data', 'radiosonde')
|
||||
os.makedirs(cfg_dir, exist_ok=True)
|
||||
cfg_dir = os.path.abspath(os.path.join('data', 'radiosonde'))
|
||||
log_dir = os.path.join(cfg_dir, 'logs')
|
||||
os.makedirs(log_dir, exist_ok=True)
|
||||
cfg_path = os.path.join(cfg_dir, 'station.cfg')
|
||||
|
||||
# Minimal station.cfg that auto_rx needs
|
||||
# Use absolute paths since auto_rx runs with cwd set to its install dir
|
||||
cfg = f"""# Auto-generated by INTERCEPT for radiosonde_auto_rx
|
||||
[search_params]
|
||||
min_freq = {freq_min}
|
||||
@@ -122,7 +124,7 @@ station_alt = 0.0
|
||||
|
||||
[logging]
|
||||
per_sonde_log = True
|
||||
log_directory = ./data/radiosonde/logs
|
||||
log_directory = {log_dir}
|
||||
|
||||
[advanced]
|
||||
web_host = 127.0.0.1
|
||||
@@ -414,12 +416,12 @@ def start_radiosonde():
|
||||
bias_t=bias_t,
|
||||
)
|
||||
|
||||
# Build command
|
||||
cfg_dir = os.path.dirname(os.path.abspath(cfg_path))
|
||||
# Build command - auto_rx -c expects a file path, not a directory
|
||||
cfg_abs = os.path.abspath(cfg_path)
|
||||
if auto_rx_path.endswith('.py'):
|
||||
cmd = [sys.executable, auto_rx_path, '-c', cfg_dir]
|
||||
cmd = [sys.executable, auto_rx_path, '-c', cfg_abs]
|
||||
else:
|
||||
cmd = [auto_rx_path, '-c', cfg_dir]
|
||||
cmd = [auto_rx_path, '-c', cfg_abs]
|
||||
|
||||
# Set cwd to the auto_rx directory so 'from autorx.scan import ...' works
|
||||
auto_rx_dir = os.path.dirname(os.path.abspath(auto_rx_path))
|
||||
|
||||
Reference in New Issue
Block a user