AWS IoT EduKit requires ESP-IDF v4.2, but I'm particularly worried about building an environment on Windows, so I'll show you how to build it on Ubuntu inside a virtual machine.
By the way, the Workshop Document does not specify minor mistakes or required libraries, so that has already been added. (Bug Report completed)
https://www.virtualbox.org/
--Installing version 6.1 and Extension --Main memory: 4096MB or more --Number of processors: 2 or more --Video memory: 64MB or more --Storage: 20GB or more
Ubuntu 20.04
Download ** ubuntu-ja-20.04.1-desktop-amd64.iso ** from https://www.ubuntulinux.jp/products/JA-Localized/download and install it in VirtualBox.
--Installation configuration --Minimal installation, third party software installation
--Update and reboot.
--Although it is not required, it is easier to work in Terminal if you set The contents of your home directory in English on Ubuntu. Also, this article assumes English directory names.
-It is recommended because it resolves the permissions of Install Arduino IDE and / dev/ttyUSB **
. (Restart required)
Translate the contents of your home directory into English
$ LANG=C xdg-user-dirs-gtk-update
Visual Studio Code installation
There are no changes from Documentation. I will write it as a memo.
Download **. Deb 64bit ** from https://code.visualstudio.com/download.
$ sudo apt install -y ~/Downloads/code_1.52.1-1608136922_amd64.deb
Installing PlatformIO
Before working, do the following:
$ sudo apt install -y git python3-venv
After that, it is as Document.
Claiming and provisioning the device
I can't read the QR code because of the font (I think), so if you paste the URL displayed below it on your browser, the QR code will be displayed.
Installing ESP-IDF v4.2
Proceed as follows.
$ sudo apt install -y git wget flex bison gperf python-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util python3-virtualenv python-is-python3
$ mkdir ~/esp/
$ cd ~/esp/
$ git clone -b release/v4.2 --recursive https://github.com/espressif/esp-idf.git
$ cd esp-idf
$ bash install.sh
$ source ~/esp/esp-idf/export.sh
--Added python3-virtualenv`` python-is-python3
to apt.
--Fixed how to execute install.sh
.
--Changed the loading method of export.sh
to source.
Miniconda setup and installation
There is no change from Document, but I added it because the information is insufficient.
Download for Python 3.8 from https://docs.conda.io/en/latest/miniconda.html#linux-installers.
$ bash ~/Downloads/Miniconda3-latest-Linux-x86_64.sh
--Installation destination is $ HOME/miniconda3
--Do you wish the installer to initialize Miniconda3 by running conda init?
Answers ** yes **.
$ source ~/.bashrc
$ conda create -n edukit python=3.7
$ conda activate edukit
--Added information when installing Miniconda3.
--Added source ~/.bashrc
.
AWS CLI v2
I have changed a little from Document.
$ sudo apt install -y curl
$ curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o ~/Downloads/awscliv2.zip
$ unzip -x ~/Downloads/awscliv2.zip
$ sudo aws/install
$ rm -rf aws
As per the documentation after AWS CLI Configuration.
--Added apt install -y curl
.
--The ZIP download destination is set to Downloads
.
--Delete the extraction directory.
Retrieving the Device Certificate and Registering your AWS IoT thing
Before working, do the following:
$ source ~/esp/esp-idf/export.sh
$ conda activate edukit
$ sudo apt install -y libusb-1.0-0-dev libudev-dev g++ python3-dev
After that, it is as Document.
If the execution of registration_helper.py
fails to import esptool, the environment variable IDF_PATH
is not set correctly.
In the new Terminal, run source ~/esp/esp-idf/export.sh
=> conda activate edukit
, and then run it again.
If you continue to open a new Terminal and develop AWS IoT EduKit, always load these two environments in the future.
$ source ~/esp/esp-idf/export.sh
$ conda activate edukit
About 2 hours in total including download time. It takes more if the network is slow.
EoT