diff --git a/routes/listening_post.py b/routes/listening_post.py index 56de062..f637ef9 100644 --- a/routes/listening_post.py +++ b/routes/listening_post.py @@ -1311,9 +1311,9 @@ def start_audio() -> Response: try: frequency = float(data.get('frequency', 0)) modulation = normalize_modulation(data.get('modulation', 'wfm')) - squelch = int(data.get('squelch') or 0) - gain = int(data.get('gain') or 40) - device = int(data.get('device') or 0) + squelch = int(data['squelch']) if data.get('squelch') is not None else 0 + gain = int(data['gain']) if data.get('gain') is not None else 40 + device = int(data['device']) if data.get('device') is not None else 0 sdr_type = str(data.get('sdr_type', 'rtlsdr')).lower() request_token_raw = data.get('request_token') request_token = int(request_token_raw) if request_token_raw is not None else None diff --git a/templates/adsb_dashboard.html b/templates/adsb_dashboard.html index a79b761..728644b 100644 --- a/templates/adsb_dashboard.html +++ b/templates/adsb_dashboard.html @@ -3652,10 +3652,12 @@ sudo make install async function startAirband() { const frequency = getAirbandFrequency(); - const device = parseInt(document.getElementById('airbandDeviceSelect').value) || 0; + const compositeVal = document.getElementById('airbandDeviceSelect').value || 'rtlsdr:0'; + const [sdr_type, deviceIdx] = compositeVal.includes(':') ? compositeVal.split(':') : ['rtlsdr', compositeVal]; + const device = parseInt(deviceIdx) || 0; const squelch = parseInt(document.getElementById('airbandSquelch').value) || 0; - console.log('[AIRBAND] Starting with device:', device, 'freq:', frequency, 'squelch:', squelch); + console.log('[AIRBAND] Starting with device:', device, 'sdr_type:', sdr_type, 'freq:', frequency, 'squelch:', squelch); // Check if ADS-B tracking is using this device if (isTracking && adsbActiveDevice !== null && device === adsbActiveDevice) { @@ -3682,7 +3684,8 @@ sudo make install modulation: 'am', // Airband uses AM squelch: squelch, gain: 40, - device: device + device: device, + sdr_type: sdr_type }) });