Home Assistant Core on Android Tablet

Did you install rustup? I had that issue too on termux (sandboxed Linux app for Android), rustup doesn’t support termux based builds. I think I’d installed rust with my package manager, and then installed rustup on top of it (not good lol). Try doing rustup self uninstall and then install rust (if you haven’t already) through your normal package manager, then try again.

1 Like

Hello

So I managed to successfully install the recent version of HA on my Android11 tablet, without any errors.
However running the HA with hass -v gives me the following errors
Running HA in safe mode works fine.

Can someone please guide? Thanks in advance.



2022-10-10 21:30:19.962 ERROR (MainThread) [homeassistant.setup] [u]**[u]**Error during setup of component hardware**[/u]**[/u]
Traceback (most recent call last):
  File "/data/data/com.termux/files/home/hass/lib/python3.10/site-packages/homeassistant/setup.py", line 235, in _async_setup_component
    result = await task
  File "/data/data/com.termux/files/home/hass/lib/python3.10/site-packages/homeassistant/components/hardware/__init__.py", line 15, in async_setup
    await websocket_api.async_setup(hass)
  File "/data/data/com.termux/files/home/hass/lib/python3.10/site-packages/homeassistant/components/hardware/websocket_api.py", line 36, in async_setup
    ha_psutil=await hass.async_add_executor_job(ha_psutil.PsutilWrapper),
  File "/data/data/com.termux/files/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/data/data/com.termux/files/home/hass/lib/python3.10/site-packages/psutil_home_assistant/__init__.py", line 15, in __init__
    psutil_spec.loader.exec_module(psutil_module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/data/data/com.termux/files/home/hass/lib/python3.10/site-packages/psutil/__init__.py", line 42, in <module>
    from . import _common
  File "/data/data/com.termux/files/home/hass/lib/python3.10/site-packages/psutil/__init__.py", line 102, in <module>
    from . import _pslinux as _psplatform
  File "/data/data/com.termux/files/home/hass/lib/python3.10/site-packages/psutil/_pslinux.py", line 26, in <module>
    from . import _psutil_linux as cext
ImportError: dlopen failed: cannot locate symbol "ethtool_cmd_speed" referenced by "/data/data/com.termux/files/home/hass/lib/python3.10/site-packages/psutil/_psutil_linux.cpython-310.so"...
2022-10-10 21:30:19.986 INFO (MainThread) [homeassistant.setup] Setup of domain zone took 0.5 seconds
2022-10-10 21:30:19.994 INFO (MainThread) [homeassistant.setup] Setup of domain schedule took 0.5 seconds
2022-10-10 21:30:19.997 INFO (MainThread) [homeassistant.setup] Setup of domain input_text took 0.5 seconds
2022-10-10 21:30:20.027 INFO (MainThread) [homeassistant.setup] Setting up tts
2022-10-10 21:30:20.030 INFO (MainThread) [homeassistant.setup] Setting up sensor
2022-10-10 21:30:20.032 INFO (MainThread) [homeassistant.setup] Setup of domain sensor took 0.0 seconds
2022-10-10 21:30:20.050 INFO (MainThread) [homeassistant.setup] Setup of domain input_select took 0.5 seconds
2022-10-10 21:30:20.063 INFO (MainThread) [homeassistant.setup] Setup of domain input_boolean took 0.5 seconds
2022-10-10 21:30:20.065 INFO (MainThread) [homeassistant.setup] Setup of domain input_button took 0.5 seconds
2022-10-10 21:30:20.082 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.energy
2022-10-10 21:30:20.086 INFO (SyncWorker_2) [homeassistant.loader] Loaded notify from homeassistant.components.notify
2022-10-10 21:30:20.194 INFO (MainThread) [homeassistant.setup] Setting up mobile_app
2022-10-10 21:30:20.198 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.2 seconds
2022-10-10 21:30:20.202 INFO (MainThread) [homeassistant.setup] Setup of domain mobile_app took 0.0 seconds
2022-10-10 21:30:20.206 INFO (MainThread) [homeassistant.setup] Setting up notify
2022-10-10 21:30:20.207 INFO (MainThread) [homeassistant.setup] Setup of domain notify took 0.0 seconds
2022-10-10 21:30:20.214 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: hardware
[u]**2022-10-10 21:30:20.225 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: (DependencyError(...), 'Could not setup dependencies: hardware')**[/u]
2022-10-10 21:30:20.233 INFO (MainThread) [homeassistant.components.notify] Setting up notify.mobile_app
2022-10-10 21:30:40.029 ERROR (MainThread) [metno] Access to https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/2.0/complete returned error 'ClientConnectorError'
2022-10-10 21:30:40.040 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Home' for met integration not ready yet: Update failed: ; Retrying in background
2022-10-10 21:30:40.050 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 26.50s
2022-10-10 21:30:40.052 INFO (MainThread) [homeassistant.core] Starting Home Assistant
2022-10-10 21:30:40.082 INFO (MainThread) [homeassistant.components.zeroconf] Starting Zeroconf broadcast
CRITICAL: Can't open /proc/net/dev !
2022-10-10 21:30:41.977 CRITICAL (SyncWorker_0) [scapy.loading] Can't open /proc/net/dev !
CRITICAL: Can't open /proc/net/route !
2022-10-10 21:30:41.998 CRITICAL (SyncWorker_0) [scapy.loading] Can't open /proc/net/route !
CRITICAL: Can't open /proc/net/dev !
2022-10-10 21:30:42.006 CRITICAL (SyncWorker_0) [scapy.loading] Can't open /proc/net/dev !
2022-10-10 21:30:42.291 WARNING (SyncWorker_1) [pyroute2.netlink.rtnl.tcmsg.common] tcmsg: [Errno 13] Permission denied: '/proc/net/psched'
2022-10-10 21:30:42.307 WARNING (SyncWorker_1) [pyroute2.netlink.rtnl.tcmsg.common] the tc subsystem functionality is limited
2022-10-10 21:30:50.614 ERROR (MainThread) [homeassistant.components.homeassistant_alerts] Timeout fetching homeassistant_alerts data
2022-10-10 21:31:00.102 ERROR (MainThread) [metno] Access to https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/2.0/complete returned error 'ClientConnectorError'
^C2022-10-10 21:31:01.188 INFO (Recorder) [homeassistant.components.recorder.pool.RecorderPool] Pool recreatingte code here

In same point of install, stop with some errors:
Failed to find tool
Cargo build…
Failed building wheel for maturin…

… a very long log.
any tip?

Looks like the same error as in this message: Home Assistant Core on Android Tablet - #134 by snotfod

“A very long log” unfortunately does not help much when it comes to finding a solution. Unless you know what to find in the log and can provide it in your post, you’d have to post all the relevant log.

That said, @leofuscaldi reported issues in the cargo build and maturin failing, check if it’s the same error: Home Assistant Core on Android Tablet - #127 by leofuscaldi
He managed to work around it by doing a lot of things manually: Home Assistant Core on Android Tablet - #132 by leofuscaldi

With that in mind, this answer seem to suggest and easier way to deal with the issue, maybe you could try that: Home Assistant Core on Android Tablet - #135 by BeagleGreen

Hello,
i just created my account to be able to reply to this.
I highly recommend looking into the app Linux Deploy
I started with the suggested approach here but I struggled a lot with fixing all the compilation errors and it was very slow on my Samsung Galaxy S5. Also I forogt the wake lock and all the time my mobile CPU went to sleep. But in the end it was running. But other issues with the bluetooth and so on made me crazy so I started this evening with Linux Deploy and the Homeassistant Server is already running.
Long story short : Linux Deploy is worth a try.

I’m trying to install Home Assistant on a Samsung S2 tablet running LineageOs.
I’m following the instructions from Home Assistant Core on Android Tablet - #64 by deividAlfa excepted for Python version where I have followed the instructions from Home Assistant Core on Android Tablet - #96 by Gnoupi to run it on the latest version (I have 3.11). I’m getting some errors during “pip install wheel homeassistant” (see below). Would you know what could be wrong? The log is long so I have only copied the errors below.
Thank you


/////////////
creating build/temp.linux-armv7l-cpython-311/aiohttp 
arm-linux-androideabi-clang -mfloat-abi=softfp -mfpu=vfpv3-d16 -DNDEBUG -g -fwrapv -O3 -Wall -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb -fstack-protector-strong -O3 -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb -fstack-protector-strong -O3 -fPIC -I/data/data/com.termux/files/home/hass/include -I/data/data/com.termux/files/usr/include/python3.11 -c aiohttp/_websocket.c -o build/temp.linux-armv7l-cpython-311/aiohttp/_websocket.o
aiohttp/_websocket.c:198:12: fatal error: 'longintrepr.h' file not found       #include "longintrepr.h"
 ^~~~~~~~~~~~~~~              1 error generated. 
error: command '/data/data/com.termux/files/usr/bin/arm-linux-androideabi-clang' failed with exit code 1                                                                                                                [end of output]                                                                                                                                                                                                     note: This error originates from a subprocess, and is likely not a problem with pip.                        
ERROR: Failed building wheel for aiohttp     

/////////////
Compiling arrayvec v0.7.2                                                                               
error: could not compile `orjson` due to 2 previous errors  
💥 maturin failed 
Caused by: Failed to build a native library through cargo    
    
/////////////
  ERROR: Failed building wheel for cryptography    

/////////////
  ERROR: Failed building wheel for orjson     
             
/////////////
Failed to build aiohttp cryptography orjson
ERROR: Could not build wheels for aiohttp, cryptography, orjson, which is required to install pyproject.toml-based projects

For aiohttp, would be good to check which version is required. Looks like there are some issues with python 3.11 (note that I still have 3.10) which should be fixed, though only recently: https://github.com/aio-libs/aiohttp/issues/6600 So we might just have a requirement which is not up to date in HA.

Or you could try downgrading python to 3.10 for the time being, I suppose.

For the rest, it’s hard to say as the errors are missing the context and actual causes. For cryptography and orjson, there are several messages earlier about potential solutions. I haven’t tried them yet as I’m still running a 2022.8, so I can’t tell much more about them.

Thanks for your help. How can I downgrade to 3.10?

This message had decent steps for that, though I cannot find 3.10 in termux-pod, so the file will have to come from somewhere else (like an old version of termux).

After, if you’re anyway installing your own OS, you might want to follow the advice from this message Home Assistant Core on Android Tablet - #124 by fran6120 and just make it a docker deployment, which will save you from the hassle of the dependency hell. (not an option for me as I’m using a few android apps on my tablet which I cannot replace)

I had seen the same.
I have also tried to move back to 3.9.7 but I’m getting an SSL error.

I don’t want to replace LineageOs by another OS. My kids are using the tablet so I want to keep it an Android tablet.
Is this Docker solution possible with LineageOs?

I have tried to build Python 3.10.4 from source but without success :sleepy:

On termux you can install qemu, run an Alpine Linux image and install docker on it.

There are a few guides on web.
https://www.motoots.com/2021/03/running-docker-using-qemu-on-android.html
https://gist.github.com/oofnikj/e79aef095cd08756f7f26ed244355d62

I tried it on my OnePlus 5 running stock Android 10 and it works, but it takes a long time to boot up and feels slow (both host and guest) which is normal for a different architecture virtualized OS.


Welcome to Termux!

Community forum: https://termux.com/community
Gitter chat:     https://gitter.im/termux/termux
IRC channel:     #termux on libera.chat

Working with packages:

 * Search packages:   pkg search <query>
 * Install a package: pkg install <package>
 * Upgrade packages:  pkg upgrade

Subscribing to additional repositories:

 * Root:     pkg install root-repo
 * X11:      pkg install x11-repo

Report issues at https://termux.com/issues

~ $ cd alpine
qemu-system-x86_64 -machine q35 -m 2048 -smp cpus=4 -cpu qemu64 \
  -drive if=pflash,format=raw,read-only=on,file=$PREFIX/share/qemu/edk2-x86_64-code.fd \
  -netdev user,id=n1,hostfwd=tcp::8123-:8123,hostfwd=tcp::9000-:9000,hostfwd=tcp::6052-:6052,hostfwd=tcp::49154-:49154,hostfwd=tcp::61208-:61208,hostfwd=tcp::3218-:3218 \
  -device virtio-net,netdev=n1 \
  -nographic alpine_2.qcow2
BdsDxe: failed to load Boot0001 "UEFI QEMU DVD-ROM QM00005 " from PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x2,0xFFFF,0x0): Not Found
BdsDxe: loading Boot0002 "UEFI QEMU HARDDISK QM00001 " from PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0xFFFF,0x0)
BdsDxe: starting Boot0002 "UEFI QEMU HARDDISK QM00001 " from PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0xFFFF,0x0)
Welcome to GRUB!


Welcome to Alpine Linux 3.16
Kernel 5.15.78-0-virt on an x86_64 (/dev/ttyS0)

alpineop5 login: root
Password:
Welcome to Alpine!

The Alpine Wiki contains a large amount of how-to guides and general
information about administrating Alpine systems.
See <http://wiki.alpinelinux.org/>.

You can setup the system with the command: setup-alpine

You may change this message by editing /etc/motd.

alpineop5:~# docker ps
CONTAINER ID   IMAGE                                          COMMAND                  CREATED          STATUS                             PORTS                                                           NAMES
b302dadea6a2   ghcr.io/home-assistant/home-assistant:latest   "/init"                  44 minutes ago   Up 2 minutes                                                                                       homeassistant
e59c38ef7d00   causticlab/hass-configurator-docker:latest     "/app/run.sh"            51 minutes ago   Up 13 seconds                      0.0.0.0:3218->3218/tcp, :::3218->3218/tcp                       configurador-hass-configurator-1
a37544f8da52   esphome/esphome                                "/entrypoint.sh dash…"   5 hours ago      Up 2 minutes                                                                                       esphome
b7ea2ae49547   filebrowser/filebrowser:latest                 "/filebrowser --noau…"   5 hours ago      Up 13 seconds (health: starting)   0.0.0.0:49154->80/tcp, :::49154->80/tcp                         archivos-filebrowser-1
645d8e7d288e   portainer/portainer-ce:latest                  "/portainer"             5 hours ago      Up 58 seconds                      8000/tcp, 9443/tcp, 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp   portainer
alpineop5:~#

Thank you for your message. I’m not convinced by this solution…

What didn’t work? Were you able to compile Python and set it up correctly?

During make -j 8 I’m getting this error:

if (!_Py_InIntegralTypeRange(_PyTime_t, d)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./Include/pymath.h:228:82: note: expanded from macro ‘_Py_InIntegralTypeRange’ #define _Py_InIntegralTypeRange(type, v) (_Py_IntegralTypeMin(type) <= v && v <= _Py_IntegralTypeMax(type)) ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~ ./Include/pymath.h:221:124: note: expanded from macro ‘_Py_IntegralTypeMax’ #define _Py_IntegralTypeMax(type) ((_Py_IntegralTypeSigned(type)) ? (((((type)1 << (sizeof(type)*CHAR_BIT - 2)) - 1) << 1) + 1) : ~(type)0) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ Python/bootstrap_hash.c:141:17: error: call to undeclared function ‘getrandom’; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] n = getrandom(dest, n, flags); ^ Python/bootstrap_hash.c:145:17: error: call to undeclared function ‘getrandom’; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] n = getrandom(dest, n, flags); ^ 2 errors generated. make[3]: *** [Makefile:1855: Python/bootstrap_hash.o] Error 1 make[3]: *** Waiting for unfinished jobs…

I have 3 possibilities. None of the following versions of python is working for me but i would like to concentrate my efforts on one of them. I’m wondering which one.
Version 3.9.7: I had SSL error.
Version 3.10.4 build from source : I had an error in ‘getrandom’
Version 3.11 I had an error due to longintrep.h

I’m tempted to go with 3.11…

I have chosen to try again the installation with python 3.11. So I had again the error due to “longintrep.h”.
I have found an interesting solution here:

I have created the file requirements.txt with:
pip3 freeze > requirements.txt

I have then edited the versions indicated in the requirements.txt file (aiohttp, yarl, frozenlist) and then used:
pip install -r requirements.txt

Finally I used:

pip install wheel -r requirements.txt
pip install homeassistant -r requirements.txt

I don’t have anymore the error due to “longintrep.h” but I have stopped the installation because I have a version conflict.
I have described it here: Dependency on AIOHTTP

Here is the content of my requirements.txt file:

(hass) ~ $ cat requirements.txt                                                                             
aiohttp==3.8.2                                                                                              
aiosignal==1.3.1                                                                                          
async-timeout==4.0.2                                                                                        
attrs==21.2.0
certifi==2022.9.24                                                                                 
charset-normalizer==2.1.1                                                                                   
docopt==0.6.2
frozenlist==1.3.1                                                                                           
homeassistant==2022.11.4                                                                                    
idna==3.4                                                                                                   
multidict==5.2.0
numpy==1.23.4                                                                                               
pipreqs==0.4.11
requests==2.28.1
tzdata==2022.6
urllib3==1.26.13                                                                                            
wheel==0.38.4                                                                                               
yarg==0.1.9                                                                                                 
yarl==1.8.1

Hi! I’ve just try for the first time to do this and i have no basic on programming or python & Co. i use a old nexus 7 (2012) tablet for this and i have some issue with Homeassistant. I try all day to install this 2 components make me mad. all other thing is alredy installed ( and also here i have some hard time to resolve the issue)

i read a lot of threads but i can’t find the way to go.
i already apologized if there is some errors in my sentences but is not my first language.

Thanks

Hi all, after installing HA it is not possible to start it… I have python 3.11. This is my error massage.
(hass) ~ $ hass -v Traceback (most recent call last): File "/data/data/com.termux/files/home/hass/bin/hass", line 5, in <module> from homeassistant.__main__ import main File "/data/data/com.termux/files/home/hass/lib/python3.11/site-packages/homeassistant/__main__.py", line 19 from homeassistant.util.async import run_callback_threadsafe ^^^^^ SyntaxError: invalid syntax (hass) ~ $ hass -v Traceback (most recent call last): File "/data/data/com.termux/files/home/hass/bin/hass", line 5, in <module> from homeassistant.__main__ import main File "/data/data/com.termux/files/home/hass/lib/python3.11/site-packages/homeassistant/__main__.py", line 19 from homeassistant.util.async import run_callback_threadsafe ^^^^^ SyntaxError: invalid syntax

Hope you can help me.