Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit 44fd306

Browse files
committed
Explicitly set heartbeat
1 parent 14f7e31 commit 44fd306

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

examples/Esp32-lwmqtt/esp32-mqtt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ void setupCloudIoT() {
124124
setupWifi();
125125
netClient = new WiFiClientSecure();
126126
mqttClient = new MQTTClient(512);
127+
mqttClient->setOptions(180, true, 1000); // keepAlive, cleanSession, timeout
127128
startMQTT();
128129
}
129130
#endif //__ESP32_MQTT_H__

examples/Esp8266-lwmqtt/esp8266_mqtt.h

100755100644
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ void setupCloudIoT() {
160160
setupCert();
161161

162162
mqttClient = new MQTTClient(512);
163+
mqttClient->setOptions(180, true, 1000); // keepAlive, cleanSession, timeout
163164
startMQTT(); // Opens connection
164165
}
165166

examples/MKR1000-lwmqtt/mkr1000-mqtt.h

100755100644
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ void setupCloudIoT() {
120120
netClient = new WiFiSSLClient;
121121

122122
mqttClient = new MQTTClient(512);
123+
mqttClient->setOptions(180, true, 1000); // keepAlive, cleanSession, timeout
123124
startMQTT();
124125
}
125-
#endif //__MKR1000_MQTT_H__
126+
#endif //__MKR1000_MQTT_H__

0 commit comments

Comments
 (0)