It did not give out any errors to you?
Did you use the whole tutorial as it is or did you use something else as well because the installation no matter how i try is not working for me. It is just bunch of errors at the best.
i am so unaware of the issue and looking desperately for a solution.
HI
I am also stuck with the same …while installing Home assistant I am getting error “Failed to build cryptography”
I tried to install cryptography , and checked but everything is ok but still no final outcome. So when cryptography was installed it gave some different error during build process…
I found that there is a error which is related with Build Process so it appears that the error is because of Build…but I don’t know how to proceed.
I tried installing it Micromax HS2 with android 7+ , Samsung Galazy On5 Pro with Android 7.01 after TWRP, and even tried it on Redmi 3s with Android 9 (wiper) with TWRP.
Pls suggest.Thanks
You need install rust
and cargo
first:
pip install rust
pip install cargo
run: rustc -vV | sed -n 's|host: ||p'
it returns target system, something like: armv7-linux-androideabi
copy it and set to cargo running: export CARGO_BUILD_TARGET=armv7-linux-androideabi
then run:
pip install cryptography==3.4.8 --no-binary cryptography
pip install homeassistant==2021.11.5
from homeassistant==2021.12.X
versions, needs cryptography==35.0.0
but install with this method fail. However installation succes for cryptography==36.0.0
which is incompatible with homeassistant==2021.12.X
if you want to upgrade from homeassistant==2021.11.5
you can overide cryptography==35.0.0
with cryptography==36.0.0
following method described above and modifiying cryptography line on package_constraints.txt
copiying from source code and creating a local file placed on /data/data/com.termux/files/home/homeassistant/package_constraints.txt
and running:
pip install --upgrade -c package_constraints.txt homeassistant
after first home assistant run, maybe you need install manually some packages
Of course while homeassistant need cryptography==35.0.0
you will need do this with every upgrade
Thanks for this excellent guide. Well done, it must have taken quite an effort.
I think using an old phone is an obvious route to go; as there are lots usually lying around unused. Throwing them out seems a big waste.
I had home assistant running on an old nexus a couple of years ago using a similar setup with Termux.
BUT, … as the phone was permanently on charge, the battery eventually failed and ruined the phone.
I’ll follow your guide for a future installation but next time put the charger behind a plug which only charges when the battery needs it.
dear Alex,
I followed your guideline. However I got a lot of error messages during the execution of the sequence of commands.
Finally given the hass -v command, but no results.
I bought a Samsung a7 lite. Are the commands shown also valid for the Tablet a7?
I hope you can help me any further.
Thx in advance.
Had some issues. This is how I installed it on Termux:
# If you get errors run: "termux-change-repo" and change the sources mirrors to ex. termux.me
pkg update
# Upgrade current packages
pkg upgrade -y
# Install required packages
pkg install nano openssh termux-api make libjpeg-turbo wget rust python -y
# Export build target for Rust
export CARGO_BUILD_TARGET="$(rustc -Vv | grep "host" | awk '{print $2}')"
# There's a bug where python 3.10 is being detected as lower than 3.6 (minimumn build version)
# Will cause error: cargo failed with code: 101
# Remove python 3.10 (But keep dependencies)
pkg remove python -y
# We have to install python 3.9.7, but we need to know the system architecture first
# Get your current architecture, based on that choose the next step
echo $CARGO_BUILD_TARGET
# Choose only one, based on the architecture you got (arm or aarch64)
# For arm
wget https://raw.githubusercontent.com/Termux-pod/termux-pod/main/arm/python/python-3.9.7/python_3.9.7_arm.deb
dpkg -i python_3.9.7_arm.deb
# For aarch64
wget https://raw.githubusercontent.com/Termux-pod/termux-pod/main/aarch64/python/python-3.9.7/python_3.9.7_aarch64.deb
dpkg -i python_3.9.7_aarch64.deb
# Upgrade pip
pip install --upgrade pip
# Install homeassistant
pip install wheel homeassistant
Still, lots of errors when starting hass which I’m trying to solve.
Can’t build numpy wheel for python 3.9.7 but success for python 3.10.2 likewise cant build cryptography==35.0.0 wheel for python 3.10.2 but succes for python 3.9.7
it’s desperate…
Looks like there was a new version of numpy the day after you posted this, have you tried it? https://github.com/numpy/numpy/releases/tag/v1.22.2
Not sure if it’s because of this, but I managed to build numpy 1.22.2 with python 3.9.7. Could be because of the aarch64 architecture, though.
This coupled with the previous help about cargo to build cryptography 35.0.0, I managed to get HA 2022.2 running on my Lenovo m10!
One thing though, for me it refused to start because of a missing component library: "libzstd.so.1" not found
. This caused “image” to not load, then person, then frontend, so basically nothing could launch.
I fixed this with installing it manually: pip install zstd
.
I still have to solve PyNaCl not building, so for now I don’t have mobile_app working. But at least the rest is fine.
Hope this helps.
I also can’t install numpy==1.22.2 with Python 3.9.7
For PyNaCl this worked for me:
(hass) ~ $ SODIUM_INSTALL=system pip install pynacl==1.4.0
Collecting pynacl==1.4.0
Using cached PyNaCl-1.4.0.tar.gz (3.4 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: six in ./hass/lib/python3.9/site-packages (from pynacl==1.4.0) (1.16.
Requirement already satisfied: cffi>=1.4.1 in ./hass/lib/python3.9/site-packages (from pynacl==1.4.0(1.15.0)
Requirement already satisfied: pycparser in ./hass/lib/python3.9/site-packages (from cffi>=1.4.1->pycl==1.4.0) (2.21)
Building wheels for collected packages: pynacl
Building wheel for pynacl (PEP 517) ... done
Created wheel for pynacl: filename=PyNaCl-1.4.0-cp39-cp39-linux_armv7l.whl size=191568 sha256=292bf96e7a90809d6aac71e41f678d8774980e134e34b16b7faf4f024d8947
Stored in directory: /data/data/com.termux/files/home/.cache/pip/wheels/3b/bb/4f/1cac0cbc50558d501046fb2942596ca9004b1055553856b8
Successfully built pynacl
Installing collected packages: pynacl
Successfully installed pynacl-1.4.0
Edit:
Finally i could install numpy on python 3.9.7 without building it. I Just downloading a wheel from piwheels.org for correct python version and system arch, and installing it locally using pip.
In spite of that wheel is for Bullseye and not for android, for the time being, hass starting and works fine except for some reason i cant run hass as daemon hass --daemon
it show error: unrecognized arguments: --daemon
. Then when i restart hass from hass ui the system not restart
About the --daemon, it’s because they decided it was not needed anymore as they cleaned up their main: https://github.com/home-assistant/core/pull/64345
I’m currently trying out daemonize, installed via pkg install daemonize
. Seems to work so far.
PyNaCl is not installing for me, something about missing sodium.h. I’ll have to check it further later.
Edit: Ok, a pkg install libsodium
helped with that one.
How did you do to get running home assistant as a daemon process?
I have already installed daemonize using pkg install daemonize
but i don’t know how configure it…
I didn’t configure anything really, I just launched the app with it (you need a full path):
daemonize /data/data/com.termux/files/home/hass/bin/hass
It seems to work so far, I haven’t really wondered more to be honest and I haven’t checked how it launched with the venv, I just did the usual source hass/bin/activate
before. Though I assume that if something was not on the venv it would have taken much longer to launch.
I am no able to instal numpy 1.22.2 with python 3.9.7 aarch64 in termux
[Errno 2] No such file or directory: 'aarch64-linux-android-ar'
error: Command "aarch64-linux-android-ar rcs build/temp.linux-aarch64-3.9/libnpymath.a build/temp.linux-aarch64-3.9/numpy/core/src/npymath/npy_math.o build/temp.linux-aarch64-3.9/build/src.linux-aarch64-3.9/numpy/core/src/npymath/ieee754.o build/temp.linux-aarch64-3.9/build/src.linux-aarch64-3.9/numpy/core/src/npymath/npy_math_complex.o build/temp.linux-aarch64-3.9/numpy/core/src/npymath/halffloat.o" failed with exit status 127
INFO:
########### CLIB COMPILER OPTIMIZATION ###########
INFO: Platform :
Architecture: aarch64
Compiler : clang
CPU baseline :
Requested : 'min'
Enabled : NEON NEON_FP16 NEON_VFPV4 ASIMD
Flags : none
Extra checks: none
CPU dispatch :
Requested : 'max -xop -fma4'
Enabled : ASIMDHP ASIMDDP
Generated : none
INFO: CCompilerOpt.cache_flush[817] : write cache to path -> /data/data/com.termux/files/usr/tmp/pip-install-aazs6vru/numpy_0ced138abad94b64af4403d88e3490be/build/temp.linux-aarch64-3.9/ccompiler_opt_cache_clib.py
----------------------------------------
ERROR: Failed building wheel for numpy
Not sure if clang has the issue
WARN: CCompilerOpt.generate_dispatch_header[2289] : dispatch header dir build/src.linux-aarch64-3.9/numpy/distutils/include does not exist, creating it
INFO: building 'npymath' library
INFO: compiling C sources
INFO: C compiler: aarch64-linux-android-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -ftrapping-math
Does anyone know the issue ? I am not able to get Hass last version up and running.
Does not work for me.
I can launch home assistant running :
1. source hass/bin/activate
2. daemonize /data/data/com.termux/files/home/hass/bin/hass
but same issue as
1. source hass/bin/activate
2. hass
On both the process does not run as daemon. When i reboot home assistant from UI, home assistant stops but not restart
Seems that daemonize
needs more arguments to work properly
Hi, has anyone been able to install the latest version with termux? what packages have you used (nexus 7) or what version of HASS and packages are correct? i am using LineageOs 18 (Android 11).
try
pkg install binutils
then install numpy again
Instead of daemonize use utilites from termux-services.
Install termux-services package:
pkg install termux-services
Edit ~/.termux/boot/start
There is my version:
#!/data/data/com.termux/files/usr/bin/sh
termux-wake-lock
runsvdir $PREFIX/var/service
Create service folder:
mkdir $PREFIX/var/service/hass
Create run file and make it executable:
touch $PREFIX/var/service/hass/run
chmod 700 $PREFIX/var/service/hass/run
Edit newly created run file:
#!/data/data/com.termux/files/usr/bin/sh
source ~/hass/bin/activate
exec /data/data/com.termux/files/home/hass/bin/hass 2>&1
That way you can all your startup scripts convert to services.
For example:
~ $ ls $PREFIX/var/service/
hass mosquitto sshd z2m
If you need, for some reason, stop one of services use:
sv down SERVICE
Disable/enable autorun service:
sv-disable SERVICE
sv-enable SERVICE
Tried what you mentioned but I’m getting “…the SSL module is not available”. Looks like the downgrade to python 3.9 messed up with SSL
I tried installing this for the first time and got this error
Encountered an error while trying to install package
-cffi
I tried installing cffi seperately,with no luck.
I have no experience in python,and would appreciate any help.
For the record, I’ve just updated to 2022.4.1 without issues on upgrade. That said, I got issues with PyNaCl when starting, not finding ld in the path for some reason:
checking for ld used by aarch64-linux-android-clang... no
Actually, after looking into it more, looks like it’s a known issue for clang: [Bug]: clang: ld: command not found · Issue #8191 · termux/termux-packages · GitHub
Installing binutils solves the issue for the time being:
pkg install binutils