Fix rtl_433 bias-t flag and add TSCM enhancements

- Fix bias-t option in rtl_433 for RTL-SDR and HackRF:
  - rtl_433's -T flag is for timeout, not bias-t
  - RTL-SDR: Use :biast=1 suffix on device string
  - HackRF: Use bias_t=1 in SoapySDR device string
- Add "Listen (FM/AM)" buttons to TSCM RF signal details
  - Switches to Listening Post mode and tunes to frequency
- Fix device detail header padding to prevent protocol badge
  overlapping with close button
This commit is contained in:
Smittix
2026-01-14 16:27:07 +00:00
parent b2feccdb90
commit 07af3acb84
3 changed files with 77 additions and 7 deletions

View File

@@ -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 += `</table></div>`;
// Add "Listen" button for RF signals
if (protocol === 'rf' && device.frequency) {
const freq = device.frequency;
html += `
<div class="device-detail-section" style="border-bottom: none;">
<h4>Actions</h4>
<div style="display: flex; gap: 8px; flex-wrap: wrap;">
<button class="tscm-action-btn" onclick="listenToRfSignal(${freq}, 'fm')">
🎧 Listen (FM)
</button>
<button class="tscm-action-btn" onclick="listenToRfSignal(${freq}, 'am')">
🎧 Listen (AM)
</button>
</div>
<div style="font-size: 10px; color: var(--text-secondary); margin-top: 8px;">
Opens Listening Post and tunes to this frequency
</div>
</div>
`;
}
// 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');

View File

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

View File

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