AWS IoT publish large binary data to S3
Posted: Sun Dec 18, 2022 8:44 pm
I'm looking for a secure way to publish a stream of binary data to a topic in AWS IoT using either a cryptographic module ATECC608A or embedded private keys generated from the AWS server.
There are plenty of examples of serverless apps that do not retransmit received data to S3. Typical examples show how to send a small json payload with temperature/humidity at a slow rate (1 sec update). But I've found no examples of working with stream data like video, images, or audio sent to AWS IoT and stored in S3 using esp-aws-iot toolkit. ESP-IDF is preferred.
Task: I need to send binary streaming data (char*) with a variable length (500-5000) each second or so.
Would much appreciate if someone share such an example.
What I've already found:
1. Should I encode binary data to base64 prior to uploading to an AWS IoT topic or S3?
2. Can I upload directly from an ESP32 board to AWS S3 via IoT in a file where each publish just appends to a file located on S3 or I should always do it via IoT topics and republish to S3?
There are plenty of examples of serverless apps that do not retransmit received data to S3. Typical examples show how to send a small json payload with temperature/humidity at a slow rate (1 sec update). But I've found no examples of working with stream data like video, images, or audio sent to AWS IoT and stored in S3 using esp-aws-iot toolkit. ESP-IDF is preferred.
Task: I need to send binary streaming data (char*) with a variable length (500-5000) each second or so.
Would much appreciate if someone share such an example.
What I've already found:
- https://github.com/espressif/esp-aws-iot/issues/93 points to an outdated branch that has not found its way to succeed in the author's requests. Moreover, the example in this outdated branch is not finished and one needs to figure out how to actually upload the data on S3.
- https://github.com/aws-samples/aws-iot- ... wan-device shows a how-to for LORAWAN binary payload and its customization. But it requires additional services like AWS SAM and NodeJS and is quite specific to LORAWAN use-cases.
- https://github.com/perldj/ESP32CAMToS3 uploads images to an endpoint in an unsecured way without using AWS IoT.
- https://stackoverflow.com/questions/638 ... pic-tested and https://github.com/knolleary/pubsubclie ... essage.ino show how to publish binary data to AWS IoT but it's (1) on Arduino (I'm looking for ESP-IDF) and (2) it does not describe (there is no tutorial on top of that) how to republish the data from a topic to S3. Besides, all these examples create a single file on S3 at each MQTT publish message. Whereas I want to have a single file on S3 for each of ESP32 boards and just append the data to it with each new message.
1. Should I encode binary data to base64 prior to uploading to an AWS IoT topic or S3?
2. Can I upload directly from an ESP32 board to AWS S3 via IoT in a file where each publish just appends to a file located on S3 or I should always do it via IoT topics and republish to S3?