diff --git a/gui/src/js/sock.js b/gui/src/js/sock.js index 8ca2d0c7..26f78b95 100644 --- a/gui/src/js/sock.js +++ b/gui/src/js/sock.js @@ -46,7 +46,7 @@ function connectModem() { client.on("connect", function () { console.log("Modem connection established"); - + stateStore.modem_running_state = "running" stateStore.busy_state = "-"; stateStore.arq_state = "-"; stateStore.frequency = "-"; @@ -63,7 +63,11 @@ client.on("error", function (err) { console.log("Modem connection error"); console.log(err); modemShowConnectStateError = 0; + stateStore.modem_running_state = "stopped" } + + + setTimeout(connectModem, 500); client.destroy(); stateStore.busy_state = "-"; @@ -93,6 +97,7 @@ client.on("end", function (data) { stateStore.dbfs_level = 0; stateStore.updateTncState(client.readyState); client.destroy(); + stateStore.modem_running_state = "stopped" setTimeout(connectModem, 500); }); diff --git a/modem/sock.py b/modem/sock.py index a1da13c7..097faa87 100644 --- a/modem/sock.py +++ b/modem/sock.py @@ -1128,12 +1128,12 @@ class ThreadedTCPRequestHandler(socketserver.StreamRequestHandler): def daemon_stop_modem(self, received_json): try: + log.warning("[SCK] Stopping Modem") + Daemon.modemstarted = False Daemon.modemprocess.kill() # unregister process from atexit to avoid process zombies atexit.unregister(Daemon.modemprocess.kill) - log.warning("[SCK] Stopping Modem") - Daemon.modemstarted = False command_response("stop_modem", True) except Exception as err: command_response("stop_modem", False)