From f2d8563597151a6e399d71cd7a1e1ce774e11128 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Mon, 3 Jan 2022 19:03:00 +0100 Subject: [PATCH] Force `MQTT_MAX_PACKET_SIZE` in PubSub client --- tasmota/xdrv_02_9_mqtt.ino | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tasmota/xdrv_02_9_mqtt.ino b/tasmota/xdrv_02_9_mqtt.ino index 38f6bcd88..d245a1964 100644 --- a/tasmota/xdrv_02_9_mqtt.ino +++ b/tasmota/xdrv_02_9_mqtt.ino @@ -188,6 +188,9 @@ void MqttDisableLogging(bool state) { PubSubClient MqttClient; void MqttInit(void) { + // Force buffer size since the #define may not be visible from Arduino lib + MqttClient.setBufferSize(MQTT_MAX_PACKET_SIZE); + #ifdef USE_MQTT_AZURE_IOT Settings->mqtt_port = 8883; #endif //USE_MQTT_AZURE_IOT