Closed MathewHDYT closed 8 months ago
Hi @MathewHDYT, thanks for reporting the issue. For some configurations, it's required to restart the client, but it's not the case for the buffer, It's indeed a bug in the library.
@euripedesrocha Thanks that is what I thought because increasing an internal buffer shouldn't have any dependency on the currently ongoing connection, the only thing that could cause problems if there is currently data in the buffer and the buffer size is made significantly smaller.
The
esp_mqtt_set_config
does not actually increase or decrease the buffer size accordingly in the client configuration, meaning when changing the buffer size and callingesp_mqtt_set_config
nothing changes the buffersize is still the initial value.Instead to actually change the buffer size the complete
esp_mqtt
client has to be reinitalized.Is this intended behaviour, meaning the buffer size can not be changed anymore after having initialised a
MQTT client
. Then it would be nice if this could be documented in the documentation.If it is not intended, then I would appreciate that feature, because I would like to temporarily while the
OTA update
is ongoing increase the buffer size to receive the payload packets and then once it has finished decrease the buffer again, because I normally never receive packets that big (4096 bytes
). If I can't do that withesp_mqtt_set_config
then the buffer size always has to be 4KB which is a rather large chunk to create on the heap.The missing update of the
bufffer_size
parameter can be found in theMQTT client
implementation.