From 787a4228bc4547d68c5de0c422e749065fff84e3 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 4 Dec 2020 09:09:09 +0100 Subject: [PATCH] mqtt: bug fixes connection establishment --- lib/nodes/mqtt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nodes/mqtt.cpp b/lib/nodes/mqtt.cpp index 85906aa73..22011a060 100644 --- a/lib/nodes/mqtt.cpp +++ b/lib/nodes/mqtt.cpp @@ -176,7 +176,7 @@ int mqtt_init(struct vnode *n) int ret; struct mqtt *m = (struct mqtt *) n->_vd; - m->client = mosquitto_new(n->name, 0, (void *) n); + m->client = mosquitto_new(NULL, true, (void *) n); if (!m->client) return -1; @@ -194,7 +194,7 @@ int mqtt_init(struct vnode *n) m->port = 1883; m->qos = 0; m->retain = 0; - m->keepalive = 1; /* 1 second */ + m->keepalive = 5; /* 5 second, minimum required for libmosquitto */ m->host = nullptr; m->username = nullptr;