MQTT now sets LWT and explicitly requests a clean sesion on startup.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
c153ce915d
commit
b71faa3bcb
@ -85,7 +85,7 @@ boolean mqtt_connect() {
|
||||
#endif
|
||||
snprintf(client_id, 30, HOSTNAME, chipid);
|
||||
LOG("MQTT * Connecting to MQTT server with client id "); LOGln(client_id);
|
||||
if (mqtt_client.connect(client_id, MQTT_USER, MQTT_PASS)) {
|
||||
if (mqtt_client.connect(client_id, MQTT_USER, MQTT_PASS, MQTT_TOPIC "status", 0, true, "OFFLINE", true)) {
|
||||
LOGln("MQTT * Connected.");
|
||||
mqtt_client.publish(MQTT_TOPIC "status", "ONLINE");
|
||||
mqtt_client.subscribe(MQTT_TOPIC "+");
|
||||
|
Loading…
Reference in New Issue
Block a user