Skip to content

Corsal8/create-esp32-app

 
 

Repository files navigation

ESP32 Starter template

A Simple ESP32 Starter template generator

from your command line run

npx create-esp32-app

create-esp-32.PNG

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

  1. You will need to have node installed.

  2. 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

  3. this template is for vscode which will need to be installed

  4. In VSCODE add the c++ extension

  5. 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

  1. in any directory run
npx create-esp32-app
  1. you will be prompted for the name of your project.
  2. 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.
  3. 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.
  4. You will be asked if you want to create a c or c++ project
  5. 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
  6. navigate to the directory of the project name you created
cd <project name>
  1. 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

  1. In vs code, open a new terminal by pressing ctrl + ` (or pressing F1 and typing open new terminal)

  2. 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.

  3. Type the following command

idf.py -p [your com port] flash monitor

Additional code samples

  • blinky [example: blink led]
  • c++ [example: c++ starter]
  • debug [debug cfg files]
  • example connect [example: connect to internet]
  • menuconfig [example: config menu with idf.py menuconfig]

log a request if you would like something else added

Contribution

Pull requests are both welcome and encouraged 😃

About

esp32 vscode generator

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 91.0%
  • CMake 5.0%
  • C 3.3%
  • Makefile 0.7%