In this chapter, you’ll install required software for this and all subsequent tutorials. Starting with the SiLabs CP210x drivers to communicate with the Core 2 for AWS IoT EduKit over USB, then the ESP-IDF toolchain for the on-board ESP32-D0WD microcontroller unit (MCU). You will also install Miniconda to manage your Python versions and your dependencies in isolated virtual environments to avoid conflicts. Additionally, we will download, install, and configure the AWS command line interface (CLI). This tutorial assumes that you have an AWS account.
Download and install the SiLabs CP210x drivers to enable your computer to communicate with the Core2 for AWS IoT EduKit device. The on-board CP2104 is an USB-to-UART bridge to facilitate host communication with the ESP32-D0WD microcontroller:
Since OS X Mavericks, Apple has included the necessary USB to serial drivers and no other steps are necessary. To verify that the drivers are installed, loaded, and the device is read for programming, connect the device via the provided USB-C cable and run:
ls -l /dev/cu.S* || ls -l /dev/cu.usbserial*
If your host machine recognizes and is able to communicate with the device, you will see a return value of
/dev/cu.SLAB_USBtoUART or a value that starts with
/dev/cu.usbserial-. Keep this value on hand, as we’ll be using it later.
If the results of the command above returns empty, check the physical connection first. If it doesn’t resolve the issue, follow the instructions for macOS <= 10.8.
On macOS 10.13 and later, the installation of the SiLabs system extension may be blocked. To unblock, open your Mac’s System Preferences Security & Privacy pane, unlock changes by clicking the , allow the developer, and then relock by clicking the . For more information, see Apple Technical Note TN2459.
Linux kernel version 3.x.x and 4.x.x already include the drivers as part of the distribution. To verify they are installed and loaded, run the command in your terminal:
modinfo usbserial modinfo cp210x
If they are not loaded, run the command:
sudo modprobe usbserial sudo modprobe cp210x
The tutorials were only tested on the 64-bit version of Windows 10. We do not support any other configuration of the Windows operating system.
The M5Stack Core2 for AWS reference hardware you’re using is equipped with an Espressif ESP32-D0WD microcontroller unit (MCU). The ESP-IDF (Espressif IoT Development Framework) allows you to configure, build, and flash firmware onto an ESP32 board. In the Getting Started tutorial, you used PlatformIO to simplify compilation and flashing of the firmware on the device—which provides a GUI to the behind-the-scene calls to ESP-IDF version 4.1 and other tools. For the subsequent steps, you will use ESP-IDF version 4.2 due to enhancements to the mbedTLS library and improved integration of the secure element.
Copy and paste the command block below to:
$HOME/esp/directory (the full ESP-IDF path will be $HOME/esp/esp-idf).
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install cmake ninja dfu-util mkdir $HOME/esp cd $HOME/esp git clone -b release/v4.2 --recursive https://github.com/espressif/esp-idf.git cd $HOME/esp/esp-idf . $HOME/esp/esp-idf/install.sh . $HOME/esp/esp-idf/export.sh
sudo yum install git wget flex bison gperf cmake ninja-build ccache dfu-util
sudo apt-get install git wget flex bison gperf python-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util
sudo pacman -S --needed gcc git make flex bison gperf cmake ninja ccache dfu-util
$HOME/esp/directory (the full ESP-IDF path is $HOME/esp/esp-idf).
mkdir $HOME/esp cd $HOME/esp git clone -b release/v4.2 --recursive https://github.com/espressif/esp-idf.git cd $HOME/esp/esp-idf . $HOME/esp/esp-idf/install.sh . $HOME/esp/esp-idf/export.sh
The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts. To be able to configure the AWS CLI, you’ll first need to have an AWS account. Please signin or create an account first before proceeding. After you’ve signed in follow the official AWS CLI installation instructions for your OS.
Once you have that installed, it is time to set it for your account and region. It’s important to keep in mind that the region you’re currently using stays consistent—for purposes of this tutorial, we are standardizing on us-west-2. Changing regions can cause other challenges in subsequent steps. To view regional service availability, reference the AWS Regional Services List for a list of services that are available.
Use the command:
For steps on obtaining the credentials for the AWS CLI, view the quick configuration documentation. To get the AWS access key Id and AWS secret access key, you will need to give necessary permissions to your IAM user. Your inputs should look like the following:
AWS Access Key ID [None]: EXAMPLEKEYIDEXAMPLE AWS Secret Access Key [None]: EXAMPLEtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY Default region name [None]: us-west-2 Default output format [None]: json
Miniconda is a bootstrap version of the full-fledge Anaconda—which simplifies package and Python virtual environment management. Many installation errors are due to incompatible Python versions (e.g. Python 2.x or 3.8.x), the python PATH variable being set to the wrong Python version, or dependency conflicts. It is strongly encouraged to always use Conda to handle your Python development environment.
Go to https://docs.conda.io/en/latest/miniconda.html and download the corresponding installer for your OS. Follow the official Miniconda installation instructions and then return to this page.
conda create -n edukit python=3.7
conda activate edukit
conda create -n edukit python=3.7
conda activate edukit
If you close your shell or open a new shell, you’ll need to re-enter
conda activate edukit to reactivate the virtual environment and source ESP-IDF’s
export.sh (macOS/Linux) or
export.bat (Windows) to re-add the ESP-IDF tools to your path each time.
git clone https://github.com/m5stack/Core2-for-AWS-IoT-EduKit.git
Windows has file path length limitations that can cause errors depending on where the project is placed. It is recommended that you clone this repo or extract the zip with a shorter initial path length if this error should occur (e.g. C:\).
With everything installed and configured, let’s move to the next chapter, Device Provisioning.