Merge pull request #734 from dudash/master

catch unhandled OSError when serial port in use
This commit is contained in:
Ian McEwen
2025-02-18 09:52:03 -07:00
committed by GitHub

View File

@@ -1268,6 +1268,12 @@ def common():
message += " After running that command, log out and re-login for it to take effect.\n"
message += f"Error was:{ex}"
meshtastic.util.our_exit(message)
except OSError as ex:
message = f"OS Error:\n"
message += " The serial device couldn't be opened, it might be in use by another process.\n"
message += " Please close any applications or webpages that may be using the device and try again.\n"
message += f"\nOriginal error: {ex}"
meshtastic.util.our_exit(message)
if client.devPath is None:
try:
client = meshtastic.tcp_interface.TCPInterface(