2018-05-13 11:37:02 +02:00
Debug Component
===============
2018-11-14 22:12:27 +01:00
.. seo ::
2019-02-16 23:25:23 +01:00
:description: Instructions for setting up the debug component in ESPHome
2021-11-16 03:19:33 +01:00
:image: bug-report.svg
2018-11-14 22:12:27 +01:00
2019-02-16 23:25:23 +01:00
The `` debug `` component can be used to debug problems with ESPHome. At startup, it prints
a bunch of useful information like reset reason, free heap size, ESPHome version and so on.
2022-11-24 07:17:03 +01:00
It also allows you to get the same information as a text sensor, and to monitor the state of the
2022-01-25 19:18:57 +01:00
ESP heap memory (free space, maximum free block size and fragmentation level) and the main-loop timing.
2018-05-13 11:37:02 +02:00
2018-06-01 18:10:00 +02:00
.. figure :: images/debug.png
2018-05-13 11:37:02 +02:00
:align: center
Example debug component output.
2018-11-19 18:32:16 +01:00
.. code-block :: yaml
2018-05-13 11:37:02 +02:00
# Example configuration entry
debug:
2022-01-25 19:18:57 +01:00
update_interval: 5s
2022-02-08 00:45:31 +01:00
text_sensor:
- platform: debug
device:
name: "Device Info"
2022-11-15 20:14:23 +01:00
reset_reason:
name: "Reset Reason"
2022-02-08 00:45:31 +01:00
sensor:
- platform: debug
free:
name: "Heap Free"
fragmentation:
name: "Heap Fragmentation"
block:
name: "Heap Max Block"
loop_time:
name: "Loop Time"
2023-09-05 04:03:02 +02:00
psram:
name: "Free PSRAM"
2018-05-13 11:37:02 +02:00
# Logger must be at least debug (default)
logger:
level: debug
2022-02-08 00:45:31 +01:00
Text Sensor
------------
2022-01-25 19:18:57 +01:00
Configuration variables:
- **device** (*Optional* ): Reports the following device information:
- ESPHome Version
- Free heap size at startup
- Flash chip size, speed and mode
- ESP32:
- Chip model, cores, revision
2023-09-05 04:03:02 +02:00
- Chip features (BLE / BT / WiFi_BGN / EMB_FLASH / EMB_PSRAM / ...)
2022-01-25 19:18:57 +01:00
- ESP-IDF version
- EFuse MAC
- Reset reason
- Wakeup reason
- ESP8266:
- Chip id, frequency
- Flash id
- SDK, Core & Boot versions
- Reset reason & information
2022-02-08 00:45:31 +01:00
2023-09-05 04:03:02 +02:00
Accepts all options from :ref: `Text Sensor <config-text_sensor>` .
2022-02-08 00:45:31 +01:00
2023-09-05 04:03:02 +02:00
- **reset_reason** (*Optional* ): Reports the last reboot reason in a human-readable form. Accepts all options from :ref: `Text Sensor <config-text_sensor>` .
2022-11-15 20:14:23 +01:00
2022-02-08 00:45:31 +01:00
Sensor
-------
Configuration variables:
2023-09-05 04:03:02 +02:00
- **free** (*Optional* ): Reports the free heap size in bytes. All options from :ref: `Sensor <config-sensor>` .
2022-01-25 19:18:57 +01:00
- **fragmentation** (*Optional* ): Reports the fragmentation metric of the heap
(0% is clean, more than ~50% is not harmless). Only available on ESP8266 with Arduino 2.5.2+.
2023-09-05 04:03:02 +02:00
All options from :ref: `Sensor <config-sensor>` .
2022-01-25 19:18:57 +01:00
2023-09-05 04:03:02 +02:00
- **block** (*Optional* ): Reports the largest contiguous free RAM block on the heap in bytes. All options from :ref: `Sensor <config-sensor>` .
2022-01-25 19:18:57 +01:00
2023-09-05 04:03:02 +02:00
- **loop_time** (*Optional* ): Reports the longest time between successive iterations of the main loop. All options from :ref: `Sensor <config-sensor>` .
2022-01-25 19:18:57 +01:00
2023-09-05 04:03:02 +02:00
- **psram** (*Optional* ): Reports the free PSRAM in bytes. Only available on ESP32. All options from :ref: `Sensor <config-sensor>` .
2018-06-01 18:10:00 +02:00
See Also
2018-08-24 22:44:01 +02:00
--------
2018-06-01 18:10:00 +02:00
2022-01-25 19:18:57 +01:00
- :ref: `sensor-filters`
2018-06-01 18:10:00 +02:00
- :doc: `logger`
2019-05-12 22:44:59 +02:00
- :apiref: `debug/debug_component.h`
2019-02-07 13:54:45 +01:00
- :ghedit: `Edit`