2024年11月21日星期四 下午7:15:54

Installing Home Assistant Core on Raspberry Pi 3B+ step by step (2022.11.2)

2 年 前
#17712 引用
check - Checklist


which python3      /srv/homeassistant/bin/python3
which pip3
which pip3           /srv/homeassistant20221103/bin/pip3
pip3 --version       pip 22.0.3 from /srv/homeassistant/lib/python3.9/site-packages/pip (python 3.9)



install a required Python package

homeassistant20221102@raspberrypi:/root $ python3 -m pip install wheel


output
Successfully installed wheel-0.38.4




which wheel  -  /srv/homeassistant20230103/bin/wheel

wheel version  -  wheel 0.38.4


0
2 年 前
#17713 引用
install homeassistant  core


homeassistant20221102@raspberrypi:/root $ pip3 install homeassistant


output

Downloading https://www.piwheels.org/simple/homeassistant/homeassistant-2022.11.2-py3-none-any.whl
0
2 年 前
#17714 引用
Troubleshooting

If you are using Linux, then you should upgrade pip (in a virtual environment!) and attempt to install cryptography again before trying to install the Rust toolchain. On most Linux distributions, the latest version of pip will be able to install a binary wheel, so you won’t need a Rust toolchain.

Building cryptography requires having a working Rust toolchain. The current minimum supported Rust version is 1.48.0. This is newer than the Rust some package managers ship, so users may need to install with the instructions below.


https://cryptography.io/en/latest/installation/#rust

These are some of the problems I faced while runing/installing. This is an error collection I got from different HA installs, you can find some or hopefully none of them.


Core installations without manylinux/osx/windows wheel PEP support need to install rust to compile cryptography.

https://github.com/home-assistant/core/pull/56481



(Musl wheel support is ready after the new auditwheel version is out)
# (in a virtual environment!)

pip install cryptography


https://cryptography.io/en/latest/installation/

https://cryptography.io/en/latest/installation/#rust
https://cryptography.io/en/latest/changelog/



Building cryptography requires having a working Rust toolchain.

https://cryptography.io/en/latest/installation/#rust

install Rust

curl https://sh.rustup.rs -sSf | sh


output
rust version 1.66.1


https://www.rust-lang.org/learn/get-started

https://www.rust-lang.org/tools/install

sudo apt -y install rustc


In the Rust development environment, all tools are installed to the ~/.cargo/bin directory, and this is where you will find the Rust toolchain, including rustc, cargo, and rustup.

pip3 install pyOpenSSL --upgrade

output

Building wheels for collected packages: cryptography
  Building wheel for cryptography (pyproject.toml) ... done
  Created wheel for cryptography: filename=cryptography-38.0.3-cp39-cp39-linux_armv7l.whl size=2464070 sha256=e73ccca55cbfcb3f2c81cd72f686463bce7cb4586b8394e0840011b23af41446
  Stored in directory: /home/homeassistant20221102/.cache/pip/wheels/e4/a1/02/3831079a3ada1d9228eea10f236572650144f7c8e99f9c6dac
Successfully built cryptography
Installing collected packages: pycparser, cffi, cryptography, pyOpenSSL
Successfully installed cffi-1.15.1 cryptography-38.0.3 pyOpenSSL-22.1.0 pycparser-2.21




Installing collected packages: pyOpenSSL
  Attempting uninstall: pyOpenSSL
    Found existing installation: pyOpenSSL 20.0.1
    Uninstalling pyOpenSSL-20.0.1:
      Successfully uninstalled pyOpenSSL-20.0.1
Successfully installed pyOpenSSL-22.1.0

0
2 年 前
#17715 引用

error: can't find Rust compiler
      
      If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.

If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.



If you are using Linux, then you should upgrade pip (in a virtual environment!) and attempt to install cryptography again before trying to install the Rust toolchain. On most Linux distributions, the latest version of pip will be able to install a binary wheel, so you won’t need a Rust toolchain.



      
      This package requires Rust >=1.48.0.



Building cryptography requires having a working Rust toolchain. The current minimum supported Rust version is 1.48.0. This is newer than the Rust some package managers ship, so users may need to install with the instructions below.
0
2 年 前
#17716 引用
Also I don't see pyOpenSSL in requirements.txt so it seems you might want to have a minimum requirement there?

s

https://github.com/home-assistant/core/issues/79688


https://github.com/home-assistant/core/blob/dev/requirements.txt

-c homeassistant/package_constraints.txt

# Home Assistant Core
aiohttp==3.8.1
astral==2.2
async_timeout==4.0.2
attrs==21.2.0
atomicwrites-homeassistant==1.4.1
awesomeversion==22.9.0
bcrypt==3.1.7
certifi>=2021.5.30
ciso8601==2.2.0
httpx==0.23.0
home-assistant-bluetooth==1.6.0
ifaddr==0.1.7
jinja2==3.1.2
lru-dict==1.1.8
PyJWT==2.5.0
cryptography==38.0.3
orjson==3.8.1
pip>=21.0,<22.4
python-slugify==4.0.1
pyyaml==6.0
requests==2.28.1
typing-extensions>=4.4.0,<5.0
voluptuous==0.13.1
voluptuous-serialize==2.5.0
yarl==1.8.1
0
2 年 前
#17717 引用


https://github.com/home-assistant/core/blob/dev/requirements_test_pre_commit.txt

# Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit

bandit==1.7.4
black==22.10.0
codespell==2.1.0
flake8-comprehensions==3.10.0
flake8-docstrings==1.6.0
flake8-noqa==1.2.8
flake8==4.0.1
isort==5.10.1
mccabe==0.6.1
pycodestyle==2.8.0
pydocstyle==6.1.1
pyflakes==2.4.0
pyupgrade==3.1.0
yamllint==1.28.0
0
2 年 前
#17718 引用
1
0
2 年 前
#17719 引用
First boot Home Assistant

Creating default Config directory in /home/homeassistant20221102/.homeassistant

2022-11-13 07:22:52.410 INFO (MainThread) [homeassistant.bootstrap] Config directory: /home/homeassistant20221102/.homeassistant


0
2 年 前
#17720 引用
[i][/i]First boot Home Assistant troubleshooting


IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.9 from "/srv/homeassistant20221102/bin/python3.9"
  * The NumPy version is: "1.23.2"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: libcblas.so.3: cannot open shared object file: No such file or directory

2022-11-13 07:45:28.487 ERROR (MainThread) [homeassistant.setup] Setup failed for mobile_app: Unable to import component:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.9 from "/srv/homeassistant20221102/bin/python3.9"
  * The NumPy version is: "1.23.2"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: libcblas.so.3: cannot open shared object file: No such file or directory


solution

https://numpy.org/devdocs/user/troubleshooting-importerror.html#raspberry-pi

2022-11-13 07:45:28.496 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: cloud, mobile_app
2022-11-13 07:45:28.499 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: (DependencyError(...), 'Could not setup dependencies: cloud, mobile_app')



s

https://numpy.org/devdocs/user/troubleshooting-importerror.html#raspberry-pi

sudo apt-get install libatlas-base-dev


run ok
0
2 年 前
#17721 引用
First boot Home Assistant troubleshooting


2022-11-13 07:46:31.212 WARNING (MainThread) [bluetooth_auto_recovery.recover] Bluetooth adapter hci0 is soft blocked by rfkill!
2022-11-13 07:46:31.243 WARNING (MainThread) [homeassistant.config_entries] Config entry 'B8:27:EB:2A:96:FA' for bluetooth integration not ready yet: hci0 (B8:27:EB:2A:96:FA): Failed to start Bluetooth: [org.bluez.Error.NotReady] Resource Not Ready; Retrying in background



solution

sudo rfkill unblock 0
0