fix: Fundamental ID matching — packets, telemetry, and utilization now work

Root cause: health engine keyed nodes by database row IDs instead of
Meshtastic node numbers. Packets and telemetry could never match.

Fixed:
- Store _node_num on all normalized nodes (mesh_sources.py)
- Key health engine node dict by _node_num (mesh_health.py)
- Fix packet field names: from_node not from/fromId
- Fix telemetry parsing: handle telemetryType/value structure
- Increase packet/telemetry fetch limits for 24h coverage
- Fix utilization formula to compute actual airtime percentage
This commit is contained in:
K7ZVX 2026-05-04 21:47:18 +00:00
commit 8c3b6a1f09
3 changed files with 162 additions and 244 deletions

View file

@ -181,8 +181,11 @@ class MeshMonitorDataSource:
else:
errors.append("channels")
# Fetch telemetry
data = self._fetch_json("/api/v1/telemetry")
# Fetch telemetry - BUG 6 FIX: Request more records for 24h coverage
data = self._fetch_json("/api/v1/telemetry?limit=5000")
if data is None:
# Fallback without limit param
data = self._fetch_json("/api/v1/telemetry")
if data is not None:
self._telemetry = data if isinstance(data, list) else []
success_count += 1
@ -190,8 +193,10 @@ class MeshMonitorDataSource:
else:
errors.append("telemetry")
# Fetch traceroutes
data = self._fetch_json("/api/v1/traceroutes")
# Fetch traceroutes - BUG 6 FIX: Request more records
data = self._fetch_json("/api/v1/traceroutes?limit=1000")
if data is None:
data = self._fetch_json("/api/v1/traceroutes")
if data is not None:
self._traceroutes = data if isinstance(data, list) else []
success_count += 1
@ -217,8 +222,11 @@ class MeshMonitorDataSource:
else:
errors.append("topology")
# Fetch packets
data = self._fetch_json("/api/v1/packets")
# Fetch packets - BUG 6 FIX: Request more packets for 24h coverage
data = self._fetch_json("/api/v1/packets?limit=5000")
if data is None:
# Fallback without limit param
data = self._fetch_json("/api/v1/packets")
if data is not None:
self._packets = data if isinstance(data, list) else []
success_count += 1