Compilation fails : xtensa-lx106-elf-g++: fatal error: Killed signal terminated program cc1plus

I tried to compile on HA Addon, but I had the same error. Than, I intsalled ESPhome on windows, and compile was ok.

Installing ESPhome on windows:
https://esphome.io/guides/installing_esphome.html

I had my own yaml on my drive d:, so I just ran it. (esphome run d:\myownyaml.yaml)

It worked for me…

I’m having the same issue too.
This started happening after I updated esphome, core and Home Assistant OS to latest.

Home Assistant 2022.9.6
Supervisor 2022.09.1
Operating System 9.0
Frontend 20220907.2 - latest
ESPHome: 2022.9.1

Also I have currently 19 esphome devices and shortly there will be more than 30 and I don’t want to unless there is a speceific reason since there is constantly an update anyways and compilation+update takes long especially for all the devices. (also, don’t fix it if it’s not broken)

INFO Reading configuration /config/esphome/powermeter-03.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing powermeter-03 (board: esp01_1m; framework: arduino; platform: platformio/espressif8266 @ 3.2.0)
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- ESPAsyncTCP-esphome @ 1.2.3
|-- ESPAsyncWebServer-esphome @ 2.1.0
|   |-- ESPAsyncTCP-esphome @ 1.2.3
|   |-- Hash @ 1.0
|   |-- ESP8266WiFi @ 1.0
|-- DNSServer @ 1.1.1
|-- ESP8266WiFi @ 1.0
|-- ESP8266mDNS @ 1.2
|-- noise-c @ 0.1.4
|   |-- libsodium @ 1.10018.1
Compiling /data/powermeter-03/.pioenvs/powermeter-03/src/esphome/components/api/api_connection.cpp.o
Compiling /data/powermeter-03/.pioenvs/powermeter-03/src/esphome/components/api/api_pb2.cpp.o
Compiling /data/powermeter-03/.pioenvs/powermeter-03/src/esphome/components/api/api_server.cpp.o
Compiling /data/powermeter-03/.pioenvs/powermeter-03/src/esphome/components/api/list_entities.cpp.o
xtensa-lx106-elf-g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
*** [/data/powermeter-03/.pioenvs/powermeter-03/src/esphome/components/api/list_entities.cpp.o] Error 1
xtensa-lx106-elf-g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
*** [/data/powermeter-03/.pioenvs/powermeter-03/src/esphome/components/api/api_server.cpp.o] Error 1
========================= [FAILED] Took 68.34 seconds =========================

Did anyone find a fix for this?

ok I updated one of the older devices which had an available update, now it seems like the new device is compilig.

Try stopping all other addons before compiling, for me on Pi3 it seems to be a RAM related issue.
After stopping all other addons it worked.

10 Likes

That worked for me. I did just a restart.
Thx !!

1 Like

I opened a terminal on HA while compiling with ESPHome. On a Raspberrypi4 with 1G of ram it looks like it almost run out of memory:

image

I found this conversation which acknowledge there seems to be a problem with lack of memory on Raspberrypis: Esphome killing home assistant

1 Like

My work-a-round was to build home assistant in a virtuabox on my iMac.
From there I was able to update or change my esphome.

1 Like

Been able to publish setting to my esphome device using Raspberry pi 4 instead of my Raspberry Pi 3b on which I run my current HA setup. Might have something to do with avalaible ram.

esphome 2022.11.0 fixes that by adding support for a new config:

esphome:
  ...
  compile_process_limit: 1
6 Likes

The compile_process_limit: 1 fixed my problem - thanks. Just to clarify for other newbies like me - it is in the script of the individual ESPhome device and not in the global config jaml file.

Question: Is there a way I can set this on a global level for all ESPhome scripts so I don’t have to specify it for every individual device?

1 Like

Thank you for this, based on my experience today, either disabling other plugins to have some room on memory or limiting worked.

The compile_process_limit: 1 fixed my problem too with Raspberry pi 3+B
Thank you!

I read somewhere else that you can also set a default_compile_process_limit in the options of ESPHome now. For me it worked and solved it without altering the individual esphome devices.

Settings → Add-ons → Esphome → configuration tab → Toggle on: “Show unused optional configuration options” and then put 1 in “default_compile_process_limit”

4 Likes

Hello, the new flag: compile_process_limit: 1 isn’t fixing the problem for me.

I manually added it to my configuration.yaml:

esphome:
  compile_process_limit: 1

I also followed the manual steps:

Settings → Add-ons → Esphome → configuration tab → Toggle on: 
“Show unused optional configuration options” and then put 1 in 
“default_compile_process_limit”

It still fails on my Pi3:

xtensa-lx106-elf-g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
*** [/data/temp-sensor/.pioenvs/temp-sensor/src/esphome/components/web_server_base/web_server_base.cpp.o] Error 1
========================= [FAILED] Took 77.53 seconds =========================

I’m going to try and kill processes to free up memory but just know that the new flag doesn’t work for everyone.

Any advice or suggestions are very welcome!

Thank you.

1 Like

I have the same problem on RPi3 so I manually stopped addons like Editor, Terminal, everything I don’t currently need and then the compilation ran fine.

1 Like

I had the same problem on my RasPi 3B+. The compile_process_limit: 1 option didn’t help. The compile would fail at random points, which is consistent with a memory shortage. What did work is running it on a different computer, as others have said above and in the thread at Esphome killing home assistant (a very good resource for this issue). As an extra bonus, compiling on my Windows machine is MUCH faster. The downside is that you have to learn to use the ESPHome command line interface, but the only command you really need to use is “esphome run <file.yaml>”. The commands are listed at Command Line Interface — ESPHome.

First, install ESPHome on your computer by following the steps at Installing ESPHome Manually — ESPHome. You have to install Python, then use pip to install esphome. The steps in the guide are pretty clear and they worked for me with no problem.

Then make a working folder and copy the yaml file from your HA ESPhome dashboard into that folder. Open a Windows command window (Start > type “cmd”) and cd into the working folder). Then type the command “esphome run yaml-file-name”). ESPHome will compile the yaml and load it OTA or by USB onto your ESP device. You will probably recognize what it is doing since it looks like the ESPHome dashboard results.

When it works, it is pretty painless, and pretty fast. And best of all, since the compile is done on your Windows (or Mac) machine, it doesn’t use any memory on the RasPi or HA device. You don’t need to stop other processes or addons. You can edit the yaml file on your Windows machine using Notepad, or you can edit it on the ESPHome dashboard if you want the indentation markings and red squiggly lines showing errors.

Once the yaml is compiled and loaded onto the ESP device, the ESP will communicate with the HA device like normal. In other words, compiling and loading from the “big” computer doesn’t affect how the ESP devices communicates with the Home Assistant computer.

This post doesn’t say anything that other people haven’t said better already (thanks). I’m mainly trying to say that (1) don’t be afraid to run ESPHome on a different computer, (2) don’t be afraid of the CLI, you probably only need one command, and (3) this solves the compilation problems completely by moving the compilation to a stronger computer.

Good luck.

9 Likes

I have RPi 3 B+ and have the same issue.

Same - RPi 4

I had a similar error. I was able to fix it by swapping to a real power supply for a Raspberry. I had previously used the USB socket of the power strip and then any power supply. With both I had an xtensa error. Since the new power supply no longer.

Brilliant - This worked for me, thanks :slight_smile: Seems like a memory problem for my device. I stopped everything I could, too - but the compile limit was the key.

1 Like