From 2491d8a2197f6a156b1b931bb34d0c9182023773 Mon Sep 17 00:00:00 2001 From: Thomas Krebs Date: Mon, 31 Aug 2015 09:46:13 +0200 Subject: [PATCH] fixed issue when signing was enabled Please enter the commit message for your changes. Lines starting --- .../examples/MQTTClientGateway/MQTTClientGateway.ino | 10 ++++++++-- .../examples/MQTTClientGateway/MyMQTTClient.h | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/libraries/MySensors/examples/MQTTClientGateway/MQTTClientGateway.ino b/libraries/MySensors/examples/MQTTClientGateway/MQTTClientGateway.ino index a436889..a1c07c9 100644 --- a/libraries/MySensors/examples/MQTTClientGateway/MQTTClientGateway.ino +++ b/libraries/MySensors/examples/MQTTClientGateway/MQTTClientGateway.ino @@ -205,13 +205,19 @@ void loop() { if (!client.connected()) { + boolean ret; #ifdef MQTT_AUTH_REQUIRED strcpy(user, MQTT_USER); strcpy(pwd, MQTT_PWD); - client.connect(connID, user,pwd); + ret = client.connect(connID, user,pwd); #else - client.connect(connID); + ret = client.connect(connID); #endif + if (ret) { + Serial.println("Connected to MQTT broker"); + } else { + Serial.println("Connection to MQTT broker failed"); + } client.subscribe(mqttTopicMask); } client.loop(); diff --git a/libraries/MySensors/examples/MQTTClientGateway/MyMQTTClient.h b/libraries/MySensors/examples/MQTTClientGateway/MyMQTTClient.h index 87610f0..d347825 100644 --- a/libraries/MySensors/examples/MQTTClientGateway/MyMQTTClient.h +++ b/libraries/MySensors/examples/MQTTClientGateway/MyMQTTClient.h @@ -29,8 +29,8 @@ version 2 as published by the Free Software Foundation. #define MQTT_AUTH_REQUIRED // if your broker has anonymous access uncomment -#define MQTT_USER "username" // username on MQTT broker -#define MQTT_PWD "pwd" // password for MQTT username above +#define MQTT_USER "user" // username on MQTT broker +#define MQTT_PWD "pwd" // password for MQTT username above #define MQTT_CONN_ID "MySensors" // passed as id to the MQTT broker