mirror of
https://github.com/smittix/intercept.git
synced 2026-07-09 01:58:13 -07:00
Add rtl_tcp (remote SDR) support v1.1.0
Features: - Add rtl_tcp support for pager and sensor decoding - Connect to remote RTL-SDR via rtl_tcp server - New UI toggle and host:port inputs in sidebar - Supports rtl_fm and rtl_433 with remote devices - Add remote dump1090 support for ADS-B tracking - Connect to dump1090 SBS output on remote machine - New "Remote" checkbox with host:port in ADS-B dashboard Backend changes: - Add rtl_tcp_host/port fields to SDRDevice dataclass - Add is_network property for detecting remote devices - Update RTLSDRCommandBuilder to use rtl_tcp:host:port format - Add create_network_device() to SDRFactory - Add validate_rtl_tcp_host/port validation functions - Update pager, sensor, and adsb routes to accept remote params Note: dump1090 doesn't support rtl_tcp directly - use remote dump1090's SBS output (port 30003) for remote ADS-B tracking.
This commit is contained in:
@@ -159,6 +159,17 @@
|
||||
<button class="gps-btn gps-connect-btn" onclick="startGpsDongle()">Connect</button>
|
||||
<button class="gps-btn gps-disconnect-btn" onclick="stopGpsDongle()" style="display: none; background: rgba(255,0,0,0.2); border-color: #ff4444;">Stop</button>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label style="display: flex; align-items: center; gap: 4px; font-size: 10px; cursor: pointer;">
|
||||
<input type="checkbox" id="useRemoteDump1090" onchange="toggleRemoteDump1090()">
|
||||
<span>Remote</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="control-group remote-dump1090-controls" style="display: none;">
|
||||
<input type="text" id="remoteSbsHost" placeholder="Host" style="width: 90px; font-size: 10px;">
|
||||
<span style="color: #666;">:</span>
|
||||
<input type="number" id="remoteSbsPort" value="30003" min="1" max="65535" style="width: 55px; font-size: 10px;">
|
||||
</div>
|
||||
<button class="start-btn" id="startBtn" onclick="toggleTracking()">START</button>
|
||||
</div>
|
||||
</main>
|
||||
@@ -1054,15 +1065,47 @@
|
||||
// ============================================
|
||||
// TRACKING CONTROL
|
||||
// ============================================
|
||||
|
||||
function toggleRemoteDump1090() {
|
||||
const useRemote = document.getElementById('useRemoteDump1090').checked;
|
||||
const controls = document.querySelector('.remote-dump1090-controls');
|
||||
controls.style.display = useRemote ? 'flex' : 'none';
|
||||
}
|
||||
|
||||
function getRemoteDump1090Config() {
|
||||
const useRemote = document.getElementById('useRemoteDump1090').checked;
|
||||
if (!useRemote) return null;
|
||||
|
||||
const host = document.getElementById('remoteSbsHost').value.trim();
|
||||
const port = parseInt(document.getElementById('remoteSbsPort').value) || 30003;
|
||||
|
||||
if (!host) {
|
||||
alert('Please enter remote dump1090 host address');
|
||||
return false;
|
||||
}
|
||||
|
||||
return { host, port };
|
||||
}
|
||||
|
||||
async function toggleTracking() {
|
||||
const btn = document.getElementById('startBtn');
|
||||
|
||||
if (!isTracking) {
|
||||
// Check for remote dump1090 config
|
||||
const remoteConfig = getRemoteDump1090Config();
|
||||
if (remoteConfig === false) return;
|
||||
|
||||
const requestBody = {};
|
||||
if (remoteConfig) {
|
||||
requestBody.remote_sbs_host = remoteConfig.host;
|
||||
requestBody.remote_sbs_port = remoteConfig.port;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch('/adsb/start', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({})
|
||||
body: JSON.stringify(requestBody)
|
||||
});
|
||||
|
||||
const text = await response.text();
|
||||
|
||||
@@ -298,6 +298,29 @@
|
||||
<button class="preset-btn" onclick="refreshDevices()" style="width: 100%;">
|
||||
Refresh Devices
|
||||
</button>
|
||||
|
||||
<!-- Remote SDR (rtl_tcp) -->
|
||||
<div class="form-group" style="margin-top: 10px;">
|
||||
<label style="display: flex; align-items: center; gap: 8px; cursor: pointer;">
|
||||
<input type="checkbox" id="useRemoteSDR" onchange="toggleRemoteSDR()">
|
||||
<span style="font-size: 11px; color: #888;">Use Remote SDR (rtl_tcp)</span>
|
||||
</label>
|
||||
</div>
|
||||
<div id="remoteSDRConfig" style="display: none; margin-bottom: 10px;">
|
||||
<div class="form-group">
|
||||
<label style="font-size: 11px; color: #888;">Host</label>
|
||||
<input type="text" id="rtlTcpHost" placeholder="192.168.1.100" style="width: 100%;">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label style="font-size: 11px; color: #888;">Port</label>
|
||||
<input type="number" id="rtlTcpPort" value="1234" min="1" max="65535" style="width: 100%;">
|
||||
</div>
|
||||
<div class="info-text" style="font-size: 10px; color: #666; margin-top: 4px;">
|
||||
Connect to rtl_tcp server on remote machine.<br>
|
||||
Start server with: <code style="color: #00d4ff;">rtl_tcp -a 0.0.0.0</code>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="toolStatusPager" class="info-text tool-status-section" style="display: grid; grid-template-columns: auto auto; gap: 4px 8px; align-items: center;">
|
||||
<span>rtl_fm:</span><span class="tool-status {{ 'ok' if tools.rtl_fm else 'missing' }}">{{ 'OK' if tools.rtl_fm else 'Missing' }}</span>
|
||||
<span>multimon-ng:</span><span class="tool-status {{ 'ok' if tools.multimon else 'missing' }}">{{ 'OK' if tools.multimon else 'Missing' }}</span>
|
||||
@@ -1918,6 +1941,10 @@
|
||||
const ppm = document.getElementById('sensorPpm').value;
|
||||
const device = getSelectedDevice();
|
||||
|
||||
// Check for remote SDR
|
||||
const remoteConfig = getRemoteSDRConfig();
|
||||
if (remoteConfig === false) return; // Validation failed
|
||||
|
||||
const config = {
|
||||
frequency: freq,
|
||||
gain: gain,
|
||||
@@ -1926,6 +1953,12 @@
|
||||
sdr_type: getSelectedSDRType()
|
||||
};
|
||||
|
||||
// Add rtl_tcp params if using remote SDR
|
||||
if (remoteConfig) {
|
||||
config.rtl_tcp_host = remoteConfig.host;
|
||||
config.rtl_tcp_port = remoteConfig.port;
|
||||
}
|
||||
|
||||
fetch('/start_sensor', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
@@ -2403,6 +2436,35 @@
|
||||
return document.getElementById('sdrTypeSelect').value;
|
||||
}
|
||||
|
||||
function toggleRemoteSDR() {
|
||||
const useRemote = document.getElementById('useRemoteSDR').checked;
|
||||
const configDiv = document.getElementById('remoteSDRConfig');
|
||||
const localControls = document.querySelectorAll('#sdrTypeSelect, #deviceSelect');
|
||||
|
||||
configDiv.style.display = useRemote ? 'block' : 'none';
|
||||
|
||||
// Dim local device controls when using remote
|
||||
localControls.forEach(el => {
|
||||
el.style.opacity = useRemote ? '0.5' : '1';
|
||||
el.disabled = useRemote;
|
||||
});
|
||||
}
|
||||
|
||||
function getRemoteSDRConfig() {
|
||||
const useRemote = document.getElementById('useRemoteSDR').checked;
|
||||
if (!useRemote) return null;
|
||||
|
||||
const host = document.getElementById('rtlTcpHost').value.trim();
|
||||
const port = parseInt(document.getElementById('rtlTcpPort').value) || 1234;
|
||||
|
||||
if (!host) {
|
||||
alert('Please enter rtl_tcp host address');
|
||||
return false;
|
||||
}
|
||||
|
||||
return { host, port };
|
||||
}
|
||||
|
||||
function getSelectedProtocols() {
|
||||
const protocols = [];
|
||||
if (document.getElementById('proto_pocsag512').checked) protocols.push('POCSAG512');
|
||||
@@ -2425,6 +2487,10 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for remote SDR
|
||||
const remoteConfig = getRemoteSDRConfig();
|
||||
if (remoteConfig === false) return; // Validation failed
|
||||
|
||||
const config = {
|
||||
frequency: freq,
|
||||
gain: gain,
|
||||
@@ -2435,6 +2501,12 @@
|
||||
protocols: protocols
|
||||
};
|
||||
|
||||
// Add rtl_tcp params if using remote SDR
|
||||
if (remoteConfig) {
|
||||
config.rtl_tcp_host = remoteConfig.host;
|
||||
config.rtl_tcp_port = remoteConfig.port;
|
||||
}
|
||||
|
||||
fetch('/start', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
|
||||
Reference in New Issue
Block a user