Closed donburch888 closed 1 year ago
See #48
@catalin2402
Please run Python and type:
import platform
print(platform.machine())
Its in my Raspberry Pi 4 with fresh install of Raspberry Pi OS Lite.
pi@raspi4:~ $ python
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> print(platform.machine())
aarch64
>>>
Ok, It's a 64 bit ARM installation, the toolchains are using the x86 executables for compilation, but Debian/ Raspberry PI OS doesn't allow them to run by default. If you want to compile using this machine to the following thing:
dpkg --add-architecture armhf
apt-get update
apt-get install -y libc6:armhf
PS: Only Beken can be compiled on ARM platforms. I didn't found the corect toolchain for Realtek yet
I'm not wedded to using the RasPi 4 for this - just seemed an easy virtual machine.
I can setup a VM on my intel i7 desktop PC running Ubuntu to do the ESPHome builds, if that would be better/easier. Or would it be feasible to install LibreTuya-esphome on my HAOS machine (a DELL intel i5 pc) instead of ESPHome ?
you can install the Libretuya-ESPHome addon as a Home Assistant addon, you don't have to uninstall the original one (Libretuya-ESPHome is a separate addon). Libretuya-ESPHome Addon is not updated with the latest additions from ESPHome base repository, but it should work anyway
I wonder how could we make PIO toolchains a little bit less of a mess.
Btw. X86 strictly refers to Intel/AMD CPUs, 32 bit ARM is not x86.
Yes, I know, I don't know why I'm always refering to arm 32 bit as x86 :)
Hi, I have similar problem:
INFO Reading configuration /config/sw09.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing sw09 (board: wr2; framework: arduino; platform: https://github.com/kuba2k2/libretuya.git)
--------------------------------------------------------------------------------
HARDWARE: RTL8710BN 125MHz, 256KB RAM, 788KB Flash
- framework-arduino-api @ 3.0.0-a4cbfc+sha.3a4cbfc
- framework-realtek-amb1 @ 750.0.0-b0bc+sha.750b0bc
- library-flashdb@03500fa @ 3500.0.0-fa+sha.03500fa
- library-lwip@2.1.3-amb1 @ 2.1.3-amb1+sha.5d6edaa
- library-printf@6.0.0 @ 6.0.0+sha.8b831c1
- tool-ltchiptool @ 2.0.2+sha.7559033
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
No dependencies
Compiling .pioenvs/sw09/src/esphome/components/binary_sensor/automation.cpp.o
sh: 1: arm-none-eabi-g++: not found
Compiling .pioenvs/sw09/src/esphome/components/binary_sensor/binary_sensor.cpp.o
sh: 1: arm-none-eabi-g++: not found
Compiling .pioenvs/sw09/src/esphome/components/binary_sensor/filter.cpp.o
sh: 1: arm-none-eabi-g++: not found
*** [.pioenvs/sw09/src/esphome/components/binary_sensor/automation.cpp.o] Error 127
*** [.pioenvs/sw09/src/esphome/components/binary_sensor/binary_sensor.cpp.o] Error 127
*** [.pioenvs/sw09/src/esphome/components/binary_sensor/filter.cpp.o] Error 127
Compiling .pioenvs/sw09/src/esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp.o
sh: 1: arm-none-eabi-g++: not found
*** [.pioenvs/sw09/src/esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp.o] Error 127
========================== [FAILED] Took 0.83 seconds ==========================
root@7c8d873a83a4:/config# python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> print(platform.machine())
x86_64
It is failing only on RT platform, Beken is fine. I'm running Docker image esphome/esphome-amd64:libretuya
Little bit more info: Libretuya installs 32bit version of the toolchain:
root@docker:/home/ziss/esphome-libretuya/.esphome/platformio/packages/toolchain-gccarmnoneeabi/bin# file ./arm-none-eabi-c++
./arm-none-eabi-c++: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.8, stripped
But docker image does not have 32bit version libc. Running this inside the docker fixes the problam:
apt-get install lib32z1
@dkaukov Check this PR to make it work in docker: https://github.com/kuba2k2/libretuya-esphome/pull/5
👍 LGTM
you can install the Libretuya-ESPHome addon as a Home Assistant addon
I assume that requires adding "https://github.com/kuba2k2/libretuya-esphome" as a repository either in HA Add-ons or in HACS ... but neither of these work. for me.
In https://docs.libretuya.ml/docs/projects/esphome/#find-your-devices-board under Download ESPHome and GUI it gives CLI commands. I am using HAOS, with "Terminal and SSL add-on". Do I enter these at this terminal (which I believe is in the HA container); at the machine's HAOS console, or where ?
No, this "GUI" guide is not for the HA addon, but standalone container with the ESPHome dashboard. The HA addon was linked above.
Got it !
For any other newbies trying to follow this, the relevant post was
If you want to test, just add https://github.com/felipecrs/libretuya-esphome-hass-addon to your HA Addon Store and install it. It should work.
My first LibreTuya-ESPHome compile...
Simple initial configuration for my Arlec PC191HA power points (uses WB2S module) is
gives
Am I missing something obvious here ?