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
MQTT call multi time on big message #1234
Comments
This would be useful for OTA updates over MQTT since the payload is managed by the Updater class and saved to flash on the fly. Any other use could be problematic. What use cases, aside from OTA, would benefit from a payload bigger than 1460bytes but not big enough to make the device run out of memory (say 10k)? |
In my case is HVAC raw ir codes. They can easily had 30-40 bytes data and mean |
@xoseperez I've seen some messages fail to send (the mqtt publish method returns zero) while adding some more HA discovery features, because the messages where big. |
long-time-no-see, but this seems to be already handled by the mqtt buffer size setting circa this commit Line 1004 in a69a705
and the actual message is assembled from multiple onMessage calls sure, this does not handle binary payloads, but none of the mqtt module funcs actually work with that. that may be another issue, but imo we also want to move away from the multiple-clients paradigm and just use a single one |
Follow this document of async MQTT library, big message will be split to multi small MQTT message with difference start index. The library will call our handler multi time with payload is small message.
I think the best logic here is our
_onMessage
handler will check the message length, total length, start index, allocate the buffer to catch the all message before dispatch it to our_mqtt_callbacks
.I don't tested with pubsub lib but since pubsub don't give me any parameter like that so I disabled that code with pubsub library.
The text was updated successfully, but these errors were encountered: