Open nmeachen opened 9 months ago
I stripped it back and it still fails, seems like only the arduino framework compiles on an aarch64 esphome container.
---
esphome:
name: family-room-echo
friendly_name: family-room-echo
project:
name: m5stack.atom-echo-voice-assistant
version: "1.0"
min_version: 2023.11.1
esp32:
board: m5stack-atom
framework:
type: esp-idf
logger:
api:
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: on
This is effectively the same error as #4992. If you don't attempt to override any of the versions it still does not compile. Seems like a container construction related problem as creating a pure Python environment directly in Ubuntu compiles this ESP-IDF project without any issues.
This issue seems to be caused by the value of PROJECT_CORE_DIR which in the container for my project is /config/config/.esphome/build/family-room-echo/"/"/.platformio
The embedded double-quotes in the path prevent the virtual environment from being created. If I patch /usr/local/lib/python3.11/dist-packages/platformio/builder/main.py to escape the double-quotes when creating the venv it gets past the pip not existing error but fails later on.
When comparing the container run to a local Python installation the .platformio and venv folder gets created directly off the folder where the dashboard is run from. In the container they are created under the device specific build folder
/config/config/.esphome/build/family-room-echo/\"/\"
Just for the people finding this issue because they wnat to protect the atoms device api with a password:
I did following workaround:
# creating VM
multipass launch -n esphome --disk 10G
multipass shell esphome
sudo apt update && sudo apt upgrade -y sudo apt install python3 -y sudo apt install python3-pip -y sudo apt install python3.10-venv
pip3 install wheel pip3 install esphome
exit mutlipass shell esphome
# create the atom-esphome-yaml:
nano atom.yaml
# -> paste in the code, add the api stuff you want (easily generate a api key with the web dashboard running in Docker)
api: encryption: key: "YOUR_API_KEY"
ota: password: "YOUR_OTA_PASSWORD"
# add to the wifi part the ip of your already install atom in you wifi:
# (change static_ip and gateway to your routers config)
wifi: on_connect:
## update your atom device via wifi:
esphome run atom.yaml
# optionally:
you can just save your atom.yaml file as a device in the esphome dashboard, so you can further use it when the docker container gets fixed.. ;)
This is not best practice, but it works.
This fixed a similar problem for me on Ubuntu 20.04:
sudo apt install python3.12-venv
The problem
Trying to compile the m5stack-atom voice assistant example using an aarch64-based container on a Raspberry Pi 4B running bookworm fails.
Which version of ESPHome has the issue?
ESPHome 2023.11.6
What type of installation are you using?
Docker
Which version of Home Assistant has the issue?
No response
What platform are you using?
ESP32-IDF
Board
m5stack-atom
Component causing the issue
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response