Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp_mqtt_set_config ignores buffer_size (IDFGH-11058) #267

Closed
MathewHDYT opened this issue Sep 13, 2023 · 2 comments
Closed

esp_mqtt_set_config ignores buffer_size (IDFGH-11058) #267

MathewHDYT opened this issue Sep 13, 2023 · 2 comments

Comments

@MathewHDYT
Copy link

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 calling esp_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 with esp_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 the MQTT client implementation.

@github-actions github-actions bot changed the title esp_mqtt_set_config ignores buffer_size esp_mqtt_set_config ignores buffer_size (IDFGH-11058) Sep 13, 2023
@euripedesrocha
Copy link
Collaborator

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.

@MathewHDYT
Copy link
Author

@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.

espressif-bot pushed a commit to espressif/esp-idf that referenced this issue Apr 17, 2024
git log --oneline e6afdb4025fe018ae0add44e3c45249ea1974774..aa6f889fb4f6f743b3a550aa587713aabbdca1fc

Detailed description of the changes:
* fix: regard reason codes greater than 0x80 as failures.
  - See merge request espressif/esp-mqtt!205
  - See commit espressif/esp-mqtt@e7b9aa5
* PR: Return on allocation failure
  - See merge request espressif/esp-mqtt!204
  - set last_retransmit to now when first connected (espressif/esp-mqtt@c06f154)
  - add return to faile_message, avoid segment fault (espressif/esp-mqtt@37478a9)
* Minor warning of unused variable
  - See merge request espressif/esp-mqtt!203
  - fix: Minor warning of unused variable (espressif/esp-mqtt@726e5f2)
* Cover the case for SOC without MAC address
  - See merge request espressif/esp-mqtt!202
  - fix: Cover the case for SOC without MAC address (espressif/esp-mqtt@5e3abd4)
* Make state and size atomic
  - See merge request espressif/esp-mqtt!199
  - feat: Make state and size atomic (espressif/esp-mqtt@891380b)
* fix: Adjust the log level on few messages to avoid cluthering the logs
  - See merge request espressif/esp-mqtt!201
  - See commit espressif/esp-mqtt@5c17fc4
* fix: Make automatic client_id soc dependent
  - See merge request espressif/esp-mqtt!200
  - See commit espressif/esp-mqtt@657a2ae
* Clarify data that users need to take care of lifetime.
  - See merge request espressif/esp-mqtt!197
  - docs: Clarify data that users need to take care of lifetime. (espressif/esp-mqtt@371f594)
* Update mqtt_client.h
  - See merge request espressif/esp-mqtt!198
  - add const char * to esp_mqtt_client_subscribe() generic macros (espressif/esp-mqtt@acdb66d)
* client: Report failure on timeout in mid-message timeout (GitHub PR)
  - See merge request espressif/esp-mqtt!165
  - Merges espressif/esp-mqtt#232
  - client: Report failure on timeout in mid-message timeout (espressif/esp-mqtt@ddde502)
* fix: Move buffer initialization to set config
  - See merge request espressif/esp-mqtt!194
  - Closes espressif/esp-mqtt#267
  - See commit espressif/esp-mqtt@ea0df31
* Fix check for message creation when processing publish
  - See merge request espressif/esp-mqtt!195
  - fix: Deliver publish verifies if message was created only for QoS >0
        (espressif/esp-mqtt@6780056)
espressif-bot pushed a commit to espressif/esp-idf that referenced this issue Apr 17, 2024
git log --oneline e6afdb4025fe018ae0add44e3c45249ea1974774..aa6f889fb4f6f743b3a550aa587713aabbdca1fc

Detailed description of the changes:
* fix: regard reason codes greater than 0x80 as failures.
  - See merge request espressif/esp-mqtt!205
  - See commit espressif/esp-mqtt@e7b9aa5
* PR: Return on allocation failure
  - See merge request espressif/esp-mqtt!204
  - set last_retransmit to now when first connected (espressif/esp-mqtt@c06f154)
  - add return to faile_message, avoid segment fault (espressif/esp-mqtt@37478a9)
* Minor warning of unused variable
  - See merge request espressif/esp-mqtt!203
  - fix: Minor warning of unused variable (espressif/esp-mqtt@726e5f2)
* Cover the case for SOC without MAC address
  - See merge request espressif/esp-mqtt!202
  - fix: Cover the case for SOC without MAC address (espressif/esp-mqtt@5e3abd4)
* Make state and size atomic
  - See merge request espressif/esp-mqtt!199
  - feat: Make state and size atomic (espressif/esp-mqtt@891380b)
* fix: Adjust the log level on few messages to avoid cluthering the logs
  - See merge request espressif/esp-mqtt!201
  - See commit espressif/esp-mqtt@5c17fc4
* fix: Make automatic client_id soc dependent
  - See merge request espressif/esp-mqtt!200
  - See commit espressif/esp-mqtt@657a2ae
* Clarify data that users need to take care of lifetime.
  - See merge request espressif/esp-mqtt!197
  - docs: Clarify data that users need to take care of lifetime. (espressif/esp-mqtt@371f594)
* Update mqtt_client.h
  - See merge request espressif/esp-mqtt!198
  - add const char * to esp_mqtt_client_subscribe() generic macros (espressif/esp-mqtt@acdb66d)
* client: Report failure on timeout in mid-message timeout (GitHub PR)
  - See merge request espressif/esp-mqtt!165
  - Merges espressif/esp-mqtt#232
  - client: Report failure on timeout in mid-message timeout (espressif/esp-mqtt@ddde502)
* fix: Move buffer initialization to set config
  - See merge request espressif/esp-mqtt!194
  - Closes espressif/esp-mqtt#267
  - See commit espressif/esp-mqtt@ea0df31
* Fix check for message creation when processing publish
  - See merge request espressif/esp-mqtt!195
  - fix: Deliver publish verifies if message was created only for QoS >0
        (espressif/esp-mqtt@6780056)
espressif-bot pushed a commit to espressif/esp-idf that referenced this issue Jun 13, 2024
git log --oneline e6afdb4025fe018ae0add44e3c45249ea1974774..aa6f889fb4f6f743b3a550aa587713aabbdca1fc

Detailed description of the changes:
* fix: regard reason codes greater than 0x80 as failures.
  - See merge request espressif/esp-mqtt!205
  - See commit espressif/esp-mqtt@e7b9aa5
* PR: Return on allocation failure
  - See merge request espressif/esp-mqtt!204
  - set last_retransmit to now when first connected (espressif/esp-mqtt@c06f154)
  - add return to faile_message, avoid segment fault (espressif/esp-mqtt@37478a9)
* Minor warning of unused variable
  - See merge request espressif/esp-mqtt!203
  - fix: Minor warning of unused variable (espressif/esp-mqtt@726e5f2)
* Cover the case for SOC without MAC address
  - See merge request espressif/esp-mqtt!202
  - fix: Cover the case for SOC without MAC address (espressif/esp-mqtt@5e3abd4)
* Make state and size atomic
  - See merge request espressif/esp-mqtt!199
  - feat: Make state and size atomic (espressif/esp-mqtt@891380b)
* fix: Adjust the log level on few messages to avoid cluthering the logs
  - See merge request espressif/esp-mqtt!201
  - See commit espressif/esp-mqtt@5c17fc4
* fix: Make automatic client_id soc dependent
  - See merge request espressif/esp-mqtt!200
  - See commit espressif/esp-mqtt@657a2ae
* Clarify data that users need to take care of lifetime.
  - See merge request espressif/esp-mqtt!197
  - docs: Clarify data that users need to take care of lifetime. (espressif/esp-mqtt@371f594)
* Update mqtt_client.h
  - See merge request espressif/esp-mqtt!198
  - add const char * to esp_mqtt_client_subscribe() generic macros (espressif/esp-mqtt@acdb66d)
* client: Report failure on timeout in mid-message timeout (GitHub PR)
  - See merge request espressif/esp-mqtt!165
  - Merges espressif/esp-mqtt#232
  - client: Report failure on timeout in mid-message timeout (espressif/esp-mqtt@ddde502)
* fix: Move buffer initialization to set config
  - See merge request espressif/esp-mqtt!194
  - Closes espressif/esp-mqtt#267
  - See commit espressif/esp-mqtt@ea0df31
* Fix check for message creation when processing publish
  - See merge request espressif/esp-mqtt!195
  - fix: Deliver publish verifies if message was created only for QoS >0
        (espressif/esp-mqtt@6780056)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants