diff --git a/templates/adsb_dashboard.html b/templates/adsb_dashboard.html index 9cd1e30..fbec6ee 100644 --- a/templates/adsb_dashboard.html +++ b/templates/adsb_dashboard.html @@ -339,6 +339,9 @@ + @@ -2444,6 +2447,7 @@ sudo make install const requestBody = { device: adsbDevice, sdr_type: adsbSdrType, + gain: parseInt(document.getElementById('adsbGainInput')?.value || '40'), bias_t: getBiasTEnabled() }; if (remoteConfig) { diff --git a/templates/index.html b/templates/index.html index f2ef0a5..49eb83a 100644 --- a/templates/index.html +++ b/templates/index.html @@ -6095,8 +6095,8 @@ 'rtlsdr': { name: 'RTL-SDR', freq_min: 24, freq_max: 1766, gain_min: 0, gain_max: 50 }, 'sdrplay': { name: 'SDRplay', freq_min: 0.001, freq_max: 2000, gain_min: 0, gain_max: 59 }, 'limesdr': { name: 'LimeSDR', freq_min: 0.1, freq_max: 3800, gain_min: 0, gain_max: 73 }, - 'hackrf': { name: 'HackRF', freq_min: 1, freq_max: 6000, gain_min: 0, gain_max: 62 }, - 'airspy': { name: 'Airspy', freq_min: 24, freq_max: 1800, gain_min: 0, gain_max: 21 } + 'hackrf': { name: 'HackRF', freq_min: 1, freq_max: 6000, gain_min: 0, gain_max: 102 }, // LNA(40)+VGA(62) + 'airspy': { name: 'Airspy', freq_min: 24, freq_max: 1800, gain_min: 0, gain_max: 45 } // LNA(15)+Mix(15)+VGA(15) }; // Current device list with SDR type info @@ -6225,6 +6225,12 @@ if (caps) { document.getElementById('capFreqRange').textContent = `${caps.freq_min}-${caps.freq_max} MHz`; document.getElementById('capGainRange').textContent = `${caps.gain_min}-${caps.gain_max} dB`; + // Update max attribute on all mode gain inputs so constraints match the SDR + const gainMax = caps.gain_max; + ['gain', 'sensorGain', 'aisGainInput', 'acarsGainInput', 'aprsStripGain', 'weatherSatGain'].forEach(id => { + const el = document.getElementById(id); + if (el) el.max = gainMax; + }); } } diff --git a/templates/partials/modes/pager.html b/templates/partials/modes/pager.html index c905b96..308d216 100644 --- a/templates/partials/modes/pager.html +++ b/templates/partials/modes/pager.html @@ -32,7 +32,7 @@

Settings

- +
diff --git a/templates/partials/modes/sensor.html b/templates/partials/modes/sensor.html index de48700..b94d7c6 100644 --- a/templates/partials/modes/sensor.html +++ b/templates/partials/modes/sensor.html @@ -18,7 +18,7 @@

Settings

- +
diff --git a/utils/validation.py b/utils/validation.py index 860cfc9..ece0b53 100644 --- a/utils/validation.py +++ b/utils/validation.py @@ -93,11 +93,16 @@ def validate_rtl_tcp_port(port: Any) -> int: def validate_gain(gain: Any) -> float: - """Validate and return gain value.""" + """Validate and return gain value. + + Accepts 0 (auto/minimum) up to 102 dB to cover multi-stage SDRs + (HackRF LNA+VGA = 40+62 = 102 dB max). RTL-SDR caps at 50 dB + internally; values above 50 are only meaningful for HackRF/LimeSDR. + """ try: gain_float = float(gain) - if not 0 <= gain_float <= 50: - raise ValueError(f"Gain must be between 0 and 50, got {gain_float}") + if not 0 <= gain_float <= 102: + raise ValueError(f"Gain must be between 0 and 102, got {gain_float}") return gain_float except (ValueError, TypeError) as e: raise ValueError(f"Invalid gain: {gain}") from e