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
cd esp-idf
git checkout v4.4.1
git submodule update --init --recursive
./ all

Install Golioth Firmware SDK

1. Clone the Golioth Firmware SDK repository and update submodules

cd ~
git clone --recursive
cd golioth-firmware-sdk
git submodule update --init --recursive

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 command is not found it usually indicates that these variable have not yet been set.

source ~/esp/esp-idf/

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 set-target esp32 build