Development Guide¶
This guide covers all aspects of developing with the ESP32 Distance Sensor, from setting up your environment to debugging and testing.
Development Topics:
Getting Started¶
Recommended: GitHub Codespaces¶
The fastest way to start developing:
Click “Use this template” to create your repository
Open in GitHub Codespaces (Code → Codespaces → Create)
Wait for container to build (first time only, ~2 minutes)
Start coding in
main/main.c
Testing Without Hardware¶
Use QEMU emulation:
# Build the project
idf.py build
# Run in QEMU with network support
./tools/run-qemu-network.sh
# Debug in QEMU
# Press F5 in VS Code or use Debug panel
Flashing Real Hardware¶
When you have physical ESP32:
# Build the project
idf.py build
# Flash and monitor (replace /dev/ttyUSB0 with your port)
idf.py -p /dev/ttyUSB0 flash monitor
# Exit monitor: Press Ctrl+]
Development Workflow¶
Typical development cycle:
# 1. Customize application
vim main/main.c
# 2. Build
idf.py build
# 3. Test in QEMU (optional)
./tools/run-qemu-network.sh
# 4. Flash to hardware
idf.py -p /dev/ttyUSB0 flash monitor
Template Benefits¶
Consistent Environment: Same toolchain everywhere (Codespaces, Docker, CI/CD)
ESP-IDF v5.4.1: Latest stable version pre-configured
QEMU Support: Test without hardware using full network emulation
GDB Debugging: Full breakpoint debugging in emulator
Web Interface: Access emulated web server via browser
Documentation: Professional requirements engineering with Sphinx-Needs
Next Steps¶
New to dev containers? Start with Development Container Setup
Want to debug? Check out Debugging Guide
Curious about QEMU networking? See QEMU Emulator Guide
Need technical details? Read QEMU Network Internals
Known Issues¶
Note
ESP-IDF-WEB extension doesn’t automatically install in Codespaces. Please search for “ESP-IDF Web” in the VS Code marketplace and install it manually.