From 6d50391ea8a2568733af9053abbb0de2a04483ab Mon Sep 17 00:00:00 2001 From: MarekWo Date: Sun, 22 Feb 2026 13:45:43 +0100 Subject: [PATCH] fix: Decode GPS coordinates as int32/1e6, not float MeshCore encodes lat/lon as little-endian signed int32 divided by 1e6, not as IEEE 754 floats. This caused all map pins to show at (0,0). Co-Authored-By: Claude Opus 4.6 --- app/contacts_cache.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/contacts_cache.py b/app/contacts_cache.py index d8b1ba7..cbd6e55 100644 --- a/app/contacts_cache.py +++ b/app/contacts_cache.py @@ -162,7 +162,7 @@ def parse_advert_payload(pkt_payload_hex: str): [32:36] Timestamp (4 bytes) [36:100] Signature (64 bytes) [100] App Flags (1 byte) - bit 4: Location, bit 7: Name - [101+] If Location (bit 4): Lat (4 bytes) + Lon (4 bytes) + [101+] If Location (bit 4): Lat (4 bytes, LE int32/1e6) + Lon (4 bytes, LE int32/1e6) If Name (bit 7): Node name (UTF-8, variable length) Returns: @@ -184,7 +184,8 @@ def parse_advert_payload(pkt_payload_hex: str): if has_location: if len(raw) >= 109: - lat, lon = struct.unpack('