diff --git a/instance/intercept.db b/instance/intercept.db index 123a5ae..15137ad 100644 Binary files a/instance/intercept.db and b/instance/intercept.db differ diff --git a/routes/adsb.py b/routes/adsb.py index ee2c7ec..334e061 100644 --- a/routes/adsb.py +++ b/routes/adsb.py @@ -213,10 +213,29 @@ def parse_sbs_stream(service_addr): @adsb_bp.route('/tools') def check_adsb_tools(): - """Check for ADS-B decoding tools.""" + """Check for ADS-B decoding tools and hardware.""" + # Check available decoders + has_dump1090 = find_dump1090() is not None + has_readsb = shutil.which('readsb') is not None + has_rtl_adsb = shutil.which('rtl_adsb') is not None + + # Check what SDR hardware is detected + devices = SDRFactory.detect_devices() + has_rtlsdr = any(d.sdr_type == SDRType.RTL_SDR for d in devices) + has_soapy_sdr = any(d.sdr_type in (SDRType.HACKRF, SDRType.LIMESDR, SDRType.AIRSPY) for d in devices) + soapy_types = [d.sdr_type.value for d in devices if d.sdr_type in (SDRType.HACKRF, SDRType.LIMESDR, SDRType.AIRSPY)] + + # Determine if readsb is needed but missing + needs_readsb = has_soapy_sdr and not has_readsb + return jsonify({ - 'dump1090': find_dump1090() is not None, - 'rtl_adsb': shutil.which('rtl_adsb') is not None + 'dump1090': has_dump1090, + 'readsb': has_readsb, + 'rtl_adsb': has_rtl_adsb, + 'has_rtlsdr': has_rtlsdr, + 'has_soapy_sdr': has_soapy_sdr, + 'soapy_types': soapy_types, + 'needs_readsb': needs_readsb }) diff --git a/templates/adsb_dashboard.html b/templates/adsb_dashboard.html index ee2c3f7..ff3d222 100644 --- a/templates/adsb_dashboard.html +++ b/templates/adsb_dashboard.html @@ -1145,8 +1145,58 @@ updateClock(); setInterval(updateClock, 1000); setInterval(cleanupOldAircraft, 10000); + checkAdsbTools(); }); + function checkAdsbTools() { + fetch('/adsb/tools') + .then(r => r.json()) + .then(data => { + if (data.needs_readsb) { + showReadsbWarning(data.soapy_types); + } + }) + .catch(() => {}); + } + + function showReadsbWarning(sdrTypes) { + const typeList = sdrTypes.join(', ') || 'SoapySDR device'; + const warning = document.createElement('div'); + warning.id = 'readsbWarning'; + warning.style.cssText = ` + position: fixed; + bottom: 80px; + left: 50%; + transform: translateX(-50%); + background: rgba(245, 158, 11, 0.95); + color: #000; + padding: 15px 25px; + border-radius: 8px; + font-size: 12px; + z-index: 10000; + box-shadow: 0 4px 20px rgba(0,0,0,0.5); + max-width: 500px; + text-align: left; + font-family: 'Inter', sans-serif; + `; + warning.innerHTML = ` +
sudo apt install build-essential libsoapysdr-dev librtlsdr-dev
+git clone https://github.com/wiedehopf/readsb.git
+cd readsb
+make HAVE_SOAPYSDR=1
+sudo make install
+