fixed issue when signing was enabled

Please enter the commit message for your changes. Lines starting
This commit is contained in:
Thomas Krebs
2015-08-31 09:46:13 +02:00
parent ff8aab095c
commit 2491d8a219
2 changed files with 10 additions and 4 deletions
@@ -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();
@@ -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