Personal ESP32 monorepo using ESP-IDF. Multiple firmware projects share a single SDK.
brew install cmake ninja python
make esp-idf # Clone and pin ESP-IDF
cd esp-idf && ./install.sh # Install toolchains (one-time)
make secrets # Create secrets.cmake for WiFiEdit secrets.cmake with your WiFi credentials:
set(WIFI_SSID "your_network")
set(WIFI_PASSWORD "your_password")Activate ESP-IDF environment (or use direnv with .envrc):
source ./esp-idf/export.shBuild and flash from any project directory:
idf.py build
idf.py flash monitorCreate a new project:
idf.py create-project esp32-my-project
cd esp32-my-project
idf.py set-target esp32esp-idf/- SDK (gitignored, pinned viaesp-idf.commit)esp32-*/- Standalone projectscommon/- Shared componentslogging/- Log wrapper (log_info,log_warn,log_error)wifi/- WiFi connection (credentials fromsecrets.cmake)
Set mDNS hostname per project in CMakeLists.txt:
set(MDNS_HOSTNAME "my-device")Shared component layout:
common/my_component/
├── CMakeLists.txt
├── include/my_component.h
└── my_component.c
Include in a project's CMakeLists.txt:
set(EXTRA_COMPONENT_DIRS ${CMAKE_CURRENT_LIST_DIR}/../common)