diff --git a/routes/sensor.py b/routes/sensor.py index a60210c..e2110fb 100644 --- a/routes/sensor.py +++ b/routes/sensor.py @@ -95,6 +95,14 @@ def stream_sensor_output(process: subprocess.Popen[bytes]) -> None: sensor_active_device = None +@sensor_bp.route('/sensor/status') +def sensor_status() -> Response: + """Check if sensor decoder is currently running.""" + with app_module.sensor_lock: + running = app_module.sensor_process is not None and app_module.sensor_process.poll() is None + return jsonify({'running': running}) + + @sensor_bp.route('/start_sensor', methods=['POST']) def start_sensor() -> Response: global sensor_active_device @@ -174,7 +182,8 @@ def start_sensor() -> Response: logger.info(f"Running: {full_cmd}") # Add signal level metadata so the frontend scope can display RSSI/SNR - cmd.extend(['-M', 'level']) + # Disable stats reporting to suppress "row count limit 50 reached" warnings + cmd.extend(['-M', 'level', '-M', 'stats:0']) try: app_module.sensor_process = subprocess.Popen( diff --git a/routes/tscm.py b/routes/tscm.py index 5a3d31d..e110495 100644 --- a/routes/tscm.py +++ b/routes/tscm.py @@ -551,6 +551,12 @@ def _start_sweep_internal( } +@tscm_bp.route('/status') +def tscm_status(): + """Check if any TSCM operation is currently running.""" + return jsonify({'running': _sweep_running}) + + @tscm_bp.route('/sweep/start', methods=['POST']) def start_sweep(): """Start a TSCM sweep."""