Update main.js
This commit is contained in:
1 parent
a04ac40061
commit
36640d28bd
1 file changed
+13
@@ -182,4 +182,17 @@ mqtt.on('connected', function(){
|
||||
register_allbuttons();
|
||||
});
|
||||
|
||||
// Added by heroash88 to reconnect if MQTT server goes down
|
||||
mqtt.on('disconnected', function() {
|
||||
mqtt.connect();
|
||||
});
|
||||
|
||||
mqtt.on('error', function() {
|
||||
setTimeout(function (){
|
||||
mqtt.connect();
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
|
||||
|
||||
mqtt.connect();
|
||||
Reference in new issue
Block a user