Update system.py

This commit is contained in:
SpudGunMan
2024-07-24 17:18:22 -07:00
parent 77a358884d
commit 67146b8d6c
+20
View File
@@ -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")