esp32-based door lock sensor that reports state changes via HTTP webhook
-
Copy the example config file:
cp main/config.h.example main/config.h
-
Edit
main/config.hwith your wifi credentials, etc. -
Build:
idf.py build -
Flash:
idf.py flash -
Monitor:
idf.py monitor
-
Build the project first, clangd needs
build/compile_commands.json:idf.py build
-
Configure clangd with the correct toolchain paths, e.g. in
.vscode/settings.json:{ "clangd.path": "/Users/<USERNAME>/.espressif/tools/esp-clang/<VERSION>/esp-clang/bin/clangd", "clangd.arguments": [ "--query-driver=/Users/<USERNAME>/.espressif/tools/xtensa-esp-elf/<VERSION>/xtensa-esp-elf/bin/xtensa-esp32-elf-*" ] }Important: Match
--query-driverto your target chip:- ESP32 (Xtensa):
xtensa-esp32-elf-* - ESP32-S2/S3 (Xtensa):
xtensa-esp32s2-elf-*/xtensa-esp32s3-elf-* - ESP32-C3/C6/H2 (RISC-V):
riscv32-esp-elf-*
See Espressif's LSP support documentation for more details.
- ESP32 (Xtensa):
-
Find your installed versions:
ls ~/.espressif/tools/esp-clang/ ls ~/.espressif/tools/xtensa-esp-elf/ # or riscv32-esp-elf for RISC-V chips
-
Restart clangd after changes:
Cmd+Shift+P→ "clangd: Restart language server"