PhracturedBlue / ESP8266MQTTMesh

Self-assembling Mesh network built around the MQTT protocol supporting OTA
GNU General Public License v3.0
265 stars 79 forks source link

Receiving message size #30

Closed hemaltandel1 closed 6 years ago

hemaltandel1 commented 6 years ago

Hi @PhracturedBlue,

What is the size limit for receiving message ? I was looking at Memory management . As per their document max receive size is about 1460 bytes per call.

How it's handled here?

Regards, John

PhracturedBlue commented 6 years ago

The maximum supported mqtt size is 1152 bytes. I believe that includes both the topic and the message.

hemaltandel1 commented 6 years ago

Yes, i saw that message buffer size is fixed on header file. We can support unlimited message size if we can somehow pass "size_t len, size_t index, size_t total" parameters of "onMqqtMessage" to mesh node "onData" method. Do you think something is possible to implement?

PhracturedBlue commented 6 years ago

it is possible but would require dynamic memory allocation to allow nodes to repeat arbitrary message sizes. I spent a lot of effort to have no dynamic memory allocation in this library, as it tends to be a poor choice for embedded applications. What is your need that you expect such large messages?

hemaltandel1 commented 6 years ago

@PhracturedBlue Understood. I don't have hard requirement for large message. Just wondering if can remove such limitation from software side.