You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
yesterday I switched my first device (esp8266) from asyncMqttClient to espMqttClient. Looks good! No crashes, no runaway memory, but also no heavy traffic. Just some status reporting and change of settings going back and forth every few seconds.
In the images below you see the heap of the same firmware running running AsyncMqtt (first and espMqtt (second)
Please ignore the peak in the asyncmqtt graph. I made a mistake with my test board and accidentally posted to the same topic as my real hardware. Also the PC went into suspend mode, but the gist remains the same.
AsyncMqtt
EspMqtt
Summary:
espMqttClient uses a bit more memory than asyncMqtt (43K of heap vs 45K of heap), while the rest of the firmware is identical.
there is more variation in the free heap. AsyncMqtt stays level at 45K after the initial phase where espMqtt "oscillates" between 42,5K and 43K of free heap all the time
Don't know if these observations play a role, but the most important info is that the free heap doesn't decrease over time :)
I suspect TCP payload buffering. ESPAsyncTCP forwards the data directly whereas I copy the incoming data to a buffer. On ESP8266 this can be improved with the peek-API but I didn't implement that.
I didn't benchmark (yet). I've got a few devices that have a 14+ day uptime (with a few MQTT and/or WiFi disconnects).
Activity
bertmelis commentedon Jun 19, 2022
I suspect TCP payload buffering. ESPAsyncTCP forwards the data directly whereas I copy the incoming data to a buffer. On ESP8266 this can be improved with the
peek-API but I didn't implement that.I didn't benchmark (yet). I've got a few devices that have a 14+ day uptime (with a few MQTT and/or WiFi disconnects).
bertmelis commentedon Jun 19, 2022
I mean the
peekBuffer-API:https://github.com/esp8266/Arduino/blob/047f14b9db4917060c663fdf7db16f50a02b0161/libraries/ESP8266WiFi/src/WiFiClient.h#L136