diff --git a/templates/index.html b/templates/index.html index 1272429..8430000 100644 --- a/templates/index.html +++ b/templates/index.html @@ -2100,6 +2100,21 @@ padding: 4px 8px; border-radius: 3px; } + .tscm-action-btn { + padding: 10px 16px; + background: var(--accent-green); + border: none; + border-radius: 4px; + color: #000; + font-size: 12px; + font-weight: 600; + cursor: pointer; + transition: all 0.2s; + } + .tscm-action-btn:hover { + background: #2ecc71; + transform: translateY(-1px); + } .tscm-device-reasons { font-size: 10px; color: var(--text-secondary); @@ -2296,6 +2311,7 @@ } .device-detail-header { padding: 16px; + padding-right: 52px; /* Reserve space for close button */ border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; @@ -10665,6 +10681,27 @@ } html += ``; + // Add "Listen" button for RF signals + if (protocol === 'rf' && device.frequency) { + const freq = device.frequency; + html += ` +
+

Actions

+
+ + +
+
+ Opens Listening Post and tunes to this frequency +
+
+ `; + } + // Add indicators section if (device.indicators && device.indicators.length > 0) { html += ` @@ -10710,6 +10747,28 @@ document.getElementById('tscmDeviceModal').style.display = 'none'; } + function listenToRfSignal(frequency, modulation) { + // Close the modal + closeTscmDeviceModal(); + + // Switch to listening post mode + switchMode('listening'); + + // Wait a moment for the mode to switch, then tune to the frequency + setTimeout(() => { + if (typeof tuneToFrequency === 'function') { + tuneToFrequency(frequency, modulation); + } else { + // Fallback: manually update the frequency input + const freqInput = document.getElementById('radioScanStart'); + if (freqInput) { + freqInput.value = frequency.toFixed(1); + } + alert(`Tune to ${frequency.toFixed(3)} MHz (${modulation.toUpperCase()}) to listen`); + } + }, 300); + } + function showDevicesByCategory(category) { const modal = document.getElementById('tscmDeviceModal'); const content = document.getElementById('tscmDeviceModalContent'); diff --git a/utils/sdr/hackrf.py b/utils/sdr/hackrf.py index 562e201..a214114 100644 --- a/utils/sdr/hackrf.py +++ b/utils/sdr/hackrf.py @@ -134,8 +134,14 @@ class HackRFCommandBuilder(CommandBuilder): Build rtl_433 command with SoapySDR support for ISM band decoding. rtl_433 has native SoapySDR support via -d flag. + + Note: rtl_433's -T flag is for timeout, NOT bias-t. + For SoapySDR devices, bias-t is passed as a device setting. """ + # Build device string with optional bias-t setting device_str = self._build_device_string(device) + if bias_t: + device_str = f'{device_str},bias_t=1' cmd = [ 'rtl_433', @@ -147,9 +153,6 @@ class HackRFCommandBuilder(CommandBuilder): if gain is not None and gain > 0: cmd.extend(['-g', str(int(gain))]) - if bias_t: - cmd.extend(['-T']) - return cmd def get_capabilities(self) -> SDRCapabilities: diff --git a/utils/sdr/rtlsdr.py b/utils/sdr/rtlsdr.py index 0c52b0e..d8b9eb3 100644 --- a/utils/sdr/rtlsdr.py +++ b/utils/sdr/rtlsdr.py @@ -129,11 +129,22 @@ class RTLSDRCommandBuilder(CommandBuilder): Build rtl_433 command for ISM band sensor decoding. Outputs JSON for easy parsing. Supports local devices and rtl_tcp connections. + + Note: rtl_433's -T flag is for timeout, NOT bias-t. + Bias-t is enabled via the device string suffix :biast=1 """ rtl_433_path = get_tool_path('rtl_433') or 'rtl_433' + + # Build device argument with optional bias-t suffix + # rtl_433 uses :biast=1 suffix on device string, not -T flag + # (-T is timeout in rtl_433) + device_arg = self._get_device_arg(device) + if bias_t: + device_arg = f'{device_arg}:biast=1' + cmd = [ rtl_433_path, - '-d', self._get_device_arg(device), + '-d', device_arg, '-f', f'{frequency_mhz}M', '-F', 'json' ] @@ -144,9 +155,6 @@ class RTLSDRCommandBuilder(CommandBuilder): if ppm is not None and ppm != 0: cmd.extend(['-p', str(ppm)]) - if bias_t: - cmd.extend(['-T']) - return cmd def get_capabilities(self) -> SDRCapabilities: