fixed issue when signing was enabled
Please enter the commit message for your changes. Lines starting
This commit is contained in:
@@ -205,13 +205,19 @@ void loop()
|
|||||||
{
|
{
|
||||||
if (!client.connected())
|
if (!client.connected())
|
||||||
{
|
{
|
||||||
|
boolean ret;
|
||||||
#ifdef MQTT_AUTH_REQUIRED
|
#ifdef MQTT_AUTH_REQUIRED
|
||||||
strcpy(user, MQTT_USER);
|
strcpy(user, MQTT_USER);
|
||||||
strcpy(pwd, MQTT_PWD);
|
strcpy(pwd, MQTT_PWD);
|
||||||
client.connect(connID, user,pwd);
|
ret = client.connect(connID, user,pwd);
|
||||||
#else
|
#else
|
||||||
client.connect(connID);
|
ret = client.connect(connID);
|
||||||
#endif
|
#endif
|
||||||
|
if (ret) {
|
||||||
|
Serial.println("Connected to MQTT broker");
|
||||||
|
} else {
|
||||||
|
Serial.println("Connection to MQTT broker failed");
|
||||||
|
}
|
||||||
client.subscribe(mqttTopicMask);
|
client.subscribe(mqttTopicMask);
|
||||||
}
|
}
|
||||||
client.loop();
|
client.loop();
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ version 2 as published by the Free Software Foundation.
|
|||||||
|
|
||||||
|
|
||||||
#define MQTT_AUTH_REQUIRED // if your broker has anonymous access uncomment
|
#define MQTT_AUTH_REQUIRED // if your broker has anonymous access uncomment
|
||||||
#define MQTT_USER "username" // username on MQTT broker
|
#define MQTT_USER "user" // username on MQTT broker
|
||||||
#define MQTT_PWD "pwd" // password for MQTT username above
|
#define MQTT_PWD "pwd" // password for MQTT username above
|
||||||
#define MQTT_CONN_ID "MySensors" // passed as id to the MQTT broker
|
#define MQTT_CONN_ID "MySensors" // passed as id to the MQTT broker
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user