Skip to content

Commit

Permalink
maybe found an issue
Browse files Browse the repository at this point in the history
  • Loading branch information
EricAndrechek committed Jul 15, 2024
1 parent 61dfa17 commit 62140e2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tracking-dashboard/backend/mqtt-syncer.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,13 @@ def on_message(client, userdata, message):
print("Error parsing data: ", e)
return

print("made it here")
# check if lat, lon, or alt changed
if (
"lat" in message_building[id]
and "lon" in message_building[id]
and "alt" in message_building[id]
):
print("into this loop")
if id in old_messages:
print("into old messages")
if (
message_building[id]["lat"] == old_messages[id]["lat"]
and message_building[id]["lon"] == old_messages[id]["lon"]
Expand Down Expand Up @@ -269,7 +266,13 @@ def on_message(client, userdata, message):
message_building[id]["lon"] = payload
elif key == "alt":
message_building[id]["alt"] = payload
print("exiting safely")
else:
if key == "lat":
message_building[id]["lat"] = payload
elif key == "lon":
message_building[id]["lon"] = payload
elif key == "alt":
message_building[id]["alt"] = payload
return
elif key == "spd":
# convert speed to mph from knots
Expand Down

0 comments on commit 62140e2

Please sign in to comment.