From a2a3ea62f1369ed9e9415144aa1db20f0e994387 Mon Sep 17 00:00:00 2001 From: Smittix Date: Tue, 6 Jan 2026 20:38:35 +0000 Subject: [PATCH] Fix SoapySDR detection and HackRF ADS-B error message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Try multiple SoapySDR utility names: SoapySDRUtil, soapy_sdr_util, soapysdr-util - Improve error message for HackRF/LimeSDR ADS-B to mention readsb requirement 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- instance/intercept.db | Bin 32768 -> 32768 bytes routes/adsb.py | 5 ++++- utils/sdr/detection.py | 16 +++++++++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/instance/intercept.db b/instance/intercept.db index 5e92d249c7e1e2eabdfe17ba3de6dd16437b01c4..123a5aed16e17ddf867aa44ded5791afd178fc75 100644 GIT binary patch delta 47 tcmZo@U}|V!njp=XHBrWyF>7N2zdVbDm66%xVtG9XV=0ue`MSJj0sui14OsvH delta 47 tcmZo@U}|V!njp=XI#I@%F?C}CzdVbnm5JfxVtG9XV=0ue`MSJj0suaZ4Ltw= diff --git a/routes/adsb.py b/routes/adsb.py index fe0aa45..ee2c7ec 100644 --- a/routes/adsb.py +++ b/routes/adsb.py @@ -336,7 +336,10 @@ def start_adsb(): time.sleep(DUMP1090_START_WAIT) if app_module.adsb_process.poll() is not None: - return jsonify({'status': 'error', 'message': 'dump1090 failed to start. Check RTL-SDR device permissions or if another process is using it.'}) + if sdr_type == SDRType.RTL_SDR: + return jsonify({'status': 'error', 'message': 'dump1090 failed to start. Check RTL-SDR device permissions or if another process is using it.'}) + else: + return jsonify({'status': 'error', 'message': f'ADS-B decoder failed to start for {sdr_type.value}. Ensure readsb is installed with SoapySDR support and the device is connected.'}) adsb_using_service = True thread = threading.Thread(target=parse_sbs_stream, args=(f'localhost:{ADSB_SBS_PORT}',), daemon=True) diff --git a/utils/sdr/detection.py b/utils/sdr/detection.py index 0dcfcb5..95fba91 100644 --- a/utils/sdr/detection.py +++ b/utils/sdr/detection.py @@ -144,6 +144,15 @@ def detect_rtlsdr_devices() -> list[SDRDevice]: return devices +def _find_soapy_util() -> str | None: + """Find SoapySDR utility command (name varies by distribution).""" + # Try different command names used across distributions + for cmd in ['SoapySDRUtil', 'soapy_sdr_util', 'soapysdr-util']: + if _check_tool(cmd): + return cmd + return None + + def detect_soapy_devices(skip_types: Optional[set[SDRType]] = None) -> list[SDRDevice]: """ Detect SDR devices via SoapySDR. @@ -156,13 +165,14 @@ def detect_soapy_devices(skip_types: Optional[set[SDRType]] = None) -> list[SDRD devices: list[SDRDevice] = [] skip_types = skip_types or set() - if not _check_tool('SoapySDRUtil'): - logger.debug("SoapySDRUtil not found, skipping SoapySDR detection") + soapy_cmd = _find_soapy_util() + if not soapy_cmd: + logger.debug("SoapySDR utility not found, skipping SoapySDR detection") return devices try: result = subprocess.run( - ['SoapySDRUtil', '--find'], + [soapy_cmd, '--find'], capture_output=True, text=True, timeout=10