Install Home Assistant, Mosquitto broker and Node-Red on android

Than only solution is some app but you already done that. Or android box with ethernet.

1 Like

You could try to use ping sensor in HA and ping your router. Maybe phone won’t shutdown wifi if there is some trafic. It’s long shot but you can try it.

binary_sensor:
  - platform: ping
    host: 192.168.1.1
    count: 2
    scan_interval: 30

Sorry about the delay in replying. After investigation, I suspect my network was causing thr problem. In typical nooby fashion, I twiddled about with parameters I have no idea what they do and it seems to be working ok now…

Hey vladosam, thanks for your help, my HA instance is running fine on my android TV box. Now I’m trying to make ssl work, loosely following this guide:

But whenever I get to step 4 => getting the SSL certificate with this (email and URL is changed of course…):

$ ./certbot-auto certonly --standalone --preferred-challenges http-01 --email [email protected] -d examplehome.duckdns.org

I receive the following error and no letsencrypt dir is created:

bash: ./certbot-auto no such file or directory

Certbot-auto is there and its permissions are correct. I tried a lots of things to fix it, but came to a full stop.

Any pointers?

I just tried to run certbot-auto and it starts ok. Are you in the right folder when run certobot-auto from tutorial it should be certobot. Type pwd in termux to see where you are.

I’m in
/data/data/com.termux/files/home/certbot

I realy don’t know why you can’t run this. Type bash then cert and press tab to auto fill. Don’t add any more arguments.

Now it says:

“sudo” is not available, will use “su” for installation steps…
Requesting to rerun certbot-auto with root privileges…
tmp-mksh: certbot-auto: not found

(“tmp-mksh” used to be “bash”, but I tried some su commands, but first it was “bash”)

My phone is not rooted so i can’t help you with this. Termux is not average linux disto i’m not shure you can do this in termux. Try with google.

Having this same issue (brand new user). How would one install venv with an old python version? Does this fix the issue?

What is your python version? If you installed homeassistant in python3.6 and than upgraded to 3.7, uninstall and then install it again.

Just trying to do a first-time install so I get 3.7 why I pkg install python

Then just install homeassistant in venv. https://www.home-assistant.io/docs/installation/virtualenv/

Ok, I’ll give this a shot. This is known to fix discovery issue ( AttributeError: undefined symbol: getifaddrs)?

Just try. I never saw that issue.

Hmm, still getting the issue. Made a totally clean termux and followed instructions to the letter. Getting the same behavior in the virtualenv:

i`2019-01-14 16:50:59 INFO (MainThread) [homeassistant.core] Starting Home Assistant

2019-01-14 16:50:59 INFO (MainThread) [homeassistant.core] Timer:starting
2019-01-14 16:51:00 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/data/data/com.termux/files/home/homeassistant/lib/python3.7/site-packages/homeassistant/components/discovery.py”, line 178, in scan_devices
results = await hass.async_add_job(_discover, netdisco)
File “/data/data/com.termux/files/usr/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/data/data/com.termux/files/home/homeassistant/lib/python3.7/site-packages/homeassistant/components/discovery.py”, line 206, in _discover
netdisco.scan()
File “/data/data/com.termux/files/home/homeassistant/lib/python3.7/site-packages/netdisco/discovery.py”, line 57, in scan
self.mdns.start()
File “/data/data/com.termux/files/home/homeassistant/lib/python3.7/site-packages/netdisco/mdns.py”, line 23, in start
self.zeroconf = zeroconf.Zeroconf()
File “/data/data/com.termux/files/home/homeassistant/lib/python3.7/site-packages/zeroconf.py”, line 1724, in init
interfaces = normalize_interface_choice(interfaces)
File “/data/data/com.termux/files/home/homeassistant/lib/python3.7/site-packages/zeroconf.py”, line 1655, in normalize_interface_choice
return get_all_addresses()
File “/data/data/com.termux/files/home/homeassistant/lib/python3.7/site-packages/zeroconf.py”, line 1645, in get_all_addresses
for iface in ifaddr.get_adapters()
File “/data/data/com.termux/files/home/homeassistant/lib/python3.7/site-packages/ifaddr/_posix.py”, line 44, in get_adapters
retval = libc.getifaddrs(ctypes.byref(addr))
File “/data/data/com.termux/files/usr/lib/python3.7/ctypes/init.py”, line 369, in getattr
func = self.getitem(name)
File “/data/data/com.termux/files/usr/lib/python3.7/ctypes/init.py”, line 374, in getitem
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: undefined symbol: getifaddrs
`

I just upgrade all termux packages to latest and also hass to 0.85.1. And no AttributeError: undefined symbol: getifaddrs error. What is your pip version in venv? Upgrade it to latest. Activate venv and run

pip install --upgrade pip

Then restart hass. Also run pkg list-installed to see what packages are installed on your system.

Thanks a ton for your help. I removed Termux data and started over from scratch. The problem persists. Here is exactly what I did starting with fresh Termux:

----------- From Phone (Installed Termux and Termux:API) -----------
pkg update
pkg upgrade
termux-setup-storage
pkg install open ssh
ssh-keygen
cd $HOME/.ssh
cat id_rsa.pub >> authorized_keys
chmod 700 $HOME/.ssh/*
cp id_rsa /sdcard
sshd

----------- From SSH -----------
pkg install python python-dev coreutils nano ndk-stl clang mosquitto nodejs termux-api libffi-dev openssl-dev
python -m venv homeassistant
cd homeassitant
source bin/activate
pip install --upgrade pip
python -m pip install wheel
python -m pip install homeassistant
hass

----------- pkg list-installed -----------
Listing… Done
apt/stable,now 1.4.8-8 aarch64 [installed]
bash/stable,now 4.4.23-3 aarch64 [installed]
binutils/stable,now 2.31.1-3 aarch64 [installed,automatic]
busybox/stable,now 1.29.3-1 aarch64 [installed]
c-ares/stable,now 1.15.0 aarch64 [installed,automatic]
ca-certificates/stable,now 20181205 all [installed]
clang/stable,now 7.0.1 aarch64 [installed]
command-not-found/stable,now 1.36 aarch64 [installed]
coreutils/stable,now 8.30-1 aarch64 [installed]
dash/stable,now 0.5.10.2-1 aarch64 [installed]
dpkg/stable,now 1.19.2 aarch64 [installed]
gdbm/stable,now 1.18.1 aarch64 [installed,automatic]
gpgv/stable,now 2.2.12 aarch64 [installed]
krb5/stable,now 1.16.2 aarch64 [installed,automatic]
ldns/stable,now 1.7.0-5 aarch64 [installed,automatic]
libandroid-glob/stable,now 0.4 aarch64 [installed,automatic]
libandroid-support/stable,now 22 aarch64 [installed]
libandroid-support-dev/stable,now 22 aarch64 [installed,automatic]
libbz2/stable,now 1.0.6-1 aarch64 [installed]
libc++/stable,now 18 aarch64 [installed]
libcrypt/stable,now 0.2-1 aarch64 [installed,automatic]
libcrypt-dev/stable,now 0.2-1 aarch64 [installed,automatic]
libcurl/stable,now 7.63.0 aarch64 [installed]
libdb/stable,now 6.2.32 aarch64 [installed,automatic]
libedit/stable,now 20181209-3.1-0 aarch64 [installed,automatic]
libffi/stable,now 3.2.1-2 aarch64 [installed,automatic]
libffi-dev/stable,now 3.2.1-2 aarch64 [installed]
libgcrypt/stable,now 1.8.4 aarch64 [installed]
libgpg-error/stable,now 1.33 aarch64 [installed]
libicu/stable,now 63.1 aarch64 [installed,automatic]
libllvm/stable,now 7.0.1 aarch64 [installed,automatic]
liblzma/stable,now 5.2.4 aarch64 [installed]
libmosquitto/stable,now 1.5.5 aarch64 [installed,automatic]
libnghttp2/stable,now 1.35.1 aarch64 [installed]
libsqlite/stable,now 3.25.3 aarch64 [installed,automatic]
libutil/stable,now 0.3 aarch64 [installed,automatic]
libuuid/stable,now 1.0.3-2 aarch64 [installed,automatic]
mosquitto/stable,now 1.5.5 aarch64 [installed]
nano/stable,now 3.2 aarch64 [installed]
ncurses/stable,now 6.1.20181117 aarch64 [installed]
ncurses-ui-libs/stable,now 6.1.20181117 aarch64 [installed,automatic]
ndk-stl/stable,now 18-4 aarch64 [installed]
ndk-sysroot/stable,now 18-8 aarch64 [installed,automatic]
nodejs/stable,now 11.6.0 aarch64 [installed]
openssh/stable,now 7.9p1-2 aarch64 [installed]
openssl/stable,now 1.1.1a aarch64 [installed]
openssl-dev/stable,now 1.1.1a aarch64 [installed]
python/stable,now 3.7.2 aarch64 [installed]
python-dev/stable,now 3.7.2 aarch64 [installed]
readline/stable,now 7.0.5-1 aarch64 [installed]
termux-am/stable,now 0.2 all [installed]
termux-api/stable,now 0.38 aarch64 [installed]
termux-auth/stable,now 1.1 aarch64 [installed,automatic]
termux-exec/stable,now 0.3 aarch64 [installed]
termux-tools/stable,now 0.59 all [installed]

These are my installed packages on android 7.


apt/stable,now 1.4.8-8 arm [installed]
autoconf/stable,now 2.69 all [installed]
bash/stable,now 4.4.23-3 arm [installed]
binutils/stable,now 2.31.1-3 arm [installed]
boost/stable,now 1.69.0 arm [installed]
busybox/stable,now 1.29.3-1 arm [installed]
c-ares/stable,now 1.15.0 arm [installed,automatic]
ca-certificates/stable,now 20181205 all [installed,automatic]
clang/stable,now 7.0.1 arm [installed]
cmake/stable,now 3.13.2 arm [installed]
cmake-curses-gui/stable,now 3.13.2 arm [installed]
command-not-found/stable,now 1.36 arm [installed]
coreutils/stable,now 8.30-1 arm [installed]
curl/stable,now 7.63.0 arm [installed]
dash/stable,now 0.5.10.2-1 arm [installed]
dirmngr/stable,now 2.2.12 arm [installed]
dpkg/stable,now 1.19.2 arm [installed]
ffmpeg/stable,now 4.1 arm [installed,automatic]
fftw/stable,now 3.3.8 arm [installed,automatic]
fontconfig/stable,now 2.13.1-1 arm [installed,automatic]
freetype/stable,now 2.9.1-1 arm [installed,automatic]
fribidi/stable,now 1.0.5 arm [installed,automatic]
gcc-7/termux,now 7.4.0 arm [installed]
gcc-8/termux,now 8.2.0-6 arm [installed]
gdbm/stable,now 1.18.1 arm [installed,automatic]
git/stable,now 2.20.1 arm [installed]
glib/stable,now 2.58.2 arm [installed,automatic]
gnupg/stable,now 2.2.12 arm [installed]
gpgv/stable,now 2.2.12 arm [installed]
gst-plugins-base/stable,now 1.14.4 arm [installed,automatic]
gstreamer/stable,now 1.14.4 arm [installed,automatic]
harfbuzz/stable,now 2.3.0 arm [installed,automatic]
htop/stable,now 2.2.0-1 arm [installed]
imagemagick/stable,now 7.0.8.23 arm [installed,automatic]
jsoncpp/stable,now 1.8.4-1 arm [installed,automatic]
krb5/stable,now 1.16.2 arm [installed,automatic]
ldns/stable,now 1.7.0-5 arm [installed,automatic]
less/stable,now 530-2 arm [installed,automatic]
libandroid-glob/stable,now 0.4 arm [installed,automatic]
libandroid-support/stable,now 22 arm [installed]
libandroid-support-dev/stable,now 22 arm [installed,automatic]
libarchive/stable,now 3.3.3-1 arm [installed,automatic]
libassuan/stable,now 2.5.2 arm [installed,automatic]
libbz2/stable,now 1.0.6-1 arm [installed,automatic]
libc++/stable,now 18 arm [installed]
libcairo/stable,now 1.16.0 arm [installed,automatic]
libcrypt/stable,now 0.2-1 arm [installed,automatic]
libcrypt-dev/stable,now 0.2-1 arm [installed]
libcurl/stable,now 7.63.0 arm [installed,automatic]
libdb/stable,now 6.2.32 arm [installed,automatic]
libedit/stable,now 20181209-3.1-0 arm [installed,automatic]
libexpat/stable,now 2.2.6 arm [installed,automatic]
libffi/stable,now 3.2.1-2 arm [installed,automatic]
libffi-dev/stable,now 3.2.1-2 arm [installed]
libgcrypt/stable,now 1.8.4 arm [installed,automatic]
libgfortran5/termux,now 8.2.0-6 arm [installed,automatic]
libgmp/stable,now 6.1.2-1 arm [installed,automatic]
libgnutls/stable,now 3.5.19 arm [installed,automatic]
libgpg-error/stable,now 1.33 arm [installed,automatic]
libgraphite/stable,now 1.3.13 arm [installed,automatic]
libicu/stable,now 63.1 arm [installed,automatic]
libidn2/stable,now 2.0.5-1 arm [installed,automatic]
libisl/stable,now 0.20 arm [installed,automatic]
libjasper/stable,now 2.0.14 arm [installed]
libjpeg-turbo/stable,now 1.5.3 arm [installed,automatic]
libjpeg-turbo-dev/stable,now 1.5.3 arm [installed]
libksba/stable,now 1.3.5-1 arm [installed,automatic]
libllvm/stable,now 7.0.1 arm [installed,automatic]
liblua/stable,now 5.3.5 arm [installed,automatic]
liblzma/stable,now 5.2.4 arm [installed]
libmosquitto/stable,now 1.5.5 arm [installed,automatic]
libmp3lame/stable,now 3.100 arm [installed,automatic]
libmpc/stable,now 1.1.0 arm [installed,automatic]
libmpfr/stable,now 4.0.1-1 arm [installed,automatic]
libnettle/stable,now 3.4.1 arm [installed,automatic]
libnghttp2/stable,now 1.35.1 arm [installed,automatic]
libnpth/stable,now 1.6 arm [installed,automatic]
libogg/stable,now 1.3.3 arm [installed,automatic]
libopus/stable,now 1.3 arm [installed,automatic]
libpcap/stable,now 1.9.0 arm [installed,automatic]
libpixman/stable,now 0.36.0 arm [installed,automatic]
libpng/stable,now 1.6.36 arm [installed,automatic]
libpng-dev/stable,now 1.6.36 arm [installed]
libprotobuf/stable,now 3.6.1 arm [installed]
libsodium/stable,now 1.0.17 arm [installed,automatic]
libsoxr/stable,now 0.1.3 arm [installed,automatic]
libsqlite/stable,now 3.25.3 arm [installed,automatic]
libssh2/stable,now 1.8.0-1 arm [installed,automatic]
libtalloc/stable,now 2.1.14 arm [installed,automatic]
libtiff/stable,now 4.0.10-1 arm [installed,automatic]
libunistring/stable,now 0.9.10 arm [installed,automatic]
libutil/stable,now 0.3 arm [installed,automatic]
libuuid/stable,now 1.0.3-2 arm [installed,automatic]
libuv/stable,now 1.24.1 arm [installed,automatic]
libvorbis/stable,now 1.3.6 arm [installed,automatic]
libvpx/stable,now 1.7.0-1 arm [installed,automatic]
libwebp/stable,now 1.0.1 arm [installed]
libx264/stable,now 20180211 arm [installed,automatic]
libx265/stable,now 2.9 arm [installed,automatic]
libxml2/stable,now 2.9.9 arm [installed,automatic]
libzmq/stable,now 4.2.5-1 arm [installed]
libzmq-dev/stable,now 4.2.5-1 arm [installed]
littlecms/stable,now 2.9 arm [installed,automatic]
m4/stable,now 1.4.18 arm [installed,automatic]
make/stable,now 4.2.1-2 arm [installed]
mosh/stable,now 1.3.2-7 arm [installed]
mosquitto/stable,now 1.5.5 arm [installed]
nano/stable,now 3.2 arm [installed]
ncurses/stable,now 6.1.20181117 arm [installed]
ncurses-ui-libs/stable,now 6.1.20181117 arm [installed,automatic]
ndk-stl/stable,now 18-4 arm [installed]
ndk-sysroot/stable,now 18-8 arm [installed,automatic]
net-tools/stable,now 1.60.2017.02.21-1 arm [installed]
netcat/stable,now 7.70-2 arm [installed,automatic]
ninja/stable,now 1.8.2-1 arm [installed]
nmap/stable,now 7.70-2 arm [installed]
nodejs-lts/stable,now 10.15.0 arm [installed]
numpy/termux,now 1.15.4 arm [installed]
openblas/termux,now 0.3.5 arm [installed,automatic]
opencv/termux,now 4.0.0 arm [installed]
openjpeg/stable,now 2.3.0-1 arm [installed,automatic]
openssh/stable,now 7.9p1-2 arm [installed]
openssl/stable,now 1.1.1a arm [installed,automatic]
openssl-dev/stable,now 1.1.1a arm [installed]
openssl-tool/stable,now 1.1.1a arm [installed]
pango/stable,now 1.42.4 arm [installed,automatic]
pcre/stable,now 8.42 arm [installed,automatic]
pcre2/stable,now 10.32 arm [installed,automatic]
perl/stable,now 5.28.1 arm [installed]
pinentry/stable,now 1.1.0 arm [installed,automatic]
pkg-config/stable,now 0.29.2 arm [installed]
proot/stable,now 5.1.107-18 arm [installed]
python/stable,now 3.7.2 arm [installed]
python-dev/stable,now 3.7.2 arm [installed]
python2/stable,now 2.7.15-4 arm [installed]
readline/stable,now 7.0.5-1 arm [installed]
resolv-conf/stable,now 1.1 arm [installed,automatic]
rhash/stable,now 1.3.7 arm [installed,automatic]
sed/stable,now 4.7 arm [installed]
setup-scripts/termux,now 2.6.2 all [installed,automatic]
termux-am/stable,now 0.2 all [installed,automatic]
termux-api/stable,now 0.37 arm [installed]
termux-auth/stable,now 1.1 arm [installed,automatic]
termux-elf-cleaner/stable,now 1.2 arm [installed]
termux-exec/stable,now 0.3 arm [installed,automatic]
termux-tools/stable,now 0.59 all [installed]
tsu/stable,now 2.0 all [installed]
wget/stable,now 1.20.1 arm [installed]
xvidcore/stable,now 1.3.5 arm [installed,automatic]
zbar/stable,now 0.10-6 arm [installed]

ok, I’m going to tear down the venv, install all the packages you have, and then try again.