retain online message
This commit is contained in:
parent
1ce18124f0
commit
12c641a43d
@ -154,7 +154,7 @@ void mqtt_reconnect() {
|
|||||||
if (mqtt_client.connect(wifi_station_get_hostname(), topic("online"), MQTTQOS1, true, "0")) {
|
if (mqtt_client.connect(wifi_station_get_hostname(), topic("online"), MQTTQOS1, true, "0")) {
|
||||||
Serial.println("connected");
|
Serial.println("connected");
|
||||||
// once connected, publish an announcement...
|
// once connected, publish an announcement...
|
||||||
mqtt_client.publish(topic("online"), "1");
|
mqtt_client.publish(topic("online"), "1", true);
|
||||||
// ... and resubscribe:
|
// ... and resubscribe:
|
||||||
mqtt_client.subscribe("inTopic");
|
mqtt_client.subscribe("inTopic");
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user