- Newest
- Most votes
- Most comments
Hi juanGomez. Although IoT Core can handle messages up to 128KB, practical limits, in regards to RAM and buffer sizes on the device, are usually hit first.
Assuming you're using AWS IoT Embedded C SDK libraries, please check the buffer size you are passing into MQTT_Init()
:
If your message is bigger than that buffer size, you will have a problem. Although your failed message doesn't look very big.
Are you calling MQTT_Publish()
to publish? Are you checking the return value?
This call may be failing. Hence the message is perhaps never sent, and that may be why you don't get the callback.
On the cloud side, you can enable AWS IoT logging in CloudWatch to get greater visibility:
https://docs.aws.amazon.com/iot/latest/developerguide/configure-logging.html
Thanks a lot for the help.
Problem was that MQTT_MAX_PACKET_SIZE was set to 256 bytes.
I changed it to 65k bytes using setBufferSize() function and it solved the issue.
Thanks a lot
You are correct about the max payload of an MQTT message being 128KB, and if you were to run up against this limit, you would receive a CLIENT_ERROR with reason of PAYLOAD_LIMIT_EXCEEDED (see references below).
https://docs.aws.amazon.com/iot/latest/developerguide/topicdata.html https://docs.aws.amazon.com/general/latest/gr/iot-core.html#message-broker-limits
I am able to successfully publish the 2nd example you've given above...Are you receiving a payload limit exception error? I suspect there is some other reason you are running into this issue.
Please accept answer if at all helpful!
Hi, I am facing problem to build HTTPS API for AWS IoT core. and Facing problem with GPRS through Arduino. How can I solve this?
Relevant content
- asked 8 months ago
- asked a year ago
- asked 2 months ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
Glad to hear it. Please don't be shy about accepting answers. We all like a few points.
65KB is a big buffer by the way. I suspect you probably didn't need to go that big.