Browse Source

feat: Split packet into parts

master
Konstantinos Kamaropoulos 5 years ago
parent
commit
40baad6fc6
  1. 11
      main.py

11
main.py

@ -7,7 +7,16 @@ lora = RYLR896Py.RYLR896("/dev/ttyS0", 115200)
lora.SetRFParamsLessThan3KM()
def dataHandler(data):
print(data["message"])
# Split data on '|' separator character
dataSplit = data["message"].split("|")
drone_id = dataSplit[0]
gprmc = dataSplit[1]
sensors = dataSplit[2:]
print("drone_id:", drone_id)
print("gprmc:", gprmc)
print("sensors:", sensors)
# 2. Listen for data
while True:

Loading…
Cancel
Save