Flash the Espressif Certificates


By the end of this chapter, you will have installed the companion phone applications on your mobile device, cloned the necessary code repository, received certificates for connecting to AWS IoT using Espressif Alexa’s AWS account, and flashed the certificates to separate flash partitions on the Core2 for AWS.

Companion mobile applications

In order to complete the authentication with Alexa, you will use Espressif’s companion app to provision the device’s Wi-Fi and provision the device with your Alexa account.

Download the ESP Alexa Phone App: iOS / Android

We recommend (optional_ for this tutorial) that you have the Amazon Alexa app available for iOS or Android - this is the same app used to provision most Alexa-enabled devices.

Access the code

All the code for this tutorial is located in the Alexa_for_IoT-Intro folder from the repo you cloned in the Blinky Hello World tutorial. If you have already cloned the repository locally, you can skip this section.

To clone the repo again from the PlatformIO CLI terminal window:

git clone https://github.com/m5stack/Core2-for-AWS-IoT-EduKit.git

Open the project environment

For this tutorial, you will use the Alexa_For_IoT-Intro project. In your new VS Code window,

  1. Click the PlatformIO logo in the VS Code activity bar (left most menu)
  2. Select Open from the left PlatformIO menu
  3. Click Open Project
  4. Navigate to the Core2-for-AWS-IoT-EduKit/Alexa_For_IoT-Intro folder, and click open.

    PlatformIO home screen

Next, you must open a new PlatformIO CLI terminal window in VS Code:

  1. Click the PlatformIO logo on the VS Code activity bar (left most menu).
  2. From the Quick Access menu, under Miscellaneous, select New Terminal.

PlatformIO CLI terminal in VS Code

Set up AWS IoT certificates

You must create the AWS IoT credentials to communicate with AWS IoT core. For this workshop and device, Espressif has provided AWS IoT credentials that can be used on their AWS account with the Core2 for AWS. To obtain the credentials for your device to connect to their service, fill out the form here .

After you receive the e-mail containing the credentials zip file, save the file and unzip the contents. After extraction, you will have a folder called espcredentials. With the device plugged in, you can upload these certificates to your device by entering the following commands in your PlatformIO CLI terminal window:

Ubuntu or macOS

With everthing set up and ready, let’s move on to Building and Testing AFI .

Questions? Please use M5Stack Forum

AWS IoT Kit now features direct access to M5Stack Forum , which is a community-driven, questions-and-answers service. Search re:Post using the Core2 for AWS tag to see if your question has been asked and answered. If not, ask a new question using the Core2 for AWS tag.