mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-07-06 09:51:24 +02:00
Update system.py
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user