mirror of
https://github.com/smittix/intercept.git
synced 2026-05-24 08:44:48 -07:00
Add readsb warning for HackRF/LimeSDR ADS-B tracking
- Enhanced /adsb/tools endpoint to detect SoapySDR hardware and check for readsb - Added UI warning in aircraft dashboard when HackRF/LimeSDR is detected but readsb is missing - Warning includes expandable installation instructions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
@@ -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
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -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 = `
|
||||
<div style="font-weight: bold; margin-bottom: 8px;">⚠️ ${typeList} Detected - readsb Required</div>
|
||||
<div style="margin-bottom: 10px;">ADS-B tracking with ${typeList} requires <strong>readsb</strong> compiled with SoapySDR support.</div>
|
||||
<details style="font-size: 11px;">
|
||||
<summary style="cursor: pointer; margin-bottom: 8px;">Installation Instructions</summary>
|
||||
<div style="background: rgba(0,0,0,0.1); padding: 10px; border-radius: 4px; margin-top: 5px;">
|
||||
<code style="display: block; white-space: pre-wrap; font-family: 'JetBrains Mono', monospace; font-size: 10px;">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</code>
|
||||
</div>
|
||||
</details>
|
||||
<button onclick="this.parentElement.remove()" style="position: absolute; top: 8px; right: 12px; background: none; border: none; color: #000; cursor: pointer; font-size: 16px; font-weight: bold;">×</button>
|
||||
`;
|
||||
document.body.appendChild(warning);
|
||||
}
|
||||
|
||||
function updateClock() {
|
||||
const now = new Date();
|
||||
document.getElementById('utcTime').textContent =
|
||||
|
||||
Reference in New Issue
Block a user