reconnectionTimerCallback and ntpSyncTimerCallback ignored xTaskCreate()'s
result. On a fragmented heap a single failure silently ended the WiFi
reconnect chain (one-shot timer) or skipped the NTP sync. Both now re-arm
their one-shot timer and retry next interval. Same failure mode as F-071;
documented under F-073.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Device went cloud-silent after days of uptime while WebSocket kept working;
last thing on status/heartbeat was garbage. Causes and fixes:
- LWT payload was a dangling pointer: setWill() stores the raw char*, begin()
passed a temporary String. The broker published freed heap as the Will on
the unclean drop. Now held in _willPayload.
- Reconnect/stabilisation/heartbeat timers each xTaskCreate()d a short-lived
task with the result ignored; one failed allocation ended the one-shot
reconnect chain for good. Replaced by one persistent supervisor task that
polls WiFi.status() itself, reconnects with backoff (cap now 60 s), sends
the heartbeat, and force-resets the client when a connect attempt is stuck
for 30 s or the heartbeat PUBACK is missing for 20 s.
- New mqtt.status command (all transports) exposes connect/disconnect
counters, last reasons and forced resets for post-mortems over WebSocket.
Latency (F-072): AsyncMqttClient holds its queue behind every QoS 1 PUBACK
and only resumes on the ~500 ms poll, so each QoS 1 message cost RTT + up to
500 ms. All publishes are now QoS 0 except the heartbeat (liveness probe);
cleanSession=true on both ends meant QoS 1 never gave redelivery. WiFi modem
sleep disabled on connect to remove DTIM-induced RX delays.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Console requested four more Health-tab metrics beyond F-054's free_heap/ping
work. None needed 30s heartbeat freshness, so this adds a separate low-frequency
report instead of growing the heartbeat further: published every 5 min to
status/info (diagnostics_report) and queryable on-demand via a new
telemetry.get_diagnostics command.
Only CPU temperature needs local sampling (15s, via a min/max/avg RunningStats
accumulator on Telemetry) — a thermal spike could occur and subside entirely
within a 5-minute gap. The other three fields are monotonic/self-tracking
(WiFi reconnect counter, FreeRTOS's own stack high-water mark, rarely-changing
OTA state) so a single read at report time loses no information.
Verified: pio run on all four board variants.