ESP32 Starter template
A Simple ESP32 Starter template generator from your command line run
npx create-esp32-app
You can watch the video by clicking the image link below
Quick overview
This template can be used as is but, its intended as a quick start for the students learning the ESP32-IDF through my course https://learnesp32.com
if you want a simple vanilla flavoured template to copy and paste see esp32-starter
prerequisites
-
You will need to have node installed.
-
The esp-idf must be installed. you can follow the instructions in my course (free of charge) with the "Setting up Your Environment" module or follow the official documentation. The installation will create 2 folders. the esp-idf and the tools folder (usually called .espresif). pay attention to where these folders are as you will need to know there locations
-
this template is for vscode which will need to be installed
-
In VSCODE add the c++ extension
-
ensure tour ESP32 is plugged in and that a COM PORT is established (You may need a driver for your ESP32 dev board)
Run command
- in any directory run
npx create-esp32-app
- you will be prompted for the name of your project.
- you will be prompted for the IDF path (esp-idf folder). select or navigate to the location of the IDF path. If you have an environment variable called IDF_PATH the path will default to the environment variable.
- you will be prompted for the IDF-TOOLS path (.espressif folder). select or navigate to the location of the IDF-TOOLS path. If you have an environment variable called IDF_TOOLS_PATH the path will default to the environment variable.
- You will be asked if you like to include additional sample code or other items. Leave blank if you would like a bare-bones project
- navigate to the directory of the project name you created
cd <project name>
- open the project in vscode
code .
vs code intellisense
intellisense should just work so long as you have set up the paths correctly. If you have trouble double check your idf and tools paths and correct them in the /.vscode/c_cpp_properties.json file
flashing the esp32
-
In vs code, open a new terminal by pressing ctrl + ` (or pressing F1 and typing
open new terminal
) -
The first time you open the terminal. Vscode will ask you to allow permission to run a script. The script in question is the esp-idf import script which imports all the esp-idf environment variables into the shell. click allow and close the shell by pressing the trash can (not the x) then reopen the terminal again.
-
Type the following command
idf.py -p [your com port] flash monitor
Contribution
Pull requests are both welcome and encouraged