ESP Home error **sh: 1: xtensa-lx106-elf-g++: not found**

HA Core Version 2021.6.2
Host Operating System Debian 10 buster
Installation Type Home Assistant Supervised
Development false
Supervisor true
Docker true
Virtual Environment false
Python Version 3.8.9
Operating System Family Linux
Operating System Version 5.10.17-v8+
CPU Architecture aarch64
ESPHome 1.18.0
Update Channel stable
Supervisor Version supervisor-2021.05.4

Tried to install ESPHome and then compile the setup i see those errors:

sh: 1: xtensa-lx106-elf-g++: not found

INFO Reading configuration /config/esphome/test.yaml...
INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d /config/esphome/test
Processing test (board: d1_mini; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 3.20704.0 (2.7.4) 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.20800.0 (2.8.0) 
 - toolchain-xtensa 2.40802.200502 (4.8.2)
Library Manager: Installing Update
Library Manager: Already installed, built-in library
Dependency Graph
|-- <ESPAsyncTCP-esphome> 1.2.3
|   |-- <ESP8266WiFi> 1.0
|-- <ESPAsyncWebServer-esphome> 1.2.7
|   |-- <ESPAsyncTCP-esphome> 1.2.3
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <Hash> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
Compiling /data/test/.pioenvs/test/src/esphome/components/api/api_connection.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
Compiling /data/test/.pioenvs/test/src/esphome/components/api/api_pb2.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
Compiling /data/test/.pioenvs/test/src/esphome/components/api/api_pb2_service.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
*** [/data/test/.pioenvs/test/src/esphome/components/api/api_connection.cpp.o] Error 127
Compiling /data/test/.pioenvs/test/src/esphome/components/api/api_server.cpp.o
*** [/data/test/.pioenvs/test/src/esphome/components/api/api_pb2.cpp.o] Error 127
*** [/data/test/.pioenvs/test/src/esphome/components/api/api_pb2_service.cpp.o] Error 127
sh: 1: xtensa-lx106-elf-g++: not found
*** [/data/test/.pioenvs/test/src/esphome/components/api/api_server.cpp.o] Error 127
========================== [FAILED] Took 3.31 seconds ==========================

Tried many things but cant solve it.

2 Likes

Did you have any luck resolving this?

Nope. Still same.issue with largest HA Version.

Run esphome locally from the terminal if using multiarch with 64 kernel and 32 userland.

To compile:
setarch arm esphome compile config.yaml

Maybe a little late to the party here, but running pi4 was working fine, then enabled 64bit kernel and then not so fine. Switched back and all is well

I can recommend a switch to full 64-bit now that the RPi OS 64-bit left beta.

I have the same problem here:

INFO Reading configuration /config/esphome/mailbox.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing mailbox (board: nodemcuv2; framework: arduino; platform: platformio/espressif8266 @ 3.2.0)
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB 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
Compiling /data/mailbox/.pioenvs/mailbox/src/esphome/components/api/api_connection.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
Compiling /data/mailbox/.pioenvs/mailbox/src/esphome/components/api/api_frame_helper.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
Compiling /data/mailbox/.pioenvs/mailbox/src/esphome/components/api/api_pb2.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
*** [/data/mailbox/.pioenvs/mailbox/src/esphome/components/api/api_connection.cpp.o] Error 127
Compiling /data/mailbox/.pioenvs/mailbox/src/esphome/components/api/api_pb2_service.cpp.o
*** [/data/mailbox/.pioenvs/mailbox/src/esphome/components/api/api_frame_helper.cpp.o] Error 127
*** [/data/mailbox/.pioenvs/mailbox/src/esphome/components/api/api_pb2.cpp.o] Error 127
sh: 1: xtensa-lx106-elf-g++: not found
*** [/data/mailbox/.pioenvs/mailbox/src/esphome/components/api/api_pb2_service.cpp.o] Error 127
========================== [FAILED] Took 6.99 seconds ==========================

I am running ESPHome as Addon on my raspberry pi 3+

-----------------------------------------------------------
 Add-on: ESPHome
 ESPHome add-on for intelligently managing all your ESP8266/ESP32 devices
-----------------------------------------------------------
 Add-on version: 2022.3.1
 You are running the latest version of this add-on.
 System: Home Assistant OS 7.5  (aarch64 / raspberrypi3-64)
 Home Assistant Core: 2022.3.6
 Home Assistant Supervisor: 2022.03.5
-----------------------------------------------------------

Any idea?

1 Like

Para los que tienen arquitectura de 64 bits esto soluciono mi problema: Edite el archivo “util.py”, primero realice la búsqueda dentro de mi sistema de archivos y me devuelve 3 resultados, como no supe cuál de los tres es el que debía modificar, modifique los tres:

def get_systype():
system = platform.system().lower() arch = platform.machine().lower() if system == “windows”: if not arch: # issue #4353 arch = “x86_” + platform.architecture()[0] if “x86” in arch: arch = “amd64” if “64” in arch else “x86” if arch == “aarch64”: if platform.architecture()[0]
== “32bit”:

arch = “armv7l” return “%s_%s”

% (system, arch)

if
arch else system

#3092 (comentario)

root@rpi4-20230102:/# Buscar | grep platformio/util.py

./usr/local/lib/python3.9/dist-packages/platformio/util.py

./var/lib/docker/overlay2/7dc1dc2395dd053c78fc5cd8616d1c61f5703e4e6433d46eb4ccd3cbb1bff485/merged/usr/local/lib/python3.9/dist-packages/platformio/util.py

./var/lib/docker/overlay2/c04cf2bac904287623c5baf075232b1ceae6d9be38336527a51a251bc513ec79/diff/usr/local/lib/python3.9/dist-packages/platformio/util.py

root@rpi4-20230102:/# nano ./usr/local/lib/python3.9/dist-packages/platformio/util.py

root@rpi4-20230102:/# nano ./var/lib/docker/overlay2/7dc1dc2395dd053c78fc5cd8616d1c61f5703e4e6433d46eb4ccd3cbb1bff485/merged/usr/local/lib/python3.9/dist-packages/platformio/util.py

root@rpi4-20230102:/# nano
./var/lib/docker/overlay2/c04cf2bac904287623c5baf075232b1ceae6d9be38336527a51a251bc513ec79/diff/usr/local/lib/python3.9/dist-packages/platformio/util.py

Después de realizar este ajuste, pude compilar sin problemas y completar la instalación y mi dispositivo aparece en linea.

I suddenly started getting this failure with a containerized esphome on a Raspberry Pi4B. Turns out a recent update to my Pi switched from the 32-bit to 64-bit kernel. So although this is not your exact scenario I am adding this update to help others understand their possible root cause and the easy fix. My existing Docker installation was still using the platform , armhf, for Docker images. Once the Pi kernel switched from kernel7l to kernel8 esphome would not correctly identify the compiler to use for the build. The resolution is to switch back to the 32-bit kernel by placing the string arm_64bit=0 at the top of the /boot/config.txt file and reboot the pi. esphome will be back to normal after that.

5 Likes

It helped me. Thank you!

This is what happened to mine.
fixed it thanks to this thank you

Thank you very much. This helped me too!!

Thanks! Very helpful.

If you are docker to build esphome. Put platform: aarch64 in docker-compose file