You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ac_training_lab/a1_cam/README.md
+27-14Lines changed: 27 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ Key considerations:
41
41
42
42

43
43
44
-
-**Bucket Versioning**: Enable (recommended for production use)
44
+
-**Bucket Versioning**: Can be left disabled by default. Enable if you want to keep multiple versions of files (less applicable when uploading timestamped images as this camera does)
The device uses [boto3](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html), the AWS SDK for Python, to upload images to S3.
@@ -113,13 +111,28 @@ boto3 is included in the device `requirements.txt` and will be installed when yo
113
111
114
112
### Configuration
115
113
116
-
The device reads AWS credentials from the `my_secrets.py` file (see Secrets section below for setup).
114
+
The device code explicitly passes AWS credentials to boto3 from the `my_secrets.py` file. This approach keeps all credentials in one place and avoids the need to configure `~/.aws/credentials` on the Raspberry Pi.
115
+
116
+
Add the following to your `my_secrets.py` file (see Secrets section below for creating this file):
BUCKET_NAME="rpi-zero2w-toolhead-camera"# or your bucket name
123
+
```
124
+
125
+
The device.py code passes these credentials directly to boto3.client():
126
+
```python
127
+
s3 = boto3.client(
128
+
"s3",
129
+
aws_access_key_id=AWS_ACCESS_KEY_ID,
130
+
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
131
+
region_name=AWS_REGION,
132
+
)
133
+
```
117
134
118
-
Required AWS credentials:
119
-
-`AWS_ACCESS_KEY_ID` - Your IAM user access key
120
-
-`AWS_SECRET_ACCESS_KEY` - Your IAM user secret key
121
-
-`AWS_REGION` - The region where your S3 bucket is located (e.g., `us-east-2`)
122
-
-`BUCKET_NAME` - Your S3 bucket name
135
+
**Note**: While boto3 also supports reading credentials from `~/.aws/credentials` or environment variables, this implementation explicitly passes them to keep all device secrets centralized in `my_secrets.py`.
0 commit comments