-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
setBufferSize() does not work. #764
Comments
There are bits of an answer in #685 . |
Thanks for you quick reply, but version 2.8 according to CHANGES.TXT "Add setBufferSize() to override MQTT_MAX_PACKET_SIZE" which in my understanding should be used to do what I want to do. |
Thanks @sebashb for the heads up, I wasn't aware of this change. Sorry to have mislead you. Thanks @knolleary too. |
No it does not work also. |
For me However, when I try to submit a string that is about 3kB it simply doesn't transmit it at all. Is there a hard limit? If yes, what it it? I am using an ESP32. thank you |
Some more details: I am trying to send a list of files as a JSON string over MQTT. A sample JSON string is something like this:
This is the biggest list of files I can send without a problem. It has 33 entries. If I add one more similar entry in my code, Just before I the
The output of it in case the JSON string has 33 item:
The output of it in case the JSON string has 34 item:
I hope this helps troubleshooting it.... |
I have tried both before and after |
I'm not currently in a position to debug any PubSubClient issues and unlikely to be for a couple weeks at least. |
@sebashb Interesting... For me it's either there or not at all. Never truncated... |
Well I have tried multiple things, I'm sure that I have seen both behaviours ( not being published and being truncated), but I can't remember which code produce each one of them. |
I add my experience to this issue. I'm using a ESP32-POE board to connect to AWS via MQTT. Some messages I'm going to receive are quite big (over 9 kbytes). So I set the buffer large enough:
It outputs 16384. I also tried to play with
It's quite repeatable. After publishing the request message it should receive the answer (the "big" payload). Instead, after some dozens of seconds disconnects and reconnects. Doing this a couple of times leads to a failure to connect anymore, until I reset the board. |
I'm trying to send packets that are bigger than the default 256 bytes. If I change the
#define MQTT_MAX_PACKET_SIZE 256
to#define MQTT_MAX_PACKET_SIZE 1024
everything works, but if I callsetBufferSize(1024)
after theconnect()
method the function appears to have no effect, even thoughgetBufferSize()
returns 1024, thepublish()
method returns false due to the packet being too long.The text was updated successfully, but these errors were encountered: