- Newest
- Most votes
- Most comments
Hi EyalG. There's no equivalent or similar upstream mechanism for MQTT. To do it over MQTT, you would have to break your file into parts of not more than 128KB (current MQTT payload limit) for transport and re-constitute it in the cloud.
One alternative you may consider is to upload to S3 using HTTP: https://aws.amazon.com/blogs/iot/securely-ingesting-large-sized-payloads-from-iot-devices-to-the-aws-cloud/. You can find a similar demo implementation here: https://github.com/aws/aws-iot-device-sdk-embedded-C/blob/main/demos/http/http_demo_s3_upload/http_demo_s3_upload.c
Thank you for the answer. In my case the requested file length is much less then 128K but the only way I know to communicate with the Core is by updating the shadow topic with publish call (MQTTAgent_Publish). How can I send a file with that MQTT interface if its size is less then 128K? Thanks
Relevant content
- asked 3 years ago
- asked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 7 months ago
Assuming your device has enough memory, a single MQTT message can have a payload of up 128KB: https://docs.aws.amazon.com/general/latest/gr/iot-core.html#message-broker-limits. That is for publishing to a custom topic, not the reserved shadow topics. So you need to define your own topic. This example publishes to
/some/topic/name
: https://aws.github.io/amazon-freertos/202107.00/embedded-csdk/libraries/standard/coreMQTT-Agent/docs/doxygen/output/html/mqtt_agent_publish_function.html. Shadows are appropriate for status information that changes infrequently, but probably not for this use case.