mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
mqtt faster out
This commit is contained in:
@@ -234,7 +234,7 @@ void Mqtt::loop() {
|
|||||||
force_publish_ = false;
|
force_publish_ = false;
|
||||||
send_heartbeat(); // create a heartbeat payload
|
send_heartbeat(); // create a heartbeat payload
|
||||||
EMSESP::publish_all_values(); // add sensors and mqtt to queue
|
EMSESP::publish_all_values(); // add sensors and mqtt to queue
|
||||||
process_all_queue(); // publish everything on queue
|
// process_all_queue(); // publish everything on queue
|
||||||
}
|
}
|
||||||
|
|
||||||
// send out heartbeat
|
// send out heartbeat
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ class Mqtt {
|
|||||||
static bool mqtt_retain_;
|
static bool mqtt_retain_;
|
||||||
|
|
||||||
static constexpr uint8_t MQTT_QUEUE_MAX_SIZE = 50;
|
static constexpr uint8_t MQTT_QUEUE_MAX_SIZE = 50;
|
||||||
static constexpr uint32_t MQTT_PUBLISH_WAIT = 750; // delay between sending publishes, to account for large payloads
|
static constexpr uint32_t MQTT_PUBLISH_WAIT = 250; // 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 constexpr uint8_t MQTT_PUBLISH_MAX_RETRY = 3; // max retries for giving up on publishing
|
||||||
static constexpr uint8_t MQTT_KEEP_ALIVE = 60; // 60 seconds. This could also be less, like 30 seconds
|
static constexpr uint8_t MQTT_KEEP_ALIVE = 60; // 60 seconds. This could also be less, like 30 seconds
|
||||||
static constexpr uint32_t MQTT_RECONNECT_DELAY_MIN = 2000; // Try to reconnect in 2 seconds upon disconnection
|
static constexpr uint32_t MQTT_RECONNECT_DELAY_MIN = 2000; // Try to reconnect in 2 seconds upon disconnection
|
||||||
|
|||||||
Reference in New Issue
Block a user