From 8079ee9749f277c17f58f82e25f0b75816826cea Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 12 Feb 2020 18:00:53 +0100 Subject: [PATCH] Change MQTT message size Change MQTT message size with additional 200 characters --- RELEASENOTES.md | 3 ++- lib/PubSubClient-EspEasy-2.7.12/src/PubSubClient.h | 3 ++- tasmota/CHANGELOG.md | 4 ++++ tasmota/tasmota.h | 2 +- tasmota/tasmota.ino | 2 +- tasmota/tasmota_post.h | 4 ++-- tasmota/tasmota_version.h | 2 +- tasmota/xdrv_02_mqtt.ino | 2 +- 8 files changed, 14 insertions(+), 8 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 09658515c..9104a5bb1 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -52,13 +52,14 @@ The following binary downloads have been compiled with ESP8266/Arduino library c ## Changelog -### Version 8.1.0.7 +### Version 8.1.0.8 - Change Lights: simplified gamma correction and 10 bits internal computation - Change commands ``Prefix``, ``Ssid``, ``StateText``, ``NTPServer``, and ``FriendlyName`` displaying all items - Change IRremoteESP8266 library updated to v2.7.3 - Change Zigbee command prefix from ``Zigbee*`` to ``Zb*`` - Change wifi connectivity stability (#7602) +- Change MQTT message size with additional 200 characters - Fix Sonoff Bridge, Sc, L1, iFan03 and CSE7766 serial interface to forced speed, config and disable logging - Fix commands ``Display`` and ``Counter`` from overruling command processing (#7322) - Fix ``White`` added to light status (#7142) diff --git a/lib/PubSubClient-EspEasy-2.7.12/src/PubSubClient.h b/lib/PubSubClient-EspEasy-2.7.12/src/PubSubClient.h index 593077e8c..612029665 100644 --- a/lib/PubSubClient-EspEasy-2.7.12/src/PubSubClient.h +++ b/lib/PubSubClient-EspEasy-2.7.12/src/PubSubClient.h @@ -24,7 +24,8 @@ // MQTT_MAX_PACKET_SIZE : Maximum packet size #ifndef MQTT_MAX_PACKET_SIZE //#define MQTT_MAX_PACKET_SIZE 128 -#define MQTT_MAX_PACKET_SIZE 1000 // Tasmota v5.11.1c +//#define MQTT_MAX_PACKET_SIZE 1000 // Tasmota v5.11.1c +#define MQTT_MAX_PACKET_SIZE 1200 // Tasmota v8.1.0.8 #endif // MQTT_KEEPALIVE : keepAlive interval in Seconds diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index 91fbca0c2..3a12aff9b 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -1,5 +1,9 @@ ## Unreleased (development) +### 8.1.0.8 20200212 + +- Change MQTT message size with additional 200 characters + ### 8.1.0.7 20200210 - Add new DHT driver. The old driver can still be used using define USE_DHT_OLD (#7468) diff --git a/tasmota/tasmota.h b/tasmota/tasmota.h index 11a530f32..2aa441878 100644 --- a/tasmota/tasmota.h +++ b/tasmota/tasmota.h @@ -128,7 +128,7 @@ const uint16_t FLOATSZ = 16; // Max number of characters in float const uint16_t CMDSZ = 24; // Max number of characters in command const uint16_t TOPSZ = 151; // Max number of characters in topic string const uint16_t LOGSZ = 700; // Max number of characters in log -const uint16_t MIN_MESSZ = 893; // Min number of characters in MQTT message +const uint16_t MIN_MESSZ = 1040; // Min number of characters in MQTT message (1000 - TOPSZ - 9 header bytes) const uint8_t SENSOR_MAX_MISS = 5; // Max number of missed sensor reads before deciding it's offline diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 9383e0e8b..2ed7976e1 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -19,7 +19,7 @@ /*==================================================== Prerequisites: - Change libraries/PubSubClient/src/PubSubClient.h - #define MQTT_MAX_PACKET_SIZE 1000 + #define MQTT_MAX_PACKET_SIZE 1200 - Select IDE Tools - Flash Mode: "DOUT" - Select IDE Tools - Flash Size: "1M (no SPIFFS)" diff --git a/tasmota/tasmota_post.h b/tasmota/tasmota_post.h index 42ee97254..615ff8919 100644 --- a/tasmota/tasmota_post.h +++ b/tasmota/tasmota_post.h @@ -666,7 +666,7 @@ extern "C" void custom_crash_callback(struct rst_info * rst_info, uint32_t stack #endif #ifndef MQTT_MAX_PACKET_SIZE -#define MQTT_MAX_PACKET_SIZE 1000 // Bytes +#define MQTT_MAX_PACKET_SIZE 1200 // Bytes #endif #ifndef MQTT_KEEPALIVE #define MQTT_KEEPALIVE 30 // Seconds @@ -679,7 +679,7 @@ extern "C" void custom_crash_callback(struct rst_info * rst_info, uint32_t stack #endif #ifndef MESSZ -//#define MESSZ 893 // Max number of characters in JSON message string (Hass discovery and nice MQTT_MAX_PACKET_SIZE = 1000) +//#define MESSZ 1040 // Max number of characters in JSON message string (Hass discovery and nice MQTT_MAX_PACKET_SIZE = 1200) #define MESSZ (MQTT_MAX_PACKET_SIZE -TOPSZ -7) // Max number of characters in JSON message string #endif diff --git a/tasmota/tasmota_version.h b/tasmota/tasmota_version.h index 4d464db82..d0db39f4b 100644 --- a/tasmota/tasmota_version.h +++ b/tasmota/tasmota_version.h @@ -20,7 +20,7 @@ #ifndef _TASMOTA_VERSION_H_ #define _TASMOTA_VERSION_H_ -const uint32_t VERSION = 0x08010007; +const uint32_t VERSION = 0x08010008; // Lowest compatible version const uint32_t VERSION_COMPATIBLE = 0x07010006; diff --git a/tasmota/xdrv_02_mqtt.ino b/tasmota/xdrv_02_mqtt.ino index 4d574a9f1..770170aa3 100644 --- a/tasmota/xdrv_02_mqtt.ino +++ b/tasmota/xdrv_02_mqtt.ino @@ -164,7 +164,7 @@ void MqttDiscoverServer(void) // Max message size calculated by PubSubClient is (MQTT_MAX_PACKET_SIZE < 5 + 2 + strlen(topic) + plength) #if (MQTT_MAX_PACKET_SIZE -TOPSZ -7) < MIN_MESSZ // If the max message size is too small, throw an error at compile time. See PubSubClient.cpp line 359 - #error "MQTT_MAX_PACKET_SIZE is too small in libraries/PubSubClient/src/PubSubClient.h, increase it to at least 1000" + #error "MQTT_MAX_PACKET_SIZE is too small in libraries/PubSubClient/src/PubSubClient.h, increase it to at least 1200" #endif #ifdef USE_MQTT_TLS