ESPHome firmware compilation causes homeassitant system restart

I am running HA ver 2025.10.3 (HassOS) and ESPHome ver 2025.10.2 an a raspi 4 with SSD disk. Several ESPs connect via WLAN gather sensor information (T&H, air quality, reed switch, infra red, hall, …) and espcam. Statistic data are stored in a Influxdb and visualized with Grafana. I update the main software components continouesly. Because I didn’t change any yaml configuration within the last months, I didnt not update the ESPs.
Trying to add a new sensor I was forced to do an update and it did not work anymore.
If I do the update via the ESPHome Builder it starts compiling

INFO ESPHome 2025.10.2
INFO Reading configuration /config/esphome/esphome-web-a99bb4.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing esphome-web-a99bb4 (board: esp01_1m; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
Dependency Graph
|-- ESPAsyncTCP @ 2.0.0
|-- ESP8266WiFi @ 1.0
|-- ESPAsyncWebServer @ 3.7.10
|-- DNSServer @ 1.1.1
|-- ESP8266mDNS @ 1.2
|-- noise-c @ 0.1.10
Compiling .pioenvs/esphome-web-a99bb4/src/esphome/components/adc/adc_sensor_common.cpp.o
Compiling .pioenvs/esphome-web-a99bb4/src/esphome/components/adc/adc_sensor_esp8266.cpp.o
Compiling .pioenvs/esphome-web-a99bb4/src/esphome/components/api/api_connection.cpp.o
Compiling .pioenvs/esphome-web-a99bb4/src/esphome/components/api/api_frame_helper.cpp.o 

and stops with the file shown above and a few seconds later the HA server disconnects. After reconnecting you can see, that the HA server has restartet.
I turned on the debug mode of ESPHome but there is no error message in the log and also the HA log doesn’t show an error.
I have no idea what’s going on - I’m looking for some help.

I wonder if it could be a raspi pi brown-out?

What does your pi cpu and memory look like before and during the compile?

What power supply are you using for your pi?

1 Like

How much ram :question:

Looks how? How many cores for compiling? Running out of memory? :thinking:

1 Like

Try setting compile_process_limit: to 1 in the esphome: block and see if it still happens.

  • compile_process_limit (Optional, int): The maximum number of simultaneous compile processes to run. Defaults to the number of cores of the CPU which is also the maximum you can set.

This is the reason I switched to a NUC from the Pi 4, I did start by moving my ESPHome compiles to Mac using command line, but the speed and robustness of using the NUC won out in the end.

3 Likes

Seconding this.

Your symptoms are exactly what I was experiencing when I originally started using ESPHome years ago. Took a really long time before I figured it out, since none of the documentation (at least at the time) gave any guidance or suggestions on needing beefier hardware.

1 Like

Many thanks to all of your replies. I’m using a raspi 4 with 2 GB.
Setting the compile_process_limit solved my problem. ESPHome compiling with limit 1 I had a CPU usage of 50-60% and mem usage of 55-70%. The usual usage is CPU < 10% and mem < 50%. I have to think about a faster system.
I really appreciate your support.

I was struggling with similar issue (but on RPi3). It is out of memory problem that leads to kill a compiling process. In a matter of fact at some point you will hit that problem again. Better option is to configure ESPHome Builder on Windows/Linux computer, build there and upload firmware with one of three available option

  • web serwer
  • ESP home cli
  • “web monitor” (I think)
    All is well documented and pretty easy to use.
1 Like

Before buying new hardware, try the command-line option on another device like a laptop or desktop. When you think about it, it doesn’t really make sense to do your development work (e.g.; compiling) on your production HA machine.

1 Like