AWS IoT publish large binary data to S3

dizcza
Posts: 56
Joined: Tue Sep 07, 2021 6:59 pm

AWS IoT publish large binary data to S3

Postby dizcza » 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: I also have general questions:

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?

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

Re: AWS IoT publish large binary data to S3

Postby chegewara » Tue Dec 20, 2022 2:21 am

I didnt work with AWS and S3 for quite some time, but as far as i know you can use one of few methods:
- write straight to S3 with AWS client certificate,
- write to AWS gateway, which will pass data to lambda and/or S3
- i think you can use mqtt and lambda to pass data to S3 too.

All options are working with SSL transport and i think some can be password protected and for sure can be protected with client side certificates.

dizcza
Posts: 56
Joined: Tue Sep 07, 2021 6:59 pm

Re: AWS IoT publish large binary data to S3

Postby dizcza » Sun Jan 08, 2023 11:33 am

chegewara wrote:
Tue Dec 20, 2022 2:21 am
- write straight to S3 with AWS client certificate,
If you mean something like it's done in https://github.com/perldj/ESP32CAMToS3 - the example does not show how to do it in a secure fashion.
chegewara wrote:
Tue Dec 20, 2022 2:21 am
All options are working with SSL transport and i think some can be password protected and for sure can be protected with client side certificates.
So that's the code I'd like to see. A full example.
chegewara wrote:
Tue Dec 20, 2022 2:21 am
- write to AWS gateway, which will pass data to lambda and/or S3
- i think you can use mqtt and lambda to pass data to S3 too.
Yes, I'd like to see the code for such cases too. It's mentioned here and there that it's possible but no one has pointed me to a working version.

The guys at aws-iot repo are also responsive, they described other ways as well: https://github.com/aws/aws-iot-device-s ... ssues/1841. Unfortunately, without the code either.

Who is online

Users browsing this forum: No registered users and 13 guests