From 721c2c8f7fe0a7ae88fd4211d56d58bbdab71961 Mon Sep 17 00:00:00 2001 From: Matthijs Abma <4146168+abmaonline@users.noreply.github.com> Date: Sun, 24 May 2020 17:23:26 +0200 Subject: [PATCH] Reduce input buffer so hex/json encoded content always fits --- tasmota/tasmota.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasmota/tasmota.h b/tasmota/tasmota.h index 7434ff28e..942d718d2 100644 --- a/tasmota/tasmota.h +++ b/tasmota/tasmota.h @@ -124,12 +124,12 @@ const uint16_t SYSLOG_TIMER = 600; // Seconds to restore syslog_level const uint16_t SERIALLOG_TIMER = 600; // Seconds to disable SerialLog const uint8_t OTA_ATTEMPTS = 5; // Number of times to try fetching the new firmware -const uint16_t INPUT_BUFFER_SIZE = 520; // Max number of characters in serial command buffer +const uint16_t INPUT_BUFFER_SIZE = 510; // Max number of characters in serial command buffer: floor((MIN_MESSZ - len({"SerialReceived":""})) / 2) + 1 const uint16_t FLOATSZ = 16; // Max number of characters in float result from dtostrfd (max 32) 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 = 1040; // Min number of characters in MQTT message (1000 - TOPSZ - 9 header bytes) +const uint16_t MIN_MESSZ = 1040; // Min number of characters in MQTT message (1200 - TOPSZ - 9 header bytes) const uint8_t SENSOR_MAX_MISS = 5; // Max number of missed sensor reads before deciding it's offline