From 67146b8d6c8738c7f618f16041826e95ad6ca828 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 24 Jul 2024 17:18:22 -0700 Subject: [PATCH] Update system.py --- modules/system.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/modules/system.py b/modules/system.py index d16c3d7..0d94c7f 100644 --- a/modules/system.py +++ b/modules/system.py @@ -51,6 +51,18 @@ else: print(f"System: Interface Type: {interface1_type} not supported. Validate your config against config.template Exiting") exit() +# Interface2 Configuration +if interface2_enabled: + if interface2_type == 'serial': + interface2 = meshtastic.serial_interface.SerialInterface(port2) + elif interface2_type == 'tcp': + interface2 = meshtastic.tcp_interface.TCPInterface(hostname2) + elif interface2_type == 'ble': + interface2 = meshtastic.ble_interface.BLEInterface(mac2) + else: + print(f"System: Interface Type: {interface2_type} not supported. Validate your config against config.template Exiting") + exit() + #Get the node number of the device, check if the device is connected try: myinfo = interface1.getMyNodeInfo() @@ -59,6 +71,14 @@ except Exception as e: print(f"System: Critical Error script abort. {e}") exit() +if interface2_enabled: + try: + myinfo2 = interface2.getMyNodeInfo() + myNodeNum2 = myinfo2['num'] + except Exception as e: + print(f"System: Critical Error script abort. {e}") + exit() + def log_timestamp(): if zuluTime: return datetime.now().strftime("%Y-%m-%d %H:%M:%S")