Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xtensa-lx106-elf-g++: not found #1386

Closed
gitolicious opened this issue Jul 30, 2020 · 208 comments
Closed

xtensa-lx106-elf-g++: not found #1386

gitolicious opened this issue Jul 30, 2020 · 208 comments

Comments

@gitolicious
Copy link

gitolicious commented Jul 30, 2020

Operating environment/Installation (Hass.io/Docker/pip/etc.):

Hass.io on Odroid N2

Hass.io Add-on: ESPHome (beta)
Beta version of ESPHome Hass.io add-on.

Add-on version: 1.15.0b3
You are running the latest version of this add-on.
System: Debian GNU/Linux 9 (stretch) (armv7 / odroid-xu)
Home Assistant Core: 0.113.2
Home Assistant Supervisor: 229

ESP (ESP32/ESP8266, Board/Sonoff):

ESP8266, but irrelevant

ESPHome version (latest production, beta, dev branch)

1.15.0b3 - fails for ESP32 and ESP8266
latest dev - fails for ESP32 and ESP8266
1.14.5 - fails for ESP32, works fine for ESP8266

Affected component:

n/a

Description of problem:
Compilation is giving me xtensa-lx106-elf-g++: not found

Problem-relevant YAML-configuration entries:

esphome:
  name: test
  platform: ESP8266
  board: esp01_1m

Logs (if applicable):

INFO Reading configuration /config/esphome/test.yaml...
INFO Generating C++ source...
INFO Core config or version changed, cleaning build files...
INFO Deleting /data/test/.pioenvs
INFO Deleting /data/test/.piolibdeps
INFO Compiling app...
INFO Running:  platformio run -d /config/esphome/test
Processing test (board: esp01_1m; framework: arduino; platform: [email protected])
--------------------------------------------------------------------------------
PackageManager: Installing toolchain-xtensa @ ~2.40802.191122
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
toolchain-xtensa @ 2.40802.200502 has been successfully installed!
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 3.20702.0 (2.7.2) 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.20800.0 (2.8.0) 
 - toolchain-xtensa 2.40802.200502 (4.8.2)
Dependency Graph
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
Compiling /data/test/.pioenvs/test/src/esphome/core/application.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
Compiling /data/test/.pioenvs/test/src/esphome/core/component.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
Compiling /data/test/.pioenvs/test/src/esphome/core/controller.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
Compiling /data/test/.pioenvs/test/src/esphome/core/esphal.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
Compiling /data/test/.pioenvs/test/src/esphome/core/helpers.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
*** [/data/test/.pioenvs/test/src/esphome/core/application.cpp.o] Error 127
Compiling /data/test/.pioenvs/test/src/esphome/core/log.cpp.o
*** [/data/test/.pioenvs/test/src/esphome/core/component.cpp.o] Error 127
*** [/data/test/.pioenvs/test/src/esphome/core/controller.cpp.o] Error 127
*** [/data/test/.pioenvs/test/src/esphome/core/esphal.cpp.o] Error 127
*** [/data/test/.pioenvs/test/src/esphome/core/helpers.cpp.o] Error 127
sh: 1: xtensa-lx106-elf-g++: not found
*** [/data/test/.pioenvs/test/src/esphome/core/log.cpp.o] Error 127
========================= [FAILED] Took 24.86 seconds =========================

Additional information and things you've tried:

  • Tried dev branch with gitpod.io, works fine there
  • Searched for the binary within the docker container, exists at
    root@15ef4d2f-esphome-beta:~/.platformio/packages/toolchain-xtensa/bin# ls -la ./xtensa-lx106-elf-g++ 
    -rwxr-xr-x 1 root root 819856 Jul 17  2019 ./xtensa-lx106-elf-g++
  • Log for ESP32:
    sh: 1: xtensa-esp32-elf-g++: not found
@gitolicious
Copy link
Author

#594 and #236 might be related

@OttoWinter
Copy link
Member

Odroid N2 is an armv7 device, right?

Notable is that it installs an extra toolchain here:

PackageManager: Installing toolchain-xtensa @ ~2.40802.191122
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
toolchain-xtensa @ 2.40802.200502 has been successfully installed!

Not sure why that's happening as the image is supposed to contain the right toolchain already.

Command not found could also mean a broken symlink, so maybe check with readlink too.

In the docker base image build the xtensa-lx106-elf-g++ command does exist: https://github.com/esphome/esphome-docker-base/runs/925103486?check_suite_focus=true#step:9:133 (ignore the -fail, that's just to create a fake build so the toolchain gets downloaded).

@gitolicious
Copy link
Author

gitolicious commented Aug 6, 2020

Odroid N2 has ARM Cortex-A73 and A53 CPUs which are armv8.

root@15ef4d2f-esphome-dev:/# lscpu 
Architecture:        aarch64
Byte Order:          Little Endian
CPU(s):              6
On-line CPU(s) list: 0-5
Thread(s) per core:  1
Core(s) per socket:  3
Socket(s):           2
Vendor ID:           ARM
Model:               4
Model name:          Cortex-A53
Stepping:            r0p4
CPU max MHz:         1896.0000
CPU min MHz:         100.0000
BogoMIPS:            48.00
Flags:               fp asimd evtstrm aes pmull sha1 sha2 crc32

Downloaded image is armv7.

20-08-06 17:31:52 INFO (MainThread) [supervisor.addons] Create Home Assistant add-on data folder /data/addons/data/15ef4d2f_esphome-beta
20-08-06 17:31:52 INFO (SyncWorker_9) [supervisor.docker.interface] Pull image esphome/esphome-hassio-armv7 tag 1.15.0b3.
20-08-06 17:32:00 INFO (MainThread) [supervisor.addons] Add-on '15ef4d2f_esphome-beta' successfully installed
20-08-06 17:32:04 INFO (SyncWorker_0) [supervisor.docker.addon] Start Docker add-on esphome/esphome-hassio-armv7 with version 1.15.0b3
20-08-06 17:32:06 INFO (MainThread) [supervisor.api.security] /host/info access from 15ef4d2f_esphome-beta

Where do you want me set the readlink command?

root@15ef4d2f-esphome-dev:/# readlink ~/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-g++ 
root@15ef4d2f-esphome-dev:/# 

@gitolicious
Copy link
Author

Is esphome/esphome-docker-base#5 related in any way?

@gitolicious
Copy link
Author

Investigating further, I saw that builds actually fail for ESP32 boards in the current stable version (1.14.5) as well:

esphome:
  name: test32
  platform: ESP32
  board: esp32dev

There the Download part is not shown in the logs...

INFO Reading configuration /config/esphome/test32.yaml...
INFO Generating C++ source...
INFO Core config or version changed, cleaning build files...
INFO Compiling app...
INFO Running:  platformio run -d /config/esphome/test32
Processing test32 (board: esp32dev; framework: arduino; platform: [email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif32 3.10004.200129 (1.0.4) 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - toolchain-xtensa32 2.50200.80 (5.2.0)
Dependency Graph
|-- <ESPmDNS> 1.0
|   |-- <WiFi> 1.0
Compiling /data/test32/.pioenvs/test32/src/esphome/core/application.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
Compiling /data/test32/.pioenvs/test32/src/esphome/core/component.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
Compiling /data/test32/.pioenvs/test32/src/esphome/core/controller.cpp.o
Compiling /data/test32/.pioenvs/test32/src/esphome/core/esphal.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
sh: 1: xtensa-esp32-elf-g++: not found
Compiling /data/test32/.pioenvs/test32/src/esphome/core/helpers.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
*** [/data/test32/.pioenvs/test32/src/esphome/core/application.cpp.o] Error 127
Compiling /data/test32/.pioenvs/test32/src/esphome/core/log.cpp.o
*** [/data/test32/.pioenvs/test32/src/esphome/core/component.cpp.o] Error 127
*** [/data/test32/.pioenvs/test32/src/esphome/core/controller.cpp.o] Error 127
*** [/data/test32/.pioenvs/test32/src/esphome/core/esphal.cpp.o] Error 127
*** [/data/test32/.pioenvs/test32/src/esphome/core/helpers.cpp.o] Error 127
sh: 1: xtensa-esp32-elf-g++: not found
*** [/data/test32/.pioenvs/test32/src/esphome/core/log.cpp.o] Error 127
========================== [FAILED] Took 2.35 seconds ==========================

@OttoWinter
Copy link
Member

@gitolicious No esphome/esphome-docker-base#5 is not related.

I tried to manually set up a qemu aarch64 VM using the raspi3 machine profile (appears to match your platform the most), and it worked fine there. Don't know what could be the issue here.

@gitolicious
Copy link
Author

Thx for looking into it. Any idea how I could investiage further on my end? Tried uninstalling the add-on and deleted everything I found in the data folder other than the config YAMLs. Reinstalled and ended up with the same error.
This weekend probably I can boot from a different SD with a fresh HomeAssistant image just to be sure there is no interference from any other component or setting.

@motwok
Copy link

motwok commented Aug 31, 2020

I have exactly the same problems with aarch64 on raspi4:

just the name of the executable is different

esphome on some older version (from january):
ESP8266 compiles
ESP32 compiles

esphome 1.14.5:
ESP8266 compiles
ESP32 not compiles (did not find the compiler)

esphome 1.15.5:
ESP8266 not compiles (did not find the compiler)
ESP32 not compiles (did not find the compiler)

after changing to arm71 it works.

Regards
Emmo

@gitolicious
Copy link
Author

Good to know I am not alone on this... I didn't find the time yet to set up a fresh system on my N2 to reconfirm the issue.
@motwok: arm71 is the 32bit version of HomeAssistant for Raspi4?

@gitolicious
Copy link
Author

gitolicious commented Sep 16, 2020

This nasty bugs now sneaked its way into the stable release 1.15.1. Will be interesting to see if this brings in more reports from affected users.
Also still happens with 1.16.0-dev.

@keteflips
Copy link

Same problem here.

@keteflips
Copy link

I have exactly the same problems with aarch64 on raspi4:

just the name of the executable is different

esphome on some older version (from january):
ESP8266 compiles
ESP32 compiles

esphome 1.14.5:
ESP8266 compiles
ESP32 not compiles (did not find the compiler)

esphome 1.15.5:
ESP8266 not compiles (did not find the compiler)
ESP32 not compiles (did not find the compiler)

after changing to arm71 it works.

Regards
Emmo

How I can change it in the ESPHome addon for Home Assistant?

@Haringstad
Copy link

And I can confirm: Same issue here.

INFO Reading configuration /config/esphome/19_inch_fans.yaml...
INFO Detected timezone 'CET' with UTC offset 1 and daylight savings time from 28 March 02:00:00 to 31 October 03:00:00
INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d /config/esphome/19_inch_fans
Processing 19_inch_fans (board: esp01_1m; framework: arduino; platform: [email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 2.20502.0 (2.5.2) 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - toolchain-xtensa 2.100100.200706 (10.1.0)
Dependency Graph
|-- <ESPAsyncTCP-esphome> 1.2.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESPAsyncWebServer-esphome> 1.2.6
|   |-- <ESPAsyncTCP-esphome> 1.2.2
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <Hash> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ArduinoJson-esphomelib> 5.13.3
|-- <ArduinoJson-esphomelib> 5.13.3
Compiling /data/19_inch_fans/.pioenvs/19_inch_fans/src/esphome/components/api/api_connection.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
Compiling /data/19_inch_fans/.pioenvs/19_inch_fans/src/esphome/components/api/api_pb2.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
Compiling /data/19_inch_fans/.pioenvs/19_inch_fans/src/esphome/components/api/api_pb2_service.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
*** [/data/19_inch_fans/.pioenvs/19_inch_fans/src/esphome/components/api/api_connection.cpp.o] Error 127
Compiling /data/19_inch_fans/.pioenvs/19_inch_fans/src/esphome/components/api/api_server.cpp.o
*** [/data/19_inch_fans/.pioenvs/19_inch_fans/src/esphome/components/api/api_pb2.cpp.o] Error 127
*** [/data/19_inch_fans/.pioenvs/19_inch_fans/src/esphome/components/api/api_pb2_service.cpp.o] Error 127
sh: 1: xtensa-lx106-elf-g++: not found
*** [/data/19_inch_fans/.pioenvs/19_inch_fans/src/esphome/components/api/api_server.cpp.o] Error 127
========================== [FAILED] Took 3.26 seconds ==========================

@nordscan
Copy link

nordscan commented Sep 20, 2020

for me too

rp4
2020-08-20-raspios-buster-arm64-lite.img
EspHome 1.15.2

INFO Reading configuration /config/esphome/kotolna.yaml...
INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d /config/esphome/kotolna
Processing kotolna (board: nodemcuv2; framework: arduino; platform: [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)
Dependency Graph
|-- <ESPAsyncTCP-esphome> 1.2.3
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESPAsyncWebServer-esphome> 1.2.7
|   |-- <ESPAsyncTCP-esphome> 1.2.3
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <Hash> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
Compiling /data/kotolna/.pioenvs/kotolna/src/esphome/components/api/api_connection.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
Compiling /data/kotolna/.pioenvs/kotolna/src/esphome/components/api/api_pb2.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
Compiling /data/kotolna/.pioenvs/kotolna/src/esphome/components/api/api_pb2_service.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
*** [/data/kotolna/.pioenvs/kotolna/src/esphome/components/api/api_connection.cpp.o] Error 127
Compiling /data/kotolna/.pioenvs/kotolna/src/esphome/components/api/api_server.cpp.o
*** [/data/kotolna/.pioenvs/kotolna/src/esphome/components/api/api_pb2.cpp.o] Error 127
*** [/data/kotolna/.pioenvs/kotolna/src/esphome/components/api/api_pb2_service.cpp.o] Error 127
sh: 1: xtensa-lx106-elf-g++: not found
*** [/data/kotolna/.pioenvs/kotolna/src/esphome/components/api/api_server.cpp.o] Error 127
========================== [FAILED] Took 2.89 seconds ==========================

@gitolicious
Copy link
Author

gitolicious commented Sep 21, 2020

Thanks a lot for the MeToos.
@keteflips @Haringstad @nordscan
Can you guys please share your environments (hardware, HomeAssistant version and installation method) so we can identify potential root causes?

@nordscan
Copy link

nordscan commented Sep 21, 2020

rasbian - docker - hassio

RASPBERRY Pi 4 Model B 4GB
2020-08-20-raspios-buster-arm64-lite.img
EspHome 1.15.2
arch | aarch64
-- | --
chassis |  
dev | false
docker | true
docker_version | 19.03.13
hassio | true
host_os | Debian GNU/Linux 10 (buster)
installation_type | Home Assistant Supervised
os_name | Linux
os_version | 5.4.51-v8+
python_version | 3.8.5
supervisor | 245
timezone | UTC
version | 0.115.2
virtualenv | false

edited 2020.09.21_12:04

@triphoppingman
Copy link

triphoppingman commented Sep 21, 2020

Hardware: Odroid-N2
Ambian - Docker - hassio
Esphome: 1.15.2

Dependency Graph
|-- <ESPAsyncTCP-esphome> 1.2.3
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESPAsyncWebServer-esphome> 1.2.7
|   |-- <ESPAsyncTCP-esphome> 1.2.3
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <Hash> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
Compiling /data/bnc60_01/.pioenvs/bnc60_01/src/esphome/components/api/api_connection.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
Compiling /data/bnc60_01/.pioenvs/bnc60_01/src/esphome/components/api/api_pb2.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
Compiling /data/bnc60_01/.pioenvs/bnc60_01/src/esphome/components/api/api_pb2_service.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
Compiling /data/bnc60_01/.pioenvs/bnc60_01/src/esphome/components/api/api_server.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
Compiling /data/bnc60_01/.pioenvs/bnc60_01/src/esphome/components/api/list_entities.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found

UPDATE1:
I docker exec onto the esphome image:

and try to run the docker manually.

root@15ef4d2f-esphome:/config/esphome$ esphome bnc60_01.yaml compile
INFO Reading configuration bnc60_01.yaml...
INFO Detected timezone 'EST' with UTC offset -5 and daylight savings time from 14 March 02:00:00 to 07 November 02:00:00
INFO Generating C++ source...
INFO Core config or version changed, cleaning build files...
INFO Compiling app...
INFO Running:  platformio run -d bnc60_01
Processing bnc60_01 (board: esp01_1m; framework: arduino; platform: [email protected])
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB 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)
...
Dependency Graph
|-- <ESPAsyncTCP-esphome> 1.2.3
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESPAsyncWebServer-esphome> 1.2.7
|   |-- <ESPAsyncTCP-esphome> 1.2.3
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <Hash> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
Compiling .pioenvs/bnc60_01/src/esphome/components/api/api_connection.cpp.o
sh: 1: xtensa-lx106-elf-g++: not found
Compiling .pioenvs/bnc60_01/src/esphome/components/api/api_pb2.cpp.o

@Haringstad
Copy link

Raspberry Pi 4, 5.4.51-v8+ #1333 SMP PREEMPT Mon Aug 10 16:58:35 BST 2020 aarch64 GNU/Linux

arch aarch64
chassis  
dev false
docker true
docker_version 19.03.13
hassio true
host_os Debian GNU/Linux 10 (buster)
installation_type Home Assistant Supervised
os_name Linux
os_version 5.4.51-v8+
python_version 3.8.5
supervisor 245
timezone Europe/Amsterdam
version 0.115.2
virtualenv false

@gitolicious
Copy link
Author

So up to now we only have Odroid N2 and RPi 4 affected. @OttoWinter, any idea what could be different for these devices compared to others? Or is it just these devices being the most popular ones in the community?

@triphoppingman
Copy link

triphoppingman commented Sep 22, 2020

It appears we are dealing with a problem with aarch64 platforms (64bit ARM). https://en.wikipedia.org/wiki/AArch64. If you run a 32bit operating system on rpi 4, I bet you don't get this issue.

@triphoppingman
Copy link

triphoppingman commented Sep 25, 2020

More information:

So I did find where platformio (which esphome uses) stores the compilers:

root@15ef4d2f-esphome:/root/.platformio$ find . -name '*g++*' -print                                                  
./packages/[email protected]/xtensa-lx106-elf/bin/g++
./packages/[email protected]/bin/xtensa-lx106-elf-g++
./packages/[email protected]/share/man/man1/xtensa-lx106-elf-g++.1
./packages/toolchain-xtensa/bin/xtensa-lx106-elf-g++
./packages/toolchain-xtensa/share/man/man1/xtensa-lx106-elf-g++.1
./packages/toolchain-xtensa32/bin/xtensa-esp32-elf-g++
./packages/tool-scons/engine/SCons/Tool/g++.py

root@15ef4d2f-esphome:/root/.platformio$ ./packages/toolchain-xtensa/bin/xtensa-lx106-elf-g++
xtensa-lx106-elf-g++: fatal error: no input files
compilation terminated.

It looks like an issue with platformio / esphome.

@triphoppingman
Copy link

I was able to get this working by adding the following to the core block:

arduino_version: 2.5.1

These seems to be the last version of the arduino framework that provides the correct compiler. Sigh. This is not a great solution as we are missing out on all the fixes that come with the Arduino code.

@gitolicious
Copy link
Author

Hooray, at least we have a workaround! Thanks for the info. For now, a little outdated version is better than no version. Also we have a starting point for investigations.

@gitolicious
Copy link
Author

Unfortunately for ESP32 I didn't find any version that works. Tried all listed in the docs.

@keteflips
Copy link

keteflips commented Sep 28, 2020

I have a custom Home Assistant instalation in a TVBOX with Armbian Linux (arm64).

System: Armbian 20.08 Bullseye (armv7 / raspberrypi3)
Home Assistant Core: 0.115.4
Home Assistant Supervisor: 245

I was able to get this working by adding the following to the core block:

arduino_version: 2.5.1

These seems to be the last version of the arduino framework that provides the correct compiler. Sigh. This is not a great solution as we are missing out on all the fixes that come with the Arduino code.

This workarround didnt work for me.

@motwok
Copy link

motwok commented Oct 5, 2020

How I can change it in the ESPHome addon for Home Assistant?

the arch can be changed in boot/config.txt

In my installation i changed the line
arm_64bit=1
to
arm_64bit=0

Please check documentation for your installation first, i take no responsibility for you installation!

Emmo

@triphoppingman
Copy link

How I can change it in the ESPHome addon for Home Assistant?

the arch can be changed in boot/config.txt

In my installation i changed the line
arm_64bit=1
to
arm_64bit=0

Please check documentation for your installation first, i take no responsibility for you installation!

Emmo

This only applies for Raspberry Pi 4.0.

@motwok
Copy link

motwok commented Oct 13, 2020

This only applies for Raspberry Pi 4.0.
You are right... had overread that a pi3 was mentioned... then it might be just running the "original armv7 kernel"!?

@jpcornil-git
Copy link

I was only talking about ESPHome for your laptop, RPi is definitively a better/more reliable choice for HAOS.
ESPHome is just running on RPi (iso your laptop) when installed thru HAOS but has no interaction with HA -> can run elsewhere/only used when your are buidling or installing a new image on a ESP-enabled device.

Wrt you question, unless you upgraded HA within HAOS with a recent version there are three years between your current installation and latest version and I would therefore expect a few "tunings" ... difficult to say anyway but I would do/will be required at some point in time anyway.

@kenmathers
Copy link

@jpcornil-git , many thanks, it’s starting to make sense. Although usually when I start to think that I understand something, I find that I really don’t. :-)
Just to be clear, I DO apply all updates as soon as they come out. My system has the following versions.
HAOS 7.5
Supervisor 2022.03.5
Core 2022.3.6
But I really like your suggestion to move ESPHome onto my laptop and do my setup there. Then just access the devices and entities via HA on the Pi.
Cheers
Ken

@UV-PWRD
Copy link

UV-PWRD commented Mar 26, 2022

I have this issue but as I understand it I'm already on a 64bit OS?

Or am I misunderstanding the 64/32bit aspect of this issue?

Output from my host RPi 4 is as follows

root@rpi4-20210823:/dev# uname -r
5.10.0-8-arm64

@jpcornil-git
Copy link

Your kernel may be 64b (what uname reports) but userland (application and library binaries) may be 32b and/or 64b.

When both match (both 32b or 64b), platformio will behave correctly otherwise (64b kernel and 32b userland) it will expose this issue.

You can check a system application to have an indication (32b or 64b application)

file /bin/ls

@UV-PWRD
Copy link

UV-PWRD commented Mar 26, 2022

Your kernel may be 64b (what uname reports) but userland (application and library binaries) may be 32b and/or 64b.

When both match (both 32b or 64b), platformio will behave correctly otherwise (64b kernel and 32b userland) it will expose this issue.

You can check a system application to have an indication (32b or 64b application)

file /bin/ls

As an absolute linux noob, I'm not sure what to do with that command to produce useful output to share back to you, can you please clarify what's needed to confirm if I have the same 32/64b issue.

Sorry for the hassle and thanks for the assistance.

@UV-PWRD
Copy link

UV-PWRD commented Mar 26, 2022

Your kernel may be 64b (what uname reports) but userland (application and library binaries) may be 32b and/or 64b.

When both match (both 32b or 64b), platformio will behave correctly otherwise (64b kernel and 32b userland) it will expose this issue.

You can check a system application to have an indication (32b or 64b application)

file /bin/ls

After some more reading, and given my RPi4 is a 4GB model I'm fairly confident I'll have a 32bit version of HA.

@UV-PWRD
Copy link

UV-PWRD commented Mar 26, 2022

file /bin/ls

I've pressed on with running ESPHome via command line on my windows machine and am hgaving a play with that.

See how I go.

@jpcornil-git
Copy link

Just type that where you typed uname

@kenmathers
Copy link

Hey @UV-PWRD
I installed ESPHome on my laptop.
I followed the instructions at https://esphome.io/guides/getting_started_command_line.html
I used the instructions at the link named installing ESPHome manually. Installed Pythod, and used the commandline:

pip3 install wheel
pip3 install esphome
pip3 install --user esphome
Then plugged in my esp8266 via usb and ran: (replave livingroom.yaml with the name you want)
esphome wizard livingroom.yaml
I followed the instructions and it flashed OK
Then I edited the .yaml and re-flashed it by running
esphome livingroon.yaml run
It appeared in Homeassistant as a new device and after using configuration, it is now listed as one of my esphome devices.
image
I now need to copy the other three offline yaml files from home assistant to my laptop and compile and flash those as well.

@UV-PWRD
Copy link

UV-PWRD commented Mar 27, 2022

Just type that where you typed uname

Sorry I should have clarified that I already tried that and I get error

"-bash: file: command not found"

on Debian 11

@UV-PWRD
Copy link

UV-PWRD commented Mar 27, 2022

Hey @UV-PWRD I installed ESPHome on my laptop. I followed the instructions at https://esphome.io/guides/getting_started_command_line.html I used the instructions at the link named installing ESPHome manually. Installed Pythod, and used the commandline:

pip3 install wheel
pip3 install esphome
pip3 install --user esphome
Then plugged in my esp8266 via usb and ran: (replave livingroom.yaml with the name you want)
esphome wizard livingroom.yaml
I followed the instructions and it flashed OK
Then I edited the .yaml and re-flashed it by running
esphome livingroon.yaml run
It appeared in Homeassistant as a new device and after using configuration, it is now listed as one of my esphome devices.
image
I now need to copy the other three offline yaml files from home assistant to my laptop and compile and flash those as well.

We are probably using different boards, mine keeps failing the flash, but appears to be trying 48000 then 112000 baud rate, where s the board specifically states use 9600.

So far, the only thing that does work is using the adopt sequence from the web portal to make the board ready for adoption, after that I can get to the web front end on the board etc.

I did it to "seemingly" flash correctly but after that I cannot see it in HA and I cannot get to the web front end on the board itself.

It does appear to be compiling and flashing correctly though because I can see that it has detected the Dallas temp sensor and returns and address for that sensor.

@UV-PWRD
Copy link

UV-PWRD commented Mar 28, 2022

There's something else at play here.

When I use the Web Portal and go through the adoption process, clean generic build, the device appears in HA as you'd expect and I can browse the web interface of the device itself.

Even if I take that same config and upload it via the esphome command line or by using the ESP Web Portal, from that point forward I can ping the device but it does not appear in HA and I cannot get to the web interface.

The only config change I make to the generic adoption config is manually inputting wifi details, which are correct as I can see the device on my router, ping it by IP and device.local

Wat am I missing?

@kenmathers
Copy link

Sorry @UV-PWRD, I'm only a newbie myself so its a bit over my head.
What device are you flashing? Is it a device recognised by EspHome?
Can you share your .yaml? Maybe I can spot a missing space or something. Its very format sensitive. :-)
Other problems that I have struck are the cables I've used (Had one that SEEEMED to work but failed randomly. And if the device requires a usb flashing stick, I had one that didn't provide high enough voltage for many devices. Some would work, some not.
I bought a new device and its been great since.
For MY example, I was just flashing an ESP8266 nodemcu dev board, and then editing my .yaml to include the I2C settings so I could connect it to a cheap light sensor.

@jpcornil-git
Copy link

@UV-PWRD, file utility is not installed, do the following then:

apt-get update
apt-get install file

file /bin/ls

Btw, shouldn't other/generic matters not been discussed in ESPHome Discord rather than in a github issue :-) ?

@UV-PWRD
Copy link

UV-PWRD commented Apr 4, 2022

@UV-PWRD, file utility is not installed, do the following then:

apt-get update
apt-get install file

file /bin/ls

Btw, shouldn't other/generic matters not been discussed in ESPHome Discord rather than in a github issue :-) ?

outcome as follows

/bin/ls: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=9c1a4999161b8b2da681b80d8bf351e40afc40ad, for GNU/Linux 3.7.0, stripped

@UV-PWRD
Copy link

UV-PWRD commented Apr 4, 2022

I'll add i have the device functioning now, but the original error is still prevalent.

@jpcornil-git
Copy link

You have therefore a 64b userspace (ls is an ELF 64-bit application) running on a 64b kernel (aarch64) -> no mismatches here

@UV-PWRD
Copy link

UV-PWRD commented Apr 4, 2022

You have therefore a 64b userspace (ls is an ELF 64-bit application) running on a 64b kernel (aarch64) -> no mismatches here

OK thanks, i did think I had done it all as 64b when I started.

So the question remains why am I missing this library and how do I add it?

@jpcornil-git
Copy link

Can you report your error logs (not sure I saw this) ?

@UV-PWRD
Copy link

UV-PWRD commented Apr 5, 2022

Can you report your error logs (not sure I saw this) ?

Which log are you after?

I get xtensa-lx106-elf-g++: not found when trying to compile configs etc through the ESP Home Dashboard within HA.

I worked around that by compiling a config and uploading it via the ESP Home Command line tool, but now the device appears in HA as an integration but not on the ESP Home dashboard itself within HA.

@jpcornil-git
Copy link

Do you have access to HAOS host cfr. SSH access to the host ?
(not the same as ssh addon)

@UV-PWRD
Copy link

UV-PWRD commented Apr 6, 2022

Yes I think so, My install is stand alone on RPi4 as its own docker image as I needed to run other docker images on the host.

Running portainer on the host directly.

@jpcornil-git
Copy link

-> you can log into esphome container directly with something like

docket exec -it <name of esphome container> /bin/bash

and from within container run

esphome compile <yaml file>

If this is the case, can you attach log file

@UV-PWRD
Copy link

UV-PWRD commented Apr 7, 2022

-> you can log into esphome container directly with something like

docket exec -it <name of esphome container> /bin/bash

and from within container run

esphome compile <yaml file>

If this is the case, can you attach log file

When I do that, I get esphome command not found.

When I referenced the ESP Home command line utility previously, I meant locally on my win10 machine.

Right now I have 2 distinct issues.

  • My externally configured ESP8266 device does not appear in the ESP Dashboard within HA. However it shows up in integrations, it was added manually that way.
  • The ESP Dashboard was unable to configure the device when I tried due to the error in this issue, xtensa not found etc.

The only time the device appeared in ESP Home Dashboard within HA was when it was put into "Adoption" mode using the ESP Home web portal - that issue is found here - #3193

@jpcornil-git
Copy link

You probably ran the command from the host/a different container than esphome one. HAOS is organized as illustrated below and you can ssh at various places (e.g. HA ssh addon gets you into addon_core_ssh, not a host/homeassistant or esphome shell)

image

You should first connect to the host, list running container and start a shell within esphome one, ex.

# docker ps
CONTAINER ID   IMAGE                                                           COMMAND                  CREATED          STATUS          PORTS                                   NAMES
935a15faf1a8   esphome/esphome-hassio-aarch64:2022.2.6                         "/init"                  53 minutes ago   Up 53 minutes                                           addon_a0d7b954_esphome
387c97c3248b   homeassistant/aarch64-addon-ssh:9.3.0                           "/init"                  53 minutes ago   Up 53 minutes   0.0.0.0:22->22/tcp, :::22->22/tcp       addon_core_ssh
fcd4a82088f2   ghcr.io/home-assistant/aarch64-hassio-multicast:2022.02.0       "/init"                  53 minutes ago   Up 53 minutes                                           hassio_multicast
7b408361c35d   ghcr.io/home-assistant/aarch64-hassio-audio:2021.07.0           "/init"                  53 minutes ago   Up 53 minutes                                           hassio_audio
33bd8399ed1e   ghcr.io/home-assistant/aarch64-hassio-dns:2021.06.0             "/init"                  53 minutes ago   Up 53 minutes                                           hassio_dns
a518cdd419f7   ghcr.io/home-assistant/aarch64-hassio-cli:2021.12.0             "/init /bin/bash -c …"   53 minutes ago   Up 53 minutes                                           hassio_cli
0eeceaf39f53   homeassistant/aarch64-hassio-supervisor:latest                  "/init"                  16 hours ago     Up 53 minutes                                           hassio_supervisor
27b1c220a9e0   ghcr.io/home-assistant/raspberrypi4-64-homeassistant:2022.2.9   "/init"                  11 days ago      Up 53 minutes                                           homeassistant
c87217239505   ghcr.io/home-assistant/aarch64-hassio-observer:2021.10.0        "/init"                  11 days ago      Up 54 minutes   0.0.0.0:4357->80/tcp, :::4357->80/tcp   hassio_observer
# docker exec -it addon_a0d7b954_esphome /bin/bash
root@a0d7b954-esphome:/# esphome compile project.yaml

If you installed esphome manually on top of raspbian, how do you start your esphome docker image (you have e.g. to expose dashboard port/6052 to make it visible outside of its container) ?

@AquaMCU
Copy link

AquaMCU commented Apr 14, 2022

Hi. I have the same issue.
I am running esphome in docker-compose on Raspberian
When I compile the software manually in the container, I basically get the same issue. so I searched for the stensa binaries and found them ( See linsting below) I can see the binary (xtensa-lx106-elf-g++ marked as executabele. When I run it it says binary not found (see log). Info: When I cat the file, I see binary jibberish on the console.

LOG:
root@c8f08395a591:/config/.esphome/platformio/packages/toolchain-xtensa/bin# ls
xtensa-lx106-elf-addr2line xtensa-lx106-elf-gcc-ar xtensa-lx106-elf-lto-dump
xtensa-lx106-elf-ar xtensa-lx106-elf-gcc-nm xtensa-lx106-elf-nm
xtensa-lx106-elf-as xtensa-lx106-elf-gcc-ranlib xtensa-lx106-elf-objcopy
xtensa-lx106-elf-c++ xtensa-lx106-elf-gcov xtensa-lx106-elf-objdump
xtensa-lx106-elf-c++filt xtensa-lx106-elf-gcov-dump xtensa-lx106-elf-ranlib
xtensa-lx106-elf-cc xtensa-lx106-elf-gcov-tool xtensa-lx106-elf-readelf
xtensa-lx106-elf-cpp xtensa-lx106-elf-gdb xtensa-lx106-elf-size
xtensa-lx106-elf-elfedit xtensa-lx106-elf-gdb-add-index xtensa-lx106-elf-strings
xtensa-lx106-elf-g++ xtensa-lx106-elf-gprof xtensa-lx106-elf-strip
xtensa-lx106-elf-gcc xtensa-lx106-elf-ld
xtensa-lx106-elf-gcc-10.3.0 xtensa-lx106-elf-ld.bfd
root@c8f08395a591:/config/.esphome/platformio/packages/toolchain-xtensa/bin# ./xtensa-lx106-elf-g++
bash: ./xtensa-lx106-elf-g++: No such file or directory
root@c8f08395a591:/config/.esphome/platformio/packages/toolchain-xtensa/bin#

@jpcornil-git
Copy link

jpcornil-git commented Apr 15, 2022

I guess you are also running a 64b kernel on a 32b system (and platformio will install a 64b toochain in that case, incompatible with the installed 32b system)

# Check kernel architecture (likely a 64b kernel)
uname -a 
# Check toolchain (likely a 32b ELF)
file /config/.esphome/platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-g++

-> Either patch get_systype as described above/here #1386 (comment) or run esphome prefixed with linux32 ("linux32 esphome compile ..." to fake uname/let it report a 32b kernel)

pcnetzwerke added a commit to pcnetzwerke/docker-tasmota-armv8 that referenced this issue Jul 31, 2022
@ssieb ssieb closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests