TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/esphome/esphome.io/llms.txt
Use this file to discover all available pages before exploring further.
esp32: component provides all platform-specific configuration for the large family of ESP32 microcontrollers supported by ESPHome. Espressif’s ESP32 line spans dual-core Xtensa chips, RISC-V single-core variants, high-performance compute chips, and everything in between — each with different peripheral sets, CPU speeds, and wireless capabilities. The most important settings are variant (which chip you have) and framework (the underlying build system, ESP-IDF or Arduino). ESP-IDF is the default and recommended choice for all variants.
Minimal Example
Configuration Variables
Selects the ESP32 chip/MCU variant. Must match the physical hardware. When specified without a
board, ESPHome automatically selects a standard Espressif devkit board for that variant.Options: esp32, esp32s2, esp32s3, esp32c2, esp32c3, esp32c5, esp32c6, esp32c61, esp32h2, esp32p4PlatformIO board ID. Affects pin aliases and some internal defaults. No longer recommended — use
variant instead. At least one of board or variant must be specified; if both are given, they must agree on the chip variant.Flash memory size of the module. Defaults to
4MB. Specifying a size larger than what is physically present will cause boot failures.Options: 2MB, 4MB, 8MB, 16MB, 32MBCPU frequency. Defaults to the maximum for the variant. If a device resets or hangs at the default frequency, try reducing (some OEM single-core ESP32 modules are only stable at
160MHz).- ESP32/S2/S3/C5:
80MHz,160MHz,240MHz - ESP32-C2:
80MHz,120MHz - ESP32-C3:
80MHz,160MHz - ESP32-C6/C61:
80MHz,120MHz,160MHz - ESP32-H2:
16MHz–96MHz - ESP32-P4:
40MHz,360MHz,400MHz
Custom partition table. Provide a path to a CSV file for full control, or a list of partition definitions to append to the auto-generated table. See Partitions below.
ESP-IDF task watchdog timeout. If a subscribed task fails to feed the watchdog within this period, the device reboots. Range:
5s–60s. Defaults to 5s. OTA updates temporarily raise this to 15s when needed.Build toolchain. Options:
platformio (default), esp-idf. Can also be set via the --toolchain CLI flag (which takes precedence over this setting).ESP32-P4 only. Set to
true for engineering sample silicon (chip revision < 3.0). Defaults to false.Framework
ESPHome supports two frameworks for ESP32 compilation:ESP-IDF (Recommended)
Espressif’s native development framework. Required for ESP32-C2, C5, C6, C61, H2, and P4. Default for all variants.Arduino
Arduino API compatibility layer built on top of ESP-IDF. Available for classic ESP32, C3, S2, and S3.Framework Configuration Variables
Framework type:
esp-idf (default) or arduino.Framework version.
recommended (default), latest (newest release), or dev (latest commit). Or specify an exact release tag (e.g. 5.3.1).Custom PlatformIO package URL or git repository for a patched framework version. Supports the same URL schemes as PlatformIO’s
pkg install (e.g. https://github.com/user/arduino-esp32.git#branch, symlink:///path/to/esp-idf).Version of the pioarduino/espressif32 PlatformIO platform package. For known framework versions this is set automatically and does not need to be specified.
ESP-IDF only. Custom
sdkconfig options injected into the build. For advanced SDK tuning.Framework log level (separate from ESPHome’s logger). One of
NONE, ERROR (default), WARN, INFO, DEBUG, VERBOSE.IDF components to add from the ESP Component Registry. Use shorthand
owner/component@version or advanced mapping with name, source, ref, and path.Fine-grained ESP-IDF optimization flags for IRAM/flash usage, TLS, FreeRTOS, LWIP, and debug features. See Advanced Configuration below.
Partitions
ESPHome auto-generates a partition table based onflash_size. Use partitions to customize:
Partition name. Cannot be one of the reserved names:
nvs, app0, app1, otadata, eeprom, spiffs, phy_init.Partition type:
app, data, or a custom integer (0x40–0xFE).Partition subtype. For
data: nvs, nvs_keys, spiffs, coredump, efuse, fat, littlefs. For app: factory, test.Size in bytes, 4 KB (0x1000) aligned.
ESP32 Variant Comparison
| Variant | Core | Max MHz | Wi-Fi | Bluetooth | USB | Notable Features |
|---|---|---|---|---|---|---|
| ESP32 | Xtensa LX6 ×2 | 240 | 2.4 GHz | BT + BLE 4.2 | No (external) | Built-in Ethernet MAC |
| ESP32-S2 | Xtensa LX7 ×1 | 240 | 2.4 GHz | None | USB OTG FS | 43 GPIOs, 2 DACs |
| ESP32-S3 | Xtensa LX7 ×2 | 240 | 2.4 GHz | BLE 5.0 | USB OTG FS | AI vector, Micro Wake Word |
| ESP32-C2 | RISC-V ×1 | 120 | 2.4 GHz | BLE 5.0 | No | Ultra-low-cost |
| ESP32-C3 | RISC-V ×1 | 160 | 2.4 GHz | BLE 5.0 | USB Serial/JTAG | ESP8266 replacement |
| ESP32-C5 | RISC-V ×1 | 240 | Dual-band (Wi-Fi 6) | BLE 5.0 | USB Serial/JTAG | 5 GHz Wi-Fi support |
| ESP32-C6 | RISC-V ×1 | 160 | 2.4 GHz (Wi-Fi 6) | BLE 5.0 | USB Serial/JTAG | 802.15.4 (Thread/Zigbee) |
| ESP32-H2 | RISC-V ×1 | 96 | None | BLE 5.3 | USB Serial/JTAG | Thread/Zigbee, no Wi-Fi |
| ESP32-P4 | RISC-V ×2 | 400 | None (co-proc) | None (co-proc) | USB OTG HS | Edge compute, MIPI DSI/CSI |
Advanced Configuration
GPIO Notes (Classic ESP32)
GPIO34–GPIO39: Input only — cannot be used as outputs.GPIO32–GPIO39: ADC-capable.GPIO0: Strapping pin — must be HIGH at boot to avoid flash download mode.GPIO2: Connected to the blue LED onesp32devboards.
At least one of
board or variant must be specified. Using variant alone (without board) is the recommended approach for new configurations.