This framework enables AWS IoT cloud connectivity with ESP32 based platforms using AWS IoT Device Embedded SDK.
- Please clone this repository using,
git clone --recursive https://github.com/espressif/esp-aws-iot
- Please refer to https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html for setting ESP-IDF
- ESP-IDF can be downloaded from https://github.com/espressif/esp-idf/
- ESP-IDF v3.1 and above is recommended version
- Please refer to example README for more information on setting up examples
The esp-aws-iot
contains the support for using a secure element
chip from microchip i.e. ATECC608A
. This will store the private key used for the TLS communication in the secure element
which has the hardware security. The module ESP32-WROOM-32SE which integrates the ATECC608A
, can be readily used for this purpose. To use the secure element
for the TLS, configure the project with help of the following steps.
To use the
secure element
(ATECC608A) for the TLS connection, it must be already configured. Please refer to the eps_cryptoauth_utility for more details.
- Add esp-cryptoauthlib as a component to your project with the help of following commands, (First change directory (cd) to your project directory)
mkdir components
cd components
git clone https://github.com/espressif/esp-cryptoauthlib.git
-
Enable the mbedtls ECDSA support in esp-cryptoauthlib with the following config (
idf.py menuconfig
) option,menuconfig->Component config->esp-cryptoauthlib->Enable Hardware ECDSA keys for mbedTLS
-
Enable support for hardware secure element with the following config (
idf.py menuconfig
) option,menuconfig->Component config->Amazon Web Services IoT Platform->Use the hardware secure element for authenticating TLS connections
-
Ensure that you call the function
atcab_init
in the application to initialise thesecure_element
before you use the AWS IoT component. -
Project TLS configuration -
i) If you have the
Trust&GO
type of ATECC608A chip then you can setmqttInitParams.pDeviceCertLocation = "#"
in your project. It will make theesp-aws-iot
read the certificate fromATECC608A
and use it for the TLS. For the other types of ATECC608A chips, you will need to provide the certificate externally (embed the certificate).ii) Tell the
esp-aws-iot
to find the client private key in a slot by settingmqttInitParams.pDevicePrivateKeyLocation = “#0”
in your project, where the digit 0 indicates the slot in the ATECC608A in which the private key is stored. In most circumstances, the key will be stored in slot 0.
Along with the secure element configurations you will have to perform additional example specific configurations (if required).