reduce mqtt queue from 50 to 30, to save of heap memory on the ESP8266

This commit is contained in:
proddy
2020-07-20 17:53:19 +02:00
parent 5486fa9d5b
commit 915f961828

View File

@@ -118,13 +118,12 @@ class Mqtt {
static AsyncMqttClient * mqttClient_;
static constexpr size_t MAX_MQTT_MESSAGES = 50;
static size_t maximum_mqtt_messages_;
static uint16_t mqtt_message_id_;
static bool mqtt_retain_;
static size_t maximum_mqtt_messages_;
static uint16_t mqtt_message_id_;
static bool mqtt_retain_;
static constexpr uint8_t MQTT_QUEUE_MAX_SIZE = 50;
static constexpr uint32_t MQTT_PUBLISH_WAIT = 250; // delay between sending publishes, to account for large payloads
static constexpr size_t MAX_MQTT_MESSAGES = 30; // size of queue
static constexpr uint32_t MQTT_PUBLISH_WAIT = 200; // delay between sending publishes, to account for large payloads
static constexpr uint8_t MQTT_PUBLISH_MAX_RETRY = 3; // max retries for giving up on publishing
static void queue_publish_message(const std::string & topic, const std::string & payload, const bool retain);