diff --git a/platformio.ini b/platformio.ini index cd32ed1797..01bd2102f3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -118,7 +118,7 @@ build_src_filter = ${env.build_src_filter} - ; Common libs for communicating over TCP/IP networks such as MQTT [networking_base] lib_deps = - knolleary/PubSubClient@2.8 + thingsboard/TBPubSubClient@^2.11.0 arduino-libraries/NTPClient@3.1.0 arcao/Syslog@2.0.0 diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 3db3c37bb9..04c2a7f47d 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -435,7 +435,7 @@ void MQTT::reconnect() serverAddr = hostAndPort.first.c_str(); serverPort = hostAndPort.second; pubSub.setServer(serverAddr, serverPort); - pubSub.setBufferSize(1024); + pubSub.setBufferSize(1024, 1024); LOG_INFO("Connect directly to MQTT server %s, port: %d, username: %s, password: %s", serverAddr, serverPort, mqttUsername, mqttPassword);