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