feat(export): AIS UDP NMEA forward and JSON export endpoints for AIS/ADS-B

AIS:
- New optional NMEA UDP forwarding via AIS-catcher's -u flag, configurable
  from the AIS sidebar (host + port). Lets OpenCPN and other NMEA tools
  receive live vessel data directly. All SDR builders updated.
- New GET /ais/vessels endpoint — clean JSON snapshot of tracked vessels
  for REST integration

ADS-B:
- New GET /adsb/aircraft endpoint — JSON snapshot of all tracked aircraft,
  with optional ?icao= and ?military=true filters. Response includes a
  reminder that port 30003 (SBS) is already available for tools like
  Virtual Radar Server and OpenCPN's AIS/target plugin.

Closes #90
This commit is contained in:
James Smith
2026-04-05 16:20:10 +01:00
parent 50de9a9932
commit a1af859cd1
9 changed files with 138 additions and 8 deletions
+29 -1
View File
@@ -18,6 +18,23 @@
</div>
</div>
<div class="section">
<h3>NMEA UDP Forward</h3>
<p class="info-text" style="font-size: 11px; color: var(--text-dim); margin-bottom: 8px;">
Forward NMEA 0183 sentences to an external app (e.g. OpenCPN). Leave host blank to disable.
</p>
<div style="display: flex; gap: 8px;">
<div style="flex: 2;">
<label style="font-size: 10px; color: var(--text-dim);">Host</label>
<input type="text" id="aisUdpHost" placeholder="e.g. 192.168.1.10" style="width: 100%;">
</div>
<div style="flex: 1;">
<label style="font-size: 10px; color: var(--text-dim);">Port</label>
<input type="number" id="aisUdpPort" value="10110" min="1" max="65535" style="width: 100%;">
</div>
</div>
</div>
<div class="section">
<h3>Status</h3>
<div id="aisStatusDisplay" class="info-text">
@@ -110,11 +127,22 @@
function startAisTracking() {
const gain = document.getElementById('aisGainInput').value || '40';
const device = document.getElementById('deviceSelect')?.value || '0';
const udpHost = document.getElementById('aisUdpHost').value.trim();
const udpPort = parseInt(document.getElementById('aisUdpPort').value) || 10110;
const body = {
device, gain,
bias_t: typeof getBiasTEnabled === 'function' ? getBiasTEnabled() : false,
};
if (udpHost) {
body.udp_host = udpHost;
body.udp_port = udpPort;
}
fetch('/ais/start', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ device, gain, bias_t: typeof getBiasTEnabled === 'function' ? getBiasTEnabled() : false })
body: JSON.stringify(body)
})
.then(r => r.json())
.then(data => {