[notice] A new release of pip is available: 23.0.1 → 23.1
[notice] To update, run: pip install --upgrade pip
(hass) ~ $ hass -v
2023-04-17 12:57:53.419 INFO (MainThread) [homeassistant.bootstrap] Config directory: /data/data/com.termux/files/home/.homeassistant
Bad system call
@talss89 you are a genius sir. Your pkg i python-numpy did the trick. I also needed your detail about uninstalling & reinstalling lru-dict
In the end, I think this is a full list of the instructions I needed to get HomeAssistant set up based on @gj9159a post (I’m not sure if there is anything that is unnecessary in the end, but I’m pasting it here in case it helps others):
# set SELinux=Permissive
su
setenforce 0
apt update
apt upgrade
pkg install openssh
passwd #setting the password
sshd #go to kitty/putty on PC
termux-setup-storage #confirm on the device
pkg install tsu python nano termux-api make libjpeg-turbo make rust python-cryptography libcrypt libffi binutils mosquitto wget -y
pkg install git
pkg i python-numpy
python -m venv --without-pip hass
source hass/bin/activate
pip install wheel
pip install tzdata
pip install maturin
pip install setuptools
MATHLIB=m pip install aiohttp_cors==0.7.0
MATHLIB=m pip install numpy==1.24.2
MATHLIB=m pip install PyTurboJPEG==1.6.7
export RUSTFLAGS="-C lto=n"
export CARGO_BUILD_TARGET="$(rustc -Vv | grep "host" | awk '{print $2}')"
export CRYPTOGRAPHY_DONT_BUILD_RUST=1
pip download homeassistant==2023.2.3
wheel unpack homeassistant-2023.2.3-py3-none-any.whl
nano homeassistant-2023.2.3/homeassistant/package_constraints.txt
#We are looking for aiohttp and change its version to 3.8.3, as well as numpy to version 1.24.2, then press CTRL-X, Y, ENTER.
nano homeassistant-2023.2.3/homeassistant-2023.2.3.dist-info/METADATA
#We are looking for aiohttp and change its version to 3.8.3, press CTRL-X, Y, ENTER.
rm homeassistant-2023.2.3-py3-none-any.whl
wheel pack homeassistant-2023.2.3
pip uninstall lru-dict
pip install git+https://github.com/amitdev/lru-dict@5013406c409a0a143a315146df388281bfb2172d
pip install homeassistant-2023.2.3-py3-none-any.whl
pip install --upgrade pip
hass -v
#wait 5 minutes and restart the device
source hass/bin/activate #don't forget to activate the environment
hass -v #after a couple of minutes, you can try to log in
Great, so glad it worked out, and thank you for contributing your process, this is exactly what I needed!
I’m building a full Home Assistant Core .deb package with dh-virtualenv, so we can all leave this confusion behind and just install with pkg i homeassistant, so your process is really useful to see. I’ll review and merge with my build script.
There are known issues with network reconnects triggering an error loop (socket _accept_connection() error 22), and a discovery bug that relies on /etc/resolv.conf. I have patches for both in the pipeline, but for now you may want to use a restart automation.
Had this error, managed to fix it somehow (can’t remember how) and worked for several days without any issues. Today I restarted Termux and now I get this error again.
I can start with --safe-mode but nothing in the logs (no errors, no warnings, no failures)
EDIT:
I think I solved it. Try this:
pkg in proot
termux-chroot
source hass/bin/activate
hass -v
I’ve built an installer for HA Core on Android / Termux (ARM64). It’s alpha, but works on my LineageOS 19 rooted device, and on Termux / ARM64 machines in the cloud.
For anyone eager to try, there is a one-liner web install (although please be prepared for this to possibly break Termux entirely - this is not production ready):
Congratulations for the work Talss89!
Awesome works on my Samsung Tab S2 lineage os 18(homeassistant 2023.5.3)! I just have an error for ha-av how can I fix?
talss89, I express my great gratitude to you for the work done! This is exactly what was needed and was asking for! I hope you won’t abandon the script and will update it as much as possible, thank you!
Unfortunately I’ve had lot of issues with this recently. I use the tablet to launch another app to monitor cameras, and it looks like a recent update of this app introduced a memory leak.
And if your foreground app requests more and more memory, Android will terminate even the “wake lock” or “pinned” processes, it seems.
At least that’s what has happened to me for about a month, whenever I let this camera app run: Termux gets memory collected.