Skip to content

Commit

Permalink
A76xx Set MQTT3.1.1 as the default
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Aug 23, 2024
1 parent b89ba32 commit 34887dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/TinyGsmMqttA76xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,12 @@ class TinyGsmMqttA76xx
thisModem().waitResponse(3000);

thisModem().sendAT("+CMQTTACCQ=", clientIndex, ",\"", clientID, "\",", __ssl);

if (thisModem().waitResponse(3000) != 1)return false;

// Set MQTT3.1.1 , Default use MQTT 3.1
thisModem().sendAT("+CMQTTCFG=\"version\",", clientIndex, ",4");
thisModem().waitResponse(30000UL);

if (username && password) {
thisModem().sendAT("+CMQTTCONNECT=", clientIndex, ',', "\"tcp://", server, ':', port, "\",", keepalive_time, ',', 1, ",\"", username, "\",\"", password, "\"");
} else {
Expand Down

0 comments on commit 34887dd

Please sign in to comment.