mirror of
https://github.com/smittix/intercept.git
synced 2026-07-16 05:18:10 -07:00
Fix stdout buffering: use PYTHONUNBUFFERED for grgsm_scanner
grgsm_scanner is a Python/GNU Radio script, so stdbuf has no effect. Setting PYTHONUNBUFFERED=1 in the subprocess env forces Python to flush stdout on every write, enabling real-time scan output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+4
-4
@@ -373,9 +373,7 @@ def start_scanner():
|
|||||||
return jsonify({'error': 'grgsm_scanner not found. Please install gr-gsm.'}), 500
|
return jsonify({'error': 'grgsm_scanner not found. Please install gr-gsm.'}), 500
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Use stdbuf to force line-buffered stdout - grgsm_scanner
|
cmd = ['grgsm_scanner']
|
||||||
# fully buffers stdout when piped, preventing real-time output
|
|
||||||
cmd = ['stdbuf', '-oL', 'grgsm_scanner']
|
|
||||||
|
|
||||||
# Add device argument (--args for RTL-SDR device selection)
|
# Add device argument (--args for RTL-SDR device selection)
|
||||||
cmd.extend(['--args', f'rtl={device_index}'])
|
cmd.extend(['--args', f'rtl={device_index}'])
|
||||||
@@ -1235,7 +1233,9 @@ def scanner_thread(cmd, device_index):
|
|||||||
# Start scanner process
|
# Start scanner process
|
||||||
# Set OSMO_FSM_DUP_CHECK_DISABLED to prevent libosmocore
|
# Set OSMO_FSM_DUP_CHECK_DISABLED to prevent libosmocore
|
||||||
# abort on duplicate FSM registration (common with apt gr-gsm)
|
# abort on duplicate FSM registration (common with apt gr-gsm)
|
||||||
env = dict(os.environ, OSMO_FSM_DUP_CHECK_DISABLED='1')
|
env = dict(os.environ,
|
||||||
|
OSMO_FSM_DUP_CHECK_DISABLED='1',
|
||||||
|
PYTHONUNBUFFERED='1')
|
||||||
process = subprocess.Popen(
|
process = subprocess.Popen(
|
||||||
cmd,
|
cmd,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
|
|||||||
Reference in New Issue
Block a user