Skip to content

t04glovern/aws-esp32-cam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS ESP 32 Cam

Connection Diagram

Setup

Download the AWS Root CA

Create your AWS Certificates with

aws iot create-keys-and-certificate \
    --set-as-active \
    --certificate-pem-outfile <certificate_filename> \
    --public-key-outfile <public_key_filename> \
    --private-key-outfile <private_key_filename>

## 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.

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.

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 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

References

ESP32 Camera WebServer Code

Fritzing ESP32-CAM Model

About

Example for publishing images from an ESP32-CAM to AWS IoT over MQTT

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published