2. Laptop Setup

Objectives

In this lab you will configure your laptop for the workshop. By the end of the module you will:

  • Have a local directory or folder to hold all the files required for your dispenser
  • Have installed and tested a device driver to communicate with the microcontroller
  • Downloaded a command line utility to program (flashed) the microcontroller
  • Have an open terminal or command prompt ready to issue commands, and verified that the microcontroller appears as a serial device

The microcontroller is programmed, or flashed, via a USB serial connection from a computer or laptop. Based on the microcontroller chipset, a specific driver is required.

Each persons laptop is unique and the general instructions may not work for a variety of reasons such as having a older version of the driver loaded, insufficient permissions to install, or older versions of Operating Systems. Please ensure that the checkpoint at the end has been completed prior to starting the next lab. If you run into problems, please ask for assistance from a workshop assistant.

Steps to Complete

Follow each step in order and use the Click to open for detailed step-by-step instructions if required.

1. Create Local Folder

Create a local folder called cdd that will contain all downloads and assets needed for the workshop. It is recommended to create this within your web browsers default download location. When asked to download resource X to cdd folder, save or move the files to that folder.

Click to open for detailed step-by-step instructions

2. Download and Install Serial Driver

The microcontroller used in this workshop, the ESP32-DevKitC, has a built-in Silicon Labs CP210x serial controller. In order for you laptop to communicate with the microcontroller you need to download and install the CP210x USB to UART Bridge VCP Drivers for your operating system. Follow the instructions exactly, you may be required to provide permissions to the driver and in some cases restart you laptop to complete the installation process.

Use the installer specific to the exact version of your operating system. Using the wrong driver will not work and may make it difficult to install the proper version later.

Click to open for detailed step-by-step instructions

3. Download and Install esptool

To be able to flash the firmware to the microcontroller we need to install a specific application called esptool. A pre-built executable can be downloaded here for macOS and here for Windows. Unzip or untar the file and place the file in the cdd directory.

For Linux users, or if you prefer to have it installed as a Python package, follow the instructions for your operating system to install the application. If installed correctly the command should accessible from any directory.

Click to open for detailed step-by-step instructions

4. Open Command Line Interface and Test All Components

Before testing, remove the ESP32 microcontroller (labeled as Provided ESP32) and USB cable from the zip-top bag:

Ensure that you have installed both the esptool and the USB to serial device driver before continuing

To interact with the microcontroller you will use a terminal window (macOS and Linux) or a command prompt (Windows). Create a terminal window and change to the cdd directory you created. Verify that you can run the esptool command, and then verify that when you connect the ESP32 via the USB cable that a new serial device is created.

When you have verified the previous step, remove the USB cable from the laptop and microcontroller.

Click to open for detailed step-by-step instructions

5. Download or Configure Serial Monitor Tool

For macOS and Linux, you will use the built-in screen utility to connect to and monitor the microcontroller. There is no configuration required.

Click to open for detailed step-by-step instructions for macOS and Linux

For Windows, you can either use a serial application already installed or download and use PuTTY.

Click to open for detailed step-by-step instructions for Windows Install of PuTTY

Checkpoints

Please ensure the following checkpoints are validated before moving on to the next module.

  1. Folder cdd - Verify and note the location of the folder
  2. Serial driver installed and tested - When the ESP32 is connected, the driver is working if a new serial port is created (/dev/tty.SLAB_USBtoUART or similar for macOS, a COMx port for Windows)
  3. Serial Monitoring Tool - Either PuTTY for Windows or screen for macOS/Linux. When you see monitoring mentioned, this is the tool to use.
  4. Flash Tool - This is the esptool or esptool.py that you will use to flash the microcontroller
  5. Command line window left open for other lab modules

Outcomes

Installation of device drivers, tool chains, and utilities such as esptool to interact with microcontrollers is complex, so why do we do it? Unlike cloud environments that can be stood up with infrastructure as code (IaaC), firmware development and testing takes place locally.

By completing and testing the installation of the tools in advance, we know that our environment is working properly. And if we need to fix or have another laptop or desktop to develop from, the steps to complete the setup are documented.

Copyright © 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.