Skip to content

Commit

Permalink
Add renewAddress if connect fails
Browse files Browse the repository at this point in the history
- Update MQTT examples to renew their address if unable to connect to the MQTT server
  • Loading branch information
TMRh20 committed Jul 6, 2024
1 parent 4b9271a commit 76a1511
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/MQTT/mqtt_basic/mqtt_basic.ino
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ void connect() {
Serial.print(".");
if (millis() - clTimeout > 5001) {
Serial.println();
mesh.renewAddress();
return;
}
uint32_t timer = millis();
Expand Down
1 change: 1 addition & 0 deletions examples/MQTT/mqtt_basic_2/mqtt_basic_2.ino
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ void connect() {
while (!client.connect(clientID)) {
Serial.print(".");
if (millis() - clTimeout > 5001) {
mesh.renewAddress();
Serial.println();
return;
}
Expand Down

0 comments on commit 76a1511

Please sign in to comment.