From 1f270b5ba5949d83a71483d436a855a7a2d85609 Mon Sep 17 00:00:00 2001 From: pdxlocations Date: Tue, 8 Apr 2025 20:50:30 -0700 Subject: [PATCH] devpath --- contact/utilities/interfaces.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contact/utilities/interfaces.py b/contact/utilities/interfaces.py index d568de6..3c52674 100644 --- a/contact/utilities/interfaces.py +++ b/contact/utilities/interfaces.py @@ -10,14 +10,15 @@ def initialize_interface(args): return meshtastic.tcp_interface.TCPInterface(args.host) else: try: - return meshtastic.serial_interface.SerialInterface(args.port) + client = meshtastic.serial_interface.SerialInterface(args.port) except PermissionError as ex: logging.error(f"You probably need to add yourself to the `dialout` group to use a serial connection. {ex}") except Exception as ex: logging.error(f"Unexpected error initializing interface: {ex}") - if globals.interface.devPath is None: - return meshtastic.tcp_interface.TCPInterface("localhost") + if client.devPath is None: + client = meshtastic.tcp_interface.TCPInterface("localhost") + return client except Exception as ex: logging.critical(f"Fatal error initializing interface: {ex}") \ No newline at end of file