Skip to content

Commit 2ee8c0e

Browse files
committed
Arduino Bootstrapper (v1.9.2)
1 parent 4293c2c commit 2ee8c0e

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": "git",
77
"url": "https://github.com/sblantipodi/arduino_bootstrapper.git"
88
},
9-
"version": "1.9.1",
9+
"version": "1.9.2",
1010
"examples": "examples/*.cpp",
1111
"exclude": "tests",
1212
"frameworks": "arduino",

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Bootstrapper
2-
version=1.9.1
2+
version=1.9.2
33
author=Davide Perini <[email protected]>
44
maintainer=Davide Perini <[email protected]>
55
sentence=A client library for MQTT messaging.

src/QueueManager.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,13 @@ void QueueManager::mqttReconnect(void (*manageDisconnections)(), void (*manageQu
5959
manageHardwareButton();
6060

6161
// Attempt to connect to MQTT server with QoS = 1 (pubsubclient supports QoS 1 for subscribe only, published msg have QoS 0 this is why I implemented a custom solution)
62-
if (mqttClient.connect(helper.string2char(deviceName), helper.string2char(mqttuser), helper.string2char(mqttpass), 0, 1, 0, 0, 1)) {
62+
boolean mqttSuccess;
63+
if (mqttuser.isEmpty() || mqttpass.isEmpty()) {
64+
mqttSuccess = mqttClient.connect(helper.string2char(deviceName), 0, 1, 0, 0);
65+
} else {
66+
mqttSuccess = mqttClient.connect(helper.string2char(deviceName), helper.string2char(mqttuser), helper.string2char(mqttpass), 0, 1, 0, 0, 1);
67+
}
68+
if (mqttSuccess) {
6369

6470
helper.smartPrintln(F(""));
6571
helper.smartPrintln(F("CONNECTED"));

0 commit comments

Comments
 (0)