diff --git a/src/platform/arduino/MQTTTelemetry.cpp b/src/platform/arduino/MQTTTelemetry.cpp index 89e3ffa..8daf1a8 100644 --- a/src/platform/arduino/MQTTTelemetry.cpp +++ b/src/platform/arduino/MQTTTelemetry.cpp @@ -1,6 +1,7 @@ #include "MQTTTelemetry.h" #include +#include #include "../../Static.h" #include "../../Config.h" @@ -340,7 +341,9 @@ void MQTTTelemetry::publishDoc(const char* topic, bool retain) { m_mqtt.beginPublish(topic, measureJson(m_json), retain); - serializeJson(m_json, m_mqtt); + BufferingPrint buf(m_mqtt, 64); + serializeJson(m_json, buf); + buf.flush(); m_mqtt.endPublish(); }