From 0e111e628b813cf2385f1bc875a59ff50be7f932 Mon Sep 17 00:00:00 2001 From: DJ2LS Date: Wed, 7 Feb 2024 22:23:49 +0100 Subject: [PATCH] possible fix for stuck radio control --- modem/rigctld.py | 5 ++--- modem/server.py | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/modem/rigctld.py b/modem/rigctld.py index 64996794..4e3a9110 100644 --- a/modem/rigctld.py +++ b/modem/rigctld.py @@ -62,7 +62,8 @@ class radio: def send_command(self, command) -> str: if self.connected: # wait if we have another command awaiting its response... - self.await_response.wait() + # we need to set a timeout for avoiding a blocking state + self.await_response.wait(timeout=1) try: self.await_response = threading.Event() @@ -73,8 +74,6 @@ class radio: except Exception as err: self.log.warning(f"[RIGCTLD] Error sending command [{command}] to rigctld: {err}") self.connected = False - - return "" def set_ptt(self, state): diff --git a/modem/server.py b/modem/server.py index d6335188..8661624d 100644 --- a/modem/server.py +++ b/modem/server.py @@ -122,7 +122,6 @@ def get_modem_state(): def post_cqcqcq(): if request.method not in ['POST']: return api_response({"info": "endpoint for triggering a CQ via POST"}) - print(app.state_manager.is_modem_running) if not app.state_manager.is_modem_running: api_abort('Modem not running', 503) enqueue_tx_command(command_cq.CQCommand)