knolleary / pubsubclient

A client library for the Arduino Ethernet Shield that provides support for MQTT.
http://pubsubclient.knolleary.net/
MIT License
3.82k stars 1.47k forks source link

MAX_PACKET_SIZE is bound to uint16_t even with ESP32 #915

Open hutje opened 2 years ago

hutje commented 2 years ago

I would like to send packets of 100KB of RAW binary data to the ESP32, but the size is bound to the max value of uint16_t. So the maximal size is of my package is 65,536 Bytes. It is not an option to send my message in two parts. For me uint32_t would be preferable.

Max_packet_size could be using malloc() and free() which saves heap during the rest of the process. While receiving the payload, the max_packet_size can be reserved, but afterwards it could be freed.

indiealexh commented 2 years ago

I'm in the same position. unfortunately this means I'll need to work directly with ESP IDF as I need to send images with mine and chunking it is not preferable.

MokhammadDaniyal commented 2 years ago

Stuck in the same position.... Have you found any solutions?

iwas108 commented 2 years ago

any solution on this?

indiealexh commented 2 years ago

Any solution for this would either need a flag to use 32 bits or some sort of capabilities check. I can look into it, but this is not where my core skill set lies.

iwas108 commented 2 years ago

I need to improve the setBufferSize to uint32_t, so I can use the PSRAM on ESP32CAM to send large base64 image over MQTT. For now, I will try to fork and modify the library by my self.