mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 06:40:00 -07:00
Support f00b4r0 acarsdec fork and fix ADS-B stop
ACARS (f00b4r0/DragonOS compatibility): - Use --output json:file (not json:file:-) for stdout - Use --rtlsdr instead of -r for device selection - Use -m 256 for 3.2 MS/s sample rate (wider bandwidth for NA freqs) - Properly detects fork by checking for --output in help The f00b4r0 fork (used by DragonOS) has different CLI syntax than TLeconte's original. Key differences: - TLeconte: -j -r <device> - f00b4r0: --output json:file -m 256 --rtlsdr <device> ADS-B stop fix: - Add Content-Type header to stop fetch request - Flask's request.json requires application/json content type - Without this header, stop returns HTTP 415 and dump1090 keeps running
This commit is contained in:
@@ -227,8 +227,8 @@ def start_acars() -> Response:
|
|||||||
json_flag = get_acarsdec_json_flag(acarsdec_path)
|
json_flag = get_acarsdec_json_flag(acarsdec_path)
|
||||||
cmd = [acarsdec_path]
|
cmd = [acarsdec_path]
|
||||||
if json_flag == '--output':
|
if json_flag == '--output':
|
||||||
# f00b4r0 fork: --output json:file:- sends JSON to stdout
|
# f00b4r0 fork: --output json:file (no path = stdout)
|
||||||
cmd.extend(['--output', 'json:file:-'])
|
cmd.extend(['--output', 'json:file'])
|
||||||
elif json_flag == '-j':
|
elif json_flag == '-j':
|
||||||
cmd.append('-j') # JSON output (TLeconte v4+)
|
cmd.append('-j') # JSON output (TLeconte v4+)
|
||||||
else:
|
else:
|
||||||
@@ -242,8 +242,14 @@ def start_acars() -> Response:
|
|||||||
if ppm and str(ppm) != '0':
|
if ppm and str(ppm) != '0':
|
||||||
cmd.extend(['-p', str(ppm)])
|
cmd.extend(['-p', str(ppm)])
|
||||||
|
|
||||||
# Add device and frequencies (-r takes device, remaining args are frequencies)
|
# Add device and frequencies
|
||||||
cmd.extend(['-r', str(device)])
|
# f00b4r0 uses --rtlsdr <device>, TLeconte uses -r <device>
|
||||||
|
if json_flag == '--output':
|
||||||
|
# Use 3.2 MS/s sample rate for wider bandwidth (handles NA frequency span)
|
||||||
|
cmd.extend(['-m', '256'])
|
||||||
|
cmd.extend(['--rtlsdr', str(device)])
|
||||||
|
else:
|
||||||
|
cmd.extend(['-r', str(device)])
|
||||||
cmd.extend(frequencies)
|
cmd.extend(frequencies)
|
||||||
|
|
||||||
logger.info(f"Starting ACARS decoder: {' '.join(cmd)}")
|
logger.info(f"Starting ACARS decoder: {' '.join(cmd)}")
|
||||||
|
|||||||
@@ -2466,7 +2466,11 @@ sudo make install</code>
|
|||||||
const url = useAgent
|
const url = useAgent
|
||||||
? `/controller/agents/${adsbCurrentAgent}/adsb/stop`
|
? `/controller/agents/${adsbCurrentAgent}/adsb/stop`
|
||||||
: '/adsb/stop';
|
: '/adsb/stop';
|
||||||
await fetch(url, { method: 'POST' });
|
await fetch(url, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify({})
|
||||||
|
});
|
||||||
|
|
||||||
// Update agent running modes tracking
|
// Update agent running modes tracking
|
||||||
if (useAgent && typeof agentRunningModes !== 'undefined') {
|
if (useAgent && typeof agentRunningModes !== 'undefined') {
|
||||||
|
|||||||
Reference in New Issue
Block a user