Jump to content

Recommended Posts

Posted

Hi!
ill try install homeassistant on orange pi zero 512MB, but i have a problem.
i have download 
Armbian_22.08_Jammy_rolling_Sid server_Kernel_5.19.y_359M_Sep.24,2022 
https://redirect.armbian.com/region/EU/orangepizero/Sid_edge
and installed armbian like
https://www.albertogonzalez.net/how-to-install-armbian-debian-on-an-orange-pi-zero
 i dont know is it correct or not, i think Kernel_5.19 is better than 5.15?

 / _ \|  _ \(_) |__  /___ _ __ ___
| | | | |_) | |   / // _ \ '__/ _ \
| |_| |  __/| |  / /|  __/ | | (_) |
 \___/|_|   |_| /____\___|_|  \___/

Welcome to Armbian 22.08.2 Sid with Linux 5.19.10-sunxi

No end-user support: unsupported (sid) userspace!

System load:   2%               Up time:       9 min
Memory usage:  15% of 490M      IP:            192.168.3.30
CPU temp:      58°C             Usage of /:    10% of 15G


i used PUTTY, my Orange pi zero has an ip address 192.16..3.30 and i try to install Home assistant like
https://www.albertogonzalez.net/how-to-install-home-assistant-on-an-orange-pi-zero/
python3 installed OK

Python 3.10.7


I can not add "hass" user because after install i have it automatic added as a first user hass. (I dont know maybe i need someting like this? -G dialout)

I get error:

hass@orangepizero:~$ sudo mkdir /srv/homeassistant


...

Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting h11<0.13,>=0.11
  Using cached h11-0.12.0-py3-none-any.whl (54 kB)
Collecting anyio==3.*
  Using cached anyio-3.6.1-py3-none-any.whl (80 kB)
Building wheels for collected packages: cryptography
  Building wheel for cryptography (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for cryptography (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [192 lines of output]
 =============================DEBUG ASSISTANCE=============================

      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.

      To update pip, run:

          pip install --upgrade pip

      and then retry package installation.

      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.

      This package requires Rust >=1.41.0.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects
(homeassistant) hass@orangepizero:~$ python3 -m pip install
ERROR: You must give at least one requirement to install (see "pip help install")

i need your help.
Thx!

Posted

I suggest to to try with both supported kernel (current branch) and supported userspace (Bullseye) rather than experimental stuff.

3 hours ago, Richard_Balogh said:
No end-user support: unsupported (sid) userspace!

 

Posted (edited)

i have changed to Armbian_22.08_Jammy_Kernel_5.15.y_296Mb_Sep.24,2022 but the problem is same. 

To update pip, run:          

pip install --upgrade pip 
Successfully installed pip-22.2.2



To install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Quote
(homeassistant) hass@orangepizero:/root$ curl https://sh.rustup.rs -sSf | sh                 -sSf | sh
info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.

Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:

  /home/hass/.rustup

This can be modified with the RUSTUP_HOME environment variable.

The Cargo home directory is located at:

  /home/hass/.cargo

This can be modified with the CARGO_HOME environment variable.

The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:

  /home/hass/.cargo/bin

This path will then be added to your PATH environment variable by
modifying the profile files located at:

  /home/hass/.profile
  /home/hass/.bashrc
  /home/hass/.zshenv

You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

Current installation options:


   default host triple: armv7-unknown-linux-gnueabihf
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation

>1

info: profile set to 'default'
info: setting default host triple to armv7-unknown-linux-gnueabihf
warning: Updating existing toolchain, profile choice will be ignored
info: syncing channel updates for 'stable-armv7-unknown-linux-gnueabihf'
info: default toolchain set to 'stable-armv7-unknown-linux-gnueabihf'

  stable-armv7-unknown-linux-gnueabihf unchanged - rustc 1.64.0 (a55dd71d5 2022-09-19)


Rust is installed now. Great!

To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH
environment variable. This has not been done automatically.

To configure your current shell, run:
source "$HOME/.cargo/env"
(homeassistant) hass@orangepizero:/root$ rustc –version
bash: rustc: command not found
(homeassistant) hass@orangepizero:/root$ cargo –version
bash: cargo: command not found

 

 

...
          Python: 3.10.6
          platform: Linux-5.15.69-sunxi-armv7l-with-glibc2.35
          pip: n/a
          setuptools: 65.4.1
          setuptools_rust: 1.5.2
          rustc: n/a
          =============================DEBUG ASSISTANCE=============================

      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.

      To update pip, run:

          pip install --upgrade pip

      and then retry package installation.

      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.

      This package requires Rust >=1.48.0.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects

Edited by Richard_Balogh
Posted

i have changed to Armbian_22.08_Jammy_Kernel_5.15.y_296Mb_Sep.24,2022 but the problem is same. 

To update pip, run:          

pip install --upgrade pip 
Successfully installed pip-22.2.2



To install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
(homeassistant) hass@orangepizero:/root$ curl https://sh.rustup.rs -sSf | sh                 -sSf | sh
info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.

Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:

  /home/hass/.rustup

This can be modified with the RUSTUP_HOME environment variable.

The Cargo home directory is located at:

  /home/hass/.cargo

This can be modified with the CARGO_HOME environment variable.

The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:

  /home/hass/.cargo/bin

This path will then be added to your PATH environment variable by
modifying the profile files located at:

  /home/hass/.profile
  /home/hass/.bashrc
  /home/hass/.zshenv

You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

Current installation options:


   default host triple: armv7-unknown-linux-gnueabihf
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation

>1

info: profile set to 'default'
info: setting default host triple to armv7-unknown-linux-gnueabihf
warning: Updating existing toolchain, profile choice will be ignored
info: syncing channel updates for 'stable-armv7-unknown-linux-gnueabihf'
info: default toolchain set to 'stable-armv7-unknown-linux-gnueabihf'

  stable-armv7-unknown-linux-gnueabihf unchanged - rustc 1.64.0 (a55dd71d5 2022-09-19)


Rust is installed now. Great!

To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH
environment variable. This has not been done automatically.

To configure your current shell, run:
source "$HOME/.cargo/env"
(homeassistant) hass@orangepizero:/root$ rustc –version
bash: rustc: command not found
(homeassistant) hass@orangepizero:/root$ cargo –version
bash: cargo: command not found

...
         

Python: 3.10.6
          platform: Linux-5.15.69-sunxi-armv7l-with-glibc2.35
          pip: n/a
          setuptools: 65.4.1
          setuptools_rust: 1.5.2
          rustc: n/a
          =============================DEBUG ASSISTANCE=============================

      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.

      To update pip, run:

          pip install --upgrade pip

      and then retry package installation.

      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.

      This package requires Rust >=1.48.0.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects

 

Posted (edited)
On 6/30/2023 at 9:04 AM, h4ckr4 said:

No way to install cryptography package...

 

Upon meditating over broken builds for quite some time, here is how to build HA on an SBC with a very limited amount of RAM:

  • Force Python build system to utilise unlimited user-supplied $TEMPDIR, rather than system-managed which is too small and zram-based
  • It's unfair, but the builder is expected to RTFM installation notes for all the dependencies. That's right, OS-packaged rustc cannot be used, and it has to be a rustup
  • I am stuck with `NumPy` installation. Whatever I do, the build OOMs by exhausting small swap file with 4x instances of cc1 compiler, running in parallel. My take is even if I manage to build HA, the deployment wouldn't be sustainable because of inability to upgrade it frequently
  • TODO: explore containerised deployment

 

EDIT: NumPy wanted a long list of dependencies. The install script has updated. Interestingly enough, with exception for `cryptography`, none of the failing dependencies are declared if I query `python -m pip show homeassistant`. Nested dependencies have to be learned the hard way.

 

Opinionated Install

Spoiler

 

sudo useradd -rm homeassistant -G dialout,i2c -d /srv/homeassistant
sudo usermod -aG homeassistant pi

sudo ln -sr /usr/bin/python3 /usr/bin/python
sudo apt remove rustc
sudo apt update; sudo apt install -y libssl-dev libffi-dev python3-venv python3-dev pkg-config cmake ninja-build build-essential
# Pillow==10.1.0 dependencies 
sudo apt install -y python3-setuptools libtiff5-dev libjpeg62-turbo-dev  libopenjp2-7-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk libharfbuzz-dev libfribidi-dev libxcb1-dev
# PyTurboJPEG==1.7.1 dependencies
sudo apt install -y libturbojpeg0 libopenblas0 libopenblas-dev
# numpy==1.26.0 dependencies
sudo apt install -y ffmpeg libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libswresample-dev libavfilter-dev

sudo su - homeassistant
python -m venv .; source bin/activate; python3 -m pip install --upgrade pip wheel setuptools
curl https://sh.rustup.rs -sSf | sh
source ~/.cargo/env

cargo --version
rustc --version
cmake --version
ninja --version
python --version
pip --version
python -m pip show cryptography
which {pip,pip3,pip3.11}

export TMPDIR=$HOME/tmp_dir
mkdir -p $TMPDIR

cat << 'EOF' >> ~/.bashrc
# Essential: it has to be an absolute path
. "$HOME/bin/activate"
export TMPDIR=$HOME/tmp_dir
mkdir -p $TMPDIR
#rm -rf $TMPDIR/*
EOF

pip install cryptography
pip install Pillow==10.1.0
pip install numpy==1.26.0
pip install PyTurboJPEG==1.7.1
pip install homeassistant

 

 

Edited by wang.wei 王維
successful installation

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines