feat: nodes should die entirely if no MCU found

This should allow anchor to restart automatically if it's being run as a service
This commit is contained in:
Tristan McGinnis
2025-04-15 20:35:49 -05:00
committed by David
parent f12daff861
commit 8c4f75f75e
4 changed files with 17 additions and 10 deletions

View File

@@ -95,9 +95,10 @@ class SerialRelay(Node):
break
if self.port is None:
self.get_logger().info("Unable to find MCU... please make sure it is connected.")
time.sleep(1)
sys.exit(1)
self.get_logger().info("Unable to find MCU...")
#kill the node/process entirely
os.kill(os.getpid(), signal.SIGKILL)
sys.exit(0)
self.ser = serial.Serial(self.port, 115200)
atexit.register(self.cleanup)