From 01409cfdead17c432fc42d8d900438cdddf19a89 Mon Sep 17 00:00:00 2001 From: mitchross Date: Fri, 20 Feb 2026 17:29:47 -0500 Subject: [PATCH] fix(adsb): use actual device index for ACARS/VDL2 SDR conflict checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ACARS and VDL2 conflict warnings were hardcoded to check device === '0' instead of comparing against the actual ADS-B device (adsbActiveDevice). This caused false warnings when ADS-B used a different device index. Also removes hardcoded device-1 defaults for ACARS/VDL2 selectors — users should pick their own device based on their antenna setup. Adds profiles: [basic] to the intercept service in docker-compose so it doesn't port-conflict with intercept-history when using --profile history. Co-Authored-By: Claude Opus 4.6 --- docker-compose.yml | 2 ++ templates/adsb_dashboard.html | 19 +++++++------------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 99b98cb..23f0982 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,6 +16,8 @@ services: image: ${INTERCEPT_IMAGE:-intercept:latest} build: . container_name: intercept + profiles: + - basic ports: - "5050:5050" # Privileged mode required for USB SDR device access diff --git a/templates/adsb_dashboard.html b/templates/adsb_dashboard.html index 4b84c9b..1d91ef4 100644 --- a/templates/adsb_dashboard.html +++ b/templates/adsb_dashboard.html @@ -3592,9 +3592,9 @@ sudo make install acarsCurrentAgent = isAgentMode ? adsbCurrentAgent : null; // Warn if using same device as ADS-B (only for local mode) - if (!isAgentMode && isTracking && device === '0') { + if (!isAgentMode && isTracking && adsbActiveDevice !== null && device === String(adsbActiveDevice)) { const useAnyway = confirm( - 'Warning: ADS-B tracking may be using SDR device 0.\n\n' + + `Warning: ADS-B tracking is using SDR device ${adsbActiveDevice}.\n\n` + 'ACARS uses VHF frequencies (129-131 MHz) while ADS-B uses 1090 MHz.\n' + 'You need TWO separate SDR devices to receive both simultaneously.\n\n' + 'Click OK to start ACARS on device ' + device + ' anyway.' @@ -3904,10 +3904,6 @@ sudo make install opt.textContent = `SDR ${d.index || i}: ${d.name || d.type || 'SDR'}`; select.appendChild(opt); }); - // Default to device 1 if available (device 0 likely used for ADS-B) - if (devices.length > 1) { - select.value = '1'; - } } }); }); @@ -4006,9 +4002,9 @@ sudo make install vdl2CurrentAgent = isAgentMode ? adsbCurrentAgent : null; // Warn if using same device as ADS-B (only for local mode) - if (!isAgentMode && isTracking && device === '0') { + if (!isAgentMode && isTracking && adsbActiveDevice !== null && device === String(adsbActiveDevice)) { const useAnyway = confirm( - 'Warning: ADS-B tracking may be using SDR device 0.\n\n' + + `Warning: ADS-B tracking is using SDR device ${adsbActiveDevice}.\n\n` + 'VDL2 uses VHF frequencies (~137 MHz) while ADS-B uses 1090 MHz.\n' + 'You need TWO separate SDR devices to receive both simultaneously.\n\n' + 'Click OK to start VDL2 on device ' + device + ' anyway.' @@ -4419,9 +4415,6 @@ sudo make install opt.textContent = `SDR ${d.index || i}: ${d.name || d.type || 'SDR'}`; select.appendChild(opt); }); - if (devices.length > 1) { - select.value = '1'; - } } }); @@ -5379,8 +5372,9 @@ sudo make install const adsbSelect = document.getElementById('adsbDeviceSelect'); const airbandSelect = document.getElementById('airbandDeviceSelect'); const acarsSelect = document.getElementById('acarsDeviceSelect'); + const vdl2Select = document.getElementById('vdl2DeviceSelect'); - [adsbSelect, airbandSelect, acarsSelect].forEach(select => { + [adsbSelect, airbandSelect, acarsSelect, vdl2Select].forEach(select => { if (!select) return; select.innerHTML = ''; @@ -5396,6 +5390,7 @@ sudo make install }); } }); + } // Hook into page init