Skip to main content

Set up ESP-IDF for ESP32

The Golioth Firmware SDK can be installed as a component of the ESP-IDF. This delivers a set of APIs that let you use Golioth with any ESP-IDF based projects. This guide will walk through the process of installing both the ESP-IDF and the Golioth Firmware SDK.

Install ESP-IDF

1. Install dependencies

sudo apt update
sudo apt-get install git wget flex bison gperf python3 python3-venv \
python3-pip python3-setuptools cmake ninja-build ccache libffi-dev \
libssl-dev dfu-util libusb-1.0-0

2. Clone the ESP-IDF Repository and set up the tools

mkdir -p ~/esp
cd ~/esp
git clone --recursive https://github.com/espressif/esp-idf.git -b v5.2.1
cd esp-idf
./install.sh all

Install Golioth Firmware SDK

Clone the Golioth Firmware SDK repository and update submodules recursively

cd ~
git clone --recursive https://github.com/golioth/golioth-firmware-sdk.git -b v0.12.0

Set the ESP IDF environment variables

Each time you begin a new terminal session, environment variables must be set to locate the ESP-IDF tools. This is an automated process using the single-line command shown below. Note that if the idf.py command is not found it usually indicates that these variable have not yet been set.

source ~/esp/esp-idf/export.sh

Sample build

Your system is all set up and ready to start building & flashing with the ESP-IDF. Verify by building a Hello World sample:

cd ~/esp
cp -r $IDF_PATH/examples/get-started/hello_world .
cd hello_world
idf.py set-target esp32
idf.py build