mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 09:19:51 +03:00
1.2.4
This commit is contained in:
@@ -193,7 +193,7 @@ void MyESP::mqttUnsubscribe(const char * topic) {
|
||||
|
||||
// MQTT Publish
|
||||
void MyESP::mqttPublish(const char * topic, const char * payload) {
|
||||
char s[600];
|
||||
char s[MQTT_MAX_SIZE];
|
||||
snprintf(s, sizeof(s), "%s%s/%s", MQTT_BASE, _app_hostname, topic);
|
||||
// myDebug_P(PSTR("[MQTT] Sending pubish to %s with payload %s"), s, payload);
|
||||
mqttClient.publish(s, MQTT_QOS, false, payload);
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#define MQTT_RECONNECT_DELAY_MIN 5000 // Try to reconnect in 5 seconds upon disconnection
|
||||
#define MQTT_RECONNECT_DELAY_STEP 5000 // Increase the reconnect delay in 5 seconds after each failed attempt
|
||||
#define MQTT_RECONNECT_DELAY_MAX 120000 // Set reconnect time to 2 minutes at most
|
||||
#define MQTT_MAX_SIZE 600 // max length of MQTT message
|
||||
// Internal MQTT events
|
||||
#define MQTT_CONNECT_EVENT 0
|
||||
#define MQTT_DISCONNECT_EVENT 1
|
||||
|
||||
Reference in New Issue
Block a user