Open Pakue95 opened 6 years ago
The problem is within the adafruit library: https://github.com/adafruit/Adafruit_MQTT_Library/blob/master/Adafruit_MQTT.h
It defines the maximum message length : // how much data we save in a subscription object // and how many subscriptions we want to be able to track.
Unfortunately it is a define and not a variable. Thus, as far as I know we would have to fork the library in order to change the value.
I tried increasing this value, but the limit still is present. Maybe another hard-coded max value somewhere?
Someone else also has that problem. Should be fixed however...
I think in order to fix this problem, we should switch to another implementation of MQTT on our microcontrollers. There is a embedded-c version made by the eclipse paho project here. I am not sure if it will run on the ESP though. There seems to be a port by "tuanpmt" here Another MQTT implementation is available by espressif here, which seems to be based on the above mentioned port by tuanmpt. Then there is pubsubclient, which is capable of changing the maximum package size by adjusting the header file. It is limited regarding QoS, but that shouldn´t be critical in our case.
I would say we should try the clients in order to see which one fits best. right now, i would prefer the one from eclipse or espressif
Might be an opportunity to change the development environment from Arduino to Espressif.
Right now the MQTT doesn't like to send/receive more than 103 bytes. Longer messages get ignores.