Add debug logging for missing from_id (#64)

This commit is contained in:
l5y
2025-09-15 18:15:46 +02:00
committed by GitHub
parent b230e79ab0
commit e2c19e1611
2 changed files with 16 additions and 0 deletions
+7
View File
@@ -157,6 +157,13 @@ def store_packet_dict(p: dict):
from_id = _first(p, "fromId", "from_id", "from", default=None)
to_id = _first(p, "toId", "to_id", "to", default=None)
if (from_id is None or str(from_id) == "") and DEBUG:
try:
raw = json.dumps(p, default=str)
except Exception:
raw = str(p)
print(f"[debug] packet missing from_id: {raw}")
# link metrics
snr = _first(p, "snr", "rx_snr", "rxSnr", default=None)
rssi = _first(p, "rssi", "rx_rssi", "rxRssi", default=None)