- Added memory debugging features to log heap usage and fragmentation recovery for MQTT clients.
- Introduced `recreateMqttClientsForFragmentationRecovery()` to manage MQTT client lifecycles and reduce memory fragmentation.
- Updated critical memory checks to log detailed heap statistics and active MQTT client counts.
- Included new debug logging for memory status every 60 seconds when memory debugging is enabled.
This update aims to improve stability and performance in memory-constrained environments.
- Main broker: only allocate _mqtt_client when custom broker configured
(analyzer-only saves one PsychicMqttClient). Reconnect main broker after
forced disconnect with 30s throttle; set last_attempt on disconnect so
throttle applies and avoids reconnect storms on flaky WiFi.
- Analyzer clients: call disconnect() when WiFi transitions to disconnected
so ESP-IDF frees MQTT buffers (it does not free on WiFi drop). Reduces
fragmentation and Max drop after disconnect/reconnect cycles.
- get wifi.status: report WiFi uptime (Xd Xh Xm Xs) when WITH_MQTT_BRIDGE.
Track connect time in bridge; backfill when already connected at first check.
- get mqtt.status: show msgs on/off, broker (connected/disconnected/n/a),
analyzer US/EU (connected/disconnected/off), and queue count.
Note: PsychicMqttClient change (register event only on first client creation)
belongs in the library repo if committed separately.
- Updated comments to specify that the Dispatcher owns the packet memory and should handle freeing.
- Removed unnecessary calls to free queued packets in the MQTTBridge, ensuring only references are discarded.
- Enhanced code clarity regarding packet lifecycle management in the end and processPacketQueue methods.
- Introduced `getPacketsRecvErrors()` method in `Dispatcher` to track receive errors.
- Updated `buildStatusMessage()` in `MQTTMessageBuilder` to include `recv_errors` parameter.
- Modified `publishStatus()` in `MQTTBridge` to retrieve and send receive error statistics.
- Adjusted `RadioLibWrappers` to override `getPacketsRecvErrors()` for consistency.
When DISPLAY_CLASS is defined via build flags but HELTEC_LORA_V4_OLED
or HELTEC_LORA_V4_TFT flags aren't set, include SSD1306Display.h as
fallback. This fixes compilation errors for environments like
heltec_v4_repeater_observer_mqtt that extend Heltec_lora32_v4 directly
and set DISPLAY_CLASS=SSD1306Display.
Updated the variable name from _max to _max_size in the BufStream class to improve code readability and maintainability. This change ensures consistency in naming conventions within the class.
This change counts when readData returns an err code other than RADIOLIB_ERR_NONE. In most cases this is going to be a CRC error. This counter is exposed in the `stats-packets` command, and in the repeater stats payload (4 additional bytes to the payload, which is now 56 bytes with this change. My incompetent robot claims the total payload size is 96 bytes (unverified but probably close).