espressif / esp-azure

SDK to connect ESP8266 and ESP32 to Microsoft Azure IoT services
176 stars 92 forks source link

Send Azure message larger than 5000 bytes (CA-153) #121

Open RLmonitor opened 3 years ago

RLmonitor commented 3 years ago

I have been testing the SDK with code based on the Azure-ESP-Starter code. When I try to send a larger message body the message fails with IOT result message is IOTHUB_CLIENT_CONFIRMATION_BECAUSE_DESTROY Message length of 5438 is ok, 5458 fails. I was looking for a reason and noticed that in the TCP settings, the default send buffer size = 5744 If I change this to 15744 I can send a 10,000 byte message. The SDK seems to be failing when trying to fragment & send larger messages. At first I thought it may have something to do with the TLS maximum outgoing fragment length setting (default 4096), but increasing this did not resolve the problem. The TCP buffer setting does allow larger messages. I thought that Azure allows a 256k message. Has anyone else noticed this issue?