ESP32
Espressif SoC family with Wi-Fi and Bluetooth sharing one 2.4 GHz radio, programmed with ESP-IDF.
hardware
also known as ESP32-S3, ESP32-C3, ESP32-C6, Espressif ESP32
Knowledge about ESP32
- "Brownout detector was triggered": ESP32 resets from a weak power supplywarning · unverified · The ESP32's brownout detector is enabled by default and resets the chip when the supply voltage drops too low. The usual cure is a better power path, not disabling the detector.
- Battery sensors with ESPHome deep_sleep, and how to still get OTA updates onto themcode · unverified · deep_sleep wakes the device for run_duration, then sleeps for sleep_duration; each wake is a full reboot. Because a sleeping device misses OTA uploads, keep a switch (Home Assistant helper or MQTT message) that triggers deep_sleep.prevent. On ESP8266, GPIO16 must be wired to RST.
- Building Zigbee devices with ESP32: only the H2 and C6 have the radioguide · unverified · Espressif's 802.15.4 SoCs (ESP32-H2, ESP32-C6) can be Zigbee coordinator, router or end device. The classic ESP32 has no 802.15.4 radio; for a Wi-Fi-to-Zigbee gateway, pair a Wi-Fi SoC with an 802.15.4 radio co-processor.
- Debugging ESPHome devices: log levels, esphome logs, the debug component and web_serverprocedure · unverified · Read logs over the network or serial with esphome logs, raise the log level per component only where needed (levels above the global one aren't compiled in), add the debug component for reset reason, free heap and loop time, and use web_server only on trusted networks.
- ESP32 'Interrupt wdt timeout on CPU1': don't print or wait inside an interrupt handlerwarning · unverified · Calling Serial.print, delay or other slow code inside an attachInterrupt handler blocks the CPU and trips the interrupt watchdog. Set a volatile flag in the ISR and do the work in loop() or a task.
- ESP32 FreeRTOS task crashes: 'Stack canary watchpoint triggered' and tasks that returnwarning · unverified · Two classic crashes when using xTaskCreate on ESP32: a task stack that is too small (Stack canary watchpoint triggered) and a task function that simply returns. Size stacks generously and end tasks with vTaskDelete(NULL).
- ESP32 OTA updates that can't brick the device: partitions, validation and rollbackprocedure · unverified · OTA needs two app partitions (ota_0, ota_1) plus otadata. With app rollback enabled, a new image boots as pending-verify and must call esp_ota_mark_app_valid_cancel_rollback() after a self-test, otherwise the bootloader reverts to the previous image.
- ESP32 Wi-Fi and BLE share one radio: expect drops unless you configure coexistencewarning · unverified · ESP32 Wi-Fi and Bluetooth share a single 2.4 GHz RF front end and are time-multiplexed, so heavy Wi-Fi traffic reduces BLE scan and connection performance. Enable software coexistence and follow Espressif's recommendations.
- ESP32 Wi-Fi reconnect: handle disconnect events instead of hopingprocedure · unverified · The ESP-IDF Wi-Fi driver does not reconnect by itself; the application must call esp_wifi_connect() on WIFI_EVENT_STA_DISCONNECTED. In Arduino, use WiFi.setAutoReconnect() and WiFi.onEvent(), keeping callbacks thread-safe.
- ESP32 analogRead() is non-linear: use analogReadMilliVolts() and the right attenuationwarning · unverified · Raw ESP32 ADC counts don't map linearly to voltage and the reference voltage varies between chips. Espressif confirmed the non-linear ADC front end; use the calibrated analogReadMilliVolts() (ESP-IDF: ADC calibration) and stay inside the attenuation's input range.
- ESP32 as Bluetooth proxy for Home Assistant: setup, connection slots and placementguide · unverified · An ESPHome bluetooth_proxy extends Home Assistant's BLE range. Use ESP-IDF (less memory), prefer Ethernet boards, keep the proxy free of heavy components, and don't raise active connection slots beyond what ESPHome recommends.
- ESP32 deep sleep in Arduino: timer and button wake-up, RTC memory, wake causecode · unverified · Deep sleep powers down the CPUs and most RAM; only RTC memory survives and the sketch restarts from setup() on wake-up. Example with timer and GPIO wake-up and an RTC_DATA_ATTR counter.
- ESP32 pins to avoid: strapping pins, flash pins, input-only pins and ADC2 with Wi-Fiwarning · unverified · On the original ESP32, GPIO0/2/5/12/15 are strapping pins, GPIO6-11 and 16-17 usually connect to flash/PSRAM, GPIO34-39 are input-only without pull-ups, and ADC2 pins cannot be read while Wi-Fi is active.
- ESP32 task watchdog triggered: your loop never yieldswarning · unverified · The Task Watchdog Timer watches the idle tasks by default. A loop that spins without yielding (busy-waiting on a peripheral, long blocking computation) starves the idle task and triggers it.
- ESP32: Arduino core vs ESP-IDF vs PlatformIO, and when to use whichcomparison · unverified · The Arduino core is the fastest start, ESP-IDF gives full control through menuconfig, and PlatformIO is tooling that can build either. Arduino can also run as an ESP-IDF component to get both.
- ESP32: use NimBLE for BLE-only products, Bluedroid only if you need Bluetooth Classicrecommendation · unverified · In ESP-IDF, ESP-NimBLE needs less memory (heap and flash) than ESP-Bluedroid but supports BLE only. Choose Bluedroid when you need Classic Bluetooth (e.g. A2DP, SPP).
- ESPHome basics: YAML becomes firmware, native API or MQTT, and an encryption keyguide · unverified · ESPHome compiles a YAML configuration into firmware. Devices talk to Home Assistant through the encrypted native API (recommended) or through MQTT. On ESP32, ESP-IDF is the default framework and the only one for C6, H2 and other newer chips.
- ESPHome: flash once over USB, then update over the air with an encrypted OTAprocedure · unverified · The first ESPHome install needs a serial/USB connection (GPIO0 to GND for bootloader mode); after that, updates go over the air. Prefer OTA encryption, which reuses the API key, over an OTA password.
- Fix ESP32 upload errors: "Failed to connect" and "Wrong boot mode detected"procedure · unverified · Upload failures mean the chip didn't enter download mode. Check the port, cable, drivers and power, enter download mode manually with BOOT (GPIO0) + EN, and lower the baud rate. Native-USB chips can drop off the bus in sleep or after reconfiguring USB pins.
- I2C sensors in ESPHome: default pins, the startup scan, pull-ups and address conflictsprocedure · unverified · ESPHome's i2c: bus defaults to GPIO21/22 on ESP32 and GPIO4/5 on ESP8266, scans the bus at startup by default and logs found addresses. Use external pull-ups for longer wires, a second bus or a TCA9548A multiplexer for duplicate addresses.
- Logging sensor data often on ESP32: buffer in RTC RAM, write flash in batchesrecommendation · unverified · Writing every reading to flash wears it out and costs energy. Keep readings in RTC slow memory across deep sleep, flush them in batches, use NVS only for rarely changing settings, and leave headroom in SPIFFS.
- Store ESP32 settings with Preferences (NVS): limits and a safe patterncode · unverified · Preferences stores key-value data in the NVS flash partition and survives restarts and power loss. Namespaces and keys are limited to 15 characters, and NVS is meant for many small values, not large data.
- Which ESP32? S3 vs C3 vs C6 vs H2 at a glanceguide · unverified · ESP32-S3 is dual-core Xtensa with vector instructions, C3 is a single-core RISC-V, C6 adds Wi-Fi 6 and IEEE 802.15.4, and H2 has 802.15.4 and BLE but no Wi-Fi.
Related
- alternative to: Raspberry Pi Pico – Both are microcontroller platforms for IoT; they differ in radios, tooling and ecosystem.