forked from iarv/contact
Compare commits
1 Commits
main
...
client-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f270b5ba5 |
@@ -10,14 +10,15 @@ def initialize_interface(args):
|
|||||||
return meshtastic.tcp_interface.TCPInterface(args.host)
|
return meshtastic.tcp_interface.TCPInterface(args.host)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
return meshtastic.serial_interface.SerialInterface(args.port)
|
client = meshtastic.serial_interface.SerialInterface(args.port)
|
||||||
except PermissionError as ex:
|
except PermissionError as ex:
|
||||||
logging.error(f"You probably need to add yourself to the `dialout` group to use a serial connection. {ex}")
|
logging.error(f"You probably need to add yourself to the `dialout` group to use a serial connection. {ex}")
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
logging.error(f"Unexpected error initializing interface: {ex}")
|
logging.error(f"Unexpected error initializing interface: {ex}")
|
||||||
if globals.interface.devPath is None:
|
if client.devPath is None:
|
||||||
return meshtastic.tcp_interface.TCPInterface("localhost")
|
client = meshtastic.tcp_interface.TCPInterface("localhost")
|
||||||
|
|
||||||
|
return client
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
logging.critical(f"Fatal error initializing interface: {ex}")
|
logging.critical(f"Fatal error initializing interface: {ex}")
|
||||||
|
|
||||||
Reference in New Issue
Block a user