Changes

Jump to: navigation, search

Orange Pi Zero 2W

800 bytes added, 14:51, 26 September 2023
Installation via python
=== Installation via python ===
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Before installation, please change the source of pip to a domestic source to speed up the installation of Python packages. For the configuration method, see the instructions in the section &quot;[[\lOrange Pi Zero 2W#How to replace pip source in Python|How to Change the Pip Source of Python]]&quot;'''</big>|}
<ol style="list-style-type: decimal;">
<li><p>First install dependency packages</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y python3 python3-dev python3-venv \'''</p>
<p>'''python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \'''</p>
<p>'''libopenjp2-7 libtiff5 libturbojpeg0-dev tzdata'''</p>
|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''If it is debian12, please use the following command:'''</p></big>
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y python3 python3-dev python3-venv \'''</p>
<p>'''python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \'''</p>
<p>'''libopenjp2-7 libturbojpeg0-dev tzdata'''</p>|}</li><li><p>Then you need to compile and install Python3.9. For the method, please refer to the [[\lOrange Pi Zero 2W#Python related instructions|'''Python source code compilation and installation method''']] section.</p>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''The default Python version of Debian Bullseye is Python3.9, so there is no need to compile and install it.'''</p>
<p>'''The default Python version of Ubuntu Jammy is Python3.10, so there is no need to compile and install it.'''</p>
<p>'''The default Python version of Debian Bookworm is Python3.11, so there is no need to compile and install it.'''</p></big>|}</li>
<li><p>Then create a Python virtual environment</p>
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Debian Bookworm is python3.11, please remember to replace the corresponding command.'''</p></big>|}{| class="wikitable" style="width:800px;" |-|
<p>orangepi@orangepi:~$ '''sudo mkdir /srv/homeassistant'''</p>
<p>orangepi@orangepi:~$ '''sudo chown orangepi:orangepi /srv/homeassistant'''</p>
<p>orangepi@orangepi:~$ '''python3.9 -m venv .'''</p>
<p>orangepi@orangepi:~$ '''source bin/activate'''</p>
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$</p>|}</li>
<li><p>Then install the required Python packages</p>
{| class="wikitable" style="width:800px;" |-| <p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''python3 -m pip install wheel'''</p>|}</li>
<li><p>Then you can install Home Assistant Core</p>
{| class="wikitable" style="width:800px;" |-| <p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''pip3 install homeassistant'''</p>|}</li>
<li><p>Then enter the following command to run Home Assistant Core</p>
{| class="wikitable" style="width:800px;" |-| <p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''hass'''</p>|}</li>
<li><p>Then enter【'''development board IP address: 8123'''】 in the browser to see the Home Assistant interface</p>
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''When you run the hass command for the first time, some libraries and dependency packages necessary for operation will be downloaded, installed and cached. This process may take several minutes. Note that you cannot see the Home Assistant interface in the browser at this time. Please wait for a while and then refresh it.'''</p></big>|}
<div class="figure">

Navigation menu