diff --git a/src/PubSubClient.cpp b/src/PubSubClient.cpp index 36200577..9658c4af 100755 --- a/src/PubSubClient.cpp +++ b/src/PubSubClient.cpp @@ -122,7 +122,7 @@ boolean PubSubClient::connect(const char *id, const char *user, const char *pass } else { result = _client->connect(this->ip, this->port); } - if (result) { + if (result == 1) { nextMsgId = 1; // Leave room in the buffer for header and variable length field uint16_t length = 5;