Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/t04glovern/aws-esp32-cam
Example for publishing images from an ESP32-CAM to AWS IoT over MQTT
https://github.com/t04glovern/aws-esp32-cam
aws-iot esp32-cam espressif mqtt
Last synced: about 2 months ago
JSON representation
Example for publishing images from an ESP32-CAM to AWS IoT over MQTT
- Host: GitHub
- URL: https://github.com/t04glovern/aws-esp32-cam
- Owner: t04glovern
- Created: 2020-05-10T13:05:48.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-08T14:19:11.000Z (over 2 years ago)
- Last Synced: 2024-04-21T17:16:23.621Z (9 months ago)
- Topics: aws-iot, esp32-cam, espressif, mqtt
- Language: C++
- Homepage: https://devopstar.com/2020/05/16/aws-iot-esp32-cam-setup
- Size: 289 KB
- Stars: 6
- Watchers: 4
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AWS ESP 32 Cam
![Connection Diagram](docs/connections.png)
## Setup
[Download the AWS Root CA](https://www.amazontrust.com/repository/AmazonRootCA1.pem)
Create your AWS Certificates with
```bash
aws iot create-keys-and-certificate \
--set-as-active \
--certificate-pem-outfile \
--public-key-outfile \
--private-key-outfile## Example
aws iot create-keys-and-certificate \
--set-as-active \
--certificate-pem-outfile "iot_cert_demo.pem" \
--public-key-outfile "iot_cert_demo.key" \
--private-key-outfile "iot_cert_demo.private"
```Get your AWS IoT endpoint URL with `aws iot describe-endpoint --region us-east-1`
Your certificates will need to be formatted with newline characters. For example your CA Certificate would look like.
```bash
const char CA_CERT[] ="-----BEGIN CERTIFICATE-----\n"
"MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\n"
"ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n"
--snip---
"-----END CERTIFICATE-----";
```Modify `lib/conf/conf.h` with your variables.
### Flashing Code
When flashing code you will need to hold the button connected to ```IO0``` and ```GND``` down. If you run into this issue then you will need to press the button on the back of the EPS32-CAM once.
```bash
Connecting........_____....._____....._____....._____....._____....._____....._____A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
*** [upload] Error 2
```### Monitoring Via Serial Port
When monitoring code via the serial port you will need to make sure the button between ```IO0``` and ```GND``` is not held down. If you still do not see anything then press the button on the back of the ESP32-CAM once.
### Monitoring MQTT topic
I tend to use [MQTT/.fx](https://mqttfx.jensd.de/) to monitor the MQTT topic without needed to log into AWS. You will need to include your ```Client Key File``` ```AWS Root CA``` and ```Client Certifiate File``` in your conection profile settings.
![mqttfx](docs/mqttfx.png)## References
[ESP32 Camera WebServer Code](https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples/Camera/CameraWebServer)
[Fritzing ESP32-CAM Model](https://forum.fritzing.org/t/esp32-cam-fritzing-part/8517/3)