From d94b9519c447510b0fa04859e11ac70d6d5bc6f9 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Wed, 16 May 2018 10:46:27 +0200 Subject: [PATCH] fix --- src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 02c35ea..0de272b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -22,7 +22,7 @@ let heartbeatTimer = setInterval(() => { -let mqttClient = Mqtt.connect(this.options.broker) +let mqttClient = Mqtt.connect(config.dict.brokerUrl) mqttClient.on('offline', () => { log.warn("MQTT client is offline") }) mqttClient.on('reconnect', () => { log.warn("MQTT client is reconnecting") }) mqttClient.on('close', () => { log.warn("MQTT connection closed") }) @@ -40,7 +40,7 @@ mqttClient.on('message', (topic : string, messageBuf : Buffer) => { let message = messageBuf.toString('UTF-8') log.info(`Message received ${this.msgCnt}, topic ${topic}, payload ${message}`) } - + LED2.writeSync(1) setTimeout(() => { LED2.writeSync(0)