There are two official methods of programming ESP32. The first one is using ESP-IDF, which gives full control over the hardware. Full control means complex set-up and configuration process. But the second programming method is so easier since it uses the Arduino IDE as a development tool.
In this post, we'll go through installing ESP32 libraries on Arduino IDE in four easy steps.
- Host computer to program ESP32. You may use Windows, Mac OS or Unix computers.
- An ESP32 based development board.
- A USB Cable.
You'll need to go through each step for proper ESP32 installation. You can skip the steps you already did before.
- Arduino IDE Installation
- ESP32 Hardware Library Installation
- USB Driver Installation
- Start Programming
1. Arduino IDE Installation
Arduino IDE is a simple to use programming environment for hardware projects. You may use Arduino IDE for programming Arduino boards and other compatible boards.
To download, go to www.arduino.cc/en/Main/Software URL and then select appropriate OS version for your computer. For Windows PC's, we recommend using the Windows Installer. After the download, you can proceed with the installer.
2. ESP32 Hardware Library Installation
The ESP32 hardware library supplies required libraries and hardware definitions to the Arduino IDE. To install the library, first, start the Arduino IDE, and then go to File > Preferences.
Find the "Additional Boards Manager URLs" text field.
Add the following line to the text field.
If you have already another URL in the text field, add the ESP32 URL after a comma as follows:
Then, save and exit from the preferences window.
Following, open Boards Manager from the Tools > Board menu. Find "esp32 by Espressif Systems" and install the latest version.
Installation can last a few minutes according to your Internet speed. After the installation, you can close the "Boards Manager" window. Now, you'll see new boards from the Tools > Board menu.
Select your board, e.g., Turta IoT Node, from the Board menu.
3. USB Driver Installation
Connect your board to the host computer. After a few seconds, open the Tools > Port menu. If you see your device, like "COM3" or "COM4", select it. You're ready to go.
If you can't see anything, you'll need to install the USB drivers manually. In this case, find the documentation of your device and follow the instructions.
If you'll be using Turta IoT Node, go to ftdichip.com/Drivers/VCP.htm URL and find the installer for your operating system.
After the installation, you should see your board on the Tools > Port menu.
4. Start Programming
To test the installation, we'll upload an example sketch (program) to the board. From File > Examples menu, go to Examples for section, and then find the WiFi. Open WiFi Scan sketch. Using the right arrow button on the Arduino IDE's toolbar, upload the sketch to the ESP32 board. Depending on your computer's performance, it might take up to a minute for IDE to compile and upload the sketch to the board.
After the upload completed, you'll see "Hard resetting via RTS pin" message on the Arduino IDE, meaning your code is sent and started on the device.
This example scans for WiFi networks around and lists them. To see the list, go to Tools > Serial Monitor. Select "115200 baud" from the bottom right corner. After a few seconds, you'll see WiFis around you.
This post illustrated how to make your ESP32 device up and running.
If you're a Turta IoT Node owner, you'll find more detailed instructions on docs.turta.io/iot-boards/iot-node address.