Mostly this is just notes to myself, but I'll document the process. It took me 30 minutes. It will take you less since you will read my third bullet point.
Go see ESP32's Standard Toolchain Setup for Linux and macOS
You are going to install
brewto get packages. I would prefer not to have
brewon my system, but it is the cost of using the ESP-IDF.
The first instruction is to
sudo easy_install pip. This does not work. There is not easy_install command. No answer found to that in a quick googling. I ultimately skipped it and everything seems to be working fine.
Install Homebrew. Be aware that if their site is every hacked you will give control of your Mac to the attackers by following the installation instructions. Also, this wants to install the Xcode command line tools, so that can take a while. Even if you already have Xcode. Pay attention at the end, there are two commands you need to execute in your terminal.
Get the tools used to build ESP-IDF from brew.
brew install cmake ninja dfu-util
Python3 checks… my clean Monterey system comes with python3 install and not python2. Sounds ok.
Get ESP-IDF. You will make a directory first. The documents suggest
~/esp, but I put mine in
~/coding/esp. We'll see if that strike me dead later. This is about a ½ GB download.
Hop on down into
./install.sh esp32to install the cross compilers and linkers.
Sent your environment variables. You need to do this each time you want to do do ESP32 work. or put it in your
.zprofileor whatever your login script is…
. ~/WHERE_YOU_PUT_ESP-IDF/export.sh. Don't miss the first
.in that command. You need to execute it in your top level shell process, not as a subshell so the environment variables stick.
See if things are working…
idf.py build. It should end making a ".bin" file and suggesting a flash command.
Congratulations! You are ready to develop. The above steps took me 30 minutes, but a good chunk of that was trying to find
easy_install. It turns out you don't need it.