Force fresh Morse JS and robust IQ stdout capture

This commit is contained in:
Smittix
2026-02-26 14:08:22 +00:00
parent d3b737c19b
commit b32d30b789
2 changed files with 9 additions and 2 deletions

View File

@@ -350,6 +350,13 @@ def start_morse() -> Response:
iq_cmd[-1:-1] = ['-D', str(direct_sampling_mode)]
else:
iq_cmd.extend(['-D', str(direct_sampling_mode)])
# Some rtl_sdr builds treat "-" as a literal filename instead of stdout.
# Use /dev/stdout explicitly on Unix-like systems for deterministic piping.
if iq_cmd:
if iq_cmd[-1] == '-':
iq_cmd[-1] = '/dev/stdout'
elif '/dev/stdout' not in iq_cmd:
iq_cmd.append('/dev/stdout')
return iq_cmd, tune_mhz
can_try_direct_sampling = bool(sdr_device.sdr_type == SDRType.RTL_SDR and freq < 24.0)
@@ -628,7 +635,7 @@ def start_morse() -> Response:
if rtl_process is None or stop_event is None or control_queue is None or decoder_thread is None:
msg = 'SDR capture started but no PCM stream was received.'
if attempt_errors:
msg = msg + ' ' + ' | '.join(attempt_errors[-2:])
msg = msg + ' ' + ' | '.join(attempt_errors)
logger.error(f'Morse startup failed: {msg}')
with app_module.morse_lock:
if morse_active_device is not None:

View File

@@ -3193,7 +3193,7 @@
<script src="{{ url_for('static', filename='js/modes/subghz.js') }}?v={{ version }}&r=subghz_layout9"></script>
<script src="{{ url_for('static', filename='js/modes/bt_locate.js') }}?v={{ version }}&r=btlocate4"></script>
<script src="{{ url_for('static', filename='js/modes/wefax.js') }}"></script>
<script src="{{ url_for('static', filename='js/modes/morse.js') }}"></script>
<script src="{{ url_for('static', filename='js/modes/morse.js') }}?v={{ version }}&r=morse_iq12"></script>
<script src="{{ url_for('static', filename='js/modes/space-weather.js') }}"></script>
<script src="{{ url_for('static', filename='js/core/voice-alerts.js') }}?v={{ version }}&r=voicefix2"></script>
<script src="{{ url_for('static', filename='js/core/keyboard-shortcuts.js') }}"></script>