ESP-WROOM-32 Testing and First Use of ESP32 Devkit Board

Created on: 21 September 2017

ESP-WROOM-32 testing and first use of the ESP32 Devkit board from DOIT (doit.am), also sold as Geekcreit ESP32 Development Board with WiFi and Bluetooth. How to start using the ESP32 Devkit from DOIT.

This article shows how to do some basic initial tests to see if a new ESP32 Devkit board is working. It also shows how to install Windows drivers for the board and how to communicate with the board from a serial port terminal program in Windows and Linux. The ESP32 Devkit board from DOIT is based on the ESP-WROOM-32 microcontroller from Espressif with integrated WiFi and Bluetooth.

LuaNode is preloaded on the board allowing it to be programmed in the Lua programming language. Some simple programs written in Lua are used to test the board to see if it is running.

Below is a top and bottom view of the board used in this tutorial.

DOIT ESP-WROOM-32 Devkit Testing and First Use Tutorial
DOIT ESP-WROOM-32 Devkit used in this Testing and First Use Tutorial

ESP32 Devkit ESP-WROOM-32 Board Basic Hardware Information

This section contains the basic minimum information that anyone using the ESP32 Devkit board needs to know before starting to use it, test it or program it.

ESP32 Devkit Power and USB Cable

The ESP32 Devkit board is powered from a micro-USB connector. Plug a USB cable with micro-B plug into the micro-USB socket on the board and the other end into a PC USB port to power up the board. A regulator on the board supplies the ESP-WROOM-32 module with 3.3V derived from the USB 5V.

ESP32 Board Micro-USB Connector
ESP32 Board Micro-USB Connector

ESP32 Devkit Main Components

Two main components or ICs are found on the board:

  • ESP-WROOM-32 module – Espressif microcontroller with integrated Wi-Fi and Bluetooth.
  • CP2102 – Silicon Labs single-chip USB-to-UART bridge.
ESP-WROOM-32 Microcontroller Module and CP2102 USB-to-UART Bridge
ESP-WROOM-32 Microcontroller Module and CP2102 USB-to-UART Bridge

On-board LEDs

A red LED indicates that the board is powered up and has 3.3V from the regulator. The blue LED is user programmable and is connected to the GPIO2 pin of the ESP-WROOM-32 module.

Both LEDs are shown illuminated in the image below.

LEDs on the ESP32 Devkit Board
LEDs on the ESP32 Devkit Board

Hardware and Software References

More information on each hardware and software component of the ESP Devkit board can be found at the following links.

There should be no need to install the LuaNode software on the board, it should already be installed when purchased.

Testing the Board – Power Indicator

The first and most basic test that can be done is to power up the board via a USB cable and to check that the red LED lights up as shown in the image below. This confirms that the 3.3V power from the on-board regulator is working.

ESP32 Devkit Power On Led
ESP32 Devkit Power On Led

The next basic test is to see if the board can be detected by the operating system and load drivers for it.

Linux Drivers

Linux drivers should already be installed on most Linux systems. Plug the ESP32 Devkit board into the Linux PC using a USB cable and enter the following command to find the name of the port that the board is connected to.

dmesg | grep tty

A more basic and manual test to see if the drivers on a Linux computer have loaded is to first enter the following command in a terminal window without the board plugged into the PC.

ls /dev/tty*

Now plug the board in and run the same command again. The new device starting with tty that appears in the list is the ESP32 Devkit board. For example, it appears as ttyUSB0 on my Linux Mint computer.

Also try the following command before and after plugging the board in to see if the board is configured as a ttyUSB device.

ls /dev/ttyUSB*

Download and Install Windows Drivers

Drivers must be installed on Windows systems for the Silicon Labs CP2102 USB-to-UART bridge chip. After drivers have been loaded, the board appears as a virtual COM port (VCP) on the PC.

Download CP2102 Driver

Go to the CP210x USB to UART Bridge VCP Drivers page and select the driver for your version of Windows. For Windows 7 and 10 download from the Download VCP link as shown highlighted by a red dot below.

CP2102 Driver Download
CP2102 Driver Download

Install CP2102 Driver

Extract the contents of the downloaded zipped driver file and copy the contents to a folder on your PC.

Use a USB cable to plug the board into a PC USB port. The device driver installation will fail.

Click the Windows Start button and search for device manager. Click Device Manager in the search results to open it as shown below.

CP2102 in Windows Device Manager
CP2102 in Windows Device Manager

Right-click CP2102 in the Device Manager window and select Update driver software... on the menu that pops up. In the dialog box that opens, click Browse my computer for driver software. In the next dialog box, use the Browse... button to navigate to the folder that you extracted the drivers to, then click the Next button as shown below.

CP2102 Windows Driver Install
CP2102 Windows Driver Install

Drivers for the CP2102 will now be installed on Windows. Click the Close button when done.

Download a Serial Port Terminal Program for Windows

A terminal program is needed to connect to the Lua interpreter on the ESP32 board via the virtual COM port.

If you don't have a serial port terminal program installed on your PC, you can download Tera Term for Windows. Go to the Tera Term download page and download the newest release of Tera Term. Download the zip file, e.g. teraterm-4.96.zip.

Extract the teraterm folder from the downloaded zipped file and place it in a convenient location, e.g. on your desktop.

To run Tera Term, open the folder, e.g. teraterm-4.96, then find and double-click ttermpro.exe.

Serial Port Terminal Program for Linux

Minicom is a text based serial port terminal program for Linux that is run from the command line. On Ubuntu based Linux distributions such as Linux Mint, enter the following command to install Minicom.

sudo apt-get install minicom

Testing the ESP32 Devkit Serial Port Connection

In this test the serial port terminal program is connected to the ESP32 Devkit board. When a connection is made and the board is booted up, diagnostic messages and the Lua prompt will be seen in the terminal window.

Connecting to the ESP32 Devkit using Tera Term in Windows

Before connecting, start Device Manager again and expand the Ports (COM & LPT) item. Find the item called Silicon Labs CP210x USB to UART Bridge (COM4) where COMx at the end shows the COM port number of the ESP32 Devkit board. Now that we know the COM port number, we can connect to the board.

Start Tera Term and close the new connection dialog box that pops up. On the top menu select Setup → Serial port.... In the dialog box that opens, select the COM port that you found in device manager and the following parameters: Baud rate: 115200, Data: 8 bit, Parity: none, Stop: 1 bit and Flow control: none as shown in the image below.

ESP32 Devkit Serial Port Settings in Tera Term
ESP32 Devkit Serial Port Settings in Tera Term

Click OK when done. Tera Term should now connect to the Devkit board and information from the board should scroll up the terminal window. Finally the Lua command prompt should appear as shown in the image below. If no connection was made, select File → New connection... from the top menu. Select the Devkit COM port in the dialog box that opens, make sure that Serial is selected and click OK.

Tera Term Lua Prompt
Tera Term Lua Prompt

At the prompt, enter the following Lua command that will restart the board and display the boot-up messages again.

node.restart();

The board can also be manually reset by pressing the EN button found next to the micro-USB connector.

Connecting to the ESP32 in Linux using Minicom

Minicom must initially be set up with the communication parameters for the ESP32 Devkit board. This only has to be done once.

Before continuing, make sure that you are a member of the dialout group. This can be changed by opening Users and Groups in Linux Mint. You will need to log out and then back in again for the changes to take effect.

Setting Up Minicom

Open a command line terminal window and enter the following to start the Minicom setup. This will change the default Minicom settings, so must be started as super user because the settings file is saved in the main file system.

sudo minicom -s

A menu will appear. Use the down arrow key to move to Serial port setup and then hit the enter key. Type A to change the serial port to the port that the ESP32 Devkit board is connected to. E.g. change it to /dev/ttyUSB0 and then hit the Enter key. Hit F to set the Hardware Flow Control to No. The default communication parameters should already be right for the board – 115200 8N1.

The image below shows the minicom serial port parameters set up for the ESP32 Devkit. Just make sure that you change the Serial Device to the correct one for your system.

Minicom ESP32 Devkit Serial Port Settings
Minicom ESP32 Devkit Serial Port Settings

Hit the Enter key to get back to the main Minicom menu. Use the down arrow key to select Screen and keyboard then hit the Enter key.

Press the Q key to switch local echo on so that you will be able to see what you are typing in minicom. Hit Enter to get back to the main menu. Now select Exit from Minicom and press Enter.

Starting and Using Minicom

First plug your ESP32 Devkit board into the PC USB port. Start Minicom, by entering minicom in a terminal window. Minicom will start and connect to the Devkit board using the parameters previously set up.

Press the En button found next to the micro-USB connector on the ESP32 Devkit board to reset the board. Boot-up text will scroll across the Minicom window, after which the Lua command prompt will appear.

At the prompt, enter the following Lua command that will restart the board and display the boot-up messages again.

node.restart();

Exiting from Minicom

Stay connected using Minicom for the next test. When you need to exit Minicom, press Ctrl + A on the keyboard, then press the X key. Finally hit the Enter key to select the default "Yes" to exit.

Testing the Blue LED on GPIO2

It is assumed that you have followed the above instructions and are connected to the ESP32 Devkit board using Tera Term in Windows or Minicom in Linux or have connected using some other serial port terminal program.

At the Lua prompt in the serial port terminal, enter the following commands to first set GPIO2 (pin connected to the blue LED) as an output pin and then switch the blue LED on.

gpio.mode(2, gpio.OUTPUT);
gpio.write(2, 1);

The LED can be switched off by entering the following command.

gpio.write(2, 0);

Basic Tests Finished

This concludes the very basic testing of the ESP32 Devkit board. If you managed to run all of the above tests successfully, then you know that your board is powering up correctly, serial communications are working and the microcontroller is booting Lua. Also the blue LED is working which means that the microcontroller is running and responding to commands.