I can not compile ESPhome on hassio

I can not compile ESPhome on hassio
Can anyone help me?
version hassio 0.98.5

INFO Reading configuration...
INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d /config/esphome/demo
Processing demo (framework: arduino; platform: [email protected]; board: esp01_1m)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/esp01_1m.html
PLATFORM: Espressif 8266 > Espressif Generic ESP8266 ESP-01 1M
HARDWARE: ESP8266 80MHz 80KB RAM (1MB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 27 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS>
|   |-- <ESP8266WiFi> 1.0
|-- <ESPAsyncTCP> 1.2.0
|   |-- <ESP8266WiFi> 1.0
Compiling /data/demo/.pioenvs/demo/src/esphome/components/api/basic_messages.cpp.o
Compiling /data/demo/.pioenvs/demo/src/esphome/components/api/list_entities.cpp.o
Compiling /data/demo/.pioenvs/demo/src/esphome/components/api/service_call_message.cpp.o
Compiling /data/demo/.pioenvs/demo/src/esphome/components/api/subscribe_logs.cpp.o
xtensa-lx106-elf-g++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
*** [/data/demo/.pioenvs/demo/src/esphome/components/api/list_entities.cpp.o] Error 4
========================== [ERROR] Took 10.90 seconds ==========================
------

Try the development version of Esphome (see the addon options).

Otherwise follow the yellow instructions.

Is someone there ?
:sunglasses::sunglasses::sunglasses:

Did you do this?

thanks,
The same error, hazzz

Then follow the yellow instructions.

I have found out that Raspbian (Buster) is creating the problem if you go back to Stretch it will work for you if your using it on docker

I use ARMBIAN Setup on tivi box 25usd :dancing_women:

Having same problem updated rpi.update everything updates fine still errors. Also tried dev version still same
Pi4 with buster docker and hassio

1 Like

It should work with latest updates of raspbian.

sudo rpi-update

anybody solved it somehow please? Rpi-update does not work for me.

I had this same issue. Followed instructions in ESPhome github (https://github.com/esphome/issues/issues/805#issuecomment-555255432). Since I am running HA on Raspbian (i.e. armv7l), I changed the Toolchain to the “arm-linux-xxxx” instead. I.e. the full command inside the container would be: curl -L https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/arm-linux-gnueabihf.xtensa-lx106-elf-b40a506.1563313032.tar.gz | tar --strip-components=1 -xzf - -C /root/.platformio/packages/toolchain-xtensa/

To be honest, I don’t exactly know what it does and why it works, but for me it did the trick.

OttoWinter commented on Oct 22, 2019

For anybody getting errors like xtensa-lx106-elf-g++: internal compiler error: Segmentation fault (program cc1plus) on RPis, please run rpi-update and confirm you’re running firmware v4.19.80 or newer installed.

I have seen that comment as well, but then again updating the kernel with rpi-update is not advised (https://raspberrypi.stackexchange.com/questions/4355/do-i-still-need-rpi-update-if-i-am-using-the-latest-version-of-raspbian)

I had the same error and while I was able to solve my error by following the below instructions : I ran into another error while running the compiled binary on the ESP. It resulted in an exception.

Workaround to do a successful compile:

Find the Container ID of the ESPHome container:
docker ps
get a shell in that container:
docker exec -it /bin/bash
Fetch the toolchain:
curl -L https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/aarch64-linux-gnu.xtensa-lx106-elf-b40a506.1563313032.tar.gz | tar --strip-components=1 -xzf - -C /root/.platformio/packages/toolchain-xtensa/

I had to delete the contents of the toolchain-xtensa directory inside docker first else it did not work.
Also after deleting and getting its contents afresh , on my first compile ESPHome installed the toolchain-xtensa files as below:
INFO Reading configuration /config/esphome/tank_controller.yaml... INFO Generating C++ source... INFO Compiling app... INFO Running: platformio run -d /config/esphome/tank_controller Processing tank_controller (board: d1_mini; framework: arduino; platform: [email protected]) PackageManager: Installing toolchain-xtensa @ <3 Downloading [####################################] 100% Unpacking [####################################] 100% toolchain-xtensa @ 2.40802.191122 has been successfully installed! HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash

I was able to compile well. I am using RPi3, Hassio/Buster/addon ESPHome 1.14.3
But ran into the following exception on the ESP and it kept rebooting:

Exception 29: StoreProhibited: A store referenced a page mapped with an attribute that does not permit stores** PC: 0x4020c39a EXCVADDR: 0x00000000 *Decoding stack results* 0x4023218a: **scalbn** at ../../../../../../dl/newlib-xtensa/newlib/libm/common/ **s_scalbn.c** line **93

I was having problems when compiling my EspHome nodes. I found that you need to have at least 500MB of free memory to compile. Once I freed memory the errors stopped.

Same error on rpi4 running hassio on raspbian buster. The fix for me was to run ‘platformio update’ in the esphome container. What sucks is you have to do this every time you start the container. I ran platformio in the container from a shell and it did the same thing.

1 Like

Thank you for this. I spent hours trying to get this to work. Have you found any other work-arounds, or are we just waiting for 4.19.80 firmware at this point?

Blockquote
The fix for me was to run ‘platformio update’ in the esphome container.
/> Blockquote

Thanks for the advice, this fixed it for me as well. I was able to upload successfully after that.

Hello, same problem here, EspHome Crashing my Rpi4 1 Gb.
I managed to run platformio update in the container.
Now I want to run esphome manually also in the container to check that it works, before I try it from hassio.
How can I do that?
docker exec a1024e1c6a77 esphome config living.yaml
This gives me errors