mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
possible fix for stuck radio control
This commit is contained in:
parent
9e617b2da5
commit
0e111e628b
2 changed files with 2 additions and 4 deletions
|
@ -62,7 +62,8 @@ class radio:
|
||||||
def send_command(self, command) -> str:
|
def send_command(self, command) -> str:
|
||||||
if self.connected:
|
if self.connected:
|
||||||
# wait if we have another command awaiting its response...
|
# 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:
|
try:
|
||||||
self.await_response = threading.Event()
|
self.await_response = threading.Event()
|
||||||
|
@ -73,8 +74,6 @@ class radio:
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
self.log.warning(f"[RIGCTLD] Error sending command [{command}] to rigctld: {err}")
|
self.log.warning(f"[RIGCTLD] Error sending command [{command}] to rigctld: {err}")
|
||||||
self.connected = False
|
self.connected = False
|
||||||
|
|
||||||
|
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def set_ptt(self, state):
|
def set_ptt(self, state):
|
||||||
|
|
|
@ -122,7 +122,6 @@ def get_modem_state():
|
||||||
def post_cqcqcq():
|
def post_cqcqcq():
|
||||||
if request.method not in ['POST']:
|
if request.method not in ['POST']:
|
||||||
return api_response({"info": "endpoint for triggering a CQ via 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:
|
if not app.state_manager.is_modem_running:
|
||||||
api_abort('Modem not running', 503)
|
api_abort('Modem not running', 503)
|
||||||
enqueue_tx_command(command_cq.CQCommand)
|
enqueue_tx_command(command_cq.CQCommand)
|
||||||
|
|
Loading…
Reference in a new issue