quick fix so Telemetry/position works

This commit is contained in:
michaelachrisco 2024-06-09 11:36:02 -07:00
parent 9e06503869
commit b9d09f2209

17
main.py
View file

@ -34,8 +34,21 @@ def onReceive(packet, interface):
if 'TEXT_MESSAGE_APP' in packet['decoded']: if 'TEXT_MESSAGE_APP' in packet['decoded']:
print('TEXT_MESSAGE_APP') print('TEXT_MESSAGE_APP')
if 'TELEMTRY_APP' in packet['decoded']: if 'portnum' in decoded:
print('Telemetry found. Ignore') app_name = decoded['portnum']
if app_name == 'TELEMETRY_APP':
with open(MESSAGE_FILE, 'w') as file:
file.write(f"TELEMETRY_APP: ")
file.write(str(packet))
print('Telemetry found')
elif app_name == 'POSITION_APP':
with open(MESSAGE_FILE, 'w') as file:
file.write(f"POSITION_APP: ")
file.write(str(packet))
print('Position found')
else:
print('Not a recodnized portnum message')
print(packet)
if 'decoded' in packet and 'text' in packet['decoded']: if 'decoded' in packet and 'text' in packet['decoded']:
print(packet) print(packet)