From c96a3ade6b9adbef465e92bc4528422776e2c738 Mon Sep 17 00:00:00 2001 From: Smittix Date: Thu, 15 Jan 2026 20:24:04 +0000 Subject: [PATCH] Fix APRS direwolf command flags - Change direwolf flags from -D 1 to correct flags for stdin input - Add -n 1 (mono), -b 16 (16-bit), -t 0 (no PTT), -q d (quiet) - Add -M fm for explicit FM demodulation in rtl_fm - Add explicit stdout output (-) to rtl_fm command Co-Authored-By: Claude Opus 4.5 --- routes/aprs.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/routes/aprs.py b/routes/aprs.py index 77f789e..2f0f48e 100644 --- a/routes/aprs.py +++ b/routes/aprs.py @@ -421,6 +421,7 @@ def start_aprs() -> Response: rtl_cmd = [ rtl_fm_path, '-f', freq_hz, + '-M', 'fm', # FM demodulation '-s', '22050', # Sample rate for AFSK1200 '-d', str(device), ] @@ -430,9 +431,19 @@ def start_aprs() -> Response: if ppm and str(ppm) != '0': rtl_cmd.extend(['-p', str(ppm)]) + # Explicitly output to stdout + rtl_cmd.append('-') + # Build decoder command if direwolf_path: - decoder_cmd = [direwolf_path, '-r', '22050', '-D', '1', '-'] + # direwolf flags for receiving AFSK1200 from stdin: + # -n 1 = mono audio channel + # -r 22050 = sample rate + # -b 16 = 16-bit samples + # -t 0 = disable PTT (receive only) + # -q d = quiet mode (less debug output) + # - = read from stdin + decoder_cmd = [direwolf_path, '-n', '1', '-r', '22050', '-b', '16', '-t', '0', '-q', 'd', '-'] decoder_name = 'direwolf' else: decoder_cmd = [multimon_path, '-t', 'raw', '-a', 'AFSK1200', '-']