Limit number of MQTT connection tries

as proposed by @nimbl at https://github.com/toblum/McLighting/issues/22
This commit is contained in:
Tobias Blum
2017-08-19 22:22:36 +02:00
parent ab9253abde
commit 91571eafcc
3 changed files with 17 additions and 7 deletions
+4
View File
@@ -9,6 +9,10 @@ const char HOSTNAME[] = "ESP8266_01"; // Friedly hostname
#define ENABLE_MQTT // If defined, enable MQTT client code.
#ifdef ENABLE_MQTT
#define MQTT_MAX_PACKET_SIZE 256
#define MQTT_MAX_RECONNECT_TRIES 4
int mqtt_reconnect_retries = 0;
char mqtt_intopic[strlen(HOSTNAME) + 3]; // Topic in will be: <HOSTNAME>/in
char mqtt_outtopic[strlen(HOSTNAME) + 4]; // Topic out will be: <HOSTNAME>/out