fix(adsb): use actual device index for ACARS/VDL2 SDR conflict checks

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 <noreply@anthropic.com>
This commit is contained in:
mitchross
2026-02-20 17:29:47 -05:00
parent 130f58d9cc
commit 01409cfdea
2 changed files with 9 additions and 12 deletions

View File

@@ -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

View File

@@ -3592,9 +3592,9 @@ sudo make install</code>
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</code>
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</code>
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</code>
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</code>
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</code>
});
}
});
}
// Hook into page init