fix: pass config file path (not directory) to radiosonde_auto_rx -c flag

Reverts the incorrect assumption from f8e5d61 that -c expects a
directory. The auto_rx -c flag expects the full path to station.cfg.
Passing the directory caused "Config file ... does not exist!" on start.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-03-02 16:35:25 +00:00
parent bcf447fe4e
commit e89a0ef486

View File

@@ -576,12 +576,12 @@ def start_radiosonde():
logger.error(f"Failed to generate radiosonde config: {e}")
return jsonify({'status': 'error', 'message': str(e)}), 500
# Build command - auto_rx -c expects a config DIRECTORY containing station.cfg
cfg_dir = os.path.dirname(os.path.abspath(cfg_path))
# Build command - auto_rx -c expects the path to station.cfg
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))