Potential serious issue with MQTT library in ESP-IDF 3.2 - resolved by Espressif?
Posted: Tue Mar 19, 2019 9:23 pm
In the thread ESP-IDF V3.2-beta3 has been released I see "Integrated esp-mqtt MQTT client library into ESP-IDF". This is good progress - the IDF could do with an official MQTT client - but I'm very concerned about this outstanding issue in that particular library:
https://github.com/espressif/esp-mqtt/issues/18
It concerns mishandling of data reads from the TCP socket, by assuming that any pending data only contains a single packet. In fact it can contain any number of packets, but the code (when I evaluated it over a year ago) would drop all but the first. As far as I can see it has not been properly resolved. If an application is only sending or receiving occasional MQTT messages it seldom arises, but if you send it many messages (such as I was originally doing via an OSC to MQTT bridge) then it results in many dropped messages.
I'd like to use this library if it's now officially to be part of the ESP-IDF, but I'd like an assertion from an Espressif engineer that this issue has been investigated and resolved in the Espressif fork, please.
Incidentally, I have been using this library instead: 256dpi/esp-mqtt
https://github.com/espressif/esp-mqtt/issues/18
It concerns mishandling of data reads from the TCP socket, by assuming that any pending data only contains a single packet. In fact it can contain any number of packets, but the code (when I evaluated it over a year ago) would drop all but the first. As far as I can see it has not been properly resolved. If an application is only sending or receiving occasional MQTT messages it seldom arises, but if you send it many messages (such as I was originally doing via an OSC to MQTT bridge) then it results in many dropped messages.
I'd like to use this library if it's now officially to be part of the ESP-IDF, but I'd like an assertion from an Espressif engineer that this issue has been investigated and resolved in the Espressif fork, please.
Incidentally, I have been using this library instead: 256dpi/esp-mqtt