esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

Cannot compile with 2022.12.0 #3904

Closed SVH-Powel closed 1 year ago

SVH-Powel commented 1 year ago

The problem

Compile fails with "sh: 1: xtensa-esp32-elf-g++: not found"

Which version of ESPHome has the issue?

2022.12.0

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2022.12.5

What platform are you using?

ESP32

Board

esp32dev

Component causing the issue

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Platform Manager: Installing platformio/espressif32 @ 5.2.0
INFO Installing platformio/espressif32 @ 5.2.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Platform Manager: espressif32@5.2.0 has been installed!
INFO espressif32@5.2.0 has been installed!
Tool Manager: Installing espressif/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
INFO Installing espressif/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
Tool Manager: toolchain-xtensa-esp32@8.4.0+2021r2-patch3 has been installed!
INFO toolchain-xtensa-esp32@8.4.0+2021r2-patch3 has been installed!
Tool Manager: Installing platformio/framework-arduinoespressif32 @ ~3.20005.0
INFO Installing platformio/framework-arduinoespressif32 @ ~3.20005.0
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
Tool Manager: framework-arduinoespressif32@3.20005.220925 has been installed!
INFO framework-arduinoespressif32@3.20005.220925 has been installed!
Tool Manager: Installing platformio/tool-esptoolpy @ ~1.40201.0
INFO Installing platformio/tool-esptoolpy @ ~1.40201.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: tool-esptoolpy@1.40201.0 has been installed!
INFO tool-esptoolpy@1.40201.0 has been installed!
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- WiFi @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- Update @ 2.0.0
Compiling /data/luftkvalitet1/.pioenvs/luftkvalitet1/src/esphome/components/api/api_connection.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
*** [/data/luftkvalitet1/.pioenvs/luftkvalitet1/src/esphome/components/api/api_connection.cpp.o] Error 127
========================= [FAILED] Took 371.07 seconds =========================

Additional information

No response

ssieb commented 1 year ago

What are you running it on? And 32-bit or 64-bit?

SVH-Powel commented 1 year ago

What are you running it on? And 32-bit or 64-bit?

Rpi 4 with 32-bit OS

leppa commented 1 year ago

Same issue. Also using Raspberry Pi 4 with Raspbian (32-bit).

JackTalisker commented 1 year ago

Same here on RPI 3b:

INFO Reading configuration /config/boxmultisensor.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing boxmultisensor (board: wt32-eth01; framework: arduino; platform: platformio/espressif32 @ 5.2.0)
--------------------------------------------------------------------------------
Platform Manager: Installing platformio/espressif32 @ 5.2.0
INFO Installing platformio/espressif32 @ 5.2.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%          
Platform Manager: espressif32@5.2.0 has been installed!
INFO espressif32@5.2.0 has been installed!
Tool Manager: Installing espressif/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
INFO Installing espressif/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
Tool Manager: toolchain-xtensa-esp32@8.4.0+2021r2-patch3 has been installed!
INFO toolchain-xtensa-esp32@8.4.0+2021r2-patch3 has been installed!
Tool Manager: Installing platformio/framework-arduinoespressif32 @ ~3.20005.0
INFO Installing platformio/framework-arduinoespressif32 @ ~3.20005.0
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
Tool Manager: framework-arduinoespressif32@3.20005.220925 has been installed!
INFO framework-arduinoespressif32@3.20005.220925 has been installed!
Tool Manager: Installing platformio/tool-esptoolpy @ ~1.40201.0
INFO Installing platformio/tool-esptoolpy @ ~1.40201.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: tool-esptoolpy@1.40201.0 has been installed!
INFO tool-esptoolpy@1.40201.0 has been installed!
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- AsyncTCP-esphome @ 1.2.2
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 2.1.0
|   |-- AsyncTCP-esphome @ 1.2.2
|-- ESPmDNS @ 2.0.0
|-- Wire @ 2.0.0
|-- ArduinoJson @ 6.18.5
Compiling .pioenvs/boxmultisensor/src/esphome/components/api/api_connection.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
Compiling .pioenvs/boxmultisensor/src/esphome/components/api/api_frame_helper.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
Compiling .pioenvs/boxmultisensor/src/esphome/components/api/api_pb2.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
*** [.pioenvs/boxmultisensor/src/esphome/components/api/api_connection.cpp.o] Error 127
Compiling .pioenvs/boxmultisensor/src/esphome/components/api/api_pb2_service.cpp.o
*** [.pioenvs/boxmultisensor/src/esphome/components/api/api_frame_helper.cpp.o] Error 127
*** [.pioenvs/boxmultisensor/src/esphome/components/api/api_pb2.cpp.o] Error 127
sh: 1: xtensa-esp32-elf-g++: not found
*** [.pioenvs/boxmultisensor/src/esphome/components/api/api_pb2_service.cpp.o] Error 127
========================= [FAILED] Took 329.43 seconds =========================
zanna-37 commented 1 year ago

Me too, 32bit raspberry, ESPHome run in Docker.

ssieb commented 1 year ago

Why do people run 32-bit systems? What's the point? Just like https://github.com/esphome/issues/issues/3899, this isn't an esphome issue. Platformio gets confused with a 32-bit OS running on a 64-bit kernel.

leppa commented 1 year ago

Why do people run 32-bit systems? What's the point? Just like #3899, this isn't an esphome issue. Platformio gets confused with a 32-bit OS running on a 64-bit kernel.

Because at the time when I was setting up my Raspberry Pi, the official OS for Raspberry Pi was Raspbian and there was no (stable) 64-bit variant.

ssieb commented 1 year ago

Then I suggest you re-install it now as 64-bit.

zanna-37 commented 1 year ago

Why do people run 32-bit systems?

I was probably the default back when I installed raspberry OS, and I didn't find time to trash everything and do a clean install. Anyway, looking at other issues, a lot of people are running 32bits. Moreover, v2022.11.x was working perfectly.

ssieb commented 1 year ago

A pure 32-bit system will probably work. It's the combination of 64-bit kernel and 32-bit userspace that causes the problem. Maybe there was a change in the newer platformio version.

SVH-Powel commented 1 year ago

A pure 32-bit system will probably work. It's the combination of 64-bit kernel and 32-bit userspace that causes the problem. Maybe there was a change in the newer platformio version.

As others have written, when I installed my system, 32-bit was the only option. I am running hass-os. I have no idea of what kernel it is (64 or 32 bits)

ssieb commented 1 year ago

Fine, but I'm telling you that there's nothing we can do about it. This is an issue with platformio.

JackTalisker commented 1 year ago

Seems (to me) a hasty statement since this issue appeared with the changes in 2022.12.0. It only follows that at the moment, with this new release, the esp32 side is unusable

kevjs1982 commented 1 year ago

Seems (to me) a hasty statement since this issue appeared with the changes in 2022.12.0. It only follows that at the moment, with this new release, the esp32 side is unusable

In particular when Home Assistant OS installs on a Raspberry Pi 4 (according to the stats the most popular hardware) are impacted too, and the installation of this broken version is allowed from the Home Assistant Add On Store - seems a bit of an oversight when one Nabu Casu project allows a broken version of another of its own products to be installed with not even a warning!

RaceAap commented 1 year ago

I get a different error but result is the same:

Processing minitemp01 (board: mhetesp32devkit; framework: arduino; platform: platformio/espressif32 @ 5.2.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- AsyncTCP-esphome @ 1.2.2
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 2.1.0
|   |-- AsyncTCP-esphome @ 1.2.2
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
Compiling /data/minitemp01/.pioenvs/minitemp01/src/esphome/components/api/api_connection.cpp.o
Compiling /data/minitemp01/.pioenvs/minitemp01/src/esphome/components/api/api_frame_helper.cpp.o
In file included from /data/cache/platformio/packages/toolchain-xtensa-esp32/xtensa-esp32-elf/sys-include/sys/reent.h:503,
                 from /data/cache/platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/newlib/platform_include/sys/reent.h:17,
                 from /data/cache/platformio/packages/toolchain-xtensa-esp32/xtensa-esp32-elf/sys-include/wchar.h:6,
                 from /data/cache/platformio/packages/toolchain-xtensa-esp32/xtensa-esp32-elf/include/c++/8.4.0/cwchar:44,
                 from /data/cache/platformio/packages/toolchain-xtensa-esp32/xtensa-esp32-elf/include/c++/8.4.0/bits/postypes.h:40,
                 from /data/cache/platformio/packages/toolchain-xtensa-esp32/xtensa-esp32-elf/include/c++/8.4.0/bits/char_traits.h:40,
                 from /data/cache/platformio/packages/toolchain-xtensa-esp32/xtensa-esp32-elf/include/c++/8.4.0/string:40,
                 from src/esphome/components/socket/socket.h:2,
                 from src/esphome/components/api/api_frame_helper.h:13,
                 from src/esphome/components/api/api_connection.h:3,
                 from src/esphome/components/api/api_connection.cpp:1:
/data/cache/platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/newlib/platform_include/assert.h:20:10: fatal error: sdkconfig.h: No such file or directory
Versie | core-2022.12.5
-- | --
Type installatie | Home Assistant OS
Ontwikkeling | false
Supervisor | true
Docker | true
Gebruiker | root
Virtuele omgeving | false
Python-versie | 3.10.7
Besturingssysteem | Linux
Versie van het besturingssysteem | 5.15.80
CPU-architectuur | x86_64
Tijdzone | Europe/Amsterdam
Configuratiemap | /config
en-ver commented 1 year ago

Same for me on Orange PI Plus 2E and Banana PI with Armbian Bullseye

edenhaus commented 1 year ago

I had also compile errors with the docker container on Ubuntu server 64-bit, which I solved by deleting the folders build (or the folder specified with the config option build_path) and platformio in the folder .esphome (this folder exists inside your config folder). Please stop the addon/container first and as always make a backup before deleting something :) Not sure if this helps also for your issue but maybe someone can give it a try.

Pop70 commented 1 year ago

A pure 32-bit system will probably work. It's the combination of 64-bit kernel and 32-bit userspace that causes the problem. Maybe there was a change in the newer platformio version.

RPi 3b 32 bit HASSOS Same problem

GazAt105 commented 1 year ago

Same here on Odroid XU4: Home Assistant 2022.12.6 Supervisor 2022.11.2 Operating System 9.4 Frontend 20221213.0 - latest

The OS is 32 bit.

ESP8266 (platform: platformio/espressif8266 @ 3.2.0)) complies okay.

ESP32 fails as per below.

> INFO Reading configuration /config/esphome/esp32-001.yaml...
INFO Detected timezone 'Australia/Brisbane'
INFO Generating C++ source...
INFO Compiling app...
Processing esp32-001 (board: esp32dev; framework: arduino; platform: platformio/espressif32 @ 5.2.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- AsyncTCP-esphome @ 1.2.2
|-- EspSoftwareSerial @ 6.16.1
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 2.1.0
|   |-- AsyncTCP-esphome @ 1.2.2
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- ArduinoJson @ 6.18.5
Compiling /data/esp32-001/.pioenvs/esp32-001/src/esphome/components/adc/adc_sensor.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
Compiling /data/esp32-001/.pioenvs/esp32-001/src/esphome/components/api/api_connection.cpp.o
Compiling /data/esp32-001/.pioenvs/esp32-001/src/esphome/components/api/api_frame_helper.cpp.o
Compiling /data/esp32-001/.pioenvs/esp32-001/src/esphome/components/api/api_pb2.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
Compiling /data/esp32-001/.pioenvs/esp32-001/src/esphome/components/api/api_pb2_service.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
sh: 1: xtensa-esp32-elf-g++: not found
Compiling /data/esp32-001/.pioenvs/esp32-001/src/esphome/components/api/api_server.cpp.o
Compiling /data/esp32-001/.pioenvs/esp32-001/src/esphome/components/api/list_entities.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
sh: 1: xtensa-esp32-elf-g++: not found
*** [/data/esp32-001/.pioenvs/esp32-001/src/esphome/components/adc/adc_sensor.cpp.o] Error 127
*** [/data/esp32-001/.pioenvs/esp32-001/src/esphome/components/api/api_connection.cpp.o] Error 127
*** [/data/esp32-001/.pioenvs/esp32-001/src/esphome/components/api/api_frame_helper.cpp.o] Error 127
*** [/data/esp32-001/.pioenvs/esp32-001/src/esphome/components/api/api_pb2.cpp.o] Error 127
*** [/data/esp32-001/.pioenvs/esp32-001/src/esphome/components/api/api_pb2_service.cpp.o] Error 127
*** [/data/esp32-001/.pioenvs/esp32-001/src/esphome/components/api/api_server.cpp.o] Error 127
Compiling /data/esp32-001/.pioenvs/esp32-001/src/esphome/components/api/proto.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
*** [/data/esp32-001/.pioenvs/esp32-001/src/esphome/components/api/list_entities.cpp.o] Error 127
sh: 1: xtensa-esp32-elf-g++: not found
*** [/data/esp32-001/.pioenvs/esp32-001/src/esphome/components/api/proto.cpp.o] Error 127
========================== [FAILED] Took 8.76 seconds ==========================
cvwillegen commented 1 year ago

Home Assistant 2022.12.5 Supervisor 2022.11.2 Operating System 9.4 Frontend-versie: 20221213.0 - latest RPi4 - 32bit

Same problem, using nothing but the Community Addon...

ssieb commented 1 year ago

RPi 3b 32 bit HASSOS Same problem

@Pop70, what does uname -a show for the architecture? (or anyone else that thinks they're running a 32-bit HASSOS)

jesserockz commented 1 year ago

Alternatively, paste the top section from here:

Open your Home Assistant instance and show information about your system.

en-ver commented 1 year ago

`## System Information

version core-2022.12.6
installation_type Home Assistant Container
dev false
hassio false
docker true
user root
virtualenv false
python_version 3.10.7
os_name Linux
os_version 5.15.80-sunxi
arch armv7l
timezone Europe/Kiev
config_dir /config
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Dashboards dashboards | 1 -- | -- resources | 0 views | 3 mode | storage
Recorder oldest_recorder_run | 5 December 2022 at 12:31 -- | -- current_recorder_run | 15 December 2022 at 09:13 estimated_db_size | 125.14 MiB database_engine | mysql database_version | 10.6.10
`
RaceAap commented 1 year ago

I updated my previous post, but i'm running hassos 64bits in a virtual machine on a Synology DS920+. ESPHome is the standard add-on from HA so no control on which version gets installed unless there is an update.

rikkertkoppes commented 1 year ago

armv7l here, so 32 bit

JackTalisker commented 1 year ago

System Information

version core-2022.12.6
installation_type Home Assistant Container
dev false
hassio false
docker true
user root
virtualenv false
python_version 3.10.7
os_name Linux
os_version 5.10.103-v7+
arch armv7l
timezone Europe/Rome
config_dir /config
ssieb commented 1 year ago

We don't need any more information now. It turns out that it's a problem with the 32-bit toolchain not matching debian. Hopefully there will be an add-on update soon to workaround that.

azirion commented 1 year ago

I had exactly the same problem. Solved with version 2022.12.1 Thank you guys!!

domcat11 commented 1 year ago

I also had the same problem, solved with new version 2022.12.1, but now I've got this new error

Compiling /data/esp32azdel/.pioenvs/esp32azdel/src/esphome/components/api/api_connection.cpp.o In file included from src/esphome/components/socket/socket.h:5, from src/esphome/components/api/api_frame_helper.h:13, from src/esphome/components/api/api_connection.h:3, from src/esphome/components/api/api_connection.cpp:1: src/esphome/components/socket/headers.h:116:10: fatal error: sys/ioctl.h: No such file or directory

I'm on RPI3 HASSIO Any idea? Thanks

zanna-37 commented 1 year ago

with 2022.12.1 this error occurs to me which was not present in 2022.11

HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- Preferences @ 2.0.0
|-- ESP32 BLE Arduino @ 1.0.1+sha.adc2aee
|-- Nuki Ble for Esp32 @ 0.0.4+sha.b0f8588
|   |-- NimBLE-Arduino @ 1.4.1+sha.0d9f039
|   |-- CRC16 @ 0.0.0+20221216094630.sha.f46d86b
|-- WiFi @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- Update @ 2.0.0
|-- noise-c @ 0.1.4
|   |-- libsodium @ 1.10018.1
Compiling .pioenvs/esp-nuki-bridge/src/esphome/components/nuki_lock/nuki_lock.cpp.o
Compiling .pioenvs/esp-nuki-bridge/src/esphome/components/sensor/filter.cpp.o
Compiling .pioenvs/esp-nuki-bridge/src/esphome/components/sensor/sensor.cpp.o
Compiling .pioenvs/esp-nuki-bridge/src/esphome/components/socket/bsd_sockets_impl.cpp.o
In file included from .piolibdeps/esp-nuki-bridge/Nuki Ble for Esp32/src/NukiBle.h:9,
                 from src/esphome/components/nuki_lock/nuki_lock.h:9,
                 from src/esphome/components/nuki_lock/nuki_lock.cpp:2:
.piolibdeps/esp-nuki-bridge/ESP32 BLE Arduino/src/FreeRTOS.h:61:28: error: 'ringbuf_type_t' has not been declared
  Ringbuffer(size_t length, ringbuf_type_t type = RINGBUF_TYPE_NOSPLIT);
                            ^~~~~~~~~~~~~~
*** [.pioenvs/esp-nuki-bridge/src/esphome/components/nuki_lock/nuki_lock.cpp.o] Error 1
Compiling .pioenvs/esp-nuki-bridge/src/esphome/components/socket/lwip_raw_tcp_impl.cpp.o
ssieb commented 1 year ago

@zanna-37 are you using a custom or external component? Your compile is importing a second BLE library and I can only imagine that is going to cause you trouble.

This issue is closed. Any other compile issues need a new issue. And try a clean build first.

zanna-37 commented 1 year ago

@zanna-37 are you using a custom or external component?

Yes, I am, but it was working before. I think a piece went missing, just like the xtensa-esp32-elf-g++: not found of this issue. The issue is the maintainer of the external component is not very responsive.

And try a clean build first

Yeah, I already tried.

nliaudat commented 1 year ago

That's related to old libs on platformio cache.

To fix it on windows : cd C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\Lib\site-packages delete platformio & platformio-6.1.5.dist-info cd In C:\Users\%USERNAME%\ delete .platformio

run :

pip install --upgrade esphome
pip install --upgrade platformio
lambu76 commented 1 year ago

with ESP 2022.12.8 default add-on on Homeassistant below version I still have the problem.

How to solve it ?

Home Assistant 2023.2.1 Supervisor 2023.01.1 Operating System 9.5 Frontend 20230202.0 - latest

alpat59 commented 1 year ago

ESPHome 2022.12.8 installed as HA add-on on Raspberry and I have the same problem "sh: 1: xtensa-esp32-elf-g++: not found"

Could someone try to fix it ? Thank you for support

lazlykama commented 1 year ago

Same here, if you use ESPHome as a HA add-on the problem not solved yet. cc: @jesserockz

SVH-Powel commented 1 year ago

Same here, if you use ESPHome as a HA add-on the problem not solved yet. cc: @jesserockz

In that case, it would be better to open a new issue instead of writing here. I am still on the 2022.11.5 version and hold off any upgrades till this and other issues are fixed.

lambu76 commented 1 year ago

done

https://github.com/esphome/issues/issues/4178

alpat59 commented 1 year ago

I inform you that the problem (exactly as described in this issue problem description) is still present on the ESPHome 2023.2.1 version. The description of the #4178 is different from my situation. My compile task ends "fatal" with message "sh: 1: xtensa-esp32-elf-g++: not found" exactly as you @SVH-Powel described. I don't understand why the problem is in closed status (which is the solution/fix ?)

lexcorp commented 1 year ago

ESPHome: Current version: 2023.2.4

El problema continua tengo las versiones mas recientes

System Information

version core-2023.3.0
installation_type Home Assistant Supervised
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.10.10
os_name Linux
os_version 5.10.0-20-arm64
arch aarch64
timezone America/Mexico_City
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 5000 Installed Version | 1.31.0 Stage | running Available Repositories | 1239 Downloaded Repositories | 1
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Debian GNU/Linux 11 (bullseye) -- | -- update_channel | stable supervisor_version | supervisor-2023.02.dev2801 agent_version | 1.4.1 docker_version | 23.0.1 disk_total | 219.6 GB disk_used | 9.3 GB healthy | true supported | true supervisor_api | ok version_api | ok installed_addons | Terminal & SSH (9.6.1), File editor (5.5.0), ArgonOne Active Cooling (29c), HassOS I2C Configurator (0.13a), Duck DNS (1.15.0), ESPHome (2023.2.4)
Dashboards dashboards | 1 -- | -- resources | 0 views | 1 mode | storage
Recorder oldest_recorder_run | 1 de marzo de 2023, 00:57 -- | -- current_recorder_run | 2 de marzo de 2023, 14:08 estimated_db_size | 1.20 MiB database_engine | sqlite database_version | 3.38.5
lexcorp commented 1 year ago

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:

El código después de modificarlo:

def getsystype(): 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

https://github.com/esphome/issues/issues/3092#issuecomment-1412223981

root@rpi4-20230102:/# find | 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.

2opremio commented 1 year ago

I am still have this problem with the most recent version of esphome and platformio on a raspberry pi 4 with raspberry pi os

Florian-Schmidt commented 1 year ago

I still get this message on a raspberry pi 4 with 64bit OS (aarch64) too. In my case I'm using a esp8266.

Read several issues now and nothing worked. I update esphome docker container, I cleaned up build files and reinstalled home assistant integration already.

ndfred commented 1 year ago

Exactly the same issue here, docker ESPHome esphome/esphome:latest (hash 1a75005e15d88c0054514aa2b882b46bd97ebc385b5ab5d95b44b8d320e5f9a8, v2023.5.1) on a Raspberry Pi 4, 32 bit OS, started happening two weeks ago:

Compiling .pioenvs/arthur_bedroom_esp32/src/esphome/components/api/api_connection.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
Compiling .pioenvs/arthur_bedroom_esp32/src/esphome/components/api/api_frame_helper.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
Compiling .pioenvs/arthur_bedroom_esp32/src/esphome/components/api/api_pb2.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
*** [.pioenvs/arthur_bedroom_esp32/src/esphome/components/api/api_connection.cpp.o] Error 127
Compiling .pioenvs/arthur_bedroom_esp32/src/esphome/components/api/api_pb2_service.cpp.o
*** [.pioenvs/arthur_bedroom_esp32/src/esphome/components/api/api_frame_helper.cpp.o] Error 127
*** [.pioenvs/arthur_bedroom_esp32/src/esphome/components/api/api_pb2.cpp.o] Error 127
sh: 1: xtensa-esp32-elf-g++: not found
*** [.pioenvs/arthur_bedroom_esp32/src/esphome/components/api/api_pb2_service.cpp.o] Error 127
========================= [FAILED] Took 100.94 seconds =========================

I tried clearing .esphome/platformio to re-download the toolchains but that did not help. Looking around .esphome/platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-g++ is present. ESPHome dashboard says it installed toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5.

ssieb commented 1 year ago

@ndfred try running that program and see what happens.

ndfred commented 1 year ago

Super weird:

$ ./.esphome/platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-g++
-bash: ./.esphome/platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-g++: No such file or directory

It looks like an arm64 binary:

$ file ./.esphome/platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-g++
./.esphome/platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-g++: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=abfed9e5893019faebfd4748833b6357f5cfe614, stripped

And my system is ARM32, but for some reason my kernel is ARM64 (don't remember when I made that change), that is probably what is throwing ESPHome off:

$ uname -a
Linux bagend 5.10.103-v8+ #1529 SMP PREEMPT Tue Mar 8 12:26:46 GMT 2022 aarch64 GNU/Linux
$ file /usr/bin/arm-linux-gnueabihf-g++-8
/usr/bin/arm-linux-gnueabihf-g++-8: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=35312a560fd37e95fb3a5d385e78048673f06cf2, stripped

I have been meaning to migrate to the ARM64 version of Raspberry OS, but that is a painful migration (I would have to reinstall everything) so I have not gotten around to it yet. It looks like my setup (ARM64 kernel, ARM32 binaries) is what caused this issue in the first place, and got resolved (it was working for me a few weeks ago), maybe this is a recent regression in the toolchain selection process.

ssieb commented 1 year ago

Yes, that's the problem. And it's not esphome, it's platformio. It sees the arch is 64-bit (from the kernel), so it gets the 64-bit toolchain.

Florian-Schmidt commented 1 year ago

@ndfred Thanks, seems to be exactly my situation too. Kernel 64-bit and binaries 32-bit.

Micha70 commented 1 year ago

I have the same issue too... Shouldn't the issue reopened? Or is there a new one existing?

Home Assistant 2023.5.3 Supervisor 2023.04.1 Frontend 20230503.3 - latest

pi@raspberrypi:~ $ uname -a Linux raspberrypi 6.1.19-v8+ #1637 SMP PREEMPT Tue Mar 14 11:11:47 GMT 2023 aarch64 GNU/Linux

ESP-Home 2023.5.1

'''

/data/kuechenlampe/.pioenvs/kuechenlampe/src/esphome/components/api/api_pb2.cpp.o sh: 1: xtensa-lx106-elf-g++: not found Compiling /data/kuechenlampe/.pioenvs/kuechenlampe/src/esphome/components/api/api_pb2_service.cpp.o *** [/data/kuechenlampe/.pioenvs/kuechenlampe/src/esphome/components/api/api_connection.cpp.o] Error 127


'''

ndfred commented 1 year ago

From this commit mentioned above it looks like the fix was to pull in the arm 32 linker in the docker container to work around the issue, I might play with that and see if it fixes it:

$ ln -s /lib/arm-linux-gnueabihf/ld-linux.so.3 /lib/ld-linux.so.3