Open main menu

Wiki-Orange Pi β

Changes

Orange Pi Zero 2W

21,844 bytes added, 20:33, 27 September 2023
Download orangepi-build from github
<div class="figure">
[[File:zero2w-img3.png|800px]]
</div>
<div class="figure">
[[File:zero2w-img4.png|800px]]
</div>
<div class="figure">
[[File:zero2w-img5.png|800px]]
</div>
<span id="orange-pi-zero-2w-24pin-expansion-board-interface-details"></span>
 
== Orange Pi Zero 2w 24pin expansion board interface details ==
<div class="figure">
[[File:zero2w-img6.png|800px]]
</div>
[[File:zero2w-img7.png|800px]]
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
# As can be seen from the table below, the available uarts are uart2, uart3, uart4 and uart5. Please note that uart0 is set as a debugging serial port by default. Please do not use uart0 as a normal serial port.
<div style="display: flex;">::{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
|-
| '''GPIO NO.'''
| '''Function'''
| '''Pin'''
|
| '''Pin'''
| '''Function'''
| '''GPIO'''
| '''GPIO NO.'''
|-
| style="text-align: left;"|
| '''3.3V'''
| '''1'''
|
| '''2'''
| '''5V'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''264'''
| '''TWI1-SDA'''
| '''3'''
|
| '''4'''
| '''5V'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''263'''
| '''TWI1-SCL'''
| '''5'''
|
| '''6'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''269'''
| '''PWM3/UART4_TX'''
| '''7'''
|
| '''8'''
| '''UART0_TX'''
| '''PH0'''
| '''224'''
|-
| style="text-align: left;"|
| '''GND'''
| '''9'''
|
| '''10'''
| '''UART0_RX'''
| '''PH1'''
| '''225'''
|-
| '''226'''
| '''UART5_TX'''
| '''11'''
|
| '''12'''
| style="text-align: left;"|
| '''PI1'''
| '''257'''
|-
| '''227'''
| '''UART5_RX'''
| '''13'''
|
| '''14'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''261'''
| '''TWI0_SCL/UART2_TX'''
| '''15'''
|
| '''16'''
| '''PWM4/UART4_RX'''
| '''PI14'''
| '''270'''
|-
| style="text-align: left;"|
| '''3.3V'''
| '''17'''
|
| '''18'''
| style="text-align: left;"|
| '''PH4'''
| '''228'''
|-
| '''231'''
| '''SPI1_MOSI'''
| '''19'''
|
| '''20'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''232'''
| '''SPI1_MISO'''
| '''21'''
|
| '''22'''
| '''TWI0_SDA/UART2_RX'''
| '''PI6'''
| '''262'''
|-
| '''230'''
| '''SPI1_CLK'''
| '''23'''
|| '''24'''| '''SPI1_CS0'''| '''PH5'''| '''229'''|-
| style="text-align: left;"|
| style="text-align: left;"|
| '''GND'''
| '''25'''
|
| '''26'''
| '''SPI1_CS1'''
| '''PH9'''
| '''233'''
|-
| '''266'''
| '''TWI2-SDA/UART3_RX'''
| '''27'''
|
| '''28'''
| '''TWI2-SCL/UART3_TX'''
| '''PI9'''
| '''265'''
|-
| '''256'''
| style="text-align: left;"|
| '''29'''
|
| '''30'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''271'''
| style="text-align: left;"|
| '''31'''
|
| '''32'''
| '''PWM1'''
| '''PI11'''
| '''267'''
|-
| '''268'''
| '''PWM2'''
| '''33'''
|
| '''34'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''258'''
| style="text-align: left;"|
| '''35'''
|
| '''36'''
| style="text-align: left;"|
| '''PC12'''
| '''76'''
|-
| '''272'''
| style="text-align: left;"|
| '''37'''
|
| '''38'''
| style="text-align: left;"|
| '''PI4'''
| '''260'''
|-
| style="text-align: left;"|
| '''GND'''
| '''39'''
|
| '''40'''
| style="text-align: left;"|
| '''PI3'''
| '''259'''
|}
 <ol start{| class="2wikitable" style="list-style-typewidth: decimal390px;"><li><p>In Linux systems, uart is turned off by default and needs to be turned on manually before it can be used. The opening steps are as follows:: </p><ol style="list-stylemargin-typeright: lower-alpha;"><li><p>First run '''orangepi-config'''. Ordinary users remember to add &gt20px; '''sudo''' permissions.</p><p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li><li><p>Then select '''System'''</p><p>[[File:zero2wtext-img80.png]]</p></li><li><p>Then select '''Hardware'''</p><p>[[Filealign:zero2w-img81.png]]</p></li><li><p>Then use the keyboard's arrow keys to locate the position shown &gtcenter; in the picture below, and then use the '''space''' to select the &gt; serial port you want to open.</p></li></ol></li></ol> {| class="wikitable"
|-
| '''Multiplexing function in 40pinPin'''| '''Corresponding dtbo configurationFunction'''| '''GPIO'''| '''GPIO NO.'''
|-
| '''40pin 2'''| '''5V'''| style="text-align: left;"|| style="text-align: left;"||-| '''4'''| '''5V'''| style="text-align: left;"|| style="text-align: left;"||-| '''6'''| '''GND'''| style="text- uart2align: left;"|| style="text-align: left;"||-| '''8'''| '''piUART0_TX'''| '''PH0'''| '''224'''|-uart2| '''10'''| '''UART0_RX'''| '''PH1'''| '''225'''
|-
| '''40pin 12'''| style="text- uart3align: left;"|| '''PI1'''| '''pi-uart3257'''
|-
| '''40pin - uart414'''| '''pi-uart4GND'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''40pin - uart516'''| '''ph-uart5PWM4/UART4_RX'''|}'''PI14'''| '''270'''[[File:zero2w|-img175.png]]| '''18'''<ol start="5" | style="listtext-style-typealign: lower-alphaleft;">|<li><p>Then select | '''&lt;Save&gt;PH4''' to save</p><p>[[File:zero2w-img83.png]]</p></li><li><p>Then select | '''&lt;Back&gt;228'''</p><p>[[File:zero2w|-img84.png]]</p></li><li><p>Then select | '''&lt;Reboot&gt;20''' to restart the system to make the &gt; configuration take effect.</p><p>[[File:zero2w-img85.png]]</p></li></ol>| '''GND''' <!-- --><ol start| style="3text-align: left;" || style="list-styletext-typealign: decimalleft;">|<li><p>After entering the Linux system, first confirm whether there is a uart5 device node under |-| '''<span class="mark">/dev</span>22'''</p><p>| '''注意, linux5.4系统为TWI0_SDA/dev/ttyASx.UART2_RX'''</p><p>orangepi@orangepi:~$ | '''ls /dev/ttyS*PI6'''</p><p>/dev/ttySx</p></li>| '''262'''<li><p>Then start testing the uart interface. First use Dupont wire to short|-circuit the rx and tx pins of the uart interface to be tested.</p></li><li><p>Use the | '''gpio24''' command in wiringOP to test the loopback function of the serial port as shown below. If you can see the following print, it means the serial port communication is normal.</p><p>| '''Note that the last x in the gpio serial /dev/ttySx command needs to be replaced with the serial number of the corresponding uart device node.SPI1_CS0'''</p><p>orangepi@orangepi:~$ | '''gpio serial /dev/ttySx # linux-6.1 test commandPH5'''</p><p>orangepi@orangepi:~$ | '''gpio serial /dev/ttyASx # linux-5.4 test command229'''</p><p>Out: 0: |-&gt; 0</p><p>Out: 1: -&gt; 1</p>| '''26'''<p>Out: 2: -&gt; 2</p>| '''SPI1_CS1'''<p>Out: 3: -&gt; 3^C</p></li><li><p>Finally, you can run the | '''serialTest.pyPH9''' program in examples to test the loopback function of the serial port. If you can see the following print, it means that the serial port loopback test is normal.</p><p>| '''Note that the x in /dev/ttySx or /dev/ttyASx in the command needs to be replaced with the serial number of the corresponding uart device node.233'''</p><p>root@orangepi:~/wiringOP|-Python# | '''cd examples28'''</p><p>root@orangepi:~/wiringOP| '''TWI2-PythonSCL/examples# UART3_TX'''| 'python3 serialTest.py --device &quot;/dev/ttySx&quot; # linux6.1 use''PI9'''</p><p>root@orangepi:~/wiringOP-Python/examples# | '''python3 serialTest.py --device &quot;/dev/ttyASx&quot; # linux5.4 use265'''</p><p>Out: 0: |-&gt; 0</p><p>Out: 1: -&gt; 1</p>| '''30'''| '''GND'''<p>Out: 2: | style="text-&gt; 2</p><p>Outalign: 3: -&gtleft; 3</p>"|<p>Out: 4:^C</p><p>exit</p></li></ol> <span id| style="hardwaretext-watchdogalign: left;"||-test"></span>| '''32'''| '''PWM1'''== Hardware watchdog test ==| '''PI11'''| '''267'''The watchdog_test program is pre|-installed in the Linux system released by Orange Pi and can be tested directly.| '''34'''The method to run the watchdog_test program is as follows:| '''GND''' <ol | style="listtext-align: left;"|| style="text-typealign: lower-alphaleft;">||-<li><p>The second parameter 10 represents the counting time of the watchdog. If the dog is not fed within this time, the system will restart.</p></li>| '''36'''<li><p>We can feed the dog by pressing any key on the keyboard (except ESC). After feeding the dog, the program will print a line &quot| style="text-align: left;keep alive&quot; to indicate that the dog feeding is successful.</p>"|<p>orangepi@orangepi:~$ | '''sudo watchdog_test 10PC12'''</p><p>open success</p>| '''76'''<p>options is 33152,identity is sunxi|-wdt</p><p>put_usr return,if 0,success| '''38'''| style="text-align:0</p>left;"|| '''PI4'''<p>The old reset time is: 16</p>| '''260'''<p>return ENOTTY,if |-1,success:0</p><p>return ENOTTY,if | '''40'''| style="text-1,successalign:0</p>left;"|<p>put_user return,if 0,success:0</p>| '''PI3'''<p>put_usr return,if 0,success:0</p>| '''259'''<p>keep alive</p>|}<p>keep alive</p><p>keep alive</p></li></oldiv>
<span idol start="check2" style="list-thestyle-chipidtype: decimal;"><li><p>In Linux systems, uart is turned off by default and needs to be turned on manually before it can be used. The opening steps are as follows:: </p><ol style="list-ofstyle-h618type: lower-chipalpha;"><li><p>First run '''orangepi-config'''. Ordinary users remember to add '''sudo''' permissions.</spanp>{| class="wikitable" style= Check "width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p>|}</li><li><p>Then select '''System'''</p><p>[[File:zero2w-img80.png]]</p></li><li><p>Then select '''Hardware'''</p><p>[[File:zero2w-img81.png]]</p></li><li><p>Then use the keyboard's arrow keys to locate the position shown in the picture below, and then use the '''space''' to select the chipid of H618 chip ==serial port you want to open.</p></li>
The command {| class="wikitable" style="width:800px;text-align: center;"|-| '''Multiplexing function in 40pin'''| '''Corresponding dtbo configuration'''|-| '''40pin - uart2'''| '''pi-uart2'''|-| '''40pin - uart3'''| '''pi-uart3'''|-| '''40pin - uart4'''| '''pi-uart4'''|-| '''40pin - uart5'''| '''ph-uart5'''|} [[File:zero2w-img175.png]]</ol><ol start="5" style="list-style-type: lower-alpha;"><li><p>Then select '''&lt;Save&gt;''' to save</p><p>[[File:zero2w-img83.png]]</p></li><li><p>Then select '''&lt;Back&gt;'''</p><p>[[File:zero2w-img84.png]]</p></li><li><p>Then select '''&lt;Reboot&gt;''' to restart the system to view make the H618 chip chipid is as followsconfiguration take effect.</p><p>[[File:zero2w-img85. The chipid of each chip png]]</p></li></ol></li></ol><!-- --><ol start="3" style="list-style-type: decimal;"><li><p>After entering the Linux system, first confirm whether there is differenta uart5 device node under '''<span class="mark">/dev</span>'''</p>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''注意, so you can use chipid to distinguish multiple development boardslinux5.4系统为/dev/ttyASx.'''</p></big>|}{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''cat ls /sysdev/classttyS*'''</p><p>/dev/ttySx</p>|}</li><li><p>Then start testing the uart interface. First use Dupont wire to short-circuit the rx and tx pins of the uart interface to be tested.</p></sunxi_infoli><li><p>Use the '''gpio''' command in wiringOP to test the loopback function of the serial port as shown below. If you can see the following print, it means the serial port communication is normal.</sys_info p>{| grep &quotclass="wikitable" style="background-color:#ffffdc;chipid&quotwidth:800px;" |-| <big><p>'''Note that the last x in the gpio serial /dev/ttySx command needs to be replaced with the serial number of the corresponding uart device node.'''</p></big>|}sunxi_chipid {| class="wikitable" style="width: 338020004c0048080147478824681ed1800px;" |-| <span id="pythonp>orangepi@orangepi:~$ '''gpio serial /dev/ttySx &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # linux-related6.1 test command'''</p><p>orangepi@orangepi:~$ '''gpio serial /dev/ttyASx &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # linux-instructions">5.4 test command'''</spanp>== Python related instructions ==
<span id="how-to-compile-and-install-python-source-code"></span>
=== How to compile and install Python source code ===
<p>Out: 0: -&gt; 0</p><p>Out: 1: -&gt; 1</p><p>Out: 2: -&gt; 2</p><p>Out: 3: -&gt; 3^C</p>|}</li><li><p>Finally, you can run the '''serialTest.py'''If the Python version program in the Ubuntu or Debian system software repository you are using does not meet the development requirements and you want examples to use test the latest version loopback function of Python, the serial port. If you can use see the following method to download print, it means that the serial port loopback test is normal.</p>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Note that the x in /dev/ttySx or /dev/ttyASx in the Python source code package command needs to compile and install be replaced with the latest version serial number of the corresponding uart device node.'''</p></big>|}{| class="wikitable" style="width:800px;" |-| <p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p><p>root@orangepi:~/wiringOP-Python/examples# '''python3 serialTest.py --device &quot;/dev/ttySx&quot; # linux6.1 use'''</p><p>root@orangepi:~/wiringOP-Python/examples# '''python3 serialTest.py --device &quot;/dev/ttyASx&quot; # linux5.4 use'''</p>
'''The following demonstration is to compile and install the latest version of Python 3.9. If you want to compile and install other versions of Python, the method is the same (you need to download the source code corresponding to the Python you want to install).'''
<ol style="list-style-type: decimal;"><li><p>First install the dependency packages needed to compile Python</p><p>orangepi@orangepiOut: 0:~$ '''sudo apt-get update'''&gt; 0</p><p>orangepi@orangepiOut: 1:~$ '''sudo apt-get install -y build-essential zlib1g-dev \'''</p><p>'''libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev \'''&gt; 1</p><p>'''libreadline-dev libffi-dev curl libbz2-dev'''</p></li><li><p>Then download the latest version of Python3.9 source code and unzip it</p><p>orangepi@orangepiOut:~$ '''wget \'''</p><p>[https2://www.python.org/ftp/python/3.9.10/Python-3.9.10.tgz '''https://www.python.org/ftp/python/3.9.10/Python-3.9.10.tgz''']&gt; 2</p><p>orangepi@orangepiOut:~$ '''tar xvf Python-3.9.10.tgz'''</p></li><li><p>Then run the configuration command</p><p>orangepi@orangepi:~$ '''cd Python-&gt; 3.9.10'''</p><p>orangepi@orangepiOut:~$ '''./configure --enable-optimizations'''</p></li><li><p>Then compile and install Python3.9. The compilation time takes about half an hour.</p><p>orangepi@orangepi4:~$ '''make -j4'''^C</p><p>orangepi@orangepi:~$ '''sudo make altinstall'''exit</p></li><li><p>After installation, you can use the following command to check the version number of the Python you just installed.</p>|}<p>orangepi@orangepi:~$ '''python3.9 --version'''</p><p>'''Python 3.9.10'''</p></li><li><p>Then update pip</p><p>orangepi@orangepi:~$ '''/usr/local/bin/python3.9 -m pip install --upgrade pip'''</p></li></ol>
<span id="howhardware-towatchdog-replace-pip-source-in-pythontest"></span>=== How to replace pip source in Python ===
'''The default source used by Linux system pip is the official source of Python. However, accessing the official source of Python in China is very slow, and the installation of Python software packages often fails due to network reasons. So when using pip to install the Python library, please remember to change the pip source.'''== Hardware watchdog test ==
<ol style="listThe watchdog_test program is pre-style-type: decimal;"><li><p>First install '''python3-pip'''</p><p>orangepi@orangepi:~$ '''sudo apt-get update'''</p><p>orangepi@orangepi:~$ '''sudo apt-get install -y python3-pip'''</p></li><li><p>How to permanently change installed in the pip source under Linux</p><ol style="list-style-type: lower-alpha;"><li><p>First create a new '''~/.pip''' directory, then add the &gt; '''pip.conf''' configuration file, system released by Orange Pi and set the pip source in it &gt; to Tsinghua source.</p><p>orangepi@orangepi:~$ '''mkdir -p ~/.pip'''</p><p>orangepi@orangepi:~$ '''cat &lt;&lt;EOF &gt; ~/.pip/pip.conf'''</p><p>'''[global]'''</p><p>'''timeout = 6000'''</p><p>'''index-url = https://pypi.tuna.tsinghua.edu.cn/simple'''</p><p>'''trusted-host = pypi.tuna.tsinghua.edu.cn'''</p><p>'''EOF'''</p></li><li><p>Then use pip3 to install the Python library very quickly</p></li></ol></li><li><p>How to temporarily change the pip source under Linux, where '''&lt;packagename&gt;''' needs to can be replaced with a specific package name</p><p>orangepi@orangepi:~$ '''pip3 install &lt;packagename&gt; -i \'''</p><p>'''https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edutested directly.cn'''</p></li></ol>
<span id="how-The method to-install-docker"></span>== How to install Docker ==run the watchdog_test program is as follows:
<ol style="list-style-type: lower-alpha;"><li><p>The Linux image provided by Orange Pi has Docker pre-installed, but second parameter 10 represents the counting time of the watchdog. If the Docker service dog is not turned fed within this time, the system will restart.</p></li><li><p>We can feed the dog by pressing any key on by default. Use the '''enable_dockerkeyboard (except ESC).sh''' script to enable After feeding the docker servicedog, and then you can start using the docker command, and the docker service program will be automatically started print a line &quot;keep alive&quot; to indicate that the next time you start the systemdog feeding is successful.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''enable_docker.shsudo watchdog_test 10'''</p><p>open success</p>You can use the following command to test docker. If '''hello<p>options is 33152,identity is sunxi-world''' can be runwdt</p><p>put_usr return,if 0, docker can be used normally.success:0</p><p>The old reset time is: 16</p>orangepi@orangepi<p>return ENOTTY,if -1,success:~$ '''docker run hello0</p><p>return ENOTTY,if -world'''1,success:0</p><p>put_user return,if 0,success:0</p>Unable to find image 'hello-world<p>put_usr return,if 0,success:latest' locally0</p><p>keep alive</p><p>keep alive</p><p>keep alive</p>|}</li></ol>
latest: Pulling from library<span id="check-the-chipid-of-h618-chip"></hello-worldspan>
256ab8fe8778: Pull complete== Check the chipid of H618 chip ==
Digest: sha256:7f0a9f93b4aa3022c3a4c147a449ef11e0941a1fd0bf4a8e6c9408b2600777c5The command to view the H618 chip chipid is as follows. The chipid of each chip is different, so you can use chipid to distinguish multiple development boards.
Status{| class="wikitable" style="width: Downloaded newer image for hello800px;" |-world| orangepi@orangepi:latest~$ '''cat /sys/class/sunxi_info/sys_info | grep &quot;chipid&quot;'''
'''Hello from Docker!'''sunxi_chipid : 338020004c0048080147478824681ed1|}
'''This message shows that your installation appears to be working correctly.'''<span id="python-related-instructions"></span>
'''.….'''== Python related instructions ==
When using the docker command, if you are prompted for '''permission denied''', please add the current user <span id="how-to the docker user group so that you can run the docker command without sudo.-compile-and-install-python-source-code"></span>=== How to compile and install Python source code ===
orangepi@orangepi{| class="wikitable" style="background-color:#ffffdc;width:~$ 800px;" |-| <big>'''sudo usermod -aG docker $USERIf the Python version in the Ubuntu or Debian system software repository you are using does not meet the development requirements and you want to use the latest version of Python, you can use the following method to download the Python source code package to compile and install the latest version of Python.'''
'''Note: You need The following demonstration is to log out compile and log in again to install the system to take effectlatest version of Python 3. You can also restart the system9.''' <span id="how-If you want to-compile and install-home-assistant"></span>== How to install Home Assistant == '''Note that this article will only provide methods for installing Home Assistant in Ubuntu or Debian systems. For detailed usage other versions of Home AssistantPython, please refer the method is the same (you need to download the official documentation or source code corresponding booksto the Python you want to install).''' <span id="installation-via-docker"></spanbig>=== Installation via docker ===|}
<ol style="list-style-type: decimal;">
<li><p>First, please install docker and ensure that docker can run normally. For the installation steps of docker, please refer to the instructions in the [[\l|'''How dependency packages needed to Install Docker''']] section.compile Python</p></li><li><p>Then you can search for the docker image of Home Assistant</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''docker search homeassistantsudo apt-get update'''</p></li><li><p>Then use the following command to download the Docker image of Home Assistant to your local computer. The image size is about 1GB, and the download time will be relatively long. Please be patient and wait for the download to complete.</p><p>orangepi@orangepi:~$ '''docker pull homeassistant/homesudo apt-get install -y build-essential zlib1g-assistantdev \'''</p><p>Using default tag: latest'''libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev \'''</p><p>latest: Pulling from homeassistant/home'''libreadline-dev libffi-dev curl libbz2-assistantdev'''</p>|}<p/li>be307f383ecc: Downloading</pli><p>5fbc4c07ac88: Download completeThen download the latest version of Python3.9 source code and unzip it</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''...... (Omit some output)wget \'''</p><p>3cc6a1510c9f'''https: Pull complete</p><p>7a4e4d5b979f: Pull complete</p><p>Digest: sha256:81d381f5008c082a37da97d8b08dd8b358dae7ecf49e62ce3ef1eeaefc4381bb<www.python.org/ftp/python/p><p>Status: Downloaded newer image for homeassistant3.9.10/homePython-assistant:latest3.9.10.tgz'''</p><p>dockerorangepi@orangepi:~$ '''tar xvf Python-3.9.10.io/homeassistant/home-assistant:latesttgz'''</p>|}</li><li><p>Then you can use run the following configuration command to view the docker image of Home Assistant you just downloaded</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''docker images homeassistant/homecd Python-assistant3.9.10'''</p><p>REPOSITORY TAG IMAGE ID CREATED SIZE</p><p>homeassistant/home-assistant latest bfa0ab9e1cf5 2 months ago orangepi@orangepi:~$ '''1.17GB/configure --enable-optimizations'''</p>|}</li><li><p>At this point you can run the Home Assistant docker containerThen compile and install Python3.9. The compilation time takes about half an hour.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''docker run make -d \j4'''</p><p>orangepi@orangepi:~$ '''--name homeassistant \sudo make altinstall'''</p>|}<p/li>'''--privileged \'''</pli><p>'''--restart=unless-stopped \'''After installation, you can use the following command to check the version number of the Python you just installed.</p><p>'''{| class="wikitable" style="width:800px;" |-e TZ=Asia/Shanghai \'''</p>| <p>'''-v /home/orangepi/home-assistant@orangepi:/config \'''</p><p>~$ '''python3.9 --network=host \version'''</p><p>'''homeassistant/home-assistant:latestPython 3.9.10'''</p>|}</li><li><p>Then enter【the IP address of the development board: 8123】in the browser to see the Home Assistant interfaceupdate pip</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''It takes a while for the Home Assistant container to start. If the interface below does not display normally, please wait a few seconds before refreshing it. If the following interface is not displayed normally after waiting for more than a minute, it means there is a problem with the Home Assistant installation. At this time, you need to check whether there is a problem with the previous installation and setting process/usr/local/bin/python3.9 -m pip install --upgrade pip'''</p>|}</li><div class="figure"/ol>
[[File:zero2w<span id="how-img180.png]]to-replace-pip-source-in-python"></span>
</div></li><li><p>Then enter your '''name, username''' and '''password''' and click '''Create Account'''</p><div class="figure">== How to replace pip source in Python ===
[[File{| class="wikitable" style="background-color:#ffffdc;width:zero2w800px;" |-img181| <big>'''The default source used by Linux system pip is the official source of Python. However, accessing the official source of Python in China is very slow, and the installation of Python software packages often fails due to network reasons. So when using pip to install the Python library, please remember to change the pip source.png]]'''</big>|}
<ol style="list-style-type: decimal;"><li><p>First install '''python3-pip'''</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo apt-get update'''</divp><p>orangepi@orangepi:~$ '''sudo apt-get install -y python3-pip'''</p>|}</li><li><p>Then follow How to permanently change the pip source under Linux</p><ol style="list-style-type: lower-alpha;"><li><p>First create a new '''~/.pip''' directory, then add the interface prompts to '''pip.conf''' configuration file, and set according the pip source in it to your own preferences, and then click NextTsinghua source.</p><div {| class="figurewikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''mkdir -p ~/.pip'''</p><p>orangepi@orangepi:~$ '''cat &lt;&lt;EOF &gt; ~/.pip/pip.conf'''</p><p>'''[[Fileglobal]'''</p><p>'''timeout = 6000'''</p><p>'''index-url = https:zero2w//pypi.tuna.tsinghua.edu.cn/simple'''</p><p>'''trusted-img182host = pypi.png]]tuna.tsinghua.edu.cn'''</p><p>'''EOF'''</divp>|}</li><li><p>Then click Nextuse pip3 to install the Python library very quickly</p></li></ol></li><div li><p>How to temporarily change the pip source under Linux, where '''&lt;packagename&gt;''' needs to be replaced with a specific package name</p>{| class="figurewikitable"style="width:800px;" |-| <p>orangepi@orangepi:~$ '''pip3 install &lt;packagename&gt; -i \'''</p><p>'''https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn'''</p>|}</li></ol> <span id="how-to-install-docker"></span> == How to install Docker == The Linux image provided by Orange Pi has Docker pre-installed, but the Docker service is not turned on by default. Use the '''enable_docker.sh''' script to enable the docker service, and then you can start using the docker command, and the docker service will be automatically started the next time you start the system.
[[File{| class="wikitable" style="width:zero2w800px;" |-img183| orangepi@orangepi:~$ '''enable_docker.png]]sh'''|}
</div></li><li><p>Then click Finish</p><div class="figure">You can use the following command to test docker. If '''hello-world''' can be run, docker can be used normally.
[[File{| class="wikitable" style="width:zero2w800px;" |-img184.png]]| orangepi@orangepi:~$ '''docker run hello-world'''
</div></li><li><p>The main interface finally displayed by Home Assistant is as shown below</p><p>[[File:zero2w-img185.png]]</p></li><li><p>Method to stop Home Assistant container</p><ol style="list-style-type: lower-alpha;"><li><p>The command Unable to view the docker container is as follows</p><p>orangepi@orangepi:~$ ''find image 'docker ps hello-a'''</p></li><li><p>The command to stop the Home Assistant container is as follows</p><p>orangepi@orangepiworld:~$ '''docker stop homeassistant'''</p></li><li><p>The command to delete the Home Assistant container is as follows</p><p>orangepi@orangepi:~$ '''docker rm homeassistant''latest'</p></li></ol></li></ol>locally
<span id="installationlatest: Pulling from library/hello-via-python"></span>=== Installation via python ===world
'''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;[[\l|How to Change the Pip Source of Python]]&quot;'''256ab8fe8778: Pull complete Digest: sha256:7f0a9f93b4aa3022c3a4c147a449ef11e0941a1fd0bf4a8e6c9408b2600777c5 Status: Downloaded newer image for hello-world:latest
<ol style="list-style-type: decimal;">
<li><p>First install dependency packages</p>
<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>
<p>'''If it is debian12, please use the following command:'''</p>
<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 [[\l|'''Python source code compilation and installation method''']] section.</p>
<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></li>
<li><p>Then create a Python virtual environment</p>
<p>'''Debian Bookworm is python3.11, please remember to replace the corresponding command.'''</p>
<p>orangepi@orangepi:~$ '''sudo mkdir /srv/homeassistant'''</p>
<p>orangepi@orangepi:~$ '''sudo chown orangepi:orangepi /srv/homeassistant'''</p>
<p>orangepi@orangepi:~$ '''cd /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>
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''python3 -m pip install wheel'''</p></li>
<li><p>Then you can install Home Assistant Core</p>
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''pip3 install homeassistant'''</p></li>
<li><p>Then enter the following command to run Home Assistant Core</p>
<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>
<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>
<div class="figure">
[[File'''<span style="color:zero2w-img180.png]]#FF0000">Hello from Docker!</span>'''
'''</div></lispan style="color:#FF0000">This message shows that your installation appears to be working correctly.</olspan>'''
<span id="opencv-installation-method"></span>'''.….'''== OpenCV installation method ==|}
<span id="use-apt-When using the docker command, if you are prompted for '''permission denied''', please add the current user to-install-opencv"></span>=== Use apt to install OpenCV ===the docker user group so that you can run the docker command without sudo.
<ol style{| class="list-style-type: decimal;wikitable"><li><p>The installation command is as follows</p><p>orangepi@orangepi:~$ '''sudo apt-get update'''</p><p>orangepi@orangepi:~$ '''sudo apt-get install -y libopencv-dev python3-opencv'''</p></li><li><p>Then use the following command to print the version number of OpenCV. The output is normal, indicating that the OpenCV installation is successful.</p><ol style="list-style-typewidth: lower-alpha800px;"><li><p>The version of OpenCV in Ubuntu22.04 is as follows:</p><p>orangepi@orangepi:~$ '''python3 |-c &quot;import cv2; print(cv2.__version__)&quot;'''</p><p>'''4.5.4'''</p></li>| <li><p>The version of OpenCV in Ubuntu20.04 is as follows:</p><p>orangepi@orangepi:~$ '''python3 sudo usermod -c &quot;import cv2; print(cv2.__version__)&quot;'''</p><p>'''4.2.0'''</p></li><li><p>The version of OpenCV in Debian11 is as follows:</p><p>orangepi@orangepi:~$ '''python3 -c &quot;import cv2; print(cv2.__version__)&quot;'''</p><p>'''4.5.1'''</p></li><li><p>The version of OpenCV in Debian12 is as follows:</p><p>orangepi@orangepi:~aG docker $ USER'''python3 -c &quot;import cv2; print(cv2.__version__)&quot;'''</p><p>'''4.6.0'''</p></li></ol></li></ol>|}
<span id{| class="wikitable" style="setbackground-upcolor:#ffffdc;width:800px;" |-| <big>'''Note: You need to log out and log in again to the-chinese-environment-and-install-system to take effect. You can also restart the-chinese-input-method">system.'''</spanbig>== Set up the Chinese environment and install the Chinese input method ==|}
'''Note, before installing the Chinese input method, please make sure that the Linux system used by the development board is a desktop version.'''<span id="how-to-install-home-assistant"></span>
<span id="debian-system-installation-method"></span>=== Debian system installation method =How to install Home Assistant ==
<ol style{| class="list-style-type: decimal;wikitable"><li><p>First set the default '''locale''' to Chinese</p><ol style="listbackground-style-typecolor: lower-alpha#ffffdc;"><li><p>Enter the following command to start configuring '''locale'''</p><p>orangepi@orangepiwidth:~$ '''sudo dpkg-reconfigure locales'''</p></li><li><p>Then select '''zh_CN.UTF-8 UTF-8''' in the pop-up interface (use &gt800px; the up and down keys on the keyboard to move up and down, use &gt; the space bar to select, and finally use the Tab key to move &gt; the cursor to '''&lt;OK&gt;''', and then return Car can be used)</p>" <p>[[File:zero2w|-img186.png]]</p></li><li><p>Then set the default '''locale''' to '''zh_CN.UTF-8'''</p><p>[[File:zero2w-img187.png]]</p></li>| <libig><p>After exiting the interface, the '''locale''' setting Note that this article will beginonly provide methods for installing Home Assistant in Ubuntu or Debian systems. &gt; The output displayed on the command line is as follows:</p><p>orangepi@orangepi:~$ '''sudo dpkg-reconfigure locales'''</p><p>Generating locales (this might take a while)...</p><p>en_US.UTF-8... done</p><p>zh_CN.UTF-8... done</p><p>Generation complete.</p></li></ol></li><li><p>Then open '''Input Method'''</p><p>[[File:zero2w-img188.png]]</p></li><li><p>Then select '''OK'''</p><p>[[File:zero2w-img189.png]]</p></li><li><p>Then select '''Yes'''</p><p>[[File:zero2w-img190.png]]</p></li><li><p>Then select '''fcitx'''</p><p>[[File:zero2w-img191.png]]</p></li><li><p>Then select '''OK'''</p><p>[[File:zero2w-img192.png]]</p></li><li><p>'''Then restart the Linux system For detailed usage of Home Assistant, please refer to make the configuration take effect.'''</p></li><li><p>Then open '''Fcitx configuration'''</p><p>[[File:zero2w-img193.png]]</p></li><li><p>Then click the + sign as shown in the picture below</p><p>[[File:zero2w-img194official documentation or corresponding books.png]]</p></li><li><p>Then search '''Google Pinyin''' and click '''OK'''</pbig><div class="figure">|}
[[File:zero2w-img195.png]] </div></li><li><p>Then put '''Google Pinyin''' on top</p><p>[[File:zero2w-img196.png]]</p><p>[[File:zero2w-img197.png]]</p></li><li><p>Then open the '''Geany''' editor to test the Chinese input method</p><p>[[File:zero2w-img198.png]]</p></li><li><p>The Chinese input method test is as follows</p><p>[[File:zero2w-img199.png]]</p></li><li><p>You can switch between Chinese and English input methods through the '''Ctrl+Space''' shortcut key</p></li><li><p>If you need the entire system to be displayed in Chinese, you can set all variables in '''/etc/default/locale''' to '''zh_CN.UTF-8'''</p><p>orangepi@orangepi:~$ '''sudo vim /etc/default/locale'''</p><p># File generated by update-locale</p><p>LC_MESSAGES='''zh_CN.UTF-8'''</p><p>LANG='''zh_CN.UTF-8'''</p><p>LANGUAGE='''zh_CN.UTF-8'''</p></li><li><p>Then '''restart the system''' and you will see that the system is displayed in Chinese.</p><p>[[File:zero2w-img200.png]]</p></li></ol> <span id="installation-method-of-ubuntu-20.04via-systemdocker"></span>=== Installation method of Ubuntu 20.04 system via docker ===
<ol style="list-style-type: decimal;">
<li><p>First open , please install docker and ensure that docker can run normally. For the installation steps of docker, please refer to the instructions in the [[Orange Pi Zero 2W#How to install Docker|'''Language SupportHow to Install Docker'''</p><p>[[File:zero2w-img201.png]]section.</p></li><li><p>Then find you can search for the '''Chinese (China)''' optiondocker image of Home Assistant</p>{| class="wikitable" style="width:800px;" |-| <p>[[Fileorangepi@orangepi:zero2w-img202.png]]~$ '''docker search homeassistant'''</p>|}</li><li><p>Then please use the left button following command to download the Docker image of Home Assistant to your local computer. The image size is about 1GB, and the mouse download time will be relatively long. Please be patient and wait for the download to select complete.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''Chinese (China)docker pull homeassistant/home-assistant''' and hold it down, then drag it up to the starting position. After dragging, the display will be as shown below</p><p>Using default tag:latest</p><p>[[Filelatest:zero2wPulling from homeassistant/home-img203.png]]assistant</p><p>be307f383ecc: Downloading</lip><p>5fbc4c07ac88: Download complete</olp<p>'''Note that this step is not easy to drag, please be patient and try it a few times...... (Omit some output)'''</p><p>3cc6a1510c9f: Pull complete</p><ol start="4" style="list-style-typep>7a4e4d5b979f: decimal;"Pull complete</p><lip>Digest: sha256:81d381f5008c082a37da97d8b08dd8b358dae7ecf49e62ce3ef1eeaefc4381bb</p><p>Then select '''Apply SystemStatus: Downloaded newer image for homeassistant/home-Wide''' to apply the Chinese settings to the entire systemassistant:latest</p><p>[[Filedocker.io/homeassistant/home-assistant:zero2w-img204.png]]latest</p>|}</li><li><p>Then set you can use the '''Keyboard input method system''' system following command to view the docker image of Home Assistant you just downloaded</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''fcitxdocker images homeassistant/home-assistant'''</p><p>[[File:zero2w-img205.png]]REPOSITORY &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TAG &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IMAGE &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ID &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CREATED &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SIZE</p></li><li><p>homeassistant/home-assistant &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; latest &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bfa0ab9e1cf5 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2 months ago &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '''Then restart the Linux system to make the configuration take effect<span style="color:#FF0000">1.17GB</span>'''</p>|}</li><li><p>After reAt this point you can run the Home Assistant docker container</p>{| class="wikitable" style="width:800px;" |-entering the system, please select | <p>orangepi@orangepi:~$ '''Do not ask me againdocker run -d \''' in the following interface, and then please decide according to your own preferences whether the standard folder should also be updated to Chinese</p>:<p>[[File:zero2w'''--img206.png]]name homeassistant \'''</p>:<p>'''--privileged \'''</lip><li>:<p>Then you can see that the desktop is displayed in Chinese'''--restart=unless-stopped \'''</p>:<p>[[File:zero2w'''-img207.png]]e TZ=Asia/Shanghai \'''</p>:<p>'''-v /lihome/orangepi/home-assistant:/config \'''</p><li>:<p>Then we can open '''Geany--network=host \''' to test the Chinese input method. The opening method is as shown in the figure below</p>:<p>[[File'''homeassistant/home-assistant:zero2w-img208.png]]latest'''</p>|}</li><li><p>After opening '''GeanyThen enter【the IP address of the development board: 8123】in the browser to see the Home Assistant interface</p>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''It takes a while for the Home Assistant container to start. If the interface below does not display normally, please wait a few seconds before refreshing it. If the English input method following interface is still not displayed normally after waiting for more than a minute, it means there is a problem with the defaultHome Assistant installation. We can switch At this time, you need to check whether there is a problem with the Chinese input method through the '''Ctrl+Spaceprevious installation and setting process.''' shortcut key, and then we can input Chinese.</p></big>|}<pdiv class="figure"> [[File:zero2w-img209img180.png]]</p></li></ol>
<span id="installation-method-of-ubuntu-22.04-system"/div></li><li><p>Then enter your '''name, username''' and '''password''' and click '''Create Account'''</spanp><div class=== Installation method of Ubuntu 22.04 system ==="figure">
<ol style="list-style-type: decimal;"><li><p>First open '''Language Support'''</p><p>[[File:zero2w-img201.png]]</p></li><li><p>Then find the '''Chinese (China)''' option</p><p>[[File:zero2w-img210.png]]</p></li><li><p>Then please use the left button of the mouse to select '''Chinese (China)''' and hold it down, then drag it up to the starting position. After dragging, the display will be as shown below:</p><p>[[File:zero2w-img211img181.png]]</p></li></ol>
'''Note that this step is not easy </div></li><li><p>Then follow the interface prompts to dragset according to your own preferences, please be patient and try it a few times.'''then click Next</p><div class="figure">
<ol start="4" style="list-style-type: decimal;"><li><p>Then select '''Apply System-Wide''' to apply the Chinese settings to the entire system</p><p>[[File:zero2w-img212.png]]</p></li><li><p>'''Then restart the Linux system to make the configuration take effect'''</p></li><li><p>After re-entering the system, please select '''Do not ask me again''' in the following interface, and then please decide whether the standard folder should also be updated to Chinese according to your own preferences.</p><p>[[File:zero2w-img206.png]]</p></li><li><p>Then you can see that the desktop is displayed in Chinese</p><p>[[File:zero2w-img207img182.png]]</p></li><li><p>Then open the Fcitx5 configuration program</p><p>[[File:zero2w-img213.png]]</pdiv></li><li><p>Then choose to use Pinyin input methodclick Next</p>
<div class="figure">
[[File:zero2w-img214img183.png]]
</div></li>
<li><p>The interface after selection is as shown below, then Then click OK</p><p>[[File:zero2w-img215.png]]Finish</p></li><li><p>Then we can open '''Geany''' to test the Chinese input method. The opening method is as shown in the div class="figure below</p><p>[[File:zero2w-img208.png]]</p></li><li><p>After opening '''Geany''', the English input method is still the default. We can switch to the Chinese input method through the '''Ctrl+Space''' shortcut key, and then we can enter Chinese.</p><p>[[File:zero2w-img216.png]]</p></li></ol">
<span id="how[[File:zero2w-to-remotely-log-in-to-the-linux-system-desktop"></span>== How to remotely log in to the Linux system desktop ==img184.png]]
<span id="remote-login-using-nomachine"/div></spanli>=== Remote login using NoMachine === '''Please ensure that the Ubuntu or Debian system installed on the development board is a desktop version of the system. In addition, NoMachine also provides detailed usage documentation. It is strongly recommended to read this document thoroughly to become familiar with the use of NoMachine. <li><p>The document link main interface finally displayed by Home Assistant is as follows:'''shown below</p> '''https<p>[[File://knowledgebasezero2w-img185.nomachine.compng]]</DT10R00166''' '''NoMachine supports Windows, Mac, Linux, iOS and Android platforms, so we can remotely log in and control the Orange Pi development board through NoMachine on a variety of devices. The following demonstrates how to remotely log in to the Linux system desktop of the Orange Pi development board through NoMachine in Windows. For installation methods on other platforms, please refer to NoMachine's official documentation.''' '''Before operating, please make sure that the Windwos computer and the development board are in the same LAN, and that you can log in to the Ubuntu or Debian system of the development board through ssh normally.''' p><ol style="list-style-type: decimal;"/li><li><p>First download the installation package of the NoMachine software Linux '''arm64''' deb version, and then install it into the Linux system of the development boardMethod to stop Home Assistant container</p>
<ol style="list-style-type: lower-alpha;">
<li>Since H618 is an ARMv8 architecture SOC and <p>The command to view the system we use docker container is &gtas follows</p>{| class="wikitable" style="width:800px; Ubuntu or Debian, we need " |-| <p>orangepi@orangepi:~$ '''docker ps -a'''</p>|}</li><li><p>The command to download stop the Home Assistant container is as follows</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''NoMachine for ARM &gt; ARMv8 DEBdocker stop homeassistant''' installation package. </p>|}</li><li><p>The download link command to delete the Home Assistant container is as &gtfollows</p>{| class="wikitable" style="width:800px; follows" |-| <p>orangepi@orangepi:~$ '''docker rm homeassistant'''</p>|}</li></ol>
</li></ol>
'''Note that this download link may change, please look for the Armv8<span id="installation-via-python"></Arm64 version of the deb package.'''span>
[https://www.nomachine.com/download/download&id=112&s=ARM '''https://downloads.nomachine.com/download/?id=118&amp;distroInstallation via python ===ARM''']
[[File{| class="wikitable" style="background-color:#ffffdc;width:zero2w800px;" |-img217| <big>'''Before installation, please change the source of pip to a domestic source to speed up the installation of Python packages.pngFor the configuration method, see the instructions in the section &quot;[[Orange Pi Zero 2W#How to replace pip source in Python|How to Change the Pip Source of Python]]&quot;'''</big>|}
<ol start="2" style="list-style-type: lower-alphadecimal;"><li><p>In additionFirst 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, you can also download please use the following command:'''</p></big><p>orangepi@orangepi:~$ '''NoMachinesudo apt-get update''' installation &gt; package from the official tool.</p><p>[[Fileorangepi@orangepi:zero2w~$ '''sudo apt-get install -y python3 python3-dev python3-img218.png]]venv \'''</p><p>'''python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \'''</p><p>First enter the '''remote login softwarelibopenjp2-NoMachine7 libturbojpeg0-dev tzdata''' folder</p>|}</li><li><p>Then you need to compile and install Python3.9. For the method, please refer to the [[FileOrange Pi Zero 2W#Python related instructions|'''Python source code compilation and installation method''']] section.</p>{| class="wikitable" style="background-color:zero2w#ffffdc;width:800px;" |-img219| <big><p>'''The default Python version of Debian Bullseye is Python3.png]]9, so there is no need to compile and install it.'''</p><p>Then download the arm64 '''The default Python version of the deb installation packageUbuntu Jammy is Python3.10, so there is no need to compile and install it.'''</p><p>[[File:zero2w-img220'''The default Python version of Debian Bookworm is Python3.11, so there is no need to compile and install it.png]]'''</p></big>|}</li><li><p>Then upload 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 downloaded 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:~$ '''cd /srv/homeassistant'''</p><p>orangepi@orangepi:~$ '''nomachine_xpython3.x9 -m venv .x_x_arm64.deb''' to </p><p>orangepi@orangepi:~$ '''source bin/activate'''</p><p>(homeassistant) orangepi@orangepi:/srv/homeassistant$</p>|}</li><li><p>Then install the &gtrequired Python packages</p>{| class="wikitable" style="width:800px; Linux system of the development board" |-| <p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''python3 -m pip install wheel'''</p>|}</li><li><p>Then use the following command to you can install Home Assistant Core</p>{| class="wikitable" style="width:800px;" |-| <p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''NoMachinepip3 install homeassistant''' in </p>|}</li><li><p>Then enter the Linux &gt; system of the development boardfollowing command to run Home Assistant Core</p>{| class="wikitable" style="width:800px;" |-| <p>(homeassistant) orangepi@orangepi:~/srv/homeassistant$ '''sudo dpkg 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;" |-i nomachine_x| <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.xNote that you cannot see the Home Assistant interface in the browser at this time.x_x_arm64_arm64Please wait for a while and then refresh it.deb'''</p></libig>|}</oldiv class="figure">
<!-- [[File:zero2w--><ol start="2" style="list-style-type: decimal;"><li>Then download the installation package of the Windows version of the NoMachine softwareimg180. The download address is as follows</li></ol>png]]
'''Note that this download link may change.'''</div></li></ol>
'''https://downloads.nomachine.com/download/?<span id=9'''"opencv-installation-method"></span>
[[File:zero2w-img221.png]]== OpenCV installation method ==
<ol startspan id="3" style="list-styleuse-type: decimal;"><li><p>Then install NoMachine in Windows. '''Please restart your computer after installation.'''</p></li><li><p>Then open '''NoMachine''' in Window</p><p>[[File:zero2wapt-img222.png]]</p></li><li><p>After NoMachine is started, it will automatically scan other devices with NoMachine installed on the LAN. After entering the main interface of NoMachine, you can see that the development board is already in the list of connectable devices, and then click on the location shown in the red box in the picture below You can now log in to the Linux system desktop of the development board.</p><p>[[File:zero2w-img223.png]]</p></li><li><p>Then click '''OK'''</p><p>[[File:zero2w-img224.png]]</p></li><li><p>Then enter the username and password of the development board Linux system in the corresponding positions in the figure below, and then click OK to start logging in.</p><p>[[File:zero2winstall-img225.png]]</p></li><li><p>Then click OK in the next interface.</p></li><li><p>Finally you can see the desktop of the development board Linux system</p><p>[[File:zero2w-img226.png]]</p></li></ol> <span id="remote-login-using-vncopencv"></span>=== Remote login using VNC Use apt to install OpenCV === '''Before operating, please make sure that the Windwos computer and the development board are in the same LAN, and that you can log in to the Ubuntu or Debian system of the development board through ssh normally.''' '''There are many problems with VNC testing in Ubuntu20.04, please do not use this method.'''
<ol style="list-style-type: decimal;">
<li><p>First run the '''set_vnc.sh''' script to set up vnc, '''remember to add sudo permission'''sThe installation command is as follows</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo set_vnc.shapt-get update'''</p><p>You will require a password to access your desktops.</p><p>Passwordorangepi@orangepi: ~$ '''#Set the vnc password here, 8 characters'''</p><p>Verify: '''#Set the vnc password here, 8 characters'''</p><p>Would you like to enter a viewsudo apt-get install -only password (y/n)? '''nlibopencv-dev python3-opencv'''</p><p>xauth: file /root/.Xauthority does not exist</p>|}<p>New 'X' desktop is orangepi:1</p><p>Creating default startup script /root/.vnc/xstartup</p><p>Starting applications specified in /root/.vnc/xstartup</p><p>Log file is /root/.vnc/orangepi:1.log</p><p>Killing Xtightvnc process ID 3047</p><p>New 'X' desktop is orangepi:1</p><p>Starting applications specified in /root/.vnc/xstartup</p><p>Log file is /root/.vnc/orangepi:1.log</p></li><li><p>The steps to Then use MobaXterm software to connect the following command to print the version number of OpenCV. The output is normal, indicating that the development board Linux system desktop are as follows:OpenCV installation is successful.</p>
<ol style="list-style-type: lower-alpha;">
<li>First click Session, then select VNC, then fill <p>The version of OpenCV in the IP Ubuntu22.04 is as follows:</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''python3 -c &gtquot;import cv2; address and port of the development board, and finally click print(cv2.__version__)&gtquot; OK to confirm'''</p><p>'''4.5.4'''</lip>|}</olli></li><p>The version of OpenCV in Ubuntu20.04 is as follows:</olp<div {| class="figurewikitable">style="width:800px;" |-| [[File<p>orangepi@orangepi:zero2w~$ '''python3 -img227c &quot;import cv2; print(cv2.__version__)&quot;'''</p><p>'''4.png]]2.0'''</p>|}</divli><ol startli><p>The version of OpenCV in Debian11 is as follows:</p>{| class="2wikitable" style="list-style-typewidth: lower-alpha800px;"><li>|-| <p>Then enter the VNC password set earlierorangepi@orangepi:~$ '''python3 -c &quot;import cv2; print(cv2.__version__)&quot;'''</p><p>[[File:zero2w-img228'''4.5.png]]1'''</p>|}</li><li><p>After successful login, the interface The version of OpenCV in Debian12 is displayed as shown below, follows:</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''python3 -c &gtquot;import cv2; and then you can remotely operate the desktop of the development print(cv2.__version__)&gtquot; board Linux system'''</p><p>'''4.6.0'''</p>|}</li></ol></li></ol> <span id="set-up-the-chinese-environment-and-install-the-chinese-input-method"></span> == Set up the Chinese environment and install the Chinese input method ==
[[File{| class="wikitable" style="background-color:#ffffdc;width:zero2w800px;" |-img229| <big>'''Note, before installing the Chinese input method, please make sure that the Linux system used by the development board is a desktop version.png]]'''</big>|}
<span id="qtdebian-system-installation-method"></span>== QT = Debian system installation method ===
<ol style="list-style-type: decimal;">
<li><p>Use First set the following script to install QT5 and QT Creator</p><p>orangepi@orangepi:~$ default '''install_qt.shlocale'''</p></li><li><p>After installation, the QT version number will be automatically printed.to Chinese</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The qt version that comes with Ubuntu20.04 is Enter the following command to start configuring '''5.12.8locale'''</p><p>orangepi@orangepi:~$ '''install_qt.sh'''</p><p>......</p><p>QMake version 3.1</p><p>Using Qt version '''5.12.8''' in /usr/lib/aarch64-linux-gnu</p></li><li><p>The QT version that comes with Ubuntu22.04 is '''5.15.3'''</p><p>orangepi@orangepi{| class="wikitable" style="width:~$ '''install_qt.sh'''</p><p>......</p><p>QMake version 3.1</p>800px;" <p>Using Qt version '''5.15.3''' in /usr/lib/aarch64-linux|-gnu</p></li><li><p>The QT version that comes with Debian11 is '''5.15.2'''</p>| <p>orangepi@orangepi:~$ '''install_qt.sh'''</p><p>......</p><p>QMake version 3.1</p><p>Using Qt version '''5.15.2''' in /usr/lib/aarch64-linuxsudo dpkg-gnu</p></li><li><p>The QT version that comes with Debian12 is '''5.15.8'''</p><p>orangepi@orangepi:~$ '''install_qt.shreconfigure locales'''</p><p>......</p><p>QMake version 3.1</p><p>Using Qt version '''5.15.8''' in /usr/lib/aarch64-linux-gnu</p></li></ol>|}
</li>
<li><p>Then you can see the QT Creator startup icon in select '''Applicationszh_CN.UTF-8 UTF-8'''</p><p>[[File:zero2win the pop-img230.png]]</p><p>You can also up interface (use the up and down keys on the keyboard to move up and down, use the space bar to select, and finally use the following command Tab key to move the cursor to open QT Creator</p><p>orangepi@orangepi:~$ '''qtcreator&lt;OK&gt;'''</p></li><li><p>The interface after QT Creator is opened is as follows, and then return Car can be used)</p><p>[[File:zero2w-img231img186.png]]</p></li><li><p>The version of QT Creator is as follows</p><ol style="list-style-type: lower-alpha;"><li><p>The Then set the default version of QT Creator in '''Ubuntu20locale''' to '''zh_CN.04UTF-8''' is as &gt; follows</p><p>[[File:zero2w-img232img187.png]]</p></li><li><p>The default version of QT Creator in After exiting the interface, the '''Ubuntu22.04locale''' setting will begin. The output displayed on the command line is as &gt; follows:</p><p>[[File{| class="wikitable" style="width:zero2w800px;" |-img233.png]]</p></li><li>| <p>The default version of QT Creator in orangepi@orangepi:~$ '''Debian11sudo dpkg-reconfigure locales''' is as follows</p><p>[[File:zero2w-img234Generating locales (this might take a while)...png]]</p>:<p>en_US.UTF-8... done</lip><li>:<p>The default version of QT Creator in '''Debian12''' is as followszh_CN.UTF-8... done</p><p>[[File:zero2w-img235Generation complete.png]]</p>|}</li></ol>
</li>
<li><p>Then set up QT</p><ol style="list-style-type: lower-alpha;"><li><p>First open '''Help'''-&gt;'''About Plugins...Input Method'''.</p><p>[[File:zero2w-img236img188.png]]</p></li><li><p>Then remove the check mark of select '''ClangCodeModelOK'''</p><p>[[File:zero2w-img237img189.png]]</p></li><li><p>'''After setting up, you need to restart QT Creator'''</p></li><li><p>Then make sure the GCC compiler used by QT Creator. If the &gt; default is Clang, please change it to GCC.</p><p>select '''Debian12 please skip this step.Yes'''</p><p>[[File:zero2w-img238.png]]</p><p>[[File:zero2w-img239img190.png]]</p></li></ol></li><li><p>Then you can open a sample codeselect '''fcitx'''</p><p>[[File:zero2w-img240img191.png]]</p></li><li><p>After clicking on the sample code, the corresponding instruction document will automatically open. You can read the instructions carefully.Then select '''OK'''</p><p>[[File:zero2w-img241img192.png]]</p></li><li><p>Then click '''Configure Project'''</pspan style="color:#FF0000">Then restart the Linux system to make the configuration take effect.<p/span>[[File:zero2w-img242.png]]'''</p></li><li><p>Then click the green triangle in the lower left corner to compile and run the sample codeopen '''Fcitx configuration'''</p><p>[[File:zero2w-img243img193.png]]</p></li><li><p>After waiting for a period of time, Then click the interface + sign as shown in the figure picture below will pop up, which means that QT can compile and run normally.</p><p>[[File:zero2w-img244img194.png]]</p></li><li><p>References</p><p>[https://wiki.qt.io/Install_Qt_5_on_Ubuntu Then search '''https://wiki.qt.io/Install_Qt_5_on_UbuntuGoogle Pinyin''']</p><p>[https://download.qt.io/archive/qtcreator and click '''https://download.qt.io/archive/qtcreatorOK''']</p><p>[https://download.qt.io/archive/qt '''https://download.qt.io/archive/qt''']</p></li></oldiv class="figure">
<span id="ros[[File:zero2w-installation-method"></span>== ROS installation method ==img195.png]]
<span id="how/div></li><li><p>Then put '''Google Pinyin''' on top</p><p>[[File:zero2w-img196.png]]</p><p>[[File:zero2w-img197.png]]</p></li><li><p>Then open the '''Geany''' editor totest the Chinese input method</p><p>[[File:zero2w-installimg198.png]]</p></li><li><p>The Chinese input method test is as follows</p><p>[[File:zero2w-rosimg199.png]]</p></li><li><p>You can switch between Chinese and English input methods through the '''Ctrl+Space''' shortcut key</p></li><li><p>If you need the entire system to be displayed in Chinese, you can set all variables in '''/etc/default/locale''' to '''zh_CN.UTF-18'''</p>{| class="wikitable" style="width:800px;" |-noetic| <p>orangepi@orangepi:~$ '''sudo vim /etc/default/locale'''</p><p># File generated by update-on-ubuntu20.04locale</p><p>LC_MESSAGES='''<span style="color:#FF0000">zh_CN.UTF-8</span>'''</p><p>LANG='''<span style== How to install ROS 1 Noetic on Ubuntu20"color:#FF0000">zh_CN.04 UTF-8</span>'''</p><p>LANGUAGE='''<span style="color:#FF0000">zh_CN.UTF-8</span>'''</p>|}</li><li><p>Then '''<span style="color:#FF0000">restart the system</span>''' and you will see that the system is displayed in Chinese.</p><p>[[File:zero2w-img200.png]]</p></li></ol>
# The currently active version <span id="installation-method-of ROS 1 is as follows, the recommended version is '''Noetic Ninjemys'''-ubuntu-20.04-system"></span>
[[File:zero2w-img245=== Installation method of Ubuntu 20.png]]04 system ===
<ol style="list-style-type: decimal;"><li><p>First open '''Language Support'''</p><p>[[File:zero2w-img201.png]]</p></li><li><p>Then find the '''Chinese (China)''' option</p><p>[[File:zero2w-img202.png]]</p></li><li><p>Then please use the left button of the mouse to select '''Chinese (China)''' and hold it down, then drag it up to the starting position. After dragging, the display will be as shown below:</p><p>[[File:zero2w-img203.png]]</p></li>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Note that this step is not easy to drag, please be patient and try it a few times.'''</big>|}</ol><ol start="4" style="list-style-type: decimal;"><li><p>Then select '''Apply System-Wide''' to apply the Chinese settings to the entire system</p><p>[[File:zero2w-img204.png]]</p></li><li><p>Then set the '''Keyboard input method system''' system to '''fcitx'''</p><p>[[File:zero2w-img205.png]]</p></li><li><p>'''<span style="color:#FF0000">Then restart the Linux system to make the configuration take effect</span>'''</p></li><li><p>After re-entering the system, please select '''Do not ask me again''' in the following interface, and then please decide according to your own preferences whether the standard folder should also be updated to Chinese</p><p>[[File:zero2w-img206.png]]</p></li><li><p>Then you can see that the desktop is displayed in Chinese</p><p>[[File:zero2w-img207.png]]</p></li><li><p>Then we can open '''Geany''' to test the Chinese input method. The opening method is as shown in the figure below</p><p>[[File:zero2w-img208.png]]</p></li><li><p>After opening '''Geany''', the English input method is still the default. We can switch to the Chinese input method through the '''Ctrl+Space''' shortcut key, and then we can input Chinese.</p><p>[[File:zero2w-img246img209.png]]</p></li></ol>
[http://docs.ros<span id="installation-method-of-ubuntu-22.org04-system"></ '''http://docs.ros.org''']span>
'''https://wiki=== Installation method of Ubuntu 22.ros.org/Distributions'''04 system ===
<ol start="2" style="list-style-type: decimal;"><li><p>The link to the official installation documentation of ROS 1 First open '''Noetic NinjemysLanguage Support''' is as follows:</p><p>[http[File://wikizero2w-img201.ros.orgpng]]</noeticp></Installation/Ubuntu li><li><p>Then find the '''http://wiki.ros.org/noetic/Installation/UbuntuChinese (China)'''option</p><p>[[File:zero2w-img210.png]]</p></li><li><p>In Then please use the official installation documentation left button of ROS the mouse to select '''Noetic NinjemysChinese (China)'''and hold it down, Ubuntu recommends using Ubuntu20then drag it up to the starting position.04After dragging, so please ensure that the system used by the development board is '''Ubuntu20.04 desktop system'''.display will be as shown below:</p><p>[http[File://wikizero2w-img211.ros.orgpng]]</noeticp></Installation li>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''http://wikiNote that this step is not easy to drag, please be patient and try it a few times.ros.org'''</noeticbig>|}</Installationol><ol start="4" style="list-style-type: decimal;"><li><p>Then select ''']Apply System-Wide''' to apply the Chinese settings to the entire system</p><p>[[File:zero2w-img247img212.png]]</p></li><li><p>'''<span style="color:#FF0000">Then use restart the script below Linux system to install ros1make the configuration take effect</span>'''</p></li><li><p>orangepi@orangepi:~$ After re-entering the system, please select '''install_ros.sh ros1Do not ask me again'''in the following interface, and then please decide whether the standard folder should also be updated to Chinese according to your own preferences.</p><p>[[File:zero2w-img206.png]]</p></li><li><p>Before using the ROS tool, you first need to initialize rosdep. Then when compiling the source code, you can quickly install some system dependencies and some core components see that the desktop is displayed in ROSChinese</p><p>[[File:zero2w-img207.png]]</p></li></olli><p'''Note that when running Then open the following command, you need to ensure that the development board can access github normally, otherwise an error will be reported due to network problems.''' '''The install_ros.sh script will try to modify Fcitx5 configuration program</etc/hosts and automatically run the following commands. However, this method cannot guarantee that github can be accessed normally every time. If install_ros.sh prompts the following error after installing ros1, please find other ways to allow the linux system of the development board to access github normally, and then manually run the following Order.'''p> '''https<p>[[File://rawzero2w-img213.githubusercontent.compng]]</rosp></rosdistroli><li><p>Then choose to use Pinyin input method</master/rosdep/osx-homebrew.yaml'''p><div class="figure">
'''Hit https[[File://rawzero2w-img214.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml'''png]]
</div></li><li><p>The interface after selection is as shown below, then click OK</p><p>[[File:zero2w-img215.png]]</p></li><li><p>Then we can open '''Geany'''ERROR: error loading sources listto test the Chinese input method. The opening method is as shown in the figure below</p><p>[[File:zero2w-img208.png]]</p></li><li><p>After opening '''Geany''', the English input method is still the default. We can switch to the Chinese input method through the '''Ctrl+Space'''shortcut key, and then we can enter Chinese.</p><p>[[File:zero2w-img216.png]]</p></li></ol>
'''The read operation timed out'''<span id="how-to-remotely-log-in-to-the-linux-system-desktop"></span>
orangepi@orangepi:~$ '''source /opt/ros/noetic/setup.bash'''== How to remotely log in to the Linux system desktop ==
orangepi@orangepi:~$ '''sudo rosdep init'''<span id="remote-login-using-nomachine"></span>=== Remote login using NoMachine ===
Wrote /etc{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Please ensure that the Ubuntu or Debian system installed on the development board is a <span style="color:#FF0000">desktop version</ros/rosdep/sourcesspan> of the system.listIn addition, NoMachine also provides detailed usage documentation.d/20-defaultIt is strongly recommended to read this document thoroughly to become familiar with the use of NoMachine.listThe document link is as follows:'''
Recommended'''https: //knowledgebase.nomachine.com/DT10R00166'''</big>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''NoMachine supports Windows, Mac, Linux, iOS and Android platforms, so we can remotely log in and control the Orange Pi development board through NoMachine on a variety of devices. The following demonstrates how to remotely log in to the Linux system desktop of the Orange Pi development board through NoMachine in Windows. For installation methods on other platforms, please refer to NoMachine's official documentation.'''</big>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Before operating, please runmake sure that the Windwos computer and the development board are in the same LAN, and that you can log in to the Ubuntu or Debian system of the development board through ssh normally.'''</big>|}
rosdep update<ol style="list-style-type: decimal;"><li><p>First download the installation package of the NoMachine software Linux '''<span style="color:#FF0000">arm64</span>''' deb version, and then install it into the Linux system of the development board</p><ol style="list-style-type: lower-alpha;"><li>Since H618 is an ARMv8 architecture SOC and the system we use is Ubuntu or Debian, we need to download the '''NoMachine for ARM ARMv8 DEB''' installation package. The download link is as follows:</li>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Note that this download link may change, please look for the Armv8/Arm64 version of the deb package.'''</big>|}{| class="wikitable" style="width:800px;" |-| [https://www.nomachine.com/download/download&id=112&s=ARM '''https://downloads.nomachine.com/download/?id=118&amp;distro=ARM''']|}
[[File:zero2w-img217.png]]</ol><ol start="2" style="list-style-type: lower-alpha;"><li><p>In addition, you can also download the '''NoMachine''' installation package from the official tool.</p><p>[[File:zero2w-img218.png]]</p><p>First enter the '''remote login software-NoMachine''' folder</p><p>[[File:zero2w-img219.png]]</p><p>Then download the arm64 version of the deb installation package</p><p>[[File:zero2w-img220.png]]</p></li><li><p>Then upload the downloaded '''nomachine_x.x.x_x_arm64.deb''' to the Linux system of the development board</p></li><li><p>Then use the following command to install '''NoMachine''' in the Linux system of the development board</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''rosdep updatesudo dpkg -i nomachine_x.x.x_x_arm64_arm64.deb'''</p>|}reading in sources list data from </etcli></rosol></rosdepli></sourcesol><ol start="2" style="list-style-type: decimal;"><li>Then download the installation package of the Windows version of the NoMachine software.listThe download address is as follows</li>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Note that this download link may change.d'''</big>|}{| class="wikitable" style="width:800px;" Hit |-| '''https://rawdownloads.githubusercontentnomachine.com/rosdownload/rosdistro/master/rosdep/osx-homebrew.yaml?id=9'''|}
Hit https[[File:zero2w-img221.png]]</ol><ol start="3" style="list-style-type: decimal;"><li><p>Then install NoMachine in Windows. '''Please restart your computer after installation.'''</p></li><li><p>Then open '''NoMachine''' in Window</rawp><p>[[File:zero2w-img222.githubusercontentpng]]</p></li><li><p>After NoMachine is started, it will automatically scan other devices with NoMachine installed on the LAN. After entering the main interface of NoMachine, you can see that the development board is already in the list of connectable devices, and then click on the location shown in the red box in the picture below You can now log in to the Linux system desktop of the development board.com</rosp><p>[[File:zero2w-img223.png]]</rosdistrop></masterli><li><p>Then click '''OK'''</rosdepp><p>[[File:zero2w-img224.png]]</basep></li><li><p>Then enter the username and password of the development board Linux system in the corresponding positions in the figure below, and then click OK to start logging in.yaml</p><p>[[File:zero2w-img225.png]]</p></li><li><p>Then click OK in the next interface.</p></li><li><p>Finally you can see the desktop of the development board Linux system</p><p>[[File:zero2w-img226.png]]</p></li></ol>
Hit https:<span id="remote-login-using-vnc"><//raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yamlspan>
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml=== Remote login using VNC ===
Hit https{| class="wikitable" style="background-color://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte#ffffdc;width:800px;" |-| <big>'''Before operating, please make sure that the Windwos computer and the development board are in the same LAN, and that you can log in to the Ubuntu or Debian system of the development board through ssh normally.yaml'''
Query rosdistro index https'''<span style="color://raw#FF0000">There are many problems with VNC testing in Ubuntu20.githubusercontent04, please do not use this method.com</rosspan>'''</rosdistro/master/index-v4.yamlbig>|}
Skip end<ol style="list-ofstyle-life distro &quottype: decimal;ardent&quot"><li><p>First run the '''set_vnc.sh''' script to set up vnc, '''remember to add sudo permission'''s</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo set_vnc.sh'''</p><p>You will require a password to access your desktops.</p>
Skip end-of-life distro &quot;bouncy&quot;
Skip end-of-life distro <p>Password: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '''<span style="color:#FF0000">#Set the vnc password here, 8 characters</span>'''</p><p>Verify: &nbsp;&nbsp;&nbsp;&nbsp;&quotnbsp;crystal&quotnbsp;'''<span style="color:#FF0000">#Set the vnc password here, 8 characters</span>'''</p><p>Would you like to enter a view-only password (y/n)? '''<span style="color:#FF0000">n</span>'''</p><p>xauth: file /root/.Xauthority does not exist</p>
Skip end-of-life distro &quot;dashing&quot;
Skip end-of-life distro &quot;eloquent&quot;<p>New 'X' desktop is orangepi:1</p>
Add distro &quot;foxy&quot;
Add distro &quot;galactic&quot;<p>Creating default startup script /root/.vnc/xstartup</p><p>Starting applications specified in /root/.vnc/xstartup</p><p>Log file is /root/.vnc/orangepi:1.log</p>
Skip end-of-life distro &quot;groovy&quot;
Add distro &quot;humble&quot;<p>Killing Xtightvnc process ID 3047</p>
Skip end-of-life distro &quot;hydro&quot;
Skip end-of-life distro &quot;indigo&quot;<p>New 'X' desktop is orangepi:1</p>
Skip end-of-life distro &quot;jade&quot;
Skip end<p>Starting applications specified in /root/.vnc/xstartup</p><p>Log file is /root/.vnc/orangepi:1.log</p>|}</li><li><p>The steps to use MobaXterm software to connect to the development board Linux system desktop are as follows:</p><ol style="list-ofstyle-type: lower-life distro &quot;kinetic&quotalpha;"><li>First click Session, then select VNC, then fill in the IP address and port of the development board, and finally click OK to confirm.</li>
Skip end-of-life distro &quot;lunar&quot;<div class="figure">
Add distro &quot;melodic&quot;[[File:zero2w-img227.png]]
Add distro &quot;noetic&quot</div></ol><ol start="2" style="list-style-type: lower-alpha;"><li><p>Then enter the VNC password set earlier</p><p>[[File:zero2w-img228.png]]</p></li><li><p>After successful login, the interface is displayed as shown below, and then you can remotely operate the desktop of the development board Linux system.</p></li>
Add distro &quot;rolling&quot;[[File:zero2w-img229.png]]</ol></li></ol><span id="qt-installation-method"></span>
updated cache in /home/orangepi/.ros/rosdep/sources.cache <ol start="6" style="list-style-type: decimal;"><li><p>Then open a command line terminal window on the '''desktop''', and then use the '''test_ros.sh''' script to start a small turtle routine to test whether ROS can be used normally.</p><p>orangepi@orangepi:~$ '''test_ros.sh'''</p></li><li><p>After running the '''test_ros.sh''' script, a small turtle as shown in the picture below will pop up.</p><p>[[File:zero2w-img248.png]]</p></li><li><p>Then please keep the terminal window you just opened at the top</p></li></ol> <div class="figure"> [[File:zero2w-img249.png]] </div><ol start="9" style="list-style-type: decimal;"><li><p>At this time, press the direction keys on the keyboard to control the little turtle to move up, down, left, and right.</p><p>[[File:zero2w-img250.png]]</p></li></ol> <span id="how-to-install-ros-2-galactic-on-ubuntu20.04"></span>=== How to install ROS 2 Galactic on Ubuntu20.04 =QT installation method ==
<ol style="list-style-type: decimal;">
<li><p>The currently active version of ROS 2 is as follows, Use the recommended version is '''Galactic Geochelone'''following script to install QT5 and QT Creator</p><p>[[File{| class="wikitable" style="width:zero2w800px;" |-img251.png]]</p>| <p>[[Fileorangepi@orangepi:zero2w-img252~$ '''install_qt.png]]sh'''</p>|}</li><li><p>[http://docs.ros.org/ '''http://docsAfter installation, the QT version number will be automatically printed.ros.org''']</p><p>'''httpol style="list-style-type://docs.ros.org/en/galactic/Releases.html'''</plower-alpha;"></li> <li><p>The link to the official installation documentation of ROS 2 qt version that comes with Ubuntu20.04 is '''Galactic Geochelone5.12.8''' is as follows:</p><p{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''docsinstall_qt.ros.org/en/galactic/Installation.htmlsh'''</p><p>'''http://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html'''...</p></li><lip>QMake version 3.1</p>In the official installation documentation of ROS 2 <p>Using Qt version '''Galactic Geochelone<span style="color:#FF0000">5.12.8</span>''', Ubuntu Linux recommends using Ubuntu20.04, so please ensure that the system used by the development board is the '''Ubuntu20.04 desktop systemin /usr/lib/aarch64-linux-gnu</p>|}</li><li><p>The QT version that comes with Ubuntu22.04 is '''5. There are several ways to install ROS 215. The following demonstrates how to install ROS 2 '''Galactic Geochelone''' through '3'''Debian packages'''.</p></li><li><p>Use the '''install_ros.sh''' script to install ros2</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''install_rosinstall_qt.sh ros2'''</p><p>......</lip><lip>QMake version 3.1</p><p>The Using Qt version '''install_ros.sh<span style="color:#FF0000">5.15.3</span>''' script will automatically run the '''ros2 in /usr/lib/aarch64-h''' command after installing ros2. If you can see the following print, it means that the ros2 installation is complete.linux-gnu</p>|}<p/li>usage: ros2 [-h] Call `ros2 &lt;command&gt; -h` for more detailed usage. .<li><p>The QT version that comes with Debian11 is '''5.15.2'''</p><p>ros2 is an extensible command{| class="wikitable" style="width:800px;" |-line tool for ROS 2.</p>| <p>optional argumentsorangepi@orangepi:~$ '''install_qt.sh'''</p><p>-h, --help show this help message and exit......</p><p>Commands:QMake version 3.1</p><p>action Various action related sub-commandsUsing Qt version '''</pspan style="color:#FF0000">5.15.2<p/span>bag Various rosbag related sub-commands<''' in /p><p>component Various component related subusr/lib/aarch64-linux-commandsgnu</p><p>daemon Various daemon related sub-commands</p>|}<p>doctor Check ROS setup and other potential issues</pli><pli>interface Show information about ROS interfaces</p><p>launch Run a launch fileThe QT version that comes with Debian12 is '''5.15.8'''</p><p>lifecycle Various lifecycle related sub-commands</p>{| class="wikitable" style="width:800px;" <p>multicast Various multicast related sub|-commands</p><p>node Various node related sub-commands</p>| <p>param Various param related sub-commandsorangepi@orangepi:~$ '''install_qt.sh'''</p><p>pkg Various package related sub-commands......</p><p>run Run a package specific executableQMake version 3.1</p><p>security Various security related sub-commandsUsing Qt version '''</pspan style="color:#FF0000">5.15.8<p/span>service Various service related sub''' in /usr/lib/aarch64-commandslinux-gnu</p>|}<p/li>topic Various topic related sub-commands</pol><p>wtf Use `wtf` as alias to `doctor`</pli><pli>Call `ros2 &lt;command&gt; -h` for more detailed usage.</p></li><li><p>Then you Then you can use see the QT Creator startup icon in '''test_ros.shApplications''' script to test whether ROS 2 is installed successfully. If you can see the following print, it means ROS 2 can run normally</p><p>[[File:zero2w-img230.png]]</p><p>orangepi@orangepi:~$ '''test_ros.sh'''You can also use the following command to open QT Creator</p>{| class="wikitable" style="width:800px;" |-| <p>[INFO] [1671174101.200091527] [talker]: Publishingorangepi@orangepi: ~$ '''qtcreator''Hello World: 1'</p>|}</li><li><p>[INFO] [1671174101.235661048] [listener]: I heard: [Hello World: 1]The interface after QT Creator is opened is as follows</p><p>[INFO] [1671174102File:zero2w-img231.199572327png] [talker]: Publishing: 'Hello World: 2'</pp></li><pli>[INFO] [1671174102.204196299] [listener]: I heard: [Hello World: 2]</p><p>[INFO] [1671174103.199580322] [talker]: Publishing: 'Hello World: 3'</p><p>[INFO] [1671174103.204019965] [listener]: I heard: [Hello World: 3]</p></li><li><p>Run the following command to open rviz2</p><p>orangepi@orangepi:~$ '''source /opt/ros/galactic/setup.bash'''</p><p>orangepi@orangepi:~$ '''ros2 run rviz2 rviz2'''</p><p>[[File:zero2w-img253.png]]</p></li><li><p>For how to use ROS, please refer to the documentation of ROS 2.</p><p>[http://docs.ros.org/en/galactic/Tutorials.html '''http://docs.ros.org/en/galactic/Tutorials.html''']</p></li></ol> <span id="how-to-install-ros-2-humble-on-ubuntu22.04"></span>=== How to install ROS 2 Humble on Ubuntu22.04 === <ol style="list-style-type: decimal;"><li><p>Use the install_ros.sh script to '''install_ros.sh'''</p><p>orangepi@orangepi:~$ '''install_ros.sh ros2'''</p></li><li><p>The '''install_ros.sh''' script will automatically run the '''ros2 -h''' command after installing ros2. If you can see the following print, it means that the ros2 installation is complete.</p><p>usage: ros2 [-h] Call `ros2 &lt;command&gt; -h` for more detailed usage. ...</p><p>ros2 is an extensible command-line tool for ROS 2.</p><p>optional arguments:</p><p>-h, --help show this help message and exit</p><p>Commands:</p><p>action Various action related sub-commands</p><p>bag Various rosbag related sub-commands</p><p>component Various component related sub-commands</p><p>daemon Various daemon related sub-commands</p><p>doctor Check ROS setup and other potential issues</p><p>interface Show information about ROS interfaces</p><p>launch Run a launch file</p><p>lifecycle Various lifecycle related sub-commands</p><p>multicast Various multicast related sub-commands</p><p>node Various node related sub-commands</p><p>param Various param related sub-commands</p><p>pkg Various package related sub-commands</p><p>run Run a package specific executable</p><p>security Various security related sub-commands</p><p>service Various service related sub-commands</p><p>topic Various topic related sub-commands</p><p>wtf Use `wtf` as alias to `doctor`</p><p>Call `ros2 &lt;command&gt; -h` for more detailed usage.</p></li><li><p>Then you can use the '''test_ros.sh''' script to test whether ROS 2 is successfully installed. If you can see the following print, it means ROS 2 can run normally.</p><p>orangepi@orangepi:~$ '''test_ros.sh'''</p><p>[INFO] [1671174101.200091527] [talker]: Publishing: 'Hello World: 1'</p><p>[INFO] [1671174101.235661048] [listener]: I heard: [Hello World: 1]</p><p>[INFO] [1671174102.199572327] [talker]: Publishing: 'Hello World: 2'</p><p>[INFO] [1671174102.204196299] [listener]: I heard: [Hello World: 2]</p><p>[INFO] [1671174103.199580322] [talker]: Publishing: 'Hello World: 3'</p><p>[INFO] [1671174103.204019965] [listener]: I heard: [Hello World: 3]</p></li><li><p>Run the following command to open rviz2</p><p>orangepi@orangepi:~$ '''source /opt/ros/humble/setup.bash'''</p><p>orangepi@orangepi:~$ '''ros2 run rviz2 rviz2'''</p><p>[[File:zero2w-img254.png]]</p></li><li><p>Reference documentation</p><p>'''http://docs.ros.org/en/humble/index.html'''</p><p>[http://docs.ros.org/en/galactic/Tutorials.html '''http://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html''']</p></li></ol> <span id="how-to-install-kernel-header-files"></span>== How to install kernel header files == '''Debian11 system with Linux6.1 kernel will report GCC error when compiling kernel module. So if you want to compile the kernel module, please use Debian12 or Ubuntu22.04.''' <ol style="list-style-type: decimal;"><li><p>The Linux image released by OPi comes with the deb package of the kernel header file by default, and the storage location is '''/opt/'''</p><p>orangepi@orangepi:~$ '''ls /opt/linux-headers*'''</p><p>/opt/linux-headers-xxx-sun50iw9_x.x.x_arm64.deb</p></li><li><p>Use the following command to install the deb package of the kernel header file</p><p>orangepi@orangepi:~$ '''sudo dpkg -i /opt/linux-headers*.deb'''</p></li><li><p>After installation, you can see the folder where the kernel header file is located under '''/usr/src'''.</p><p>orangepi@orangepi:~$ '''ls /usr/src'''</p><p>linux-headers-x.x.x</p></li><li><p>Then you can compile the source code of the hello kernel module that comes with the Linux image. The source code of the hello module is in '''/usr/src/hello'''. After entering this directory, then use the make command to compile.</p><p>orangepi@orangepi:~$ '''cd /usr/src/hello/'''</p><p>orangepi@orangepi:/usr/src/hello$ '''sudo make'''</p><p>make -C /lib/modules/5.4.125/build M=/usr/src/hello modules</p><p>make[1]: Entering directory '/usr/src/linux-headers-5.4.125'</p><p>CC [M] /usr/src/hello/hello.o</p><p>Building modules, stage 2.</p><p>MODPOST 1 modules</p><p>CC [M] /usr/src/hello/hello.mod.o</p><p>LD [M] /usr/src/hello/hello.ko</p><p>make[1]: Leaving directory '/usr/src/linux-headers-5.4.125'</p></li><li><p>After compilation, the '''hello.ko''' kernel module will be generated</p><p>orangepi@orangepi:/usr/src/hello$ '''ls *.ko'''</p><p>hello.ko</p></li><li><p>Use the '''insmod''' command to insert the '''hello.ko''' kernel module into the kernel</p><p>orangepi@orangepi:/usr/src/hello$ '''sudo insmod hello.ko'''</p></li><li><p>Then use the '''demsg''' command to view the output of the '''hello.ko''' kernel module. If you can see the following output, it means that the '''hello.ko''' kernel module is loaded correctly.</p><p>orangepi@orangepi:/usr/src/hello$ '''dmesg | grep &quot;Hello&quot;'''</p><p>[ 2871.893988] '''Hello Orange Pi -- init'''</p></li><li><p>Use the '''rmmod''' command to uninstall the '''hello.ko''' kernel module</p><p>orangepi@orangepi:/usr/src/hello$ '''sudo rmmod hello'''</p><p>orangepi@orangepi:/usr/src/hello$ '''dmesg | grep &quot;Hello&quot;'''</p><p>[ 2871.893988] Hello Orange Pi -- init</p><p>[ 3173.800892] '''Hello Orange Pi -- exit'''</p></li></ol> <span id="testing-of-some-programming-languages-supported-by-linux-system"></span>== Testing of some programming languages supported by Linux system == <span id="debian-bullseye-system"></span>=== Debian Bullseye system === <ol style="list-style-type: decimal;"><li><p>Debian Bullseye The version of QT Creator is installed with the gcc compilation tool chain by default, which can directly compile C language programs in the Linux system of the development board.as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The default version of a.gcc is as follows</p><p>orangepi@orangepi:~$ QT Creator in '''gcc --versionUbuntu20.04'''is as follows</p><p>gcc (Debian 10.2.1[[File:zero2w-6) 10.2.1 20210110</p><p>Copyright (C) 2020 Free Software Foundation, Inc.</p><p>This is free software; see the source for copying conditions. There is NO</p><p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSEimg232.png]]</p></li><li><p>Write the The default version of QT Creator in '''hello_worldUbuntu22.c04''' program in C languageis as follows</p><p>orangepi@orangepi[[File:~$ '''vim hello_worldzero2w-img233.c'''</p><p>#include &lt;stdio.h&gt;</p><p>int main(void)</p><p>{</p><p>printf(&quot;Hello World!\n&quot;);</p><p>return 0;</p><p>}png]]</p></li><li><p>Then compile and run The default version of QT Creator in '''hello_world.cDebian11'''is as follows</p><p>orangepi@orangepi[[File:~$ '''gcc zero2w-o hello_world hello_worldimg234.c'''png]]</p></li><li><p>orangepi@orangepi:~$ The default version of QT Creator in '''./hello_worldDebian12'''is as follows</p><p>Hello World![[File:zero2w-img235.png]]</p></li></ol>
</li>
<li><p>Debian Bullseye has Python3 installed by defaultThen set up QT</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The specific version of Python is as follows</p><p>orangepi@orangepi:~$ First open '''python3Help'''</p><p>-&gt;'''Python 3About Plugins..9.2''' (default, Feb 28 2021, 17:03:44).</p><p>[GCC 10[File:zero2w-img236.2.1 20210110png]] on linux</p><p/li>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</pli><p>&gt;&gt;&gt;Then remove the check mark of '''ClangCodeModel'''</p><p>'''Use the Ctrl+D shortcut key to exit python's interactive mode[[File:zero2w-img237.'''png]]</p></li><li><p>Write the '''hello_world.py''' program in Python language</pspan style="color:#FF0000">After setting up, you need to restart QT Creator<p/span>orangepi@orangepi:~$ '''vim hello_world.py'''</p></li><pli>print('Hello World!')</p>Then make sure the GCC compiler used by QT Creator. If the default is Clang, please change it to GCC.</lip>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <libig><p>The result of running '''hello_worldDebian12 please skip this step.py''' is as follows</p></big>|}<p>orangepi@orangepi[[File:~$ '''python3 hello_worldzero2w-img238.py'''png]]</p><p>Hello World![[File:zero2w-img239.png]]</p></li></ol>
</li>
<li><p>Debian Bullseye does not install Java compilation tools and operating environment by default.</p><ol style="list-style-type: lower-alpha;"><li><p>You Then you can use the following command to install openjdk. The latest &gt; version in Debian Bullseye is openjdk-17open a sample code</p><p>orangepi@orangepi[[File:~$ '''sudo apt install zero2w-y openjdk-17-jdk'''img240.png]]</p></li><li><p>After installationclicking on the sample code, you the corresponding instruction document will automatically open. You can check read the Java versioninstructions carefully.</p><p>orangepi@orangepi[[File:~$ '''java zero2w--version'''img241.png]]</p></li><li><p>Write the Java version of Then click '''hello_world.javaConfigure Project'''</p><p>orangepi@orangepi[[File:~$ '''vim hello_worldzero2w-img242.java'''png]]</p><p/li>public class hello_world</pli><p>{Then click the green triangle in the lower left corner to compile and run the sample code</p><p>public static void main(String[[File:zero2w-img243.png]] args)</p></li><li><p>{After waiting for a period of time, the interface shown in the figure below will pop up, which means that QT can compile and run normally.</p><p>System[[File:zero2w-img244.out.println(&quot;Hello World!&quot;);png]]</p><p>}</pli><pli>}</p>References</lip><li>{| class="wikitable" style="width:800px;" |-| <p>Then compile and run [https://wiki.qt.io/Install_Qt_5_on_Ubuntu '''hello_worldhttps://wiki.qt.javaio/Install_Qt_5_on_Ubuntu''']</p><p>orangepi@orangepi[https:~$ //download.qt.io/archive/qtcreator '''javac hello_worldhttps://download.qt.javaio/archive/qtcreator''']</p><p>orangepi@orangepi[https:~$ //download.qt.io/archive/qt '''java hello_worldhttps://download.qt.io/archive/qt''']</p><p>Hello World!</p></li></ol>|}
</li></ol>
<span id="debianros-bookworminstallation-systemmethod"></span> == ROS installation method == <span id="how-to-install-ros-1-noetic-on-ubuntu20.04"></span>=== Debian Bookworm system How to install ROS 1 Noetic on Ubuntu20.04 === # The currently active version of ROS 1 is as follows, the recommended version is '''Noetic Ninjemys''' ::[[File:zero2w-img245.png]]
<ol style="list-style-type: decimal;"><li><p>Debian Bookworm is installed with the gcc compilation tool chain by default, which can directly compile C language programs in the Linux system of the development board.</p><ol style="list-style-type: lower-alpha;"><li><p>The version of a.gcc is as follows</p><p>orangepi@orangepi:~$ '''gcc --version'''</p><p>gcc (Debian 12.2.0-14) 12.2.0</p><p>Copyright (C) 2022 Free Software Foundation, Inc.</p><p>This is free software; see the source for copying conditions. There is NO</p><p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p></li><li><p>Write the '''hello_world.c''' program in C language</p><p>orangepi@orangepi:~$ '''vim hello_world.c'''</p><p>#include &lt;stdio.h&gt;</p><p>int main(void)</p><p>{</p><p>printf(&quot;Hello World!\n&quot;);</p><p>return 0;</p><p>}</p></li><li><p>Then compile and run '''hello_world.c'''</p><p>orangepi@orangepi:~$ '''gcc -o hello_world hello_world.c'''</p><p>orangepi@orangepi[[File:~$ '''./hello_world'''</p><p>Hello World!</p></li></ol></li><li><p>Debian Bookworm has Python3 installed by default</p><ol style="listzero2w-style-type: lower-alpha;"><li><p>The specific version of Python is as follows</p><p>orangepi@orangepi:~$ '''python3'''</p><p>Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12img246.2.0png] on linux</p><p>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</p><p>&gt;&gt;&gt;</p><p>'''Use the Ctrl+D shortcut key to exit python's interactive mode.'''</p></li><li><p>Write the '''hello_world.py''' program in Python language</p><p>orangepi@orangepi:~$ '''vim hello_world.py'''</p><p>print('Hello World!')</p></li><li><p>The result of running '''hello_world.py''' is as follows</p><p>orangepi@orangepi:~$ '''python3 hello_world.py'''</p><p>Hello World!</p></li></ol></li><li><p>Debian Bookworm does not install Java compilation tools and operating environment by default.</p><ol style="list-style-type: lower-alpha;"><li><p>You can use the following command to install openjdk. The latest &gt; version in Debian Bookworm is openjdk-17</p><p>orangepi@orangepi:~$ '''sudo apt install -y openjdk-17-jdk'''</p></li><li><p>After installation, you can check the Java version.</p><p>orangepi@orangepi:~$ '''java --version'''</p></li><li><p>Write the Java version of '''hello_world.java'''</p><p>orangepi@orangepi:~$ '''vim hello_world.java'''</p><p>public class hello_world</p><p>{</p><p>public static void main(String[] args)</p><p>{</p><p>System.out.println(&quot;Hello World!&quot;);</p><p>}</p><p>}</p></li><li><p>Then compile and run '''hello_world.java'''</p><p>orangepi@orangepi:~$ '''javac hello_world.java'''</p><p>orangepi@orangepi:~$ '''java hello_world'''</p><p>Hello World!</p></li></ol></li></ol>
<span id::{| class="ubuntuwikitable" style="width:800px;" |-focal-system"><| [http://docs.ros.org/ '''http://span>=== Ubuntu Focal system ===docs.ros.org''']
'''https://wiki.ros.org/Distributions'''|} <ol start="2" style="list-style-type: decimal;"><li><p>Ubuntu Focal is installed with The link to the gcc compilation tool chain by default, which can directly compile C language programs in the Linux system official installation documentation of the development board.ROS 1 '''Noetic Ninjemys''' is as follows:</p><ol {| class="wikitable" style="list-style-typewidth: lower-alpha800px;"><li>|-| <p>The version of a[http://wiki.ros.gcc is as follows<org/noetic/Installation/p><p>orangepi@orangepi:~$ Ubuntu '''gcc --version'''<http://p><p>gcc (Ubuntu 9wiki.4ros.0-1ubuntu1~20.04.1) 9.4.0<org/noetic/Installation/p><p>Copyright (C) 2019 Free Software Foundation, Inc.Ubuntu''']</p><p>This is free software; see the source for copying conditions. There is NO</p>|}<p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p></li><li><p>Write In the official installation documentation of ROS '''hello_worldNoetic Ninjemys''', Ubuntu recommends using Ubuntu20.c04, so please ensure that the system used by the development board is ''' program in C language</pspan style="color:#FF0000">Ubuntu20.04 desktop system<p/span>orangepi@orangepi:~$ '''vim hello_world.c'''</p><p>#include &lt{| class="wikitable" style="width:800px;stdio.h&gt;</p>" <p>int main(void)</p>|-<p>{</p>| <p>printf(&quot;Hello World!\n&quot;);<[http:/p><p>return 0;</p><p>}<wiki.ros.org/p><noetic/li><li><p>Then compile and run Installation '''hello_worldhttp://wiki.cros.org/noetic/Installation''']</p><p>orangepi@orangepi[[File:~$ '''gcc zero2w-o hello_world hello_worldimg247.c'''png]]</p><p>orangepi@orangepi:~$ '''./hello_world'''</p><p>Hello World!</p></li></ol>|}
</li>
<li><p>Ubuntu Focal has Python3 installed by defaultThen use the script below to install ros1</p><ol {| class="wikitable" style="list-style-typewidth: lower-alpha800px;"><li><p>The specific version of Python3 is as follows</p>|-<p>orangepi@orangepi:~$ '''python3'''</p><p>Python 3.8.10 (default, Nov 14 2022, 12:59:47)</p><p>[GCC 9.4.0] on linux</p><p>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</p><p>&gt;&gt;&gt;</p><p>'''Use the Ctrl+D shortcut key to exit python's interactive mode.'''</p></li><li><p>Write the '''hello_world.py''' program in Python language</p><p>orangepi@orangepi:~$ '''vim hello_world.py'''</p><p>print('Hello World!')</p></li><li><p>The result of running '''hello_world.py''' is as follows</p>| <p>orangepi@orangepi:~$ '''python3 hello_worldinstall_ros.pysh ros1'''</p><p>Hello World!</p></li></ol>|}
</li>
<li><p>Ubuntu Focal does not have Java compilation tools Before using the ROS tool, you first need to initialize rosdep. Then when compiling the source code, you can quickly install some system dependencies and running environment installed by defaultsome core components in ROS.</p></li><ol {| class="wikitable" style="listbackground-style-typecolor:#ffffdc;width: lower-alpha800px;"><li><p>You can use the following command to install openjdk|-17</p>| <pbig>orangepi@orangepi:~$ '''sudo apt install -y openjdk-17-jdk'''</pspan style="color:#FF0000"></li><li><p>After installationNote that when running the following command, you need to ensure that the development board can check the Java version.</p><p>orangepi@orangepi:~$ '''java --version'''</p><p>openjdk 17.0.2 2022-01-18</p><p>OpenJDK Runtime Environment (build 17.0.2+8-Ubuntu-120.04)</p><p>OpenJDK 64-Bit Server VM (build 17.0.2+8-Ubuntu-120.04access github normally, mixed mode, sharing)</p></li><li><p>Write the Java version of '''hello_worldotherwise an error will be reported due to network problems.java'''</p><pspan>orangepi@orangepi:~$ '''vim hello_world.java'''</p><p>public class hello_world</p><p>{</p><p>public static void main(String[] args)</p><p>{</p><p>System.out.println(&quot;Hello World!&quot;);</p><p>}</p><p>}</p></li><li><p>Then compile and run '''hello_world.java'''</p><p>orangepi@orangepi:~$ '''javac hello_world.java'''</p><p>orangepi@orangepi:~$ '''java hello_world'''</p><p>Hello World!</p></li></ol></li></ol>
<span id="ubuntu-jammy-system"><'''The install_ros.sh script will try to modify /etc/span>=== Ubuntu Jammy hosts and automatically run the following commands. However, this method cannot guarantee that github can be accessed normally every time. If install_ros.sh prompts the following error after installing ros1, please find other ways to allow the linux system ===of the development board to access github normally, and then manually run the following Order.'''
<ol style="list-style-type: decimal;">
<li><p>Ubuntu Jammy is installed with the gcc compilation tool chain by default, which can directly compile C language programs in the Linux system of the development board.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The version of a.gcc is as follows</p>
<p>orangepi@orangepi:~$ '''gcc --version'''</p>
<p>gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) '''11.3.0'''</p>
<p>Copyright (C) 2021 Free Software Foundation, Inc.</p>
<p>This is free software; see the source for copying conditions. There is NO</p>
<p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p></li>
<li><p>Write the '''hello_world.c''' program in C language</p>
<p>orangepi@orangepi:~$ '''vim hello_world.c'''</p>
<p>#include &lt;stdio.h&gt;</p>
<p>int main(void)</p>
<p>{</p>
<p>printf(&quot;Hello World!\n&quot;);</p>
<p>return 0;</p>
<p>}</p></li>
<li><p>Then compile and run '''hello_world.c'''</p>
<p>orangepi@orangepi:~$ '''gcc -o hello_world hello_world.c'''</p>
<p>orangepi@orangepi:~$ '''./hello_world'''</p>
<p>Hello World!</p></li></ol>
</li>
<li><p>Ubuntu Jammy has Python3 installed by default</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The specific version of Python3 is as follows</p>
<p>orangepi@orangepi:~$ '''python3'''</p>
<p>Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux</p>
<p>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</p>
<p>&gt;&gt;&gt;</p>
<p>'''Use the Ctrl+D shortcut key to exit python's interactive mode.'''</p></li>
<li><p>Write the '''hello_world.py''' program in Python language</p>
<p>orangepi@orangepi:~$ '''vim hello_world.py'''</p>
<p>print('Hello World!')</p></li>
<li><p>The result of running '''hello_world.py''' is as follows</p>
<p>orangepi@orangepi:~$ '''python3 hello_world.py'''</p>
<p>Hello World!</p></li></ol>
</li>
<li><p>Ubuntu Jammy does not install Java compilation tools and operating environment by default.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>You can use the following command to install openjdk-18</p>
<p>orangepi@orangepi:~$ '''sudo apt install -y openjdk-18-jdk'''</p></li>
<li><p>After installation, you can check the Java version.</p>
<p>orangepi@orangepi:~$ '''java --version'''</p>
<p>openjdk 18.0.2-ea 2022-07-19</p>
<p>OpenJDK Runtime Environment (build 18.0.2-ea+9-Ubuntu-222.04)</p>
<p>OpenJDK 64-Bit Server VM (build 18.0.2-ea+9-Ubuntu-222.04, mixed mode, sharing)</p></li>
<li><p>Write the Java version of '''hello_world.java'''</p>
<p>orangepi@orangepi:~$ '''vim hello_world.java'''</p>
<p>public class hello_world</p>
<p>{</p>
<p>public static void main(String[] args)</p>
<p>{</p>
<p>System.out.println(&quot;Hello World!&quot;);</p>
<p>}</p>
<p>}</p></li>
<li><p>Then compile and run '''hello_world.java'''</p>
<p>orangepi@orangepi:~$ '''javac hello_world.java'''</p>
<p>orangepi@orangepi:~$ '''java hello_world'''</p>
<p>Hello World!</p></li></ol>
</li></ol>
<span id="method-of-uploading-files-to-the-development-board-linux'''https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-system"></span>== Method of uploading files to the development board Linux system ==homebrew.yaml'''
<span id="method-to-upload-files-to-the-development-board-linux-system-in-ubuntu-pc"><'''Hit https:/span>=== Method to upload files to the development board Linux system in Ubuntu PC ===/raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml'''
'''<span idstyle="how-to-upload-files-using-scp-commandcolor:#FF0000">ERROR: error loading sources list:</span>==== How to upload files using scp command ===='''
::'''<ol span style="list-style-typecolor: decimal;#FF0000">The read operation timed out<li/span><p>Use the scp command to upload files to the Linux system of the development board in Ubuntu PC. The specific command is as follows'''</pbig><ol |}{| class="wikitable" style="list-style-typewidth: lower-alpha800px;"><li><p>'''file_path: '''Needs to be replaced with the path of the file to &gt; be uploaded</p></li>|-<li><p>'''orangepi: '''This is the user name of the development board's &gt; Linux system. It can also be replaced with something else, &gt; such as root.</p></li>| <li><p>'''192.168.xx.xx:''' This is the IP address of the development &gt; board. Please modify it according to the actual situation.</p></li><li><p>'''/home/orangepi:''' The path in the development board Linux &gt; system can also be modified to other paths.</p><p>test@testorangepi:~$ '''scp file_path orangepi@192.168.xx.xx:/homesource /orangepiopt/'''<ros/p></li></ol></li><li><p>If you want to upload a folder, you need to add the -r parameter<noetic/p><p>test@test:~$ '''scp -r dir_path orangepi@192.168.xxsetup.xx:/home/orangepi/bash'''</p></li><li><p>There are more usages of scp, please use the following command to view the man manual</p></li></ol>
testorangepi@testorangepi:~$ '''man scpsudo rosdep init'''
<span id="how-toWrote /etc/ros/rosdep/sources.list.d/20-upload-files-using-filezilla"></span>==== How to upload files using filezilla ====default.list
<ol style="list-style-typeRecommended: decimal;"><li><p>First install filezilla in Ubuntu PC</p><p>test@test:~$ '''sudo apt install -y filezilla'''</p></li><li><p>Then use the following command to open filezilla</p><p>test@test:~$ '''filezilla'''</p></li><li><p>The interface after opening filezilla is as shown below. At this time, the remote site on the right is empty.</p><div class="figure">please run
[[File:zero2w-img255.png]]
</div></li><li><p>The method of connecting the development board is as shown in the figure below</p></li></ol>::rosdep update
<div class="figure">orangepi@orangepi:~$ '''rosdep update'''
[[File:zero2w-img256reading in sources list data from /etc/ros/rosdep/sources.png]]list.d
<Hit https:/div><ol start="5" style="list-style-type: decimal;"><li><p>Then choose to '''save the password''' and click '''OK'''</p><p>[[File:zero2w-img257raw.githubusercontent.png]]<com/p><ros/li><li><p>Then select '''Always trust this host''' and click '''OK'''<rosdistro/p><master/li><rosdep/ol>osx-homebrew.yaml
<div class="figure">Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
[[FileHit https:zero2w-img258//raw.png]]githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
<Hit https://div><ol start="7" style="list-style-type: decimal;"><li>After the connection is successful, you can see the directory structure of the development board's Linux file system on the right side of the filezilla softwareraw.githubusercontent.<com/ros/rosdistro/master/li><rosdep/ol>ruby.yaml
<div class="figure">Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
[[FileQuery rosdistro index https:zero2w//raw.githubusercontent.com/ros/rosdistro/master/index-img259v4.png]]yaml
</div><ol start="8" style="listSkip end-styleof-type: decimallife distro &quot;ardent&quot;"><li>Then select the path to be uploaded to the development board on the right side of the filezilla software, select the file to be uploaded in Ubuntu PC on the left side of the filezilla software, right-click the mouse, and then click the upload option to start uploading the file to the development board.</li></ol>
<div class="figure">Skip end-of-life distro &quot;bouncy&quot;
[[File:zero2wSkip end-img260.png]]of-life distro &quot;crystal&quot;
</div><ol start="9" style="listSkip end-styleof-type: decimallife distro &quot;dashing&quot;"><li><p>After the upload is completed, you can go to the corresponding path in the development board Linux system to view the uploaded file.</p></li><li><p>The method of uploading a folder is the same as the method of uploading a file, so I won't go into details here.</p></li></ol>
<span id="methodSkip end-toof-upload-files-from-windows-pc-to-development-board-linux-system"></span>=== Method to upload files from Windows PC to development board Linux system ===life distro &quot;eloquent&quot;
<span id="how-to-upload-files-using-filezilla-1"></span>==== How to upload files using filezilla ====Add distro &quot;foxy&quot;
# First download the installation file of the Windows version of the filezilla software. The download link is as followsAdd distro &quot;galactic&quot;
[https://filezillaSkip end-project.org/download.php?type=client '''https://filezillaof-project.org/download.php?type=client''']life distro &quot;groovy&quot;
[[File:zero2w-img261.png]]Add distro &quot;humble&quot;
<div class="figure">Skip end-of-life distro &quot;hydro&quot;
[[File:zero2wSkip end-img262.png]]of-life distro &quot;indigo&quot;
</div><ol start="2" style="listSkip end-styleof-type: decimallife distro &quot;jade&quot;"><li><p>The downloaded installation package is as shown below, then double-click to install it directly</p><p>'''FileZilla_Server_1.5.1_win64-setup.exe'''</p></li></ol>
During the installation process, please select '''Decline''' on the following installation interface, and then select '''NextSkip end-of-life distro &gtquot;kinetic&quot;'''
<div class="figure">Skip end-of-life distro &quot;lunar&quot;
[[File:zero2w-img263.png]]Add distro &quot;melodic&quot;
</div><ol start="3" style="list-style-type: decimalAdd distro &quot;noetic&quot;"><li>The interface after opening filezilla is as shown below. At this time, the remote site on the right is empty.</li></ol>
<div class="figure">Add distro &quot;rolling&quot;
[[File:zero2w-img264.png]] <updated cache in /div><ol start="4" style="list-style-type: decimal;"><li>The method of connecting the development board is as shown in the figure below:<home/li><orangepi/ol> <div class="figure"> [[File:zero2w-img256.png]] </div><ol start="5" style="list-style-type: decimal;"><li>Then choose to '''save the password''' and click '''OK'''<ros/li><rosdep/ol> <div class="figure"> [[File:zero2w-img265sources.png]]cache|}</divol>
<ol start="6" style="list-style-type: decimal;">
<li><p>Then select open a command line terminal window on the '''Always trust this hostdesktop''' , and click then use the '''OKtest_ros.sh'''script to start a small turtle routine to test whether ROS can be used normally.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''test_ros.sh'''</p>|}</li><li><p>After running the '''test_ros.sh''' script, a small turtle as shown in the picture below will pop up.</p><p>[[File:zero2w-img248.png]]</p></li><li><p>Then please keep the terminal window you just opened at the top</p></olli>
<div class="figure">
[[File:zero2w-img266img249.png]]
</div></ol><ol start="79" style="list-style-type: decimal;"><li>After the connection is successful<p>At this time, you can see press the directory structure of direction keys on the development board's Linux file system on keyboard to control the little turtle to move up, down, left, and right side of the filezilla software.</p><p>[[File:zero2w-img250.png]]</p></li></ol>
<div classspan id="figurehow-to-install-ros-2-galactic-on-ubuntu20.04"></span>
[[File:zero2w-img267=== How to install ROS 2 Galactic on Ubuntu20.png]]04 ===
</div><ol start="8" style="list-style-type: decimal;"><li>Then select the path to be uploaded to the development board on the right side <p>The currently active version of the filezilla softwareROS 2 is as follows, select the file recommended version is '''Galactic Geochelone'''</p><p>[[File:zero2w-img251.png]]</p><p>[[File:zero2w-img252.png]]</p>{| class="wikitable" style="width:800px;" |-| <p>[http://docs.ros.org/ '''http://docs.ros.org''']</p><p>'''http://docs.ros.org/en/galactic/Releases.html'''</p>|}</li><li><p>The link to be uploaded on the Windows PC on official installation documentation of ROS 2 '''Galactic Geochelone''' is as follows:</p>{| class="wikitable" style="width:800px;" |-| <p>'''docs.ros.org/en/galactic/Installation.html'''</p><p>'''http://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html'''</p>|}</li><li><p>In the left side official installation documentation of the filezilla softwareROS 2 '''Galactic Geochelone''', right-click the mouseUbuntu Linux recommends using Ubuntu20.04, and then click so please ensure that the upload option to start uploading the file to system used by the development boardis the '''<span style="color:#FF0000">Ubuntu20.04 desktop system</span>'''. There are several ways to install ROS 2. The following demonstrates how to install ROS 2 '''Galactic Geochelone''' through '''Debian packages'''.</p></li><li><p>Use the '''install_ros.sh''' script to install ros2</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''install_ros.sh ros2'''</olp>|}<div /li><li><p>The '''install_ros.sh''' script will automatically run the '''ros2 -h''' command after installing ros2. If you can see the following print, it means that the ros2 installation is complete.</p>{| class="figurewikitable" style="width:800px;">|-| <p>usage: ros2 [[File:zero2w-img268h] Call `ros2 &lt;command&gt; -h` for more detailed usage.png]]...</p>
</div>
<ol start="9" style="list-style-type: decimal;">
<li><p>After the upload is completed, you can go to the corresponding path in the development board Linux system to view the uploaded file.</p></li>
<li><p>The method of uploading a folder is the same as the method of uploading a file, so I won't go into details here.</p></li></ol>
<span id="instructionsp>ros2 is an extensible command-line tool for-using-the-logo-on-and-off-the-machine">ROS 2.</spanp>== Instructions for using the logo on and off the machine ==
<ol style="list-style-type: decimal;">
<li><p>The power on/off logo will only be displayed on the desktop version of the system by default.</p></li>
<li><p>Set the '''bootlogo''' variable to '''false''' in '''/boot/orangepiEnv.txt''' to turn off the switch logo.</p>
<p>orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''</p>
<p>verbosity=1</p>
<p>'''bootlogo=false'''</p></li>
<li><p>Set the '''bootlogo''' variable to '''true''' in '''/boot/orangepiEnv.txt''' to enable the power on/off logo.</p>
<p>orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''</p>
<p>verbosity=1</p>
<p>'''bootlogo=true'''</p></li>
<li><p>The location of the boot logo picture in the Linux system is</p>
<p>'''/usr/share/plymouth/themes/orangepi/watermark.png'''</p></li>
<li><p>After replacing the boot logo image, you need to run the following command to take effect</p>
<p>orangepi@orangepi:~$ '''sudo update-initramfs -u'''</p></li></ol>
<span id="how-to-turn-onp>optional arguments:</p>:<p>-theh, -power-button-in-linux5.4">help show this help message and exit</spanp>== How to turn on the power button in Linux5.4 ==
There is no power on/off button on the main board of the development board. We can expand it through a 24pin expansion board. The location of the power on/off button on the expansion board is as follows:
[[File<p>Commands:zero2w</p>:<p>action Various action related sub-commands</p>:<p>bag Various rosbag related sub-commands</p>:<p>component Various component related sub-commands</p>:<p>daemon Various daemon related sub-commands</p>:<p>doctor Check ROS setup and other potential issues</p>:<p>interface Show information about ROS interfaces</p>:<p>launch Run a launch file</p>:<p>lifecycle Various lifecycle related sub-commands</p>:<p>multicast Various multicast related sub-commands</p>:<p>node Various node related sub-commands</p>:<p>param Various param related sub-commands</p>:<p>pkg Various package related sub-commands</p>:<p>run Run a package specific executable</p>:<p>security Various security related sub-commands</p>:<p>service Various service related sub-img269.png]]commands</p>:<p>topic Various topic related sub-commands</p>:<p>wtf Use `wtf` as alias to `doctor`</p>
The power on/off button of the Linux 6.1 image is turned on by default, but the power on/off button of the Linux 5.4 kernel image is turned off by default and needs to be turned on manually for normal use. The steps are as follows:
:<ol style="listp>Call `ros2 &lt;command&gt; -style-type: decimal;"h` for more detailed usage.</p>|}</li><li><p>First run Then you can use the '''orangepi-configtest_ros.sh'''script to test whether ROS 2 is installed successfully. Ordinary users remember to add '''sudo''' permissionsIf you can see the following print, it means ROS 2 can run normally.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo orangepi-configtest_ros.sh'''</p></li><li><p>Then select '''System'[INFO] [1671174101.200091527] [talker]: Publishing: 'Hello World: 1'</p><p>[INFO] [File:zero2w-img801671174101.png235661048][listener]: I heard: [Hello World: 1]</p></li><li><p>Then select '''Hardware'[INFO] [1671174102.199572327] [talker]: Publishing: 'Hello World: 2'</p><p>[INFO] [File:zero2w-img811671174102.png204196299] [listener]: I heard: [Hello World: 2]</p></li><li><p>Then use the keyboard[INFO] [1671174103.199580322] [talker]: Publishing: 's arrow keys to locate the position shown in the picture below, and then use the Hello World: 3'''space''' to select the dtbo configuration of the SPI you want to open.</p><p>[INFO] [File:zero2w-img2701671174103.png204019965][listener]: I heard: [Hello World: 3]</p>|}</li><li><p>Then select '''&lt;Save&gt;''' Run the following command to saveopen rviz2</p>{| class="wikitable" style="width:800px;" |-| <p>[[Fileorangepi@orangepi:zero2w-img83~$ '''source /opt/ros/galactic/setup.png]]bash'''</p></li><li><p>Then select orangepi@orangepi:~$ '''&lt;Back&gt;ros2 run rviz2 rviz2'''</p>|}<p>[[File:zero2w-img84img253.png]]</p></li><li><p>Then select '''&lt;Reboot&gt;''' For how to restart the system use ROS, please refer to make the configuration take effectdocumentation of ROS 2.</p>{| class="wikitable" style="width:800px;" |-| <p>[[Filehttp://docs.ros.org/en/galactic/Tutorials.html '''http:zero2w-img85//docs.ros.org/en/galactic/Tutorials.png]html''']</p>|}</li></ol> <span id="how-to-install-ros-2-humble-on-ubuntu22.04"></span>
<span id="how-to-shut-down-and-restart-the-development-board"></span>== How to shut down and restart the development board install ROS 2 Humble on Ubuntu22.04 ===
<ol style="list-style-type: decimal;">
<li><p>During the running of the Linux system, if you directly unplug the power supply, it may cause Use the file system to lose some datainstall_ros. It is recommended sh script to use the '''poweroffinstall_ros.sh''' command to shut down the Linux system of the development board before powering off, and then unplug the power supply.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo poweroffinstall_ros.sh ros2'''</p><p>'''Note that after turning off the development board, you need to unplug and replug the power supply before it can be turned on.'''</p>|}</li><li><p>In addition to using the poweroff command to shut down, you can also use the power on/off button on the expansion board to shut down.</p><p>[[File:zero2w-img269.png]]</p><p>The '''Note that Linux 5.4 requires manual configuration of the power on/off button before it can be used. For the opening method, please refer to the method of opening the power button in Linux5.4install_ros.sh'''</p></li><li><p>Use script will automatically run the '''rebootros2 -h''' command to restart after installing ros2. If you can see the Linux system in following print, it means that the development boardros2 installation is complete.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepiusage:~$ '''sudo''' '''reboot'''</p></li></ol> <span id="linuxros2 [-sdkorangepi-buildh] Call `ros2 &lt;command&gt; -h` for more detailed usage-instructions">. ...</spanp>
= '''Linux SDK——orangepi-build usage instructions''' =
<span id="compilationp>ros2 is an extensible command-system-requirements">line tool for ROS 2.</spanp>== Compilation system requirements ==
The Linux SDK, '''orangepi-build''', only supports running on X64 computers with '''Ubuntu 22.04''' installed. Therefore, before downloading orangepi-build, please first ensure that the Ubuntu version installed on your computer is Ubuntu 22.04. The command to check the Ubuntu version installed on the computer is as follows. If the Release field does not display '''22.04''', it means that the Ubuntu version currently used does not meet the requirements. Please change the system before performing the following operations.
test@test<p>optional arguments:~$ '''lsb_release </p>:<p>-h, --a''' No LSB modules are available.help show this help message and exit</p>
Distributor ID: Ubuntu
Description<p>Commands: Ubuntu 22.04 LTS</p>:<p>action Various action related sub-commands</p>:<p>bag Various rosbag related sub-commands</p>:<p>component Various component related sub-commands</p>:<p>daemon Various daemon related sub-commands</p>:<p>doctor Check ROS setup and other potential issues</p>:<p>interface Show information about ROS interfaces</p>:<p>launch Run a launch file</p>:<p>lifecycle Various lifecycle related sub-commands</p>:<p>multicast Various multicast related sub-commands</p>:<p>node Various node related sub-commands</p>:<p>param Various param related sub-commands</p>:<p>pkg Various package related sub-commands</p>:<p>run Run a package specific executable</p>:<p>security Various security related sub-commands</p>:<p>service Various service related sub-commands</p>:<p>topic Various topic related sub-commands</p>:<p>wtf Use `wtf` as alias to `doctor`</p>
Release: '''22.04'''
Codename: <p>Call `ros2 &lt;command&gt; -h` for more detailed usage.</p>|}</li><li><p>Then you can use the '''jammytest_ros.sh'''script to test whether ROS 2 is successfully installed. If you can see the following print, it means ROS 2 can run normally.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''test_ros.sh'''</p><p>[INFO] [1671174101.200091527] [talker]: Publishing: 'Hello World: 1'</p><p>[INFO] [1671174101.235661048] [listener]: I heard: [Hello World: 1]</p><p>[INFO] [1671174102.199572327] [talker]: Publishing: 'Hello World: 2'</p><p>[INFO] [1671174102.204196299] [listener]: I heard: [Hello World: 2]</p><p>[INFO] [1671174103.199580322] [talker]: Publishing: 'Hello World: 3'</p><p>[INFO] [1671174103.204019965] [listener]: I heard: [Hello World: 3]</p>|}</li><li><p>Run the following command to open rviz2</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''source /opt/ros/humble/setup.bash'''</p><p>orangepi@orangepi:~$ '''ros2 run rviz2 rviz2'''</p><p>[[File:zero2w-img254.png]]</p>|}</li><li><p>Reference documentation</p>{| class="wikitable" style="width:800px;" |-| <p>'''http://docs.ros.org/en/humble/index.html'''</p><p>[http://docs.ros.org/en/galactic/Tutorials.html '''http://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html''']</p>|}</li></ol>
If the computer is installed with a Windows system and does not have Ubuntu 22.04 installed on it, you can consider using'''VirtualBox''' or '''VMware''' <span id="how-to -install an Ubuntu 22.04 virtual machine in the Windows system. But please note, do not compile orangepi-build on the WSL virtual machine, because orangepi-build has not been tested in the WSL virtual machine, so there is no guarantee that orangepikernel-build can be used normally in WSL. In addition, please do not compile the Linux system on the development board. Use orangepiheader-build. The installation image download address of Ubuntu 22.04 amd64 version is:files"></span>
[https://repo.huaweicloud.com/ubuntu-releases/21.04/ubuntu-21.04-desktop-amd64.iso '''https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04/ubuntu-22.04-desktop-amd64.iso''']== How to install kernel header files ==
After installing Ubuntu 22{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Debian11 system with <span style="color:#FF0000">Linux6.1</span> kernel will report GCC error when compiling kernel module.04 on your computer or virtual machineSo if you want to compile the kernel module, please first set the software source of Ubuntu 22use Debian12 or Ubuntu22.04 to Tsinghua source (or other domestic sources that you think is fast), otherwise it is easy to make errors due to network reasons when installing the software later. The steps to replace Tsinghua Source are as follows:'''</big>|}
<ol style="list-style-type: lower-alphadecimal;"><li>For <p>The Linux image released by OPi comes with the method deb package of replacing Tsinghua Sourcethe kernel header file by default, please refer to and the instructions on this pagestorage location is '''/opt/'''</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''ls /opt/linux-headers*'''</p><p>/opt/linux-headers-xxx-sun50iw9_x.x.x_arm64.deb</p>|}</li><li><p>Use the following command to install the deb package of the kernel header file</olp>{| class="wikitable" style="width:800px;" [https|-| <p>orangepi@orangepi:~$ '''sudo dpkg -i /opt/mirrorslinux-headers*.tuna.tsinghua.edu.cndeb'''</helpp>|}</ubuntuli><li><p>After installation, you can see the folder where the kernel header file is located under '''/ usr/src'''https.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''ls /usr/src'''</mirrorsp><p>linux-headers-x.tunax.tsinghuax</p>|}</li><li><p>Then you can compile the source code of the hello kernel module that comes with the Linux image.edu.cnThe source code of the hello module is in '''/helpusr/ubuntusrc/hello''']. After entering this directory, then use the make command to compile.</p> <ol start{| class="2wikitable" style="listwidth:800px;" |-style| <p>orangepi@orangepi:~$ '''cd /usr/src/hello/'''</p><p>orangepi@orangepi:/usr/src/hello$ '''sudo make'''</p><p>make -typeC /lib/modules/5.4.125/build M=/usr/src/hello modules</p><p>make[1]: lowerEntering directory '/usr/src/linux-alpha;"headers-5.4.125'</p>:<lip>Note that the Ubuntu version needs to be switched to 22CC [M] /usr/src/hello/hello.04o</p>:<p>Building modules, stage 2.</lip>:<p>MODPOST 1 modules</olp>:<p>CC [M] /usr/src/hello/hello.mod.o</p>:<p>LD [M] /usr/src/hello/hello.ko</p><p>make[File1]:zero2wLeaving directory '/usr/src/linux-img271headers-5.png]]4.125'</p>|}<ol start/li><li><p>After compilation, the '''hello.ko''' kernel module will be generated</p>{| class="3wikitable" style="list-style-typewidth: lower-alpha800px;"|-| <p>orangepi@orangepi:/usr/src/hello$ '''ls *.ko'''</p><p>hello.ko</p>|}</li><li>The contents of <p>Use the '''insmod''' command to insert the '''hello.ko''' kernel module into the kernel</etcp>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:/aptusr/sourcessrc/hello$ '''sudo insmod hello.listko''' file that need to be replaced are:</p>|}</li><li><p>Then use the '''demsg''' command to view the output of the '''hello.ko''' kernel module. If you can see the following output, it means that the '''hello.ko''' kernel module is loaded correctly.</olp>{| class="wikitable" style="width:800px;" |-| test<p>orangepi@testorangepi:~/usr/src/hello$ '''sudo mv dmesg | grep &quot;Hello&quot;'''</etc/apt/sourcesp><p>[ 2871.list cat 893988] '''Hello Orange Pi -- init'''</etcp>|}</apt/sourcesli><li><p>Use the '''rmmod''' command to uninstall the '''hello.list.bakko'''kernel module</p>{| class="wikitable" style="width:800px;" |-| test<p>orangepi@testorangepi:~/usr/src/hello$ '''sudo vim rmmod hello'''</etcp><p>orangepi@orangepi:/aptusr/sourcessrc/hello$ '''dmesg | grep &quot;Hello&quot;'''</p><p>[ 2871.list893988] Hello Orange Pi -- init</p><p>[ 3173.800892] '''Hello Orange Pi -- exit'''</p>|}# The source code image is commented by default to improve apt update speed. You can uncomment it yourself if necessary.</li></ol>
deb https:<span id="testing-of-some-programming-languages-supported-by-linux-system"><//mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiversespan>
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse== Testing of some programming languages supported by Linux system ==
deb https://mirrors.tuna.tsinghua.edu.cn<span id="debian-bullseye-system"></ubuntu/ jammy-updates main restricted universe multiversespan>=== Debian Bullseye system ===
# deb<ol style="list-style-src httpstype:decimal;"><li><p>Debian Bullseye is installed with the gcc compilation tool chain by default, which can directly compile C language programs in the Linux system of the development board.<//mirrorsp><ol style="list-style-type: lower-alpha;"><li><p>The version of a.tuna.tsinghua.edu.cngcc is as follows</ubuntu/ jammyp>{| class="wikitable" style="width:800px;" |-updates main restricted universe multiverse| deb https<p>orangepi@orangepi:~$ '''gcc --version'''<//mirrorsp><p>gcc (Debian 10.tuna2.tsinghua1-6) 10.edu2.cn1 20210110</ubuntup><p>Copyright (C) 2020 Free Software Foundation, Inc.</ jammy-backports main restricted universe multiversep><p>This is free software; see the source for copying conditions. There is NO</p># deb-src https:<p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p>|}</mirrors.tuna.tsinghuali><li><p>Write the '''hello_world.edu.cnc''' program in C language</ubuntu/ jammyp>{| class="wikitable" style="width:800px;" |-backports main restricted universe multiverse| deb https<p>orangepi@orangepi://mirrors~$ '''vim hello_world.tuna.tsinghua.edu.cn/ubuntuc'''</ jammy-security main restricted universe multiversep><p># deb-src https://mirrors.tunainclude &lt;stdio.tsinghua.edu.cnh&gt;</ubuntu/ jammy-security main restricted universe multiversep>
# Pre-release software source, not recommended to be enabled
# deb https:<p>int main(void)</p><p>{</mirrors.tuna.tsinghua.edu.cnp>:<p>printf(&quot;Hello World!\n&quot;);</ubuntu/ jammy-proposed main restricted universe multiversep>
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
<ol start="4" style="list-style-type: lower-alpha;"><lip>After the replacement, you need to update the package information and ensure that no errors are reported.return 0;</li></ol> test@test:~$ '''sudo apt-get update''' <ol start="5" style="list-style-type: lower-alpha;"p><lip>'''In addition, since the source code of the kernel and Uboot are stored on GitHub, it is very important to ensure that the computer can download the code from GitHub normally when compiling the image.'''}</li></olp>|}<span id="obtain-the-source-code-of-linux-sdk"></spanli>== Obtain the source code of linux sdk == <span id="download-orangepi-build-from-github"li></spanp>=== Download orangepi-build from github === Linux sdk refers to the orangepi-build set of codes. Orangepi-build is modified based on the armbian build compilation system. Multiple versions of Linux images can be compiled using orangepi-build. Use the following command to download the orangepi-build code: test@test:~$ '''sudo apt-get update''' test@test:~$ '''sudo apt-get install -y git''' test@test:~$ '''git clone https://github.com/orangepi-xunlong/orangepi-build.git -b next''' Then compile and run '''Note that when using the H618 Soc development board, you need to download the source code of the next branch of orangepi-build. The above git clone command needs to specify the branch of the orangepi-build source code as nexthello_world.c''' <div class="figure"> [[File:zero2w-img272.png]] </divp>'''When downloading the orangepi-build code through the git clone command, you do not need to enter the user name and password of the github account (the same is true for downloading other codes in this manual). If after entering the git clone command, Ubuntu PC prompts you to enter the user name of the github account. The name and password are usually entered incorrectly in the address of the orangepi-build warehouse behind git clone. Please carefully check whether there are any errors in the spelling of the command, rather than thinking that we have forgotten to provide the username and password of the github account.''' The u-boot and linux kernel versions currently used by the H618 series development boards are as follows: {| class="wikitable" style="width:800px;"
|-
| '''branch'''| <p>orangepi@orangepi:~$ '''ugcc -boot Versiono hello_world hello_world.c'''</p>| <p>orangepi@orangepi:~$ '''linux Kernel version./hello_world'''</p><p>Hello World!</p>|-}</li></ol></li>| '''current'''<li><p>Debian Bullseye has Python3 installed by default</p>| '''u<ol style="list-style-type: lower-boot v2018.05'''alpha;"><li><p>The specific version of Python is as follows</p>{| '''linux5.4'''class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''python3'''</p><p>'''Python 3.9.2''' (default, Feb 28 2021, 17:03:44)</p><p>[GCC 10.2.1 20210110] on linux</p><p>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</p><p>&gt;&gt;&gt;</p>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Use the Ctrl+D shortcut key to exit python's interactive mode.'''</p></big>|}</li><li><p>Write the '''hello_world.py''' program in Python language</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''vim hello_world.py'''</p><p>print('Hello World!')</p>|}</li><li><p>The result of running '''hello_world.py''' is as follows</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''python3 hello_world.py'''</p><p>Hello World!</p>|}</li></ol></li><li><p>Debian Bullseye does not install Java compilation tools and operating environment by default.</p><ol style="list-style-type: lower-alpha;"><li><p>You can use the following command to install openjdk. The latest version in Debian Bullseye is openjdk-17</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''nextsudo apt install -y openjdk-17-jdk'''</p>| }</li><li><p>After installation, you can check the Java version.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''ujava --boot v2021version'''</p>|}</li><li><p>Write the Java version of '''hello_world.07java'''</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''vim hello_world.java'''</p><p>public class hello_world</p><p>{</p>:<p>public static void main(String[] args)</p>:<p>{</p>::<p>System.out.println(&quot;Hello World!&quot;);</p>:<p>}</p><p>}</p>|}</li><li><p>Then compile and run '''hello_world.java'''</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''linux6javac hello_world.1java'''</p><p>orangepi@orangepi:~$ '''java hello_world'''</p><p>Hello World!</p>
|}
</li></ol>
</li></ol>
'''The branch mentioned here is not the same thing as the branch of orangepi<span id="debian-build source code, please don't get confused. This branch is mainly used to distinguish different kernel source code versions.'''bookworm-system"></span>
'''We define the linux5.4 bsp kernel currently provided by Allwinner as the current branch. The latest linux6.1 LTS kernel is defined as the next branch.''' After downloading, the following files and folders will be included:=== Debian Bookworm system ===
<ol style="list-style-type: decimal;">
<li><p>Debian Bookworm is installed with the gcc compilation tool chain by default, which can directly compile C language programs in the Linux system of the development board.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The version of a.gcc is as follows</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''build.shgcc --version''': Compile startup script</p><p>gcc (Debian 12.2.0-14) 12.2.0</lip><lip>Copyright (C) 2022 Free Software Foundation, Inc.</p><p>'''external''': Contains configuration files needed to compile This is free software; see the image, specific scripts, and source code of some programs, etcfor copying conditions.There is NO</p></li><li><p>'''LICENSE''': GPL 2 license filewarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p>|}</li><li><p>Write the '''READMEhello_world.mdc''': orangepi-build documentationprogram in C language</p></li><li>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''scriptsvim hello_world.c''': Common script for compiling linux images</p></lip>#include &lt;stdio.h&gt;</olp>
test@test:~/orangepi-build$ '''ls'''
'''build.sh external LICENSE README.md scripts'''<p>int main(void)</p><p>{</p>:<p>printf(&quot;Hello World!\n&quot;);</p>
'''If you downloaded the orangepi-build code from github, after downloading, you may find that orangepi-build does not contain the source code of u-boot and linux kernel, and there is no cross-compilation tool required to compile u-boot and linux kernel. chain, this is normal, because these things are stored in other separate github repositories or some servers (their addresses will be detailed below). Orangepi-build will specify the addresses of u-boot, Linux kernel and cross-compilation tool chain in the script and configuration file. When running orangepi-build, when it finds that these things are not available locally, it will automatically download them from the corresponding places.'''
 
<span id="download-the-cross-compilation-tool-chain"></span>
=== Download the cross-compilation tool chain ===
 
When orangepi-build is run for the first time, it will automatically download the cross-compilation '''toolchain''' and put it in the '''toolchains''' folder. Every time you run orangepi-build's build.sh script, it will check whether the cross-compilation toolchain in toolchains exists. If If it does not exist, the download will be restarted. If it exists, it will be used directly without repeated downloading.
 
<div class="figure">
 
[[File:zero2w-img273.png]]
 
</div>
The mirror URL of the cross-compilation tool chain in China is the open source software mirror site of Tsinghua University:
 
[https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/ '''https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/''']
 
After toolchains is downloaded, it will contain multiple versions of cross-compilation t'''toolchain''':
 
test@test:~/orangepi-build$ '''ls toolchains/'''
 
gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu gcc-linaro-4.9.4-2017.01-x86_64_aarch64-linux-gnu gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi
 
gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi gcc-linaro-aarch64-none-elf-4.8-2013.11_linux
 
gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux
 
gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu gcc-linaro-arm-none-eabi-4.8-2014.04_linux
 
The cross-compilation tool chain used to compile the H618 Linux kernel source code is:
:<p>return 0;</p>
<p>}</p>
|}
</li>
<li><p>Then compile and run '''hello_world.c'''</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''gcc -o hello_world hello_world.c'''</p>
<p>orangepi@orangepi:~$ '''./hello_world'''</p>
<p>Hello World!</p>
|}
</li></ol>
</li>
<li><p>Debian Bookworm has Python3 installed by default</p>
<ol style="list-style-type: lower-alpha;">
<li>linux5<p>The specific version of Python is as follows</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''python3'''</p><p>Python 3.411.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux</p><p>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</p><p>&gt;&gt;&gt;</p>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Use the Ctrl+D shortcut key to exit python's interactive mode.'''</p></big>|}</li><li><p>Write the '''hello_world.py''' program in Python language</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''vim hello_world.py'''</p><p>print('Hello World!')</p>|}</li><li><p>The result of running '''hello_world.py''' is as follows</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''python3 hello_world.py'''</p><p>Hello World!</p>|}</li></ol></li><li><p>Debian Bookworm does not install Java compilation tools and operating environment by default.</p><ol style="list-style-type: lower-alpha;"><li><p>You can use the following command to install openjdk. The latest version in Debian Bookworm is openjdk-17</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo apt install -y openjdk-17-jdk'''</p>|}</li><li><p>After installation, you can check the Java version.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''java --version'''</p>|}</li><li><p>Write the Java version of '''hello_world.java'''</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''vim hello_world.java'''</p><p>public class hello_world</p><p>{</p>:<p>public static void main(String[] args)</p>:<p>{</p>::<p>System.out.println(&quot;Hello World!&quot;);</p>:<p>}</p><p>}</p>|}</li><li><p>Then compile and run '''hello_world.java'''</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''javac hello_world.java'''</p><p>orangepi@orangepi:~$ '''java hello_world'''</p><p>Hello World!</p>|}</li></ol></li></ol>
'''gcc<span id="ubuntu-armfocal-11.2-2022.02-x86_64-aarch64-none-linux-gnu'''system"></span>
<ol start="2" style="list-style-type: lower-alpha;"><li>linux6.1</li></ol> '''gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu''' The cross-compilation tool chain used to compile the H618 u-boot source code is:= Ubuntu Focal system ===
<ol style="list-style-type: decimal;">
<li><p>Ubuntu Focal is installed with the gcc compilation tool chain by default, which can directly compile C language programs in the Linux system of the development board.</p>
<ol style="list-style-type: lower-alpha;">
<li>v2018<p>The version of a.05gcc is as follows</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''gcc --version'''</p><p>gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0</p><p>Copyright (C) 2019 Free Software Foundation, Inc.</p><p>This is free software; see the source for copying conditions. There is NO</p><p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p>|}</li><li><p>Write the '''hello_world.c''' program in C language</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''vim hello_world.c'''</p><p>#include &lt;stdio.h&gt;</olp>
'''gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi'''
<ol start="2" style="list-style-type: lower-alpha;"p>int main(void)</p><lip>v2021.07{</lip>:<p>printf(&quot;Hello World!\n&quot;);</olp>
'''gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu'''
:<span id="orangepi-build-complete-directory-structure-description"p>return 0;</spanp>=== orangepi-build complete directory structure description ===<p>}</p>|}<ol style="list-style-type: decimal;"/li><li><p>After downloading, the orangepi-build warehouse does not contain the source code of the linux kernel, u-boot Then compile and cross-compilation tool chain. The source code of the linux kernel and u-boot is stored in an independent git warehouserun '''hello_world.c'''</p><ol {| class="wikitable" style="list-style-typewidth: lower-alpha800px;"><li>|-| <p>The git warehouse where the linux kernel source code is stored is as followsorangepi@orangepi:~$ '''gcc -o hello_world hello_world. Please note that the branch of the linux-orangepi warehouse is switched toc'''</p><ol style="list-style-typep>orangepi@orangepi: lower-alpha;"~$ '''./hello_world'''</p><lip>Linux5.4Hello World!</li></olp>|}
</li></ol>
</li></ol> https://github.com/orangepi-xunlong/linux-orangepi/tree/'''orange-pi-5.4-sun50iw9''' <ol start="2" style="list-style-type: lower-alpha;"><li>Linux6.1</li></ol> https://github.com/orangepi-xunlong/linux-orangepi/tree/'''orange-pi-6.1-sun50iw9''' <ol start="2" style="list-style-type: lower-alpha;"><li><p>The git warehouse where the u-boot source code is stored is as follows. Please note that the branch of the u-boot-orangepi warehouse is switched toUbuntu Focal has Python3 installed by default</p>
<ol style="list-style-type: lower-alpha;">
<li>v2018.05</lip>The specific version of Python3 is as follows</olp>{| class="wikitable" style="width:800px;" |-| </lip>orangepi@orangepi:~$ '''python3'''</olphttps<p>Python 3.8.10 (default, Nov 14 2022, 12:59:47)</p><p>[GCC 9.4.0] on linux</githubp><p>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.com</orangepi-xunlongp><p>&gt;&gt;&gt;</up>|}{| class="wikitable" style="background-bootcolor:#ffffdc;width:800px;" |-orangepi| <big><p>'''Use the Ctrl+D shortcut key to exit python's interactive mode.'''</p></treebig>|}</li><li><p>Write the '''v2018hello_world.05-h618py'''program in Python language</p> <ol start{| class="2wikitable" style="list-style-typewidth: lower-alpha800px;">|-| <lip>v2021orangepi@orangepi:~$ '''vim hello_world.07py'''</lip><p>print('Hello World!')</olp>|}https://github.com/orangepi-xunlong/u-boot-orangepi/tree</li><li><p>The result of running '''v2021hello_world.07-sunxipy'''is as follows</p> <ol start{| class="2wikitable" style="list-style-typewidth: decimal800px;"|-| <p>orangepi@orangepi:~$ '''python3 hello_world.py'''</p><p>Hello World!</p>|}</li></ol></li><li><p>When orangepi-build is run for the first time, it will download the cross-Ubuntu Focal does not have Java compilation tool chain, u-boot tools and linux kernel source coderunning environment installed by default. After successfully compiling a linux image, the files and folders that can be seen in orangepi-build are:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>You can use the following command to install openjdk-17</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''build.shsudo apt install -y openjdk-17-jdk''': Compile startup script</p>|}</li><li><p>'''external''': Contains the configuration files needed to compile the imageAfter installation, scripts for specific functions, and you can check the source code of some programs. The rootfs compressed package cached during the image compilation process is also stored in externalJava version.</p></li><li>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''kerneljava --version''': Store the source code of the linux kernel</p><p>openjdk 17.0.2 2022-01-18</lip><lip>OpenJDK Runtime Environment (build 17.0.2+8-Ubuntu-120.04)</p><p>'''LICENSE''': GPL OpenJDK 64-Bit Server VM (build 17.0.2 license file+8-Ubuntu-120.04, mixed mode, sharing)</p>|}</li><li><p>Write the Java version of '''READMEhello_world.mdjava''': orangepi-build documentation</p></li><li>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''outputvim hello_world.java''': Store compiled u-boot, linux and other deb packages, compilation logs, and compiled images and other files</p><p>public class hello_world</lip><lip>{</p>'''scripts''': Common script for compiling linux images</p>public static void main(String[] args)</lip>:<lip>{</p>'''toolchains''':: Store cross-compilation tool chain</p>System.out.println(&quot;Hello World!&quot;);</lip>:<lip>}</p><p>'''u-boot''': Store the source code of u-boot}</p>|}</li><li><p>Then compile and run '''userpatcheshello_world.java''': Store the configuration files needed to compile the script</p></li></ol>{| class="wikitable" style="width:800px;" |-| </lip></ol> testorangepi@testorangepi:~/orangepi-build$ '''lsjavac hello_world.java'''</p> <p>orangepi@orangepi:~$ '''build.sh external kernel LICENSE output README.md scripts toolchains u-boot userpatchesjava hello_world'''</p><span id="compile-u-boot"p>Hello World!</spanp>== Compile u-boot ==|}</li></ol># Run the build.sh script, remember to add sudo permissions test@test:~</orangepi-build$ '''sudo .li></build.sh'''ol>
<ol startspan id="2" style="listubuntu-stylejammy-type: decimal;system"><li>Select '''U-boot package''' and press Enter</li></olspan>
<div class="figure">== Ubuntu Jammy system ===
[[File:zero2w-img274.png]] </div><ol start="3" style="list-style-type: decimal;"><li>Then select <p>Ubuntu Jammy is installed with the gcc compilation tool chain by default, which can directly compile C language programs in the model Linux system of the development board</li></ol> [[File:zero2w-img275.png]] <ol start="4" style="list-style-type: decimal;"><li><p>Then select the branch type of u-boot</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The current branch will compile the u-boot v2018.05 version code that needs to be used by the linux5.4 imageof a.gcc is as follows</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''gcc --version'''</lip><li><p>The next branch will compile the ugcc (Ubuntu 11.3.0-boot v20211ubuntu1~22.07 version code that needs to be used by the linux604.1 image) '''11.3.0'''</p><p>[[File:zero2w-img276Copyright (C) 2021 Free Software Foundation, Inc.png]]</p><p>This is free software; see the source for copying conditions. There is NO</lip><p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</olp>|}
</li>
<li><p>If you select Write the next branch, you will also be prompted to select the memory size, and you do not need to select the current branch'''hello_world.c''' program in C language</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''vim hello_world.c'''</lip><p>#include &lt;stdio.h&gt;</olp
<blockquotep>int main(void)</p><p>{</p>:<p>printf(&quot;Hello World!\n&quot;);</p>a. If the development board you purchased has a memory size of 1.5GB, please select the first option.
b. If the development board you purchased has 1GB or 2GB or 4GB memory size, please choose the second option.
</blockquote>
[[File:zero2w-img277.png]]
:<p>return 0;<ol start/p><p>}</p>|}</li><li><p>Then compile and run '''hello_world.c'''</p>{| class="6wikitable" style="listwidth:800px;" |-style| <p>orangepi@orangepi:~$ '''gcc -typeo hello_world hello_world.c'''</p><p>orangepi@orangepi: decimal;"~$ '''./hello_world'''</p><p>Hello World!</p>|}</li></ol></li><li><p>Then it will start to compile u-boot. Some of the information prompted when compiling the next branch is as follows:Ubuntu Jammy has Python3 installed by default</p>
<ol style="list-style-type: lower-alpha;">
<li>Version <p>The specific version of uPython3 is as follows</p>{| class="wikitable" style="width:800px;" |-boot source code| <p>orangepi@orangepi:~$ '''python3'''</p><p>Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux</p><p>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</p><p>&gt;&gt;&gt;</p>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Use the Ctrl+D shortcut key to exit python's interactive mode.'''</p></big>|}</li><li><p>Write the '''hello_world.py''' program in Python language</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''vim hello_world.py'''</p><p>print('Hello World!')</p>|}</li><li><p>The result of running '''hello_world.py''' is as follows</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''python3 hello_world.py'''</p><p>Hello World!</p>|}</li></ol></li><li><p>Ubuntu Jammy does not install Java compilation tools and operating environment by default.</p><ol style="list-style-type: lower-alpha;"><li><p>You can use the following command to install openjdk-18</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo apt install -y openjdk-18-jdk'''</p>|}</li><li><p>After installation, you can check the Java version.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''java --version'''</p><p>openjdk 18.0.2-ea 2022-07-19</p><p>OpenJDK Runtime Environment (build 18.0.2-ea+9-Ubuntu-222.04)</p><p>OpenJDK 64-Bit Server VM (build 18.0.2-ea+9-Ubuntu-222.04, mixed mode, sharing)</p>|}</li><li><p>Write the Java version of '''hello_world.java'''</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''vim hello_world.java'''</p><p>public class hello_world</p><p>{</p>:<p>public static void main(String[] args)</p>:<p>{</p>::<p>System.out.println(&quot;Hello World!&quot;);</p>:<p>}</p><p>}</p>|}</li><li><p>Then compile and run '''hello_world.java'''</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''javac hello_world.java'''</p><p>orangepi@orangepi:~$ '''java hello_world'''</p><p>Hello World!</p>|}</li></ol>
</li></ol>
[ o.k. ] Compiling u-boot [ '''v2021.07''' ] <ol start="2" stylespan id="listmethod-style-type: lower-alpha;"><li>Version of the cross-compilation tool chain</li></ol> [ o.k. ] Compiler version [ '''aarch64uploading-linuxfiles-gnuto-gcc 11''' ] <ol start="3" style="list-style-type: lower-alpha;"><li>Path to the compiled u-boot deb package</li></ol> [ o.k. ] Target directory [ '''orangepi-build/output/debs/udevelopment-boot''' ] <ol start="4" style="list-style-type: lower-alpha;"><li>The package name of the compiled uboard-boot deb package</li></ol> [ o.k. ] File name [ '''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb''' ] <ol start="5system" style="list-style-type: lower-alpha;"><li>Compilation time</li></ol> [ o.k. ] Runtime [ '''1 min''' ] <ol start="6" style="list-style-type: lower-alpha;"><li>Repeat the command to compile u-boot. Use the following command without selecting through the graphical interface. You can start compiling u-boot directly.</li></olspan>
[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPTMethod of uploading files to the development board Linux system ==u-boot''' ]
<ol startspan id="7" style="listmethod-to-upload-files-styleto-type: decimal;"><li>View the compiled u-boot deb package</lidevelopment-board-linux-system-in-ubuntu-pc"></olspan>=== Method to upload files to the development board Linux system in Ubuntu PC ===
test@test:~/orangepi<span id="how-to-upload-files-using-build$ '''ls output/debs/uscp-bootcommand"></'''span>==== How to upload files using scp command ====
'''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb''' <ol start="8" style="list-style-type: decimal;"><li>When the orangepi-bulid compilation system compiles the u-boot source code, it will first synchronize the u-boot source code with <p>Use the u-boot source code of the github server. Therefore, if you want scp command to modify the u-boot source code, you first need upload files to turn off the download and update function Linux system of the source code. ('''You need to completely compile u-boot before you can turn off this function, otherwise it will prompt that the source code of u-boot cannot be found'''), otherwise the modifications will be restoreddevelopment board in Ubuntu PC. The method specific command is as follows:</li></ol> <blockquote>Set the IGNORE_UPDATES variable in u'''userpatches/config-default.conf''' to &quot;yes&quot;</blockquote>test@test:~/orangepi-build$ '''vim userpatches/config-default.conf''' ...... IGNORE_UPDATES=&quot;'''yes'''&quot; ...... <ol start="9" style="list-style-type: decimal;"><li><p>When debugging u-boot code, you can use the following method to update u-boot in the linux image for testing</p>
<ol style="list-style-type: lower-alpha;">
<li>First upload <p>'''file_path: '''Needs to be replaced with the compiled deb package path of u-boot the file to be uploaded</p></li><li><p>'''orangepi: '''This is the user name of the development board's Linux system . It can also be replaced with something else, such as root.</p></li><li><p>'''192.168.xx.xx:''' This is the IP address of the development board.Please modify it according to the actual situation.</p></li><li><p>'''/home/orangepi:''' The path in the development board Linux system can also be modified to other paths.</p>{| class="wikitable" style="width:800px;" |-| <p>test@test:~$ '''scp file_path orangepi@192.168.xx.xx:/home/orangepi/'''</olp>|}
</li></ol>
</li>
<li><p>If you want to upload a folder, you need to add the -r parameter</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>test@test:~$ '''scp <span style="color:#FF0000">-r</span> dir_path orangepi@192.168.xx.xx:/home/orangepi/'''</p>
|}
</li>
<li><p>There are more usages of scp, please use the following command to view the man manual</p></li>
{| class="wikitable" style="width:800px;"
|-
|
test@test:~$ '''man scp'''
|}
</ol>
<span id="how-to-upload-files-using-filezilla"></span>
test@test:~/orangepi-build$ '''cd output/debs/u-boot''' test@test:~/orangepi_build/output/debs/u-boot$ '''scp \'''==== How to upload files using filezilla ====
<ol style="list-style-type: decimal;"><li><p>First install filezilla in Ubuntu PC</p>{| class="wikitable" style="width:800px;" |-| <p>test@test:~$ '''linuxsudo apt install -uy filezilla'''</p>|}</li><li><p>Then use the following command to open filezilla</p>{| class="wikitable" style="width:800px;" |-boot-next-orangepizero2w_x.x.x_arm64.deb [mailto:root| <p>test@192.168.1.xxxtest:~$ '''filezilla'''</root root@192p>|}</li><li><p>The interface after opening filezilla is as shown below.168At this time, the remote site on the right is empty.1.xxx:</root]'''p><div class="figure">
<ol start="2" style="list-style-type[[File: lower-alpha;"><li>Install the new uzero2w-boot deb package just uploaded</li></ol>img255.png]]
orangepi@orangepi:~$ '''sudo dpkg -i''' '''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb'''</div></li><li><p>The method of connecting the development board is as shown in the figure below</p></li>
<ol startdiv class="3figure" style="list-style-type: lower-alpha;"><li>Then run the nand-sata-install script</li></ol>
orangepi@orangepi[[File:~$ '''sudo nandzero2w-sata-install'''img256.png]]
</div></ol><ol start="45" style="list-style-type: lower-alphadecimal;"><li><p>Then select choose to '''save the password''' and click '''OK'''5 Install</p><p>[[File:zero2w-img257.png]]</Update the bootloader on SDp></eMMCli><li><p>Then select '''Always trust this host''' and click '''OK'''</lip></olli>
[[File:zero2w-img278.png]]<div class="figure">
<ol start="5" style="list-style-type[[File: lowerzero2w-alpha;"><li>After pressing the Enter key, a Warning will pop up firstimg258.</li></ol>png]]
[[File</div></ol><ol start="7" style="list-style-type:zero2w-img279decimal;"><li>After the connection is successful, you can see the directory structure of the development board's Linux file system on the right side of the filezilla software.png]]</li>
<ol startdiv class="6figure" style="list-style-type: lower-alpha;"><li>Press the Enter key again to start updating u-boot. After the update is completed, the following information will be displayed.</li></ol>
[[File:zero2w-img280img259.png]]
</div></ol><ol start="78" style="list-style-type: lower-alphadecimal;"><li>Then you can restart select the path to be uploaded to the development board on the right side of the filezilla software, select the file to test whether be uploaded in Ubuntu PC on the uleft side of the filezilla software, right-boot modification has taken effectclick the mouse, and then click the upload option to start uploading the file to the development board.</li></ol>
<span iddiv class="compile-the-linux-kernelfigure"></span>== Compile the linux kernel ==
# Run the '''build[[File:zero2w-img260.sh''' script, remember to add sudo permissionspng]]
test@test</div></ol><ol start="9" style="list-style-type:~decimal;"><li><p>After the upload is completed, you can go to the corresponding path in the development board Linux system to view the uploaded file.</p></li><li><p>The method of uploading a folder is the same as the method of uploading a file, so I won't go into details here.</p></li></ol> <span id="method-to-upload-files-from-windows-pc-to-development-board-linux-system"></orangepispan> === Method to upload files from Windows PC to development board Linux system === <span id="how-to-build$ upload-files-using-filezilla-1"></span>==== How to upload files using filezilla ==== # First download the installation file of the Windows version of the filezilla software. The download link is as follows ::{| class="wikitable" style="width:800px;" |-| [https://filezilla-project.org/download.php?type=client '''sudo https://filezilla-project.org/builddownload.shphp?type=client''']|} ::[[File:zero2w-img261.png]] <div class="figure"> ::[[File:zero2w-img262.png]]
</div>
<ol start="2" style="list-style-type: decimal;">
<li>Select <p>The downloaded installation package is as shown below, then double-click to install it directly</p>{| class="wikitable" style="width:800px;" |-| <p>'''Kernel packageFileZilla_Server_1.5.1_win64-setup.exe''' and press Enter</li></olp>|}During the installation process, please select '''Decline''' on the following installation interface, and then select '''Next&gt;'''
<div class="figure">
[[File:zero2w-img281img263.png]]
</div>
</li></ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then you will be prompted whether you need to display the kernel configuration The interfaceafter opening filezilla is as shown below. If you do not need to modify the kernel configurationAt this time, select the first one. If you need to modify the kernel configuration, select remote site on the second oneright is empty.</li> </oldiv class="figure">
[[File:zero2w-img282img264.png]]
</div></ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then select the model The method of connecting the development boardis as shown in the figure below:</li> </oldiv class="figure">
[[File:zero2w-img275img256.png]]
</div></ol>
<ol start="5" style="list-style-type: decimal;">
<li>Then select choose to '''save the branch type of the kernel source codepassword''' and click '''OK'''</li></ol>
<blockquotediv class="figure">a. The current branch will compile the linux5.4 kernel source code
b. The next branch will compile the linux6.1 kernel source code</blockquote>[[File:zero2w-img276img265.png]]
</div></ol>
<ol start="6" style="list-style-type: decimal;">
<li>If you choose to display the kernel configuration menu (the second option) in step 3), the kernel configuration interface opened through Then select '''make menuconfigAlways trust this host''' will pop up. At this time, you can directly modify the kernel configuration. After modification, save and exit. Yes, compilation of the kernel source code will begin after exiting.click '''OK'''</li></ol>
[[File:zero2w-img283.png]]<div class="figure">
<ol style="list-style-type[[File: lower-alpha;"><li>If you do not need to modify the kernel configuration options, when running the build.sh script, pass '''KERNEL_CONFIGURE=no''' to temporarily block the popzero2w-up of the kernel configuration interfaceimg266.</li></ol>png]]
test@test:~</div></orangepiol><ol start="7" style="list-build$ style-type: decimal;"><li>After the connection is successful, you can see the directory structure of the development board'''sudo s Linux file system on the right side of the filezilla software.</build.sh KERNEL_CONFIGURE=no'''li>
<ol startdiv class="2figure" style="list-style-type: lower-alpha;"><li><p>b. You can also set '''KERNEL_CONFIGURE=no''' in the orangepi-build/userpatches/config-default.confconfiguration file to permanently disable this function.</p></li><li><p>If the following error is prompted when compiling the kernel, it is because the Ubuntu PC terminal interface is too small, causing the make menuconfig interface to be unable to be displayed. Please increase the Ubuntu PC terminal to the maximum size, and then rerun the build.sh script.</p></li></ol>
[[File:zero2w-img284img267.png]]
</div></ol><ol start="78" style="list-style-type: decimal;"><li><p>Part Then select the path to be uploaded to the development board on the right side of the information prompted when compiling filezilla software, select the next branch kernel source code is explained as follows:</p><ol style="listfile to be uploaded on the Windows PC on the left side of the filezilla software, right-style-type: lower-alpha;"><li>Version of click the mouse, and then click the upload option to start uploading the file to the linux kernel source code</li></ol>development board.</li></ol>
[ o.k. ] Compiling current kernel [ '''6.1.31''' ]<div class="figure">
<ol start="2" style="list-style-type[[File: lower-alpha;"><li>The version of the crosszero2w-compilation tool chain used</li></ol>img268.png]]
[ o.k. ] Compiler version [ '''aarch64</div></ol><ol start="9" style="list-linuxstyle-gnu-gcc 11type: decimal;"><li><p>After the upload is completed, you can go to the corresponding path in the development board Linux system to view the uploaded file.</p></li><li><p>The method of uploading a folder is the same as the method of uploading a file, so I won''' ]t go into details here.</p></li></ol>
<ol startspan id="3" style="listinstructions-stylefor-type: lowerusing-alpha;"><li>The default configuration file used by the kernel -logo-on-and -off-the path where it is stored are as follows</li-machine"></olspan>
[ o.k. ] Using kernel config file [ '''orangepi-build/external/config/kernel/linux-6.1-sun50iw9-next.config''' ]== Instructions for using the logo on and off the machine ==
<ol start="4" style="list-style-type: lowerdecimal;"><li><p>The power on/off logo will only be displayed on the desktop version of the system by default.</p></li><li><p>Set the '''bootlogo''' variable to '''false''' in '''/boot/orangepiEnv.txt''' to turn off the switch logo.</p>{| class="wikitable" style="width:800px;" |-alpha| <p>orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''</p><p>verbosity=1</p><p>'''<span style="color:#FF0000">bootlogo=false</span>'''</p>|}</li><li><p>Set the '''bootlogo''' variable to '''true''' in '''/boot/orangepiEnv.txt''' to enable the power on/off logo.</p>{| class="wikitable" style="width:800px;"|-| <p>orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''</p><p>verbosity=1</p><p>'''<span style="color:#FF0000">bootlogo=true</span>'''</p>|}</li><li><p>The path location of the boot logo picture in the Linux system is</p>{| class="wikitable" style="width:800px;" |-| <p>'''/usr/share/plymouth/themes/orangepi/watermark.png'''</p>|}</li><li><p>After replacing the boot logo image, you need to run the kernelfollowing command to take effect</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo update-initramfs -related deb package generated by compilationu'''</p>|}</li></ol>
[ o<span id="how-to-turn-on-the-power-button-in-linux5.k. ] Target directory [ '''output/debs4"></''' ]span>
<ol start="5" style="list-style-type: lower-alpha;"><li>The package name of How to turn on the kernel image deb package generated by compilation</li></ol>power button in Linux5.4 ==
[ oThere is no power on/off button on the main board of the development board.kWe can expand it through a 24pin expansion board. ] File name [ '''linux-image-next-sun50iw9_x.x.x_arm64.deb''' ]The location of the power on/off button on the expansion board is as follows:
<ol start="6" style="list-style-type[[File: lowerzero2w-alpha;"><li>Compilation time</li></ol>img269.png]]
[ oThe power on/off button of the Linux 6.k1 image is turned on by default, but the power on/off button of the Linux 5. ] Runtime [ '''10 min''' ]4 kernel image is turned off by default and needs to be turned on manually for normal use. The steps are as follows:
<ol start="7" style="list-style-type: lower-alphadecimal;"><li>Finally, the compilation command to repeatedly compile the last selected kernel will be displayed. Use the following command without selecting through the graphical interface, and you can directly start compiling the kernel source code.</lip></ol> [ oFirst run '''orangepi-config'''.k. ] Repeat Build Options [ Ordinary users remember to add '''sudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=kernel KERNEL_CONFIGURE=no''' ]permissions.</p> <ol start{| class="8wikitable" style="list-style-typewidth: decimal800px;"|-| <p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p>|}</li><li><p>View the kernel-related deb package generated by compilationThen select '''System'''</p><ol style="list-style-typep>[[File: lowerzero2w-alpha;"img80.png]]</p></li><li><p>Then select '''linux-dtb-nextHardware'''</p><p>[[File:zero2w-sun50iw9_ximg81.x.x_arm64.debpng]]</p></li><li><p>Then use the keyboard's arrow keys to locate the position shown in the picture below, and then use the '''space''' Contains dtb files used by to select the dtbo configuration of the kernelSPI you want to open.</p><p>[[File:zero2w-img270.png]]</p></li><li><p>Then select '''linux-headers-next-sun50iw9_x.x.x_arm64.deb&lt;Save&gt;''' Contains kernel header filesto save</p><p>[[File:zero2w-img83.png]]</p></li><li><p>Then select '''linux-image-next-sun50iw9_x.x.x_arm64.deb&lt;Back&gt;''' Contains kernel images and kernel modules</p><p>[[File:zero2w-img84.png]]</p></li><li><p>Then select '''&lt;Reboot&gt;''' to restart the system to make the configuration take effect.</olp><p>[[File:zero2w-img85.png]]</p></li></ol>
test@test:~/orangepi<span id="how-to-shut-down-and-restart-the-development-build$ '''ls outputboard"></debs/linux-*'''span>
output/debs/linux-dtb-next-sun50iw9_x.x.x_arm64.deb== How to shut down and restart the development board ==
output<ol style="list-style-type: decimal;"><li><p>During the running of the Linux system, if you directly unplug the power supply, it may cause the file system to lose some data. It is recommended to use the '''poweroff''' command to shut down the Linux system of the development board before powering off, and then unplug the power supply.</debsp>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo poweroff'''</linuxp>|}{| class="wikitable" style="background-headerscolor:#ffffdc;width:800px;" |-next| <big><p>'''Note that after turning off the development board, you need to unplug and replug the power supply before it can be turned on.'''</p></big>|}</li><li><p>In addition to using the poweroff command to shut down, you can also use the power on/off button on the expansion board to shut down.</p><p>[[File:zero2w-sun50iw9_ximg269.xpng]]</p>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Note that Linux 5.4 requires manual configuration of the power on/off button before it can be used.x_arm64For the opening method, please refer to [[Orange Pi Zero 2W#How to turn on the power button in Linux5.deb4|the method of opening the power button in Linux5.4]].'''</p></big>|}</li><li><p>Use the '''reboot''' command to restart the Linux system in the development board</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo''' '''reboot'''</p>|}</li></ol>
output/debs/<span id="linux-imagesdkorangepi-build-nextusage-sun50iw9_x.x.x_arm64.debinstructions"></span>
<ol start="9" style="list-style-type: decimal;"><li>When the orangepi-bulid compilation system compiles the linux kernel source code, it will first synchronize the linux kernel source code with the linux kernel source code of the github server. Therefore, if you want to modify the linux kernel source code, you first need to turn off the update function of the source code ('''it needs to be completely compiled once This function can only be turned off after obtaining the Linux kernel source code, otherwise it will prompt that the source code of the Linux kernel cannot be foundSDK——orangepi-build usage instructions'''), otherwise the modifications will be restored. The method is as follows:</li></ol>=
<blockquotespan id="compilation-system-requirements">Set the IGNORE_UPDATES variable in '''userpatches/config-default.conf''' to &quot;yes&quot;</blockquotespan>test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''== Compilation system requirements ==
IGNORE_UPDATESThe Linux SDK, '''orangepi-build''', only supports running on X64 computers with '''<span style=&quot;"color:#FF0000">Ubuntu 22.04</span>'''installed. Therefore, before downloading orangepi-build, please first ensure that the Ubuntu version installed on your computer is Ubuntu 22.04. The command to check the Ubuntu version installed on the computer is as follows. If the Release field does not display ''yes'<span style="color:#FF0000">22.04</span>'''&quot;, it means that the Ubuntu version currently used does not meet the requirements. Please change the system before performing the following operations.
<ol start{| class="10wikitable" style="listwidth:800px;" |-style| test@test:~$ '''lsb_release -typea''' No LSB modules are available. Distributor ID: Ubuntu Description: decimal;">Ubuntu 22.04 LTS Release: '''<lispan style="color:#FF0000">22.04<p/span>''' Codename: '''jammy'''|} If the kernel computer is modifiedinstalled with a Windows system and does not have Ubuntu 22.04 installed on it, you can use the following method consider using'''VirtualBox''' or '''VMware''' to update the kernel and kernel module of install an Ubuntu 22.04 virtual machine in the development board Linux Windows system</p><ol style="list. But please note, do not compile orangepi-stylebuild on the WSL virtual machine, because orangepi-type: lowerbuild has not been tested in the WSL virtual machine, so there is no guarantee that orangepi-alpha;"><li>Upload the compiled deb package of the Linux kernel to build can be used normally in WSL. In addition, please do not compile the Linux system of on the development board</li></ol></li></ol>. Use orangepi-build. The installation image download address of Ubuntu 22.04 amd64 version is:
test@test{| class="wikitable" style="width:800px;" |-| [https:~/orangepi/repo.huaweicloud.com/ubuntu-releases/21.04/ubuntu-21.04-desktop-build$ amd64.iso '''cd outputhttps:/debs/mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04/ubuntu-22.04-desktop-amd64.iso''']|}
test@testAfter installing Ubuntu 22.04 on your computer or virtual machine, please first set the software source of Ubuntu 22.04 to Tsinghua source (or other domestic sources that you think is fast), otherwise it is easy to make errors due to network reasons when installing the software later. The steps to replace Tsinghua Source are as follows:~/orangepi-build/output/debs$ '''scp \'''
'''linux<ol style="list-imagestyle-nexttype: lower-sun50iw9_x.x.x_arm64alpha;"><li>For the method of replacing Tsinghua Source, please refer to the instructions on this page.deb root@192.168.1.xxx:</root'''li>
{| class="wikitable" style="width:800px;"
|-
|
[https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/ '''https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/''']
|}
</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>Install Note that the deb package of the new linux kernel just uploadedUbuntu version needs to be switched to 22.04.</li></ol> orangepi@orangepi:~$ '''sudo dpkg -i linux-image-next-sun50iw9_x.x.x_arm64.deb'''
[[File:zero2w-img271.png]]
</ol>
<ol start="3" style="list-style-type: lower-alpha;">
<li>Then restart The contents of the development board and check whether the kernel-related modifications have taken effect'''/etc/apt/sources.list''' file that need to be replaced are:</li><{| class="wikitable" style="width:800px;" |-| test@test:~$ '''sudo mv /etc/apt/sources.list cat /etc/apt/ol>sources.list.bak'''
orangepitest@orangepitest:~$ '''sudo''' '''rebootvim /etc/apt/sources.list'''
<span id="compile-rootfs"></span>== Compile rootfs =='''#''' The source code image is commented by default to improve apt update speed. You can uncomment it yourself if necessary.
# Run the builddeb https://mirrors.sh script, remember to add sudo permissionstuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
test@test:~/orangepi-build$ '''sudo ./build.sh#'''deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
<ol start="2" style="list-style-typedeb https: decimal;"><li>Select '''Rootfs and all deb packages''' and press Enter</li></ol>mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
<div class="figure">'''#''' deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
[[Filedeb https:zero2w//mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-img285.png]]backports main restricted universe multiverse
</div><ol start="3" style="list'''#''' deb-style-typesrc https: decimal;"><li>Then select the model of the development board</li></ol>mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
[[Filedeb https:zero2w//mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-img275.png]]security main restricted universe multiverse
<ol start="4" style="list'''#''' deb-style-typesrc https: decimal;"><li><p>Then select the branch type of the kernel source code. Different versions of the kernel source code maintain different rootfs types.</p><ol style="list-style-type: lower-alpha;"><li><p>In the current branch, you can see three options: debian11, ubuntu20/mirrors.04, and ubuntu22tuna.04tsinghua.</p></li><li><p>In the next branch, you can see three options: debian11, debian12, and ubuntu22.04edu.<cn/p><ubuntu/li></ol></li></ol>jammy-security main restricted universe multiverse
[[File:zero2w-img276.png]]
<ol start="5" style="list'''#''' Pre-style-type: decimal;"><li>Then select the type of rootfs</li></ol>release software source, not recommended to be enabled
[[File'''#''' deb https:zero2w//mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-img286.png]]proposed main restricted universe multiverse
'''#''' deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse|}</ol><ol start="64" style="list-style-type: decimallower-alpha;"><li>After the replacement, you need to update the package information and ensure that no errors are reported.<p/li>Then select the type of image{| class="wikitable" style="width:800px;" |-| test@test:~$ '''sudo apt-get update'''|}</pol><ol start="5" style="list-style-type: lower-alpha;"><li><p>'''Image with console interface (server)''' Represents <span style="color:#FF0000">In addition, since the image source code of the server versionkernel and Uboot are stored on GitHub, which it is relatively small in sizevery important to ensure that the computer can download the code from GitHub normally when compiling the image.</p></li><li><pspan>'''Image with desktop environment''' Represents an image with a desktop, which is relatively large in size.</p></li></ol></li></ol>
<div classspan id="figureobtain-the-source-code-of-linux-sdk"></span>
[[File:zero2w-img287.png]]== Obtain the source code of linux sdk ==
</div><ol start="7" stylespan id="listdownload-styleorangepi-type: decimal;"><li>If you are compiling the server version of the image, you can also choose to compile the Standard version or the Minimal version. The Minimal version will have much less prebuild-installed software than the Standard version ('''please do not choose the Minimal version without special needs, because many things are not prefrom-installed by default. Some functions may not be available''')</ligithub"></olspan>=== Download orangepi-build from github ===
<div class="figure">Linux sdk refers to the orangepi-build set of codes. Orangepi-build is modified based on the armbian build compilation system. Multiple versions of Linux images can be compiled using orangepi-build. Use the following command to download the orangepi-build code:
[[File{| class="wikitable" style="width:zero2w800px;" |-img288.png]]| test@test:~$ '''sudo apt-get update'''
</div><ol start="8" style="listtest@test:~$ '''sudo apt-styleget install -type: decimal;"><li>If you are compiling a desktop version of the image, you also need to select the type of desktop environment. Currently, only XFCE is maintained, so please select an XFCE type desktop.</li></ol>y git'''
[[Filetest@test:zero2w~$ '''git clone https://github.com/orangepi-xunlong/orangepi-build.git -b next'''|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Note that when using the H618 Soc development board, you need to download the source code of the <span style="color:#FF0000">next</span> branch of orangepi-build. The above git clone command needs to specify the branch of the orangepi-img289build source code as next.png]]'''</big>
[[File:zero2w-img290.png]]<div class="figure">
You can then select additional packages that need to be installed. Please press the Enter key here to skip directly[[File:zero2w-img272.png|center|800px]]
[[File</div>|}{| class="wikitable" style="background-color:#ffffdc;width:zero2w800px;" |-| <big>'''When downloading the orangepi-img291build code through the git clone command, you do not need to enter the user name and password of the github account (the same is true for downloading other codes in this manual). If after entering the git clone command, Ubuntu PC prompts you to enter the user name of the github account. The name and password are usually entered incorrectly in the address of the orangepi-build warehouse behind git clone. Please carefully check whether there are any errors in the spelling of the command, rather than thinking that we have forgotten to provide the username and password of the github account.png]]'''</big>|}
<ol start="9" style="listThe u-style-type: decimal;"><li><p>Then the compilation of rootfs will start. Some of boot and linux kernel versions currently used by the information prompted during compilation H618 series development boards are as follows:</p><ol style="list-style-type: lower-alpha;"><li>Type of rootfs</li></ol></li></ol>
[ o{| class="wikitable" style="width:800px;text-align: center;"|-| '''branch'''| '''u-boot Version'''| '''linux Kernel version'''|-| '''current'''| '''u-boot v2018.k05'''| '''linux5.4'''|-| '''next'''| '''u-boot v2021. ] local not found [ Creating new rootfs cache for 07'''| '''bullseyelinux6.1''' ]|}<ol start{| class="2wikitable" style="listbackground-style-typecolor:#ffffdc;width: lower-alpha800px;">|-| <libig>The storage path of the compiled rootfs compressed package</li></ol> [ o.k. ] Target directory [ '''The branch mentioned here is not the same thing as the branch of orangepi-build/external/cache/rootfssource code, please don't get confused. This branch is mainly used to distinguish different kernel source code versions.''' ]
<ol start="3" style="list-style-type: lower-alpha;"><li>'''We define the linux5.4 bsp kernel currently provided by Allwinner as the current branch. The name of latest linux6.1 LTS kernel is defined as the rootfs compressed package generated by compilationnext branch.'''</li></olbig>|}
[ o.k. ] File name [ '''bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4''' ]After downloading, the following files and folders will be included:
<ol start="10" style="list-style-type: decimal;">
<li><p>View the compiled rootfs compressed package</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''bullseye-xfce-arm64build.5250ec7002de9e81a41de169f1f89721.tar.lz4sh''': Compile startup script</p></li><li><p>'''external''' It is a compressed package : Contains configuration files needed to compile the image, specific scripts, and source code of rootfssome programs, etc. The meaning of each field in the name is</p></li><li><p>'''LICENSE''': GPL 2 license file</p></li><li><p>'''README.md''': orangepi-build documentation</p></olli><li><p>'''scripts''': Common script for compiling linux images</p></li></ol>{| class="wikitable" style="width:800px;" |-| test@test:~/orangepi-build$ '''ls'''
<blockquote>a) '''bullseyebuild.sh &nbsp;&nbsp;&nbsp;&nbsp; external &nbsp;&nbsp;&nbsp;&nbsp; LICENSE &nbsp;&nbsp;&nbsp;&nbsp; README.md &nbsp;&nbsp;&nbsp;&nbsp; scripts'''|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>''' represents If you downloaded the orangepi-build code from github, after downloading, you may find that orangepi-build does not contain the source code of u-boot and linux kernel, and there is no cross-compilation tool required to compile u-boot and linux kernel. chain, this is normal, because these things are stored in other separate github repositories or some servers (their addresses will be detailed below). Orangepi-build will specify the type addresses of u-boot, Linux distribution of rootfskernel and cross-compilation tool chain in the script and configuration file. When running orangepi-build, when it finds that these things are not available locally, it will automatically download them from the corresponding places.'''</big>|}
b) '''xfce''' indicates that <span id="download-the rootfs is the desktop version, and if it is cli, it indicates the server version.-cross-compilation-tool-chain"></span>
c) '''arm64''' represents === Download the architecture type of rootfscross-compilation tool chain ===
d) When orangepi-build is run for the first time, it will automatically download the cross-compilation '''25250ec7002de9e81a41de169f1f89721toolchain''' is and put it in the MD5 hash value generated by '''toolchains''' folder. Every time you run orangepi-build's build.sh script, it will check whether the package names of all software packages installed by rootfscross-compilation toolchain in toolchains exists. As long as the list of software packages installed by rootfs is If If it does not modifiedexist, this value the download will not changebe restarted. The compilation script If it exists, it will use this MD5 hash value. Determine whether rootfs needs to be recompiled</blockquote><ol start="2" style="list-style-type: lower-alpha;"><li>'''bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tarused directly without repeated downloading.lz4.list''' Lists the package names of all packages installed by rootfs</li></ol>
test@test:~/orangepi-build$ '''ls external/cache/rootfs/'''<div class="figure">
bullseye[[File:zero2w-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tarimg273.lz4png]]
bullseye</div>The mirror URL of the cross-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.currentcompilation tool chain in China is the open source software mirror site of Tsinghua University:
bullseye{| class="wikitable" style="width:800px;" |-xfce| [https://mirrors.tuna.tsinghua.edu.cn/armbian-arm64releases/_toolchain/ '''https://mirrors.5250ec7002de9e81a41de169f1f89721tuna.tartsinghua.lz4edu.listcn/armbian-releases/_toolchain/''']|}
<ol start="11" style="list-style-type: decimal;"><li>If the required rootfs already exists under '''external/cache/rootfs'''After toolchains is downloaded, then compiling the rootfs again it will directly skip the contain multiple versions of cross-compilation process and will not restart the compilation. When compiling the image, it will also go to '''external/cache/rootfstoolchain''' to check whether it already exists. There is a cached rootfs available. If it is available, use it directly. This can save a lot of download and compilation time.</li></ol>:
<span id{| class="compilewikitable" style="width:800px;" |-linux| test@test:~/orangepi-image"><build$ '''ls toolchains/span>== Compile linux image =='''
# Run the '''buildgcc-arm-11.sh''' script, remember to add sudo permissions2-2022.02-x86_64-aarch64-none-linux-gnu
test@test:~/orangepigcc-build$ '''sudo linaro-4./build9.4-2017.sh'''01-x86_64_aarch64-linux-gnu
<ol start="2" style="listgcc-stylelinaro-type: decimal;"><li>Select '''Full OS image for flashing''' and press Enter</li></ol>7.4.1-2019.02-x86_64_arm-linux-gnueabi
<div class="figure">gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf
[[File:zero2wgcc-img292linaro-4.9.4-2017.png]]01-x86_64_arm-linux-gnueabi
</div><ol start="3" style="listgcc-stylelinaro-type: decimal;"><li>Then select the model of the development board</li></ol>aarch64-none-elf-4.8-2013.11_linux
[[File:zero2wgcc-img275arm-9.2-2019.png]]12-x86_64-aarch64-none-linux-gnu
<ol start="4" style="listgcc-stylelinaro-type: decimal;"><li><p>Then select the branch type of the kernel source code5. Different versions of the kernel source code maintain different rootfs types5.</p><ol style="list0-style2017.10-x86_64_arm-type: lowerlinux-alpha;"><li><p>In the current branch, you can see three options: debian11, ubuntu20.04, and ubuntu22.04.</p></li><li><p>In the next branch, you can see three options: debian11, debian12, and ubuntu22.04.</p></li></ol></li></ol>gnueabihf
[[File:zero2wgcc-img276linaro-arm-linux-gnueabihf-4.8-2014.png]]04_linux
<ol start="5" style="listgcc-stylearm-type: decimal;"><li><p>If you select the next branch, you will also be prompted to select the memory size, and you do not need to select the current branch9.</p><ol style="list2-style2019.12-x86_64-arm-type: lowernone-alpha;"><li><p>If the development board you purchased has a memory size of 1.5GB, please select the first option.</p></li><li><p>If the development board you purchased has 1GB or 2GB or 4GB memory size, please choose the second option.</p><p>[[File:zero2wlinux-img277.png]]</p></li></ol></li><li><p>Then select the type of rootfs</p></li></ol>gnueabihf
[[File:zero2wgcc-img286linaro-7.4.1-2019.png]]02-x86_64_aarch64-linux-gnu
<ol start="7" style="listgcc-stylelinaro-type: decimal;"><li><p>Then select the type of image</p><ol style="listarm-stylenone-type: lowereabi-alpha;"><li><p>'''Image with console interface (server)''' Represents the image of the server version, which is relatively small in size4.</p></li><li><p>'''Image with desktop environment'''Represents an image with a desktop, which is relatively large in size8-2014.</p></li></ol>04_linux</li></ol>|}
<div class="figure">The cross-compilation tool chain used to compile the H618 Linux kernel source code is:
[[File<ol style="list-style-type: lower-alpha;"><li>linux5.4</li>{| class="wikitable" style="width:800px;" |-| '''gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu'''|}</ol><ol start="2" style="list-style-type:zero2wlower-img287alpha;"><li>linux6.png]]1</li>{| class="wikitable" style="width:800px;" |-| '''gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu'''|}</ol>The cross-compilation tool chain used to compile the H618 u-boot source code is:
<ol style="list-style-type: lower-alpha;"><li>v2018.05</li>{| class="wikitable" style="width:800px;" |-| '''gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi'''|}</divol><ol start="82" style="list-style-type: decimallower-alpha;"><li>If you are compiling the server version of the image, you can also choose to compile the Standard version or the Minimal versionv2021. The Minimal version will have much less pre07</li>{| class="wikitable" style="width:800px;" |-installed software than the Standard version (| '''please do not choose the Minimal version without special needs, because many things are not pregcc-installed by defaultarm-11.2-2022. Some functions may not be available02-x86_64-aarch64-none-linux-gnu''')|}</liol><span id="orangepi-build-complete-directory-structure-description"></olspan>
<div class="figure">== orangepi-build complete directory structure description ===
[[File<ol style="list-style-type: decimal;"><li><p>After downloading, the orangepi-build warehouse does not contain the source code of the linux kernel, u-boot and cross-compilation tool chain. The source code of the linux kernel and u-boot is stored in an independent git warehouse.</p><ol style="list-style-type: lower-alpha;"><li><p>The git warehouse where the linux kernel source code is stored is as follows. Please note that the branch of the linux-orangepi warehouse is switched to</p><ol style="list-style-type: none;"><li>a) Linux5.4</li>{| class="wikitable" style="width:zero2w800px;" |-img288| https://github.png]]com/orangepi-xunlong/linux-orangepi/tree/'''orange-pi-5.4-sun50iw9'''|}</divol><ol start="92" style="list-style-type: lower-alpha;"><li>b) Linux6.1</li>{| class="wikitable" style="width:800px;" |-| https://github.com/orangepi-xunlong/linux-orangepi/tree/'''orange-pi-6.1-sun50iw9'''|}</ol></li></ol><ol start="2" style="list-style-type: lower-alpha;"><li><p>The git warehouse where the u-boot source code is stored is as follows. Please note that the branch of the u-boot-orangepi warehouse is switched to</p><ol style="list-style-type: lower-alpha;"><li>a) v2018.05</li>{| class="wikitable" style="width:800px;" |-| https://github.com/orangepi-xunlong/u-boot-orangepi/tree/'''v2018.05-h618'''|}</ol><ol start="2" style="list-style-type: lower-alpha;"><li>b) v2021.07</li>{| class="wikitable" style="width:800px;" |-| https://github.com/orangepi-xunlong/u-boot-orangepi/tree/'''v2021.07-sunxi'''|}</ol></li></ol></li></ol><ol start="2" style="list-style-type: decimal;"><li>If you are <p>When orangepi-build is run for the first time, it will download the cross-compilation tool chain, u-boot and linux kernel source code. After successfully compiling a desktop version linux image, the files and folders that can be seen in orangepi-build are:</p><ol style="list-style-type: lower-alpha;"><li><p>'''build.sh''': Compile startup script</p></li><li><p>'''external''': Contains the configuration files needed to compile the image, scripts for specific functions, and the source code of some programs. The rootfs compressed package cached during the image, you compilation process is also need to select stored in external.</p></li><li><p>'''kernel''': Store the type source code of desktop environmentthe linux kernel</p></li><li><p>'''LICENSE''': GPL 2 license file</p></li><li><p>'''README. Currentlymd''': orangepi-build documentation</p></li><li><p>'''output''': Store compiled u-boot, only XFCE is maintainedlinux and other deb packages, compilation logs, so please select an XFCE type desktop.and compiled images and other files</p></li><li><p>'''scripts''': Common script for compiling linux images</p></li><li><p>'''toolchains''': Store cross-compilation tool chain</p></li><li><p>'''u-boot''': Store the source code of u-boot</p></li><li><p>'''userpatches''': Store the configuration files needed to compile the script</olp></li>{| class="wikitable" style="width:800px;" |-| test@test:~/orangepi-build$ '''ls'''
[[File:zero2w'''build.sh &nbsp;&nbsp;&nbsp;&nbsp; external &nbsp;&nbsp;&nbsp;&nbsp; kernel &nbsp;&nbsp;&nbsp;&nbsp; LICENSE &nbsp;&nbsp;&nbsp;&nbsp; output &nbsp;&nbsp;&nbsp;&nbsp; README.md &nbsp;&nbsp;&nbsp;&nbsp; scripts &nbsp;&nbsp;&nbsp;&nbsp; toolchains &nbsp;&nbsp;&nbsp;&nbsp; u-img289.png]]boot &nbsp;&nbsp;&nbsp;&nbsp; userpatches'''|}</ol></li></ol>
[[File:zero2w<span id="compile-img290.png]]u-boot"></span>
You can then select additional packages that need to be installed. Please press the Enter key here to skip directly.== Compile u-boot ==
[[File:zero2w-img291# Run the build.png]]sh script, remember to add sudo permissions
<ol start{| class="10wikitable" style="list-style-typewidth: decimal800px;"><li>Then the compilation of the linux image will begin|-| test@test:~/orangepi-build$ '''sudo . The general process of compilation is as follows</li></ol>build.sh'''|}
a. Initialize the compilation environment of Ubuntu PC <ol start="2" style="list-style-type: decimal;"><li>Select '''U-boot package''' and install the software packages required for the compilation process.press Enter</li>
b. Download the source code of u-boot and linux kernel (if already cached, only update the code)<div class="figure">
c[[File:zero2w-img274. Compile u-boot source code and generate u-boot deb packagepng]]
d. Compile linux source code and generate linux</div></ol><ol start="3" style="list-related deb packagesstyle-type: decimal;"><li>Then select the model of the development board</li>
e[[File:zero2w-img275. Make the deb package of linux firmwarepng]]</ol>f. Make <ol start="4" style="list-style-type: decimal;"><li><p>Then select the deb package branch type of orangepiu-config toolboot</p> g. Create a deb package with board<ol style="list-level support h. If you compile the desktop version image, you will also create a desktopstyle-related deb package. i. Check whether rootfs has been cached. If not, retype: lower-create rootfs. If it has been cached, decompress it directly and use it.alpha;"> j. Install <li><p>The current branch will compile the deb package generated previously into rootfs k. Make some specific settings for different development boards and different types of images, such as preu-installing additional software packages, modifying system configurations, etcboot v2018l. Then create the image file and format the partition. The default type is ext4. m. Then copy the configured rootfs 05 version code that needs to be used by the mirror partitionlinux5n4 image. Then update initramfs</p></li> o. Finally, write <li><p>The next branch will compile the bin file of u-boot into v2021.07 version code that needs to be used by the linux6.1 image through the dd command.</p><p>[[File:zero2w-img276.png]]</p></li></ol><ol start="11" style="list-style-type: decimal;"/li><li><p>After compiling If you select the imagenext branch, the following message you will also be displayedprompted to select the memory size, and you do not need to select the current branch.</p>
<ol style="list-style-type: lower-alpha;">
<li>The storage path <p>If the development board you purchased has a memory size of 1.5GB, please select the first option.</p></li><li><p>If the development board you purchased has 1GB or 2GB or 4GB memory size, please choose the compiled imagesecond option.</p><p>[[File:zero2w-img277.png]]</p></li></ol>
</li></ol>
<ol start="6" style="list-style-type: decimal;"><li><p>Then it will start to compile u-boot. Some of the information prompted when compiling the next branch is as follows:</p><ol style="list-style-type: lower-alpha;"><li>Version of u-boot source code</li>{| class="wikitable" style="width:800px;" |-| [ o.k. ] Done building Compiling u-boot [ '''output/images/orangepizero2w_x.x.x_debian_bullseye_linux6.1.xx_xfce_desktop/orangepizero2w_xv2021.x.x_debian_bullseye_linux6.1.xx_xfce_desktop.img07''' ]|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>Compilation timeVersion of the cross-compilation tool chain</li></ol>{| class="wikitable" style="width:800px;" |-| '''[ o.k. ] Runtime Compiler version [ 19 min ]'''aarch64-linux-gnu-gcc 11''' ]|}</ol>
<ol start="3" style="list-style-type: lower-alpha;">
<li>Repeat the command Path to compile the image. Use the following command to start compiling the image directly without selecting it through the graphical interface.compiled u-boot deb package</li></ol>{| class="wikitable" style="width:800px;" |-| [ o.k. ] Repeat Build Options Target directory [ '''sudo .orangepi-build/output/debs/build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=image RELEASE=bullseye BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=yesu-boot''' ]|}</ol><span idol start="4" style="instructions-for-using-the-orange-pilist-osstyle-archtype: lower-systemalpha;"></spanli= '''Instructions for using The package name of the Orange Pi OS Arch system''' = <span id="orange-pi-os-arch-system-function-adaptationcompiled u-status">boot deb package</spanli>== Orange Pi OS Arch system function adaptation status == {| class="wikitable" style="width:800px;"
|-
| [ o.k. ] File name [ '''Motherboard functionslinux-u-boot-next-orangepizero2w_x.x.x_arm64.deb''']|}</ol><ol start="5" style="list-style-type: lower-alpha;"><li>Compilation time</li>{| '''OPi OS Arch'''class="wikitable" style="width:800px;"
|-
| [ o.k. ] Runtime [ '''HDMI video1 min''']|}</ol><ol start="6" style="list-style-type: lower-alpha;"><li>Repeat the command to compile u-boot. Use the following command without selecting through the graphical interface. You can start compiling u-boot directly.</li>{| '''OK'''class="wikitable" style="width:800px;"
|-
| [ o.k. ] Repeat Build Options [ '''HDMI Audiosudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=u-boot''']| '''OK'''}</ol></li></ol><ol start="7" style="list-style-type: decimal;"><li>View the compiled u-boot deb package</li>{| class="wikitable" style="width:800px;"
|-
| test@test:~/orangepi-build$ '''ls output/debs/u-boot/''' '''Typelinux-u-boot-next-C USB2orangepizero2w_x.0 x 2.x_arm64.deb'''| }</ol><ol start="8" style="list-style-type: decimal;"><li>When the orangepi-bulid compilation system compiles the u-boot source code, it will first synchronize the u-boot source code with the u-boot source code of the github server. Therefore, if you want to modify the u-boot source code, you first need to turn off the download and update function of the source code. ('''You need to completely compile u-boot before you can turn off this function, otherwise it will prompt that the source code of u-boot cannot be found'''), otherwise the modifications will be restored. The method is as follows:</li> Set the IGNORE_UPDATES variable in u'OK''userpatches/config-default.conf''' to &quot;yes&quot; {| class="wikitable" style="width:800px;"
|-
| test@test:~/orangepi-build$ '''TF Card Startupvim userpatches/config-default.conf'''| ...... IGNORE_UPDATES=&quot;'''OK<span style="color:#FF0000">yes</span>'''&quot; ......|}</ol><ol start="9" style="list-style-type: decimal;"><li><p>When debugging u-boot code, you can use the following method to update u-boot in the linux image for testing</p><ol style="list-style-type: lower-alpha;"><li>First upload the compiled deb package of u-boot to the Linux system of the development board.</li>{| class="wikitable" style="width:800px;"
|-
| test@test:~/orangepi-build$ '''cd output/debs/u-boot''' test@test:~/orangepi_build/output/debs/u-boot$ '''WIFIscp \'''| '''OKlinux-u-boot-next-orangepizero2w_x.x.x_arm64.deb [mailto:root@192.168.1.xxx:/root root@192.168.1.xxx:/root]'''|}</ol><ol start="2" style="list-style-type: lower-alpha;"><li>Install the new u-boot deb package just uploaded</li>{| class="wikitable" style="width:800px;"
|-
| orangepi@orangepi:~$ '''Bluetoothsudo dpkg -i'''| '''OKlinux-u-boot-next-orangepizero2w_x.x.x_arm64.deb'''|}</ol><ol start="3" style="list-style-type: lower-alpha;"><li>Then run the nand-sata-install script</li>{| class="wikitable" style="width:800px;"
|-
| '''LED Light'''| '''OK'''|-| '''40pin GPIO'''| '''OK'''|-| '''40pin I2C'''| '''OK'''|-| '''40pin SPI'''| '''OK'''|-| '''40pin UART'''| '''OK'''|-| '''40pin PWM'''| '''OK'''|-| '''Temperature Sensor'''| '''OK'''|-| '''Hardware watchdog'''| orangepi@orangepi:~$ '''OK'''|sudo nand-| '''Mali GPU'''| '''NO'''|sata-| '''Video codec'''| '''NOinstall'''
|}
</ol>
<ol start="4" style="list-style-type: lower-alpha;">
<li>Then select '''5 Install/Update the bootloader on SD/eMMC'''</li>
 
[[File:zero2w-img278.png]]
</ol>
<ol start="5" style="list-style-type: lower-alpha;">
<li>After pressing the Enter key, a Warning will pop up first.</li>
 
[[File:zero2w-img279.png]]
</ol>
<ol start="6" style="list-style-type: lower-alpha;">
<li>Press the Enter key again to start updating u-boot. After the update is completed, the following information will be displayed.</li>
{| class[[File:zero2w-img280.png]]</ol><ol start="wikitable7" style="|list-style-type: lower-alpha;">| '''24pin expansion <li>Then you can restart the development board function'''to test whether the u-boot modification has taken effect.</li></ol>| '''OPi OS Arch'''</li></ol>|<span id="compile-the-linux-kernel"></span>| '''100M network port'''| '''OK'''== Compile the linux kernel ==|-| # Run the '''100M Ethernet port lightbuild.sh'''script, remember to add sudo permissions ::{| '''OK'''class="wikitable" style="width:800px;"
|-
| '''USB2.0 HOST x 2'''| '''OK'''|test@test:~/orangepi-| build$ '''Infrared reception'''| '''OK'''|-| '''Headphone audio playback'''| '''OK'''|-| '''Onsudo ./off button'''| '''OK'''|-| '''LRADC''' '''Custom buttons x 2'''| '''OK'''|-| '''TV-OUT'''| '''NObuild.sh'''
|}
<span idol start="orange-pi-os-arch-system-user2" style="list-guidestyle-instructionstype: decimal;"><li>Select '''Kernel package''' and press Enter</spanli>== Orange Pi OS Arch System User Guide Instructions ==
First of all, please note that the OPi OS Arch system does not have a default orangepi user and password, so you cannot directly log in remotely through the serial port and ssh after the system is started after burning (not even the root user). This is different from Ubuntu and Debian systems.<div class="figure">
When the OPi OS Arch system is started for the first time, you need to connect an HDMI display and then initialize the system settings through the user wizard (including creating a new user name and setting a password)[[File:zero2w-img281. The setup steps of the user wizard are as follows:png]]
</div></ol ><ol start="3" style="list-style-type: lower-alphadecimal;"><li><p>After burning Then you will be prompted whether you need to display the kernel configuration interface. If you do not need to modify the systemkernel configuration, when you start it for select the first time and enter one. If you need to modify the desktopkernel configuration, you will see the user wizard program shown in select the figure belowsecond one.</p><div class="figure"li>
[[File:zero2w-img293img282.png]]</ol><ol start="4" style="list-style-type: decimal;"><li>Then select the model of the development board</li>
[[File:zero2w-img275.png]]</divol></liol start="5" style="list-style-type: decimal;"><li><p>First you need to Then select the language you wantbranch type of the kernel source code</p><div class="figure"li>
[[File:zero2w-img294:a. The current branch will compile the linux5.png]]4 kernel source code
</div></li><li><p>After selecting the language, the user wizard ::b. The next branch will immediately switch to compile the corresponding language interface, as shown below in Chinese</p><div class="figure">linux6.1 kernel source code
::[[File:zero2w-img295img276.png]]</ol><ol start="6" style="list-style-type: decimal;"><li>If you choose to display the kernel configuration menu (the second option) in step 3), the kernel configuration interface opened through '''make menuconfig''' will pop up. At this time, you can directly modify the kernel configuration. After modification, save and exit. Yes, compilation of the kernel source code will begin after exiting.</li>
</div></li><li><p>Then select the area</p><div class="figure">[[File:zero2w-img283.png]]
[[File<ol style="list-style-type: lower-alpha;"><li>If you do not need to modify the kernel configuration options, when running the build.sh script, pass '''KERNEL_CONFIGURE=no''' to temporarily block the pop-up of the kernel configuration interface.</li>{| class="wikitable" style="width:800px;" |-| test@test:~/orangepi-build$ '''sudo ./build.sh KERNEL_CONFIGURE=no'''|}</ol><ol start="2" style="list-style-type:zero2wlower-img296alpha;"><li><p>b. You can also set '''KERNEL_CONFIGURE=no''' in the orangepi-build/userpatches/config-default.confconfiguration file to permanently disable this function.</p></li><li><p>If the following error is prompted when compiling the kernel, it is because the Ubuntu PC terminal interface is too small, causing the make menuconfig interface to be unable to be displayed. Please increase the Ubuntu PC terminal to the maximum size, and then rerun the build.sh script.png]]</p></li>
[[File:zero2w-img284.png]]</divol></liol><ol start="7" style="list-style-type: decimal;"><li><p>Then select Part of the information prompted when compiling the keyboard modelnext branch kernel source code is explained as follows:</p><div classol style="figurelist-style-type: lower-alpha;"><li>Version of the linux kernel source code</li>[[File{| class="wikitable" style="width:zero2w800px;" |-img297| [ o.k.png]Compiling current kernel [ '''6.1.31''' ]|}</divol><ol start="2" style="list-style-type: lower-alpha;"><li>The version of the cross-compilation tool chain used</li>{| class="wikitable" style="width:800px;" |-| [ o.k. ] Compiler version [ '''aarch64-linux-gnu-gcc 11''' ]|}</ol><liol start="3" style="list-style-type: lower-alpha;"><pli>Then create a new username The default configuration file used by the kernel and set a passwordthe path where it is stored are as follows</pli><div {| class="figurewikitable">style="width:800px;" |-| [o.k. ] Using kernel config file [File:zero2w'''orangepi-build/external/config/kernel/linux-6.1-sun50iw9-img298next.png]config''' ]|}</divol></liol start="4" style="list-style-type: lower-alpha;"><li>The path to the kernel-related deb package generated by compilation<p/li>Then make sure there is no problem with the selection, and then click the install {| class="wikitable" style="width:800px;" |-| [ o.k. ] Target directory [ '''buttonoutput/debs/''']|}</pol><ol start="5" style="list-style-type: lower-alpha;"><div li>The package name of the kernel image deb package generated by compilation</li>{| class="figurewikitable" style=">width:800px;" |-| [o.k. ] File name [File:zero2w'''linux-image-next-img299sun50iw9_x.x.x_arm64.png]deb''' ]|}</divol><ol start="6" style="list-style-type: lower-alpha;"><li>Compilation time</li>{| class="wikitable" style="width:800px;" |-| [ o.k. ] Runtime [ '''10 min''' ]|}</ol><liol start="7" style="list-style-type: lower-alpha;"><pli>Then wait for Finally, the installation compilation command to completerepeatedly compile the last selected kernel will be displayed. Use the following command without selecting through the graphical interface, and you can directly start compiling the kernel source code.</pli><div {| class="figurewikitable" style="width:800px;">|-| [o.k. ] Repeat Build Options [File:zero2w-img300'''sudo ./build.png]sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=kernel KERNEL_CONFIGURE=no''' ]|}</divol></li></ol><ol start="8" style="list-style-type: decimal;"><li><p>After the installation is complete, you need to click View the kernel-related deb package generated by compilation</p><ol style="list-style-type: lower-alpha;"><li><p>'''Finishlinux-dtb-next-sun50iw9_x.x.x_arm64.deb''' button to restart Contains dtb files used by the systemkernel</p></li><li><p>'''linux-headers-next-sun50iw9_x.x.x_arm64.deb''' Contains kernel header files</p></li><div li><p>'''linux-image-next-sun50iw9_x.x.x_arm64.deb''' Contains kernel images and kernel modules</p></li>{| class="figurewikitable" style=">width:800px;" |-| test@test:~/orangepi-build$ '''ls output/debs/linux-*'''
[[File:zero2woutput/debs/linux-img301dtb-next-sun50iw9_x.x.x_arm64.png]]deb
<output/div><debs/li><li><p>The Orange Pi Hello program will automatically start after restartinglinux-headers-next-sun50iw9_x. At this time, you need to remove the check '''mark of Start on startup''' in the lower right corner, otherwise you need to manually close the Orange Pi Hello program every time you start itx.</p><div class="figure">x_arm64.deb
[[Fileoutput/debs/linux-image-next-sun50iw9_x.x.x_arm64.deb|}</ol></li></ol><ol start="9" style="list-style-type:zero2wdecimal;"><li>When the orangepi-img302bulid compilation system compiles the linux kernel source code, it will first synchronize the linux kernel source code with the linux kernel source code of the github server.png]]Therefore, if you want to modify the linux kernel source code, you first need to turn off the update function of the source code ('''it needs to be completely compiled once This function can only be turned off after obtaining the Linux kernel source code, otherwise it will prompt that the source code of the Linux kernel cannot be found'''), otherwise the modifications will be restored. The method is as follows:</li>
</div><p>At this point, you can use Set the newly created username and password to log IGNORE_UPDATES variable in '''userpatches/config-default.conf''' to the OPi OS system through the serial port or ssh.</p></li></ol>&quot;yes&quot;
<span id{| class="howwikitable" style="width:800px;" |-to| test@test:~/orangepi-setbuild$ '''vim userpatches/config-dt-overlays"></span>== How to set DT overlays ==default.conf'''
The multiplexing functions such as I2CIGNORE_UPDATES=&quot;'''<span style="color:#FF0000">yes</SPIspan>'''&quot;|}</UARTol><ol start="10" style="list-style-type: decimal;"><li><p>If the kernel is modified, you can use the following method to update the kernel and kernel module of the development board Linux system</PWM in p><ol style="list-style-type: lower-alpha;"><li>Upload the compiled deb package of the Linux kernel to the Linux system of the 40-pin development board are turned off by default in </li>{| class="wikitable" style="width:800px;" |-| test@test:~/orangepi-build$ '''cd output/debs''' test@test:~/orangepi-build/output/debs$ '''scp \''' '''linux-image-next-sun50iw9_x.x.x_arm64.deb root@192.168.1.xxx:/root'''|}</ol><ol start="2" style="list-style-type: lower-alpha;"><li>Install the deb package of the new linux kerneljust uploaded.</li>{| class="wikitable" style="width:800px;" |-| orangepi@orangepi:~$ ''s dts, 'sudo dpkg -i linux-image-next-sun50iw9_x.x.x_arm64.deb'''|}</ol><ol start="3" style="list-style-type: lower-alpha;"><li>Then restart the development board and check whether the corresponding DT overlays need to be manually turned on before they can be usedkernel-related modifications have taken effect.</li>{| class="wikitable" style="width:800px;" |-| The method to open DT overlays in OPi OS Arch system is as followsorangepi@orangepi:~$ '''sudo''' '''reboot'''|}</ol></li></ol><span id="compile-rootfs"></span> == Compile rootfs ==
# First open Run the '''/boot/extlinux/extlinuxbuild.conf''' configuration filesh script, remember to add sudo permissions
[orangepi::{| class="wikitable" style="width:800px;" |-| test@test:~/orangepi-pc ~]build$ '''sudo vim /boot/extlinux./extlinuxbuild.confsh'''|}
<ol start="2" style="list-style-type: decimal;">
<li>Then open the corresponding configuration by adding Select '''FDTOVERLAYS''' '''/dtbs/allwinner/overlay/xxx.dtbo''' in '''/boot/extlinux/extlinux.confRootfs and all deb packages'''and press Enter</li></ol>
'''Note that xxx.dtbo in FDTOVERLAYS /dtbs/allwinner/overlay/xxx.dtbo needs to be replaced with the specific dtbo configuration, please do not copy it.'''<div class="figure">
[orangepi@orangepi[File:zero2w-pc ~img285.png]]$ '''sudo vim /boot/extlinux/extlinux.conf'''
LABEL Orange Pi</div></ol><ol start="3" style="list-style-type: decimal;"><li>Then select the model of the development board</li>
KERNEL [[File:zero2w-img275.png]]</Imageol><ol start="4" style="list-style-type: decimal;"><li><p>Then select the branch type of the kernel source code. Different versions of the kernel source code maintain different rootfs types.</p><ol style="list-style-type: lower-alpha;"><li><p>In the current branch, you can see three options: debian11, ubuntu20.04, and ubuntu22.04.</p></li><li><p>In the next branch, you can see three options: debian11, debian12, and ubuntu22.04.</p></li>
FDT [[File:zero2w-img276.png]]</dtbsol></allwinnerli></sun50iol><ol start="5" style="list-h616style-orangepi-zero2w.dtbtype: decimal;"><li>Then select the type of rootfs</li>
[[File:zero2w-img286.png]]</ol><ol start="6" style="list-style-type: decimal;"><li><p>Then select the type of image</p><ol style="list-style-type: lower-alpha;"><li><p>'''Image with console interface (server)'''FDTOVERLAYS Represents the image of the server version, which is relatively small in size.</dtbsp></allwinner/overlay/xxx.dtboli><li><p>'''Image with desktop environment''' #Configuration that needs to be addedRepresents an image with a desktop, which is relatively large in size.</p></li>
<ol startdiv class="3figure" style="list-style-type: decimal;"><li><p>The storage path of xxx.dtbo in the OPi OS Arch image is as follows. Please note that not all dtbo under this path can be used.</p><p>'''/boot/dtbs/allwinner/overlay/'''</p></li><li><p>The DT overlays configuration that can be used by the development board is as follows</p></li></ol>
[[File:zero2w-img287.png]] </div></ol></li></ol><ol start="7" style="list-style-type: decimal;"><li>If you are compiling the server version of the image, you can also choose to compile the Standard version or the Minimal version. The Minimal version will have much less pre-installed software than the Standard version ('''please do not choose the Minimal version without special needs, because many things are not pre-installed by default. Some functions may not be available''')</li> <div class="figure"> [[File:zero2w-img288.png]] </div></ol><ol start="8" style="list-style-type: decimal;"><li>If you are compiling a desktop version of the image, you also need to select the type of desktop environment. Currently, only XFCE is maintained, so please select an XFCE type desktop.</li> [[File:zero2w-img289.png]] [[File:zero2w-img290.png]] You can then select additional packages that need to be installed. Please press the Enter key here to skip directly. [[File:zero2w-img291.png]]</ol><ol start="9" style="list-style-type: decimal;"><li><p>Then the compilation of rootfs will start. Some of the information prompted during compilation are as follows:</p><ol style="list-style-type: lower-alpha;"><li>Type of rootfs</li>{| class="wikitable" style="width:800px;"
|-
| [ o.k. ] local not found [ Creating new rootfs cache for '''Functions on the development boardbullseye''']|}</ol><ol start="2" style="list-style-type: lower-alpha;"><li>The storage path of the compiled rootfs compressed package</li>{| '''Corresponding DT overlays configuration'''class="wikitable" style="width:800px;"
|-
| [ o.k. ] Target directory [ '''40pin orangepi- i2c0build/external/cache/rootfs''']| '''sun50i}</ol><ol start="3" style="list-h616style-pitype: lower-i2c0.dtbo'''alpha;"><li>The name of the rootfs compressed package generated by compilation</li>{| class="wikitable" style="width:800px;"
|-
| [ o.k. ] File name [ '''40pin bullseye- i2c1xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4''']| }</ol></li></ol><ol start="10" style="list-style-type: decimal;"><li><p>View the compiled rootfs compressed package</p><ol style="list-style-type: lower-alpha;"><li>'''bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4''' It is a compressed package of rootfs. The meaning of each field in the name is</li> :a) '''bullseye''' represents the type of Linux distribution of rootfs :b) '''xfce''' indicates that the rootfs is the desktop version, and if it is cli, it indicates the server version. :c) '''arm64''' represents the architecture type of rootfs :d) '''25250ec7002de9e81a41de169f1f89721'sun50i'' is the MD5 hash value generated by the package names of all software packages installed by rootfs. As long as the list of software packages installed by rootfs is not modified, this value will not change. The compilation script will use this MD5 hash value. Determine whether rootfs needs to be recompiled</ol><ol start="2" style="list-h616style-pitype: lower-i2c1alpha;"><li>'''bullseye-xfce-arm64.dtbo5250ec7002de9e81a41de169f1f89721.tar.lz4.list'''Lists the package names of all packages installed by rootfs</li>{| class="wikitable" style="width:800px;"
|-
| '''40pin - i2c2'''| '''sun50i-h616-pi-i2c2.dtbo'''|-| '''40pin - uart2'''| '''sun50i-h616-pi-uart2.dtbo'''|-| '''40pin - uart3'''| '''sun50i-h616-pi-uart3.dtbo'''|-| '''40pin - uart4'''| '''sun50i-h616-pi-uart4.dtbo'''|-| '''40pin - uart5'''| '''sun50i-h616-ph-uart5.dtbo'''|-| '''40pin - pwm1'''| '''sun50i-h616-pi-pwm1.dtbo'''|-| '''40pin - pwm2'''| '''sun50i-h616-pi-pwm2.dtbo'''|-| '''40pin - pwm3'''| '''sun50i-h616-pi-pwm3.dtbo'''|-| '''40pin - pwm4'''| '''sun50i-h616-pi-pwm4.dtbo'''|-| '''40pin - spi1 cs0'''| '''sun50i-h616-spi1-cs0-spidev.dtbo'''|-| '''40pin - spi1 cs1'''| '''sun50i-h616-spi1-cs1-spidev.dtbo'''|-| '''40pin test@test:~/orangepi- spi1 cs0 cs1build$ '''| ls external/cache/rootfs/'''sun50i-h616-spi1-cs0-cs1-spidev.dtbo'''|-| '''设Set USB0 to Host mode'''| '''sun50i-h616-usb0-host.dtbo'''|-| '''Turn off the green LED light'''| '''sun50i-h616-zero2w-disable-led.dtbo'''|-| '''How to close the UART0 debugging serial port'''| '''sun50i-h616-disable-uart0.dtbo'''|}
<ol start="5" style="listbullseye-stylexfce-type: decimal;"><li>If you need to open multiple configurations at the same time, just add the paths of multiple configurations directly after '''FDTOVERLAYSarm64.''' For example, the configuration of opening i2c1 and uart5 at the same time is as follows</li></ol>5250ec7002de9e81a41de169f1f89721.tar.lz4
[orangepi@orangepibullseye-pc ~]$ '''sudo vim /boot/extlinux/extlinuxxfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.conf'''current
LABEL Orange Pibullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.list|}</ol></li></ol><ol start="11" style="list-style-type: decimal;"><li>If the required rootfs already exists under '''external/cache/rootfs''', then compiling the rootfs again will directly skip the compilation process and will not restart the compilation. When compiling the image, it will also go to '''external/cache/rootfs''' to check whether it already exists. There is a cached rootfs available. If it is available, use it directly. This can save a lot of download and compilation time.</li></ol>
KERNEL <span id="compile-linux-image"></Imagespan>
FDT /dtbs/allwinner/sun50i-h616-orangepi-zero2w.dtb== Compile linux image ==
# Run the '''FDTOVERLAYS /dtbs/allwinner/overlay/sun50i-h616-pi-i2c1build.dtbo /dtbs/allwinner/overlay/sun50i-h616-ph-uart5.dtbosh'''script, remember to add sudo permissions
<ol start::{| class="6wikitable" style="list-style-typewidth: decimal800px;"><li>After setting, you need to restart the system for the configuration to take effect|-| test@test:~/orangepi-build$ '''sudo .</li></ol>build.sh'''|}
[orangepi@orangepi<ol start="2" style="list-style-pc ~]$ type: decimal;"><li>Select '''sudo rebootFull OS image for flashing'''and press Enter</li> <div class="figure"> [[File:zero2w-img292.png]] </div></ol><ol start="3" style="list-style-type: decimal;"><li>Then select the model of the development board</li>
[[File:zero2w-img275.png]]</ol><span idol start="4" style="howlist-style-totype: decimal;"><li><p>Then select the branch type of the kernel source code. Different versions of the kernel source code maintain different rootfs types.</p><ol style="list-installstyle-softwaretype: lower-alpha;"><li><p>In the current branch, you can see three options: debian11, ubuntu20.04, and ubuntu22.04.</p></spanli>== How to install software ==<li><p>In the next branch, you can see three options: debian11, debian12, and ubuntu22.04.</p></li>
You can use [[File:zero2w-img276.png]]</ol></li></ol><ol start="5" style="list-style-type: decimal;"><li><p>If you select the pacman package management tool next branch, you will also be prompted to install software that is select the memory size, and you do not available in OPi OS. For example, the command need to install select the vim editor is as followscurrent branch. </p><ol style="list-style-type: lower-alpha;"><li><p>If the development board you want to install other softwarepurchased has a memory size of 1.5GB, you only need to replace vim with please select the package name of first option.</p></li><li><p>If the software development board you want to installpurchased has 1GB or 2GB or 4GB memory size, please choose the second option.</p><p>[[File:zero2w-img277.png]]</p></li></ol></li><li><p>Then select the type of rootfs</p></li>
[orangepi@orangepi[File:zero2w-pc ~img286.png]$ ]</ol><ol start="7" style="list-style-type: decimal;"><li><p>Then select the type of image</p><ol style="list-style-type: lower-alpha;"><li><p>'''sudo pacman -Syy vimImage with console interface (server)''' Represents the image of the server version, which is relatively small in size.</p></li><li><p>'''Image with desktop environment'''Represents an image with a desktop, which is relatively large in size.</p></li>
<span iddiv class="android-12-tv-system-usage-instructionsfigure"></span>
= '''Android 12 TV system usage instructions''' =[[File:zero2w-img287.png]]
<span id/div></ol></li></ol><ol start="supported8" style="list-androidstyle-versionstype: decimal;"><li>If you are compiling the server version of the image, you can also choose to compile the Standard version or the Minimal version. The Minimal version will have much less pre-installed software than the Standard version ('''please do not choose the Minimal version without special needs, because many things are not pre-installed by default. Some functions may not be available''')</spanli>== Supported Android versions ==
{| <div class="wikitablefigure"|-| Android Version| Kernel version|-| '''Android 12 TV Version'''| '''linux5.4'''|}>
<span id="android[[File:zero2w-12-tv-function-adaptation-status"></span>== Android 12 TV function adaptation status ==img288.png]]
{| class</div></ol><ol start="9" style="list-style-type: decimal;"><li>If you are compiling a desktop version of the image, you also need to select the type of desktop environment. Currently, only XFCE is maintained, so please select an XFCE type desktop.</li> [[File:zero2w-img289.png]] [[File:zero2w-img290.png]] You can then select additional packages that need to be installed. Please press the Enter key here to skip directly. [[File:zero2w-img291.png]]</ol><ol start="10" style="wikitablelist-style-type: decimal;"><li>Then the compilation of the linux image will begin. The general process of compilation is as follows</li> ::a. Initialize the compilation environment of Ubuntu PC and install the software packages required for the compilation process. ::b. Download the source code of u-boot and linux kernel (if already cached, only update the code) ::c. Compile u-boot source code and generate u-boot deb package ::d. Compile linux source code and generate linux-related deb packages ::e. Make the deb package of linux firmware ::f. Make the deb package of orangepi-config tool ::g. Create a deb package with board-level support|::h. If you compile the desktop version image, you will also create a desktop-related deb package. ::i. Check whether rootfs has been cached. If not, re-create rootfs. If it has been cached, decompress it directly and use it. ::j. Install the deb package generated previously into rootfs ::k. Make some specific settings for different development boards and different types of images, such as pre-installing additional software packages, modifying system configurations, etc. ::l. Then create the image file and format the partition. The default type is ext4. ::m. Then copy the configured rootfs to the mirror partition. | '''Motherboard functions'''::n. Then update initramfs| '''Android12 TV'''|::o. Finally, write the bin file of u-boot into the image through the dd command.</ol>| '''HDMI video'''<ol start="11" style="list-style-type: decimal;">| '''OK'''<li><p>After compiling the image, the following message will be displayed</p>|<ol style="list-style-type: lower-alpha;">| '''HDMI Audio'''<li>The storage path of the compiled image</li>{| '''OK'''class="wikitable" style="width:800px;"
|-
| [ o.k. ] Done building [ '''Type-C USB2output/images/orangepizero2w_x.x.x_debian_bullseye_linux6.1.xx_xfce_desktop/orangepizero2w_x.0 x 2.x_debian_bullseye_linux6.1.xx_xfce_desktop.img''']| '''OK'''}</ol><ol start="2" style="list-style-type: lower-alpha;"><li>Compilation time</li>{| class="wikitable" style="width:800px;"
|-
| '''TF card startup[ o.k. ] Runtime [ 19 min ]'''| '''OK'''}</ol><ol start="3" style="list-style-type: lower-alpha;"><li>Repeat the command to compile the image. Use the following command to start compiling the image directly without selecting it through the graphical interface.</li>{| class="wikitable" style="width:800px;"
|-
| [ o.k. ] Repeat Build Options [ '''WIFIsudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=image RELEASE=bullseye BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=yes''']| }</ol></li></ol><span id="instructions-for-using-the-orange-pi-os-arch-system"></span> = '''OKInstructions for using the Orange Pi OS Arch system'''= <span id="orange-pi-os-arch-system-function-adaptation-status"></span>== Orange Pi OS Arch system function adaptation status == {| class="wikitable" style="width:800px;text-align: center;"
|-
| '''BluetoothMotherboard functions'''| '''OPi OS Arch'''|-| '''HDMI video'''| '''OK'''|-| '''HDMI Audio'''| '''OK'''|-| '''Type-C USB2.0 x 2'''| '''OK'''|-| '''TF Card Startup'''| '''OK'''|-| '''WIFI'''
| '''OK'''
|-
| '''USB CameraBluetooth'''
| '''OK'''
|-
| '''OK'''
|-
| '''40pin SPI1SPI'''
| '''OK'''
|-
|-
| '''Mali GPU'''
| '''OK<span style="color:#FF0000">NO</span>'''
|-
| '''Video codec'''
| '''OK<span style="color:#FF0000">NO</span>'''
|}
{| class="wikitable" style="width:800px;text-align: center;"
|-
| '''24pin Expansion expansion board function'''| '''Android12 TVOPi OS Arch'''
|-
| '''100M network port'''
|-
| '''LRADC''' '''Custom buttons x 2'''
| '''OK, The default setting is the volume up and down keys.'''
|-
| '''TV-OUT'''
| '''OK<span style="color:#FF0000">NO</span>'''
|}
<span id="onboardorange-ledpi-lightos-displayarch-system-user-guide-instructions"></span>== Onboard LED light display instructions ==
{| class="wikitable"|-|| '''green light'''| '''red light'''|-| '''u-boot startup phase'''| '''Off'''| '''on'''|-| '''Kernel boot to enter the system'''| '''on'''| '''on'''|}= Orange Pi OS Arch System User Guide Instructions ==
<span id="how-to-return-to-First of all, please note that the-previous-interface-OPi OS Arch system does not have a default orangepi user and password, so you cannot directly log in-android"></span>== How to return to remotely through the previous interface in Android ==serial port and ssh after the system is started after burning (not even the root user). This is different from Ubuntu and Debian systems.
We generally use When the mouse and keyboard to control the Android OPi OS Arch system of is started for the development board. When entering certain interfaces and first time, you need to return to connect an HDMI display and then initialize the previous interface or desktop, we can only return by right-clicking system settings through the mouse, user wizard (including creating a new user name and setting a password). The setup steps of the keyboard cannot return.user wizard are as follows:
If <ol style="list-style-type: lower-alpha;"><li><p>After burning the system, when you have purchased start it for the infrared remote control (other remote controls do not work) first time and a 24pin expansion board that come with the development board, after connecting the 24pin expansion board to enter the development boarddesktop, you can also use will see the return key on the remote control to return to the previous menu. The location of user wizard program shown in the return key is as shown figure below. Shown:</p><div class="figure">
[[File:zero2w-img303img293.png]]
<span id="how-to-use-adb"/div></spanli>== How <li><p>First you need to use ADB =select the language you want</p><div class="figure">
<span id="use[[File:zero2w-network-connection-adb-debugging"></span>=== Use network connection adb debugging ===img294.png]]
'''Using network adb does not require a USB Typc C interface data cable to connect the computer and </div></li><li><p>After selecting the development board. Insteadlanguage, it communicates through the network, so first make sure that user wizard will immediately switch to the development board's wired or wireless network is connectedcorresponding language interface, and then obtain the IP address of the development board. Next To be used.'''as shown below in Chinese</p><div class="figure">
# Make sure the '''service[[File:zero2w-img295.adb.tcp.port''' of the Android system is set to 5555 port numberpng]]
apollo-p2:</ # '''getprop | grep &quot;adb.tcp&quot;'''div></li><li><p>Then select the area</p><div class="figure">
[service.adb.tcp[File:zero2w-img296.portpng]: [5555]
<ol start="2" style="list-style-type: decimal;"/div></li><li>If '''service.adb.tcp.port''' is not set, you can use the following command in the serial port to set <p>Then select the port number of the network adbkeyboard model</lip></oldiv class="figure">
apollo[[File:zero2w-p2:/ # '''setprop service.adb.tcpimg297.port 5555'''<br />apollo-p2:/ # '''stop adbd'''png]]
apollo-p2:</ # '''start adbd'''div></li><li><p>Then create a new username and set a password</p><div class="figure">
<ol start="3" style="list[[File:zero2w-style-type: decimal;"><li>Install adb tool on Ubuntu PC</li></ol>img298.png]]
test@test:~$ </div></li><li><p>Then make sure there is no problem with the selection, and then click the install '''sudo apt-get updatebutton'''</p><div class="figure">
test@test[[File:~$ '''sudo aptzero2w-get install -y adb'''img299.png]]
<ol start="4" style="list-style-type: decimal;"/div></li><li><p>Then connect network adb on Ubuntu PCwait for the installation to complete</lip></oldiv class="figure">
test@test[[File:~$ '''adb connect 192zero2w-img300.168.1.xxx:5555''' '''(Need to be modified to the IP address of the development board)'''png]]
* daemon not running; starting now at tcp:5037</div></li><li><p>After the installation is complete, you need to click the '''Finish''' button to restart the system.</p><div class="figure">
* daemon started successfully[[File:zero2w-img301.png]]
connected </div></li><li><p>The Orange Pi Hello program will automatically start after restarting. At this time, you need to remove the check '''mark of Start on startup''' in the lower right corner, otherwise you need to 192.168.1manually close the Orange Pi Hello program every time you start it.xxx:5555</p><div class="figure">
test@test[[File:~$ '''adb devices'''zero2w-img302.png]]
List of devices attached</div><p>At this point, you can use the newly created username and password to log in to the OPi OS system through the serial port or ssh.</p></li></ol>
192.168.1.xxx:5555 device<span id="how-to-set-dt-overlays"></span>== How to set DT overlays ==
<ol start="5" style="listThe multiplexing functions such as I2C/SPI/UART/PWM in the 40-style-type: decimal;"><li>Then you can log pin development board are turned off by default in the kernel's dts, and the corresponding DT overlays need to the android system through adb shell be manually turned on Ubuntu PC</li></ol>before they can be used.
test@testThe method to open DT overlays in OPi OS Arch system is as follows:~$ '''adb shell'''
apollo-p2:# First open the '''/boot/extlinux/ #extlinux.conf''' configuration file
<span id::{| class="usewikitable" style="width:800px;" |-data| [orangepi@orangepi-cable-to-connect-adb-debugging"><pc ~]$ '''sudo vim /boot/extlinux/span>extlinux.conf'''=== Use data cable to connect adb debugging ===|}
# Prepare a USB Type C interface data cable, plug one end of <ol start="2" style="list-style-type: decimal;"><li>Then open the USB interface into the USB interface of the computer, and plug one end of the USB Type C interface into the USB0 interface of the development board (see the description of the picture on the right below for the location of USB0)corresponding configuration by adding '''FDTOVERLAYS''' '''/dtbs/allwinner/overlay/xxx. In this case, the development board is powered by the computerdtbo''' in ''s USB interface, so please ensure that the computer's USB interface can provide the most sufficient power to drive the development board/boot/extlinux/extlinux.conf'''</li>
[[File{| class="wikitable" style="background-color:#ffffdc;width:zero2w800px;" |-img304| <big>'''Note that xxx.dtbo in FDTOVERLAYS /dtbs/allwinner/overlay/xxx.dtbo needs to be replaced with the specific dtbo configuration, please do not copy it.png]] ['''</big>|}{| class="wikitable" style="width:800px;" |-| [File:zero2worangepi@orangepi-img305pc ~]$ '''sudo vim /boot/extlinux/extlinux.png]]conf'''
<ol start="2" style="list-style-type: decimal;"><li>Install adb tool on Ubuntu PC</li></ol>LABEL Orange Pi
test@test:~$ '''sudo apt-get update'''KERNEL /Image
test@test:~$ '''sudo aptFDT /dtbs/allwinner/sun50i-get install h616-y adb'''orangepi-zero2w.dtb
'''FDTOVERLAYS /dtbs/allwinner/overlay/<span style="color:#FF0000">xxx.dtbo</span>''' #Configuration that needs to be added
|}
</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Check whether <p>The storage path of xxx.dtbo in the ADB device OPi OS Arch image is recognizedas follows. Please note that not all dtbo under this path can be used.</p>{| class="wikitable" style="width:800px;" |-| <p>'''/boot/dtbs/allwinner/overlay/'''</p>|}</li><li><p>The DT overlays configuration that can be used by the development board is as follows</p></olli>
test@test{| class="wikitable" style="width:800px;text-align:~$ center;"|-| '''Functions on the development board'''| '''Corresponding DT overlays configuration'''|-| '''40pin - i2c0'''| '''sun50i-h616-pi-i2c0.dtbo'''|-| '''40pin - i2c1'''| '''sun50i-h616-pi-i2c1.dtbo'''|-| '''adb devices40pin - i2c2'''| '''sun50i-h616-pi-i2c2.dtbo'''List of devices attached|-| '''40pin - uart2'''4c00146473c28651dd0 device| '''sun50i-h616-pi-uart2.dtbo'''|-<ol start="4" style="list| '''40pin - uart3'''| '''sun50i-h616-pi-uart3.dtbo'''|-style| '''40pin -type: decimal;">uart4'''<li>Then you can log in to the android system through adb shell on Ubuntu PC</li></ol>| '''sun50i-h616-pi-uart4.dtbo'''|-test@test:~$ | '''adb shell40pin - uart5'''| '''sun50i-h616-ph-uart5.dtbo'''apollo|-p2:/ $| '''40pin - pwm1'''<span id="view| '''sun50i-h616-pi-howpwm1.dtbo'''|-to| '''40pin -setpwm2'''| '''sun50i-hdmih616-displaypi-resolution"></span>pwm2.dtbo'''== View how to set HDMI display resolution ==|-| '''40pin - pwm3'''<ol style="list| '''sun50i-h616-pi-stylepwm3.dtbo'''|-type: decimal;"><li><p>Enter first | '''Settings40pin - pwm4'''</p><p>[[File:zero2w| '''sun50i-h616-pi-img306pwm4.png]]</p></li>dtbo'''|-<li><p>Then select | '''Device Preferences40pin - spi1 cs0'''</p><p>[[File:zero2w| '''sun50i-h616-spi1-cs0-img307spidev.png]]</p></li>dtbo'''|-<li><p>Then select | '''Display &amp; Sound40pin - spi1 cs1'''</p><p>[[File:zero2w| '''sun50i-h616-spi1-cs1-img308spidev.png]]</p></li>dtbo'''|-<li><p>Then select | '''Advanced display settings40pin - spi1 cs0 cs1'''</p><p>[[File:zero2w| '''sun50i-h616-spi1-cs0-cs1-img309spidev.png]]</p></li>dtbo'''|-<li><p>Then select | '''HDMI output 设Set USB0 to Host mode'''</p><p>[[File:| '''sun50i-h616-usb0-host.dtbo'''|-| '''Turn off the green LED light'''| '''sun50i-h616-zero2w-img310disable-led.dtbo'''|-| '''How to close the UART0 debugging serial port'''| '''sun50i-h616-disable-uart0.png]]dtbo'''|}</pol></liol start="5" style="list-style-type: decimal;"><li><p>Then If you can see need to open multiple configurations at the list of resolutions supported by the monitor. At this same time, clicking just add the corresponding option will switch to the corresponding resolutionpaths of multiple configurations directly after '''FDTOVERLAYS. Please note that different monitors may support different resolutions. If you connect it to a TV''' For example, you will generally see more resolution options than the picture below.configuration of opening i2c1 and uart5 at the same time is as follows</pli><p>[[File{| class="wikitable" style="width:zero2w800px;" |-img311.png]]</p></li><li><p>The HDMI output of the development board supports 4K display. When connected to a 4K TV, you can see the 4K resolution option.</p>| <p>[[File:zero2worangepi@orangepi-img312.pngpc ~]]<$ '''sudo vim /p><boot/li><extlinux/ol>extlinux.conf''' LABEL Orange Pi
<span id="hdmi-to-vga-display-test-1"><KERNEL /span>=== HDMI to VGA display test ===Image
<ol style="list-style-type: decimal;"><li><p>First you need to prepare the following accessories<FDT /dtbs/allwinner/p><ol style="listsun50i-styleh616-type: lowerorangepi-alpha;"><li>HDMI to VGA converter</li></ol></li></ol>zero2w.dtb
[[File'''FDTOVERLAYS <span style="color:zero2w#FF0000">/dtbs/allwinner/overlay/sun50i-h616-pi-i2c1.dtbo /dtbs/allwinner/overlay/sun50i-h616-ph-uart5.dtbo</span>'''|}</ol><ol start="6" style="list-style-img144type: decimal;"><li>After setting, you need to restart the system for the configuration to take effect.png]</li>{| class="wikitable" style="width:800px;" |-| [orangepi@orangepi-pc ~]$ '''sudo reboot'''|}</ol><span id="how-to-install-software"></span>
<ol start="2" style="list-style-type: lower-alpha;"><li>A VGA cable and a Mini HDMI male How to HDMI female adapter</li></ol>install software ==
[[File:zero2w-img145You can use the pacman package management tool to install software that is not available in OPi OS.png]] [[File:zero2w-img146For example, the command to install the vim editor is as follows. If you want to install other software, you only need to replace vim with the package name of the software you want to install.png]]
<ol start{| class="3wikitable" style="listwidth:800px;" |-style| [orangepi@orangepi-type: lowerpc ~]$ '''sudo pacman -alpha;">Syy vim'''<li>A monitor or TV that supports VGA interface</li></ol>|}
<!span id="android-12- tv-system-><ol start="2" style="list-styleusage-type: decimal;instructions"><li>HDMI to VGA display test is as follows</li></olspan>
[[File:zero2w-img313.png]]= '''Android 12 TV system usage instructions''' =
'''When using HDMI to VGA display, the development board and the <span id="supported-android-versions"></span>== Supported Android system of the development board do not need to make any settings. You only need the Mini HDMI interface of the development board to display normally. So if there is a problem with the test, please check whether there is a problem with the HDMI to VGA converter, VGA cable and monitor.'''versions ==
<span id{| class="wiwikitable" style="width:800px;text-fialign: center;"|-connection| Android Version| Kernel version|-method"></span>== WI-FI connection method ==| '''Android 12 TV Version'''| '''linux5.4'''|}
# Choose first '''Settings'''<span id="android-12-tv-function-adaptation-status"></span>== Android 12 TV function adaptation status ==
[[File:zero2w-img306.png]] <ol start{| class="2wikitable" style="listwidth:800px;text-style-typealign: decimalcenter;"><li>Then select |-| '''Motherboard functions'''| '''Android12 TV'''|-| '''HDMI video'''| '''OK'''|-| '''Network &amp; InternetHDMI Audio'''| '''OK'''</li></ol>|-[[File:zero2w| '''Type-img314C USB2.png]]0 x 2'''| '''OK'''|-| '''TF card startup'''| '''OK'''|-| '''WIFI'''| '''OK'''|-| '''Bluetooth'''| '''OK'''|-<ol start="3" style="list| '''USB Camera'''| '''OK'''|-| '''LED Light'''| '''OK'''|-| '''40pin GPIO'''| '''OK'''|-style| '''40pin I2C'''| '''OK'''|-type: decimal;"><li>Then turn on WI| '''40pin SPI1'''| '''OK'''|-FI</li></ol>| '''40pin UART'''| '''OK'''[[File:zero2w|-| '''40pin PWM'''| '''OK'''|-img315.png]]| '''Temperature Sensor'''<ol start="4" style="list| '''OK'''|-style| '''Hardware watchdog'''| '''OK'''|-type: decimal;"><li>After turning on WI| '''Mali GPU'''| '''OK'''|-FI, you can see the searched signals under | '''Video codec'Available networks''| '.</li></ol>''OK'''|}
[[File:zero2w-img316.png]] <ol start{| class="5wikitable" style="list-stylewidth:800px;text-typealign: decimalcenter;"><li>After selecting the WI|-| '''24pin Expansion board function'''| '''Android12 TV'''|-FI you want to connect to, the password input interface shown below will pop up.</li></ol>| '''100M network port'''| '''OK'''|-<div class="figure">| '''100M Ethernet port light'''| '''OK'''[[File:zero2w|-img317| '''USB2.png]]0 HOST x 2'''| '''OK'''</div>|-| '''Infrared reception'''| '''OK'''<ol start="6" style="list|-style| '''Headphone audio playback'''| '''OK'''|-type: decimal;"><li>Then use the keyboard to enter the password corresponding to the WI| '''On/off button'''| '''OK'''|-FI| '''LRADC''' '''Custom buttons x 2'''| '''OK, The default setting is the volume up and then use the mouse to click the Enter button on the virtual keyboard to start connecting to the WIdown keys.'''|-| '''TV-FI.</li></ol>OUT'''| '''OK'''|}
<div classspan id="figureonboard-led-light-display-instructions"></span>== Onboard LED light display instructions ==
[[File{| class="wikitable" style="width:zero2w800px;text-img318.png]]align: center;"|-|| '''green light'''| '''red light'''|-| '''u-boot startup phase'''| '''Off'''| '''on'''|-| '''Kernel boot to enter the system'''| '''on'''| '''on'''|}
</div><ol startspan id="7" style="listhow-to-return-to-the-previous-interface-stylein-type: decimal;android"><li>The display after successful WI-FI connection is as shown below</li></olspan>== How to return to the previous interface in Android ==
[[File:zero2wWe generally use the mouse and keyboard to control the Android system of the development board. When entering certain interfaces and need to return to the previous interface or desktop, we can only return by right-img319clicking the mouse, and the keyboard cannot return.png]]
<span id="how-If you have purchased the infrared remote control (other remote controls do not work) and a 24pin expansion board that come with the development board, after connecting the 24pin expansion board to-the development board, you can also use-wi-fi-hotspot"></span>== How the return key on the remote control to use WI-FI hotspot ==return to the previous menu. The location of the return key is as shown below. Shown:
# First, please make sure that the Ethernet port is connected to the network cable and can access the Internet normally[[File:zero2w-img303.# Then select '''Settings'''png]]
[[File:zero2w<span id="how-img306.png]]to-use-adb"></span>== How to use ADB ==
<ol startspan id="3" style="listuse-network-connection-styleadb-type: decimal;debugging"><li>Then select '''Network &amp; Internet'''</li></olspan>=== Use network connection adb debugging ===
[[File{| class="wikitable" style="background-color:#ffffdc;width:zero2w800px;" |-img314| <big>'''Using network adb does not require a USB Typc C interface data cable to connect the computer and the development board. Instead, it communicates through the network, so first make sure that the development board's wired or wireless network is connected, and then obtain the IP address of the development board. Next To be used.png]]'''</big>|}
<ol start="4" style="list-style-type: decimal;"><li>Then select # Make sure the '''WIFI hotspotservice.adb.tcp.port'''</li></ol>of the Android system is set to 5555 port number
[[File:zero2w:{| class="wikitable" style="width:800px;" |-| apollo-img320p2:/ # '''getprop | grep &quot;adb.png]]tcp&quot;'''
<ol start="5" style="list-style-type: decimal;"><li>Then open '''Hotspot Enable'''[service. You can also see the name and password of the generated hotspot in the picture belowadb. Remember them and use them when connecting to the hotspot (if you need to modify the name and password of the hotspot, you need to close Hotspot Enable firsttcp. Then you can modify it)</li></ol>port]: [5555]|}
[[File<ol start="2" style="list-style-type: decimal;"><li>If '''service.adb.tcp.port''' is not set, you can use the following command in the serial port to set the port number of the network adb</li>{| class="wikitable" style="width:zero2w800px;" |-img321| apollo-p2:/ # '''setprop service.adb.tcp.png]]port 5555'''
<ol start="6" style="listapollo-style-typep2: decimal;"><li>At this time, you can take out your mobile phone. If everything is normal, you can find the WIFI hotspot with the same name (/ # '''here AndroidAP_7132stop adbd''') shown under the '''Hotspot name''' in the picture above in the WI-FI list searched by the mobile phone. Then you can click AndroidAP_7132 to connect to the hotspot. The password can be seen under the '''Hotspot password''' in the picture above.</li></ol>
[[Fileapollo-p2:/ # '''start adbd'''|}</ol><ol start="3" style="list-style-type: decimal;"><li>Install adb tool on Ubuntu PC</li>{| class="wikitable" style="width:800px;" |-| test@test:zero2w~$ '''sudo apt-img322.png]]get update'''
test@test:~$ '''sudo apt-get install -y adb'''|}</ol><ol start="74" style="list-style-type: decimal;"><li>After the connection is successful, it will be displayed as shown below (the interface will be different Then connect network adb on different mobile phones, the specific interface is subject to the one displayed on your mobile phone)Ubuntu PC</li>{| class="wikitable" style="width:800px;" |-| test@test:~$ '''adb connect 192.168. At this time, you can open a web page on your mobile phone to see if you can access the Internet1. If the web page can be opened normally, it means that the xxx:5555'''WI-FI Hotspot''' (Need to be modified to the IP address of the development board can be used normally.</li></ol>)'''
[[File<p>* daemon not running; starting now at tcp:zero2w-img323.png]]5037</p>
<span id="how-to-check-the-ip-address-of-the-ethernet-port"p>* daemon started successfully</spanp>== How to check the IP address of the Ethernet port ==
# There is no wired network interface on the main board of the development boardconnected to 192. We can expand the 100M Ethernet through a 24pin expansion board168.1.xxx:5555
[[File:zero2w-img107.png]]
<ol start="2" style="list-style-typetest@test: decimal;"><li><p>Then make sure the network port of the expansion board is connected to the router or switch</p></li><li><p>Then open ~$ '''Settingsadb devices'''</p><p>[[File:zero2w-img324.png]]</p></li><li><p>Then select '''Network &amp; Internet'''</p><p>[[File:zero2w-img325.png]]</p></li><li><p>Then you can see the IP address of the development board's wired network port at the location shown in the picture below.</p><p>[[File:zero2w-img326.png]]</p></li></ol>
<span id="bluetooth-connection-method"></span>== Bluetooth connection method ==List of devices attached
# Choose first 192.168.1.xxx:5555 device|}</ol><ol start="5" style="list-style-type: decimal;"><li>Then you can log in to the android system through adb shell on Ubuntu PC</li>{| class="wikitable" style="width:800px;" |-| test@test:~$ '''Settingsadb shell'''
apollo-p2:/ #|}</ol><span id="use-data-cable-to-connect-adb-debugging"></span> === Use data cable to connect adb debugging === # Prepare a USB Type C interface data cable, plug one end of the USB interface into the USB interface of the computer, and plug one end of the USB Type C interface into the USB0 interface of the development board (see the description of the picture on the right below for the location of USB0). In this case, the development board is powered by the computer's USB interface, so please ensure that the computer's USB interface can provide the most sufficient power to drive the development board. ::[[File:zero2w-img304.png]] [[File:zero2w-img306img305.png]]
<ol start="2" style="list-style-type: decimal;">
<li>Then select '''Bluetooth'''Install adb tool on Ubuntu PC</li></ol>{| class="wikitable" style="width:800px;" |-| [[Filetest@test:zero2w~$ '''sudo apt-img327.png]]get update'''
test@test:~$ '''sudo apt-get install -y adb'''
|}
</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then Open Check whether the ADB device is recognized</li>{| class="wikitable" style="width:800px;" |-| test@test:~$ '''Bluetooth Enableadb devices'''</li></ol>
[[File:zero2w-img328.png]]List of devices attached
4c00146473c28651dd0 device
|}
</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then click you can log in to the android system through adb shell on Ubuntu PC</li>{| class="wikitable" style="width:800px;" |-| test@test:~$ '''Pair new deviceadb shell'''to start scanning for surrounding Bluetooth devices</li></ol>
[[Fileapollo-p2:zero2w/ $|}</ol><span id="view-how-to-set-hdmi-display-img329.png]]resolution"></span>
<ol start="5" style="list-style-type: decimal;"><li>The searched Bluetooth devices will be displayed under '''Available devices'''</li></ol>View how to set HDMI display resolution ==
<ol style="list-style-type: decimal;"><li><p>Enter first '''Settings'''</p><p>[[File:zero2w-img306.png]]</p></li><li><p>Then select '''Device Preferences'''</p><p>[[File:zero2w-img307.png]]</p></li><li><p>Then select '''Display &amp; Sound'''</p><p>[[File:zero2w-img308.png]]</p></li><li><p>Then select '''Advanced display settings'''</p><p>[[File:zero2w-img309.png]]</p></li><li><p>Then select '''HDMI output mode'''</p><p>[[File:zero2w-img310.png]]</p></li><li><p>Then you can see the list of resolutions supported by the monitor. At this time, clicking the corresponding option will switch to the corresponding resolution. Please note that different monitors may support different resolutions. If you connect it to a TV, you will generally see more resolution options than the picture below.</p><p>[[File:zero2w-img311.png]]</p></li><li><p>The HDMI output of the development board supports 4K display. When connected to a 4K TV, you can see the 4K resolution option.</p><p>[[File:zero2w-img330img312.png]]</p></li></ol>
<ol startspan id="6" style="listhdmi-to-vga-display-styletest-type: decimal;1"><li/span>Then click on the Bluetooth device you want === HDMI to connect to start pairing. When the following interface pops up, please use the mouse to select the '''Pair'''option</li></ol>VGA display test ===
[[File<ol style="list-style-type: decimal;"><li><p>First you need to prepare the following accessories</p><ol style="list-style-type:zero2wlower-img331.png]]alpha;"><li>HDMI to VGA converter</li>
[[File:zero2w-img144.png]]</ol><ol start="72" style="list-style-type: decimallower-alpha;"><li>What is tested here is the Bluetooth configuration process between the development board A VGA cable and the Android phone. At this time, the following confirmation interface will pop up on the phone. Click the pairing button on the phone a Mini HDMI male to start the pairing process.HDMI female adapter</li></ol>
[[File:zero2w-img332img145.png]][[File:zero2w-img146.png]]</ol><ol start="3" style="list-style-type: lower-alpha;"><li>A monitor or TV that supports VGA interface</li></ol></li></ol>
<ol start="82" style="list-style-type: decimal;"><li>After pairing HDMI to VGA display test is completed, open '''Paired devices''' and you will see the paired Bluetooth devices.as follows</li></ol>
[[File:zero2w-img333img313.png]]
<ol start{| class="9wikitable" style="listbackground-style-typecolor:#ffffdc;width: decimal800px;">|-| <libig>At this time'''When using HDMI to VGA display, you can use the Bluetooth development board and the Android system of your mobile phone to send a picture to the development boarddo not need to make any settings. After sending, you can see You only need the following confirmation Mini HDMI interface in the Android system of the development boardto display normally. So if there is a problem with the test, please check whether there is a problem with the HDMI to VGA converter, VGA cable and then click monitor.'''Accept''' to start receiving the pictures sent by the mobile phone.</libig>|}</ol><span id="wi-fi-connection-method"></span>
[[File:zero2w== WI-img334.png]]FI connection method ==
<ol start="10" style="list-style-type: decimal;"><li>Pictures received by the Bluetooth system of the development board Android system can be viewed in # Choose first '''Received filesSettings'''.</li></ol>
::[[File:zero2w-img335img306.png]]
<span idol start="how-to-set-usb0-to-host2" style="list-modestyle-1type: decimal;"><li>Then select '''Network &amp; Internet'''</spanli>== How to set USB0 to HOST mode ==
As shown in the figure below, there are two Type[[File:zero2w-img314.png]]</ol><ol start="3" style="list-style-C interfaces type: decimal;"><li>Then turn on the motherboard of the development board: USB0 and USB1. Both of these interfaces can be used to power the development board, and they can also be used as USB2.0 HOST interfaces. The difference between USB0 and USB1 is that in addition to being set to HOST mode, USB0 can also be set to Device mode, while USB1 only has HOST mode.WI-FI</li>
[[File:zero2w-img160img315.png]]</ol><ol start="4" style="list-style-type: decimal;"><li>After turning on WI-FI, you can see the searched signals under '''Available networks'''.</li>
USB0 of [[File:zero2w-img316.png]]</ol><ol start="5" style="list-style-type: decimal;"><li>After selecting the Android12 TV system released by Orange Pi is set WI-FI you want to Device mode by default, so when there is no need connect to use USB0 Device mode (ADB function needs to ensure that USB0 is in Device mode), it is recommended to use USB0 for power supply, so that USB1 can be directly used to connect USB devices the password input interface shown below will pop up.</li>
If you want to use USB0 to connect USB devices, you need to set USB0 to HOST mode. The method is as follows:<div class="figure">
<ol style="list-style-type[[File: lowerzero2w-alpha;"><li>Run the following command to set USB0 to HOST mode:</li></ol>img317.png]]
apollo-p2:</ # '''cat div></sys/devices/platform/soc@3000000/soc@3000000\ol><ol start="6" style="list-style-type:usbc0@0decimal;"><li>Then use the keyboard to enter the password corresponding to the WI-FI, and then use the mouse to click the Enter button on the virtual keyboard to start connecting to the WI-FI.</usb_host'''li>
host_chose finished!<div class="figure">
apollo[[File:zero2w-p2:/ #img318.png]]
</div></ol><ol start="27" style="list-style-type: lower-alphadecimal;"><li>Run the following command to switch back to Device modeThe display after successful WI-FI connection is as shown below</li></ol>
apollo[[File:zero2w-p2:img319.png]]</ # '''cat /sys/devices/platform/soc@3000000/soc@3000000\:usbc0@0ol><span id="how-to-use-wi-fi-hotspot"></usb_device'''span>
device_chose finished!== How to use WI-FI hotspot ==
apollo-p2:/ #First, please make sure that the Ethernet port is connected to the network cable and can access the Internet normally.# Then select '''Settings'''
<ol start="3" style="list-style-type: lower:[[File:zero2w-alpha;"><li>The command to view the current mode of USB0 is</li></ol>img306.png]]
apollo<ol start="3" style="list-p2style-type:/ # decimal;"><li>Then select '''cat /sys/devices/platform/soc@3000000/soc@3000000\:usbc0@0/otg_roleNetwork &amp; Internet'''</li>
usb_host[[File:zero2w-img314.png]]</ol><ol start="4" style="list-style-type: decimal;"><li>Then select '''WIFI hotspot'''</li>
[[File:zero2w-img320.png]]<span id/ol><ol start="5" style="howlist-tostyle-use-usb-cameratype: decimal;"><li>Then open '''Hotspot Enable'''. You can also see the name and password of the generated hotspot in the picture below. Remember them and use them when connecting to the hotspot (if you need to modify the name and password of the hotspot, you need to close Hotspot Enable first. Then you can modify it)</spanli>== How to use USB camera ==
# First insert [[File:zero2w-img321.png]]</ol><ol start="6" style="list-style-type: decimal;"><li>At this time, you can take out your mobile phone. If everything is normal, you can find the USB WIFI hotspot with the same name (UVC protocol'''here AndroidAP_7132''') camera into shown under the '''Hotspot name''' in the USB interface of picture above in the development board# If WI-FI list searched by the USB camera is recognized normally, mobile phone. Then you can click AndroidAP_7132 to connect to the corresponding video device node will hotspot. The password can be generated seen under the '''Hotspot password''' in the picture above.</devli>
console[[File:zero2w-img322.png]]</ # ol><ol start="7" style="list-style-type: decimal;"><li>After the connection is successful, it will be displayed as shown below (the interface will be different on different mobile phones, the specific interface is subject to the one displayed on your mobile phone). At this time, you can open a web page on your mobile phone to see if you can access the Internet. If the web page can be opened normally, it means that the '''ls /dev/video0WI-FI Hotspot'''of the development board can be used normally.</li>
[[File:zero2w-img323.png]]</devol><span id="how-to-check-the-ip-address-of-the-ethernet-port"></video0span>
<ol start="3" style="list-style-type: decimal;"><li><p>Then make sure that the adb connection between the Ubuntu PC and the development board is normal. For how to use adb, please refer to the instructions in the section &quot;'''How to use ADB'''&quot;.</p></li><li><p>Download check the USB camera test APP from IP address of the '''official tool''' on the development board information download page</p></li></ol>Ethernet port ==
<div class="figure"># There is no wired network interface on the main board of the development board. We can expand the 100M Ethernet through a 24pin expansion board.
::[[File:zero2w-img336img107.png]]
<ol start="2" style="list-style-type: decimal;"><li><p>Then make sure the network port of the expansion board is connected to the router or switch</p></li><li><p>Then open '''Settings'''</p><p>[[File:zero2w-img324.png]]</p></li><li><p>Then select '''Network &amp; Internet'''</p><p>[[File:zero2w-img325.png]]</divp></li><div class="figure"li><p>Then you can see the IP address of the development board's wired network port at the location shown in the picture below.</p><p>[[File:zero2w-img326.png]]</p></li></ol>
[[File:zero2w<span id="bluetooth-img337.png]]connection-method"></span>
</div><ol start="5" style="list-style-type: decimal;"><li>Then use the adb command to install the USB camera test APP into the Android system. Of course, you can also use a USB disk copy to install it.</li></ol>Bluetooth connection method ==
test@test:~$ # Choose first '''adb install usbcamera.apkSettings'''
<ol start="6" style="list::[[File:zero2w-style-type: decimal;"><li>After installation, you can see the startup icon of the USB camera on the Android desktopimg306.</li></ol>png]]
[[File<ol start="2" style="list-style-type:zero2w-img338.png]]decimal;"><li>Then select '''Bluetooth'''</li>
[[File:zero2w-img327.png]]</ol><ol start="73" style="list-style-type: decimal;"><li>Then double-click to open the USB camera APP and you can see the output video of the USB camera.Open '''Bluetooth Enable'''</li></ol>
[[File:zero2w-img328.png]]<span id/ol><ol start="4" style="android-systemlist-rootstyle-descriptiontype: decimal;"><li>Then click '''Pair new device'''to start scanning for surrounding Bluetooth devices</spanli>== Android system ROOT description ==
[[File:zero2w-img329.png]]</ol><ol start="5" style="list-style-type: decimal;"><li>The searched Bluetooth devices will be displayed under '''The Android system released by Orange Pi has been ROOT and can be tested using the following method.Available devices'''</li>
# Download from [[File:zero2w-img330.png]]</ol><ol start="6" style="list-style-type: decimal;"><li>Then click on the Bluetooth device you want to connect to start pairing. When the '''official tool''' on following interface pops up, please use the mouse to select the development board data download page '''rootcheck.apkPair'''option</li>
[[File:zero2w-img331.png]]<div class/ol><ol start="7" style="figurelist-style-type: decimal;"><li>What is tested here is the Bluetooth configuration process between the development board and the Android phone. At this time, the following confirmation interface will pop up on the phone. Click the pairing button on the phone to start the pairing process.</li>
[[File:zero2w-img336img332.png]]</ol><ol start="8" style="list-style-type: decimal;"><li>After pairing is completed, open '''Paired devices''' and you will see the paired Bluetooth devices.</li>
[[File:zero2w-img333.png]]</divol><div classol start="figure9"style="list-style-type: decimal;"><li>At this time, you can use the Bluetooth of your mobile phone to send a picture to the development board. After sending, you can see the following confirmation interface in the Android system of the development board, and then click '''Accept''' to start receiving the pictures sent by the mobile phone.</li>
[[File:zero2w-img339img334.png]]</ol><ol start="10" style="list-style-type: decimal;"><li>Pictures received by the Bluetooth system of the development board Android system can be viewed in '''Received files'''.</li>
[[File:zero2w-img335.png]]</divol><ol startspan id="2" style="listhow-to-set-usb0-to-host-stylemode-type: decimal;1"><li><p>Then make sure that the adb connection between the Ubuntu PC and the development board is normal. For how to use adb, please refer to the instructions in the section &quot;'''How to use ADB'''&quot;.</p></li><li><p>Then use the adb command to install rootcheck.apk into the Android system. Of course, you can also use a USB disk copy to install it.</p></li></olspan>
test@test:~$ '''adb install rootcheck.apk'''== How to set USB0 to HOST mode ==
<ol start="4" style="listAs shown in the figure below, there are two Type-style-type: decimal;"><li>After installation, you can see C interfaces on the startup icon motherboard of the ROOT test tool on development board: USB0 and USB1. Both of these interfaces can be used to power the Android desktopdevelopment board, and they can also be used as USB2.0 HOST interfaces. The difference between USB0 and USB1 is that in addition to being set to HOST mode, USB0 can also be set to Device mode, while USB1 only has HOST mode.</li></ol>
[[File:zero2w-img340img160.png]]
<ol start="5" style="list-style-type: decimal;"><li>The display interface after opening USB0 of the '''ROOT test tool''' Android12 TV system released by Orange Pi is set to Device mode by default, so when there is no need to use USB0 Device mode (ADB function needs to ensure that USB0 is in Device mode), it is recommended to use USB0 for the first time is as shown below</li></ol>power supply, so that USB1 can be directly used to connect USB devices .
[[FileIf you want to use USB0 to connect USB devices, you need to set USB0 to HOST mode. The method is as follows:zero2w-img341.png]]
<ol start="6" style="list-style-type: decimallower-alpha;"><li>Then you can click Run the following command to set USB0 to HOST mode:</li>{| class="wikitable" style="width:800px;" |-| apollo-p2:/ # '''CHECK NOWcat /sys/devices/platform/soc@3000000/soc@3000000\:usbc0@0/usb_host''' to start checking the ROOT status of the Android system. After the check is completed, the display is as follows. You can see that the Android system has obtained ROOT permissions.</li></ol>
[[File:zero2w-img342.png]]host_chose finished!
apollo-p2:/ #|}</ol><span idol start="2" style="howlist-tostyle-use-miracastreceivertype: lower-alpha;"><li>Run the following command to-cast-the-mobile-phone-screen-switch back to-the-development-board">Device mode</spanli>{| class="wikitable" style= How to use MiracastReceiver to cast the mobile phone screen to the development board =="width:800px;" |-| apollo-p2:/ # '''cat /sys/devices/platform/soc@3000000/soc@3000000\:usbc0@0/usb_device'''
<ol style="list-style-type: decimal;"><li><p>First, please make sure that both the development board and the mobile phone are connected to the same WIFI hotspot. For the method of connecting the development board to WIFI, please refer to '''the instructions in the WI-FI connection method.'''</p></li><li><p>Then open the '''MiracastReceiver'''application in the Android system of the development board</p><p>[[File:zero2w-img343.png]]</p></li><li><p>The interface after '''MiracastReceiver''' is opened is as follows</p><div class="figure">device_chose finished!
[[Fileapollo-p2:zero2w/ #|}</ol><ol start="3" style="list-img344.png]]style-type: lower-alpha;"><li>The command to view the current mode of USB0 is</li>{| class="wikitable" style="width:800px;" |-| apollo-p2:/ # '''cat /sys/devices/platform/soc@3000000/soc@3000000\:usbc0@0/otg_role'''
</div></li>usb_host|}<li><p>Then find the screen mirroring function in the phone settings. Here we take '''Xiaomi 12S Pro mobile phone''' as an example. Please research other brands of mobile phones by yourself. As shown in the picture below, click the button in the red box to open the screen mirroring function of the phone.</pol><p>[[File:zero2wspan id="how-img345.png]]</p></li><li><p>After waiting for a period of time, you will be able to see the searched connectable devices on your mobile phone, and then we can select the device corresponding to the development board to connect.</p><p>[[File:zero2w-img346.png]]</p></li><li><p>Then the selection box shown in the figure below will pop up in the '''MiracastReceiver''' application interface of the development board. Here we can select '''Accept'''</p><p>[[File:zero2wuse-img347.png]]</p></li><li><p>Then you can see the content of the mobile phone screen on the HDMI screen connected to the development board</p><p>[[File:zero2wusb-img348.png]]</pcamera"></li></olspan>
<span id="method-of-turning-on-and-off-the-machine-through-buttons-or-infrared-remote-control"></span>== Method of turning on and off the machine through buttons or infrared remote control How to use USB camera ==
We can turn off or turn on # First insert the Android system USB (UVC protocol) camera into the USB interface of the development board through # If the power on/off button or infrared remote control. HoweverUSB camera is recognized normally, it should the corresponding video device node will be noted that there is no power ongenerated under /off button and infrared receiver on the main board of the development board, and it needs to be expanded through a 24pin expansion board.dev
[[File:zero2w:{| class="wikitable" style="width:800px;" |-img107.png]]| console:/ # '''ls /dev/video0'''
The location of the power button on the 24pin expansion board is as shown in the figure below:/dev/video0|}
<ol start="3" style="list-style-type: decimal;"><li><p>Then make sure that the adb connection between the Ubuntu PC and the development board is normal. For how to use adb, please refer to the instructions in the section &quot;[[File:zero2w-img269.pngOrange Pi Zero 2W#How to use ADB|'''How to use ADB''']]&quot;.</p></li><li><p>Download the USB camera test APP from the '''official tool''' on the development board information download page</p></li>
The location of the infrared remote control power button is as follows:<div class="figure">
[[File:zero2w-img349img336.png]]
When shutting down, we need to press and hold the power button or the power button on the infrared remote control, and then the Android system will pop up the confirmation dialog box shown in the </div><div class="figure below, and then select '''OK''' to shut down the Android system.">
[[File:zero2w-img350img337.png]]
</div></ol><ol start="5" style="list-style-type: decimal;"><li>Then use the adb command to install the USB camera test APP into the Android system. Of course, you can also use a USB disk copy to install it.</li>{| class="wikitable" style="width:800px;" |-| test@test:~$ '''adb install usbcamera.apk'''|}</ol><ol start="6" style="list-style-type: decimal;"><li>After shutting downinstallation, press and hold you can see the power button or startup icon of the power button USB camera on the infrared remote control again to turn it onAndroid desktop.</li>
[[File:zero2w-img338.png]]</ol><span idol start="7" style="pinlist-interfacestyle-gpiotype: decimal;"><li>Then double-uart-spi-test"click to open the USB camera APP and you can see the output video of the USB camera.</li></spanol>== 40pin interface GPIO, UART, SPI test ==
'''Note: The pin header on the 40pin interface is not soldered by default, and you need to solder it yourself before it can be used.'''<span id="android-system-root-description"></span>
<span id="pin-gpio-port-test-method"></span>=== 40pin GPIO port test method =Android system ROOT description ==
{| class="wikitable" style="background-color:# First open wiringOP APP on ffffdc;width:800px;" |-| <big>'''The Android system released by Orange Pi has been ROOT and can be tested using the desktopfollowing method.'''</big>|}
[[File:zero2w-img351# Download from the '''official tool''' on the development board data download page '''rootcheck.png]]apk'''
<ol startdiv class="2figure" style="list-style-type: decimal;"><li>Then click the '''GPIO_TEST''' button to open the GPIO test interface</li></ol>
::[[File:zero2w-img352img336.png]]
<ol start="3" style="list-style-type: decimal;"/div><li>The GPIO test interface is as shown in the div class="figure below. The two rows of '''CheckBox''' buttons on the left have a one-to-one correspondence with the 40pin pins. When the '''CheckBox''' button is checked, the corresponding GPIO pin will be set to '''OUT''' mode and the pin level is set to high level; when unchecked, the GPIO pin level will be set to low level; when the GPIO is clicked When you click the '''GPIO READALL''' button, you can get information such as wPi number, GPIO mode, pin level, etc.; when you click the'''BLINK ALL GPIO''' button, all GPIO ports will cycle through outputting high and low levels. This function can be used to test all the 40pin pins. GPIO port.</li></ol">
::[[File:zero2w-img353img339.png]]
</div>
<ol start="2" style="list-style-type: decimal;">
<li><p>Then make sure that the adb connection between the Ubuntu PC and the development board is normal. For how to use adb, please refer to the instructions in the section &quot;[[Orange Pi Zero 2W#How to use ADB|'''How to use ADB''']]&quot;.</p></li>
<li><p>Then use the adb command to install rootcheck.apk into the Android system. Of course, you can also use a USB disk copy to install it.</p></li>
{| class="wikitable" style="width:800px;"
|-
|
test@test:~$ '''adb install rootcheck.apk'''
|}
</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then click After installation, you can see the startup icon of the ROOT test tool on the Android desktop.</li> [[File:zero2w-img340.png]]</ol><ol start="5" style="list-style-type: decimal;"><li>The display interface after opening the '''GPIO READALLROOT test tool''' button, and for the output information first time is as shown below</li> [[File:zero2w-img341.png]]</ol><ol start="6" style="list-style-type: decimal;"><li>Then you can click '''CHECK NOW''' to start checking the ROOT status of the Android system. After the check is completed, the display is as follows. You can see that the Android system has obtained ROOT permissions.</li> [[File:zero2w-img342.png]]</ol><span id="how-to-use-miracastreceiver-to-cast-the-mobile-phone-screen-to-the-development-board"></span> == How to use MiracastReceiver to cast the mobile phone screen to the development board ==
<ol style="list-style-type: decimal;">
<li><p>First, please make sure that both the development board and the mobile phone are connected to the same WIFI hotspot. For the method of connecting the development board to WIFI, please refer to [[Orange Pi Zero 2W#WI-FI connection method|'''the instructions in the WI-FI connection method.''']]</p></li>
<li><p>Then open the '''MiracastReceiver'''application in the Android system of the development board</p>
<p>[[File:zero2w-img343.png]]</p></li>
<li><p>The interface after '''MiracastReceiver''' is opened is as follows</p>
<div class="figure">
[[File:zero2w-img354img344.png]]
</div><ol start="5" style="list-style-type: decimal;"/li><li>There are a total of 28 GPIO ports available <p>Then find the screen mirroring function in the 40-pin development boardphone settings. The following takes pin 12 - corresponding to GPIO PI01 - corresponding to wPi serial number 6 - Here we take '''Xiaomi 12S Pro mobile phone''' as an example to demonstrate how to set the high and low levels . Please research other brands of mobile phones by yourself. As shown in the GPIO port. First picture below, click the '''CheckBox''' button corresponding in the red box to pin 12open the screen mirroring function of the phone.</p><p>[[File:zero2w-img345. When the button is selectedpng]]</p></li><li><p>After waiting for a period of time, pin 12 you will be set able to high level. After settingsee the searched connectable devices on your mobile phone, you and then we can use a multimeter select the device corresponding to measure the value of development board to connect.</p><p>[[File:zero2w-img346.png]]</p></li><li><p>Then the selection box shown in the figure below will pop up in the voltage '''MiracastReceiver''' application interface of the pindevelopment board. If it is Here we can select '''3.3vAccept''', it means </p><p>[[File:zero2w-img347.png]]</p></li><li><p>Then you can see the content of the mobile phone screen on the HDMI screen connected to the setting High level successdevelopment board</p><p>[[File:zero2w-img348.png]]</p></li></ol>
[[File:zero2w<span id="method-img355.png]]of-turning-on-and-off-the-machine-through-buttons-or-infrared-remote-control"></span>
<ol start="6" style="list-style-type: decimal;"><li>Then click the '''GPIO READALL''' button Method of turning on and you can see that off the current pin 12 mode is '''OUT''' and the pin level is high level.</li></ol>machine through buttons or infrared remote control ==
[[File:zero2w-img356We can turn off or turn on the Android system of the development board through the power on/off button or infrared remote control. However, it should be noted that there is no power on/off button and infrared receiver on the main board of the development board, and it needs to be expanded through a 24pin expansion board.png]]
<ol start="7" style="list[[File:zero2w-style-type: decimal;"><li>Click the '''CheckBox''' button in the picture below again to uncheck it, and pin 12 will be set to low level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is '''0v''', it means the low level setting is successfulimg107.</li></ol>png]]
[[FileThe location of the power button on the 24pin expansion board is as shown in the figure below:zero2w-img357.png]]
<ol start="8" style="list[[File:zero2w-style-type: decimal;"><li>Then click the '''GPIO READALL''' button and you can see that the current pin 12 mode is OUT and the pin level is low levelimg269.</li></ol>png]]
[[FileThe location of the infrared remote control power button is as follows:zero2w-img358.png]]
<span id="pin[[File:zero2w-uart-test-method"></span>=== 40pin UART test method ===img349.png]]
# As can be seen from When shutting down, we need to press and hold the power button or the table belowpower button on the infrared remote control, and then the default uarts available Android system will pop up the confirmation dialog box shown in the Android12 TV figure below, and then select '''OK''' to shut down the Android system are uart2 and uart5. Please note that uart0 is set as a debugging serial port by default. Please do not use uart0 as a normal serial port.
[[File:zero2w-img350.png]] After shutting down, press and hold the power button or the power button on the infrared remote control again to turn it on. <span id="pin-interface-gpio-uart-spi-test"></span>== 40pin interface GPIO, UART, SPI test == {| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Note: The pin header on the 40pin interface is not soldered by default, and you need to solder it yourself before it can be used.'''</big>|} <span id="pin-gpio-port-test-method"></span>=== 40pin GPIO port test method === # First open wiringOP APP on the desktop ::[[File:zero2w-img351.png]] <ol start="2" style="list-style-type: decimal;"><li>Then click the '''GPIO_TEST''' button to open the GPIO test interface</li> [[File:zero2w-img352.png]]</ol><ol start="3" style="list-style-type: decimal;"><li>The GPIO test interface is as shown in the figure below. The two rows of '''CheckBox''' buttons on the left have a one-to-one correspondence with the 40pin pins. When the '''CheckBox''' button is checked, the corresponding GPIO pin will be set to '''OUT''' mode and the pin level is set to high level; when unchecked, the GPIO pin level will be set to low level; when the GPIO is clicked When you click the '''GPIO READALL''' button, you can get information such as wPi number, GPIO mode, pin level, etc.; when you click the'''BLINK ALL GPIO''' button, all GPIO ports will cycle through outputting high and low levels. This function can be used to test all the 40pin pins. GPIO port.</li> [[File:zero2w-img353.png]]</ol><ol start="4" style="list-style-type: decimal;"><li>Then click the '''GPIO READALL''' button, and the output information is as shown below:</li> <div class="figure"> [[File:zero2w-img354.png]] </div></ol><ol start="5" style="list-style-type: decimal;"><li>There are a total of 28 GPIO ports available in the 40-pin development board. The following takes pin 12 - corresponding to GPIO PI01 - corresponding to wPi serial number 6 - as an example to demonstrate how to set the high and low levels of the GPIO port. First click the '''CheckBox''' button corresponding to pin 12. When the button is selected, pin 12 will be set to high level. After setting, you can use a multimeter to measure the value of the voltage of the pin. If it is '''3.3v''', it means the setting High level success.</li> [[File:zero2w-img355.png]]</ol><ol start="6" style="list-style-type: decimal;"><li>Then click the '''GPIO READALL''' button and you can see that the current pin 12 mode is '''OUT''' and the pin level is high level.</li> [[File:zero2w-img356.png]]</ol><ol start="7" style="list-style-type: decimal;"><li>Click the '''CheckBox''' button in the picture below again to uncheck it, and pin 12 will be set to low level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is '''0v''', it means the low level setting is successful.</li> [[File:zero2w-img357.png]]</ol><ol start="8" style="list-style-type: decimal;"><li>Then click the '''GPIO READALL''' button and you can see that the current pin 12 mode is OUT and the pin level is low level.</li> [[File:zero2w-img358.png]]</ol><span id="pin-uart-test-method"></span> === 40pin UART test method === # As can be seen from the table below, the default uarts available in the Android12 TV system are uart2 and uart5. Please note that uart0 is set as a debugging serial port by default. Please do not use uart0 as a normal serial port. <div style="display: flex;">::{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"|-| '''GPIO序号GPIO NO.'''
| '''GPIO'''
| '''功能Function'''| '''引脚'''|| '''引脚'''| '''功能'''| '''GPIO'''| '''GPIO序号Pin'''
|-
| style="text-align: left;"|
| '''3.3V'''
| '''1'''
|| '''2'''| '''5V'''| style="text-align: left;"|| style="text-align: left;"||-
| '''264'''
| '''PI8'''
| '''TWI1-SDA'''
| '''3'''
|
| '''4'''
| '''5V'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''263'''
| '''TWI1-SCL'''
| '''5'''
|
| '''6'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''269'''
| '''PWM3'''
| '''7'''
|
| '''8'''
| '''UART0_TX'''
| '''PH0'''
| '''224'''
|-
| style="text-align: left;"|
| '''GND'''
| '''9'''
|
| '''10'''
| '''UART0_RX'''
| '''PH1'''
| '''225'''
|-
| '''<span style="color:#FF0000">226</span>'''| '''<span style="color:#FF0000">PH2</span>'''| '''<span style="color:#FF0000">UART5_TX</span>'''| '''11'''|| '''12'''| <span style="text-aligncolor: left;#FF0000"|| '''PI1'''| '''257>11</span>'''
|-
| '''<span style="color:#FF0000">227</span>'''| '''<span style="color:#FF0000">PH3</span>'''| '''<span style="color:#FF0000">UART5_RX</span>'''| '''13'''|| '''14'''| '''GND'''| <span style="text-aligncolor: left;#FF0000"|| style="text-align: left;"|>13</span>'''
|-
| '''<span style="color:#FF0000">261</span>'''| '''<span style="color:#FF0000">PI5</span>'''| '''<span style="color:#FF0000">UART2_TX</span>'''| '''<span style="color:#FF0000">15'''|| '''16'''| '''PWM4'''| '''PI14'''| '''270</span>'''
|-
| style="text-align: left;"|
| '''3.3V'''
| '''17'''
|
| '''18'''
| style="text-align: left;"|
| '''PH4'''
| '''228'''
|-
| '''231'''
| '''SPI1_MOSI'''
| '''19'''
|| '''20'''| '''GND'''| style="text-align: left;"|| style="text-align: left;"||-| '''232'''
| '''PH8'''
| '''SPI1_MISO'''
| '''21'''
|
| '''22'''
| '''UART2_RX'''
| '''PI6'''
| '''262'''
|-
| '''230'''
| '''SPI1_CLK'''
| '''23'''
|
| '''24'''
| '''SPI1_CS0'''
| '''PH5'''
| '''229'''
|-
| style="text-align: left;"|
| '''GND'''
| '''25'''
|
| '''26'''
| '''SPI1_CS1'''
| '''PH9'''
| '''233'''
|-
| '''266'''
| '''TWI2-SDA'''
| '''27'''
|
| '''28'''
| '''TWI2-SCL'''
| '''PI9'''
| '''265'''
|-
| '''256'''
| style="text-align: left;"|
| '''29'''
|
| '''30'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''271'''
| style="text-align: left;"|
| '''31'''
|
| '''32'''
| '''PWM1'''
| '''PI11'''
| '''267'''
|-
| '''268'''
| '''PWM2'''
| '''33'''
|
| '''34'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''258'''
| style="text-align: left;"|
| '''35'''
|
| '''36'''
| style="text-align: left;"|
| '''PC12'''
| '''76'''
|-
| '''272'''
| style="text-align: left;"|
| '''37'''
|
| '''38'''
| style="text-align: left;"|
| '''PI4'''
| '''260'''
|-
| style="text-align: left;"|
| '''GND'''
| '''39'''
|
| '''40'''
| style="text-align: left;"|
| '''PI3'''
| '''259'''
|}
 <ol start{| class="2" style="list-style-type: decimal;"><li>The device node corresponding to uart2 is '''/dev/ttyAS2''', and the device node corresponding to uart5 is'''/dev/ttyAS5'''</li></ol> apollo-p2:/ # ls /dev/ttyAS* /dev/ttyAS0 /dev/ttyAS1 '''/dev/ttyAS2 /dev/ttyAS5''' <ol start="3" style="list-style-type: decimal;"><li>First open wiringOP APP on the desktop</li></ol> [[File:zero2w-img351.png]] <ol start="4" style="list-style-type: decimal;"><li>Then click the '''UART_TEST'''button to open the UART test interface</li></ol> [[File:zero2w-img359.png]] <ol start="5wikitable" style="list-style-typewidth: decimal390px;"><li>The serial port test interface of wiringOP is as shown in the figure below</li></ol> [[File:zero2w-img360.png]] <ol start="6" style="list-style-type: decimal;"><li><p>Then select the '''/dev/ttyAS2''' or'''/dev/ttyAS5''' node in the selection box</p><p>[[File:zero2w-img361.png]]</p></li><li><p>Enter the baud rate you want to set in the edit box, and then click the '''OPEN''' button to open the uart node. After the opening is successful, the '''OPEN''' button becomes unselectable, and the '''CLOSE''' button and '''SEND''' button become selectable.</p></li></ol> [[File:zero2wmargin-img362.png]] <ol start="8" style="list-style-typeright: decimal20px;"><li><p>Then use Dupont wire to short the rx and tx pins of uart</p></li><li><p>Then you can enter a paragraph of characters in the send edit box below and click the '''SEND''' button to start sending.</p></li></ol> [[File:zero2w-img363.png]] <ol start="10" style="list-styletext-typealign: decimalcenter;"><li>If everything is normal, the received string will be displayed in the receiving box</li></ol> [[File:zero2w-img364.png]] <span id="pin-spi-test-method"></span>=== 40pin SPI test method === # As can be seen from the table below, the spi available for the 40pin interface is spi1, and there are two chip select pins cs0 and cs1 {| class="wikitable"|-| '''GPIO serial number'''| '''GPIO'''| '''Function'''| '''pin'''|| '''pinPin'''| '''Function'''| '''GPIO'''| '''GPIO serial numberNO.'''
|-
| style="text-align: left;"|
| style="text-align: left;"|
| '''3.3V'''
| '''1'''
|
| '''2'''
| '''5V'''
| style="text-align: left;"|
|-
| '''264'''
| '''PI8'''
| '''TWI1-SDA'''
| '''3'''
|
| '''4'''
| '''5V'''
| style="text-align: left;"|
|-
| '''263'''
| '''PI7'''
| '''TWI1-SCL'''
| '''5'''
|
| '''6'''
| '''GND'''
| style="text-align: left;"|
|-
| '''269'''
| '''PI13'''
| '''PWM3'''
| '''7'''
|
| '''8'''
| '''UART0_TX'''
| '''224'''
|-
| style="text-align: left;"|| style="text-align: left;"|| '''GND'''| '''9'''|| '''10'''
| '''UART0_RX'''
| '''PH1'''
| '''225'''
|-
| '''226'''
| '''PH2'''
| '''UART5_TX'''
| '''11'''
|
| '''12'''
| style="text-align: left;"|
| '''257'''
|-
| '''227'''
| '''PH3'''
| '''UART5_RX'''
| '''13'''
|
| '''14'''
| '''GND'''
| style="text-align: left;"|
|-
| '''261'''
| '''PI5'''
| '''UART2_TX'''
| '''15'''
|
| '''16'''
| '''PWM4'''
| '''270'''
|-
| style="text-align: left;"|
| style="text-align: left;"|
| '''3.3V'''
| '''17'''
|
| '''18'''
| style="text-align: left;"|
| '''228'''
|-
| '''231'''
| '''PH7'''
| '''SPI1_MOSI'''
| '''19'''
|
| '''20'''
| '''GND'''
| style="text-align: left;"|
|-
| '''232'''| '''PH8'''| '''SPI1_MISO'''| '''21'''|| '''<span style="color:#FF0000">22</span>'''| '''<span style="color:#FF0000">UART2_RX</span>'''| '''<span style="color:#FF0000">PI6</span>'''| '''<span style="color:#FF0000">262</span>'''
|-
| '''230'''
| '''PH6'''
| '''SPI1_CLK'''
| '''23'''
|
| '''24'''
| '''SPI1_CS0'''
| '''229'''
|-
| style="text-align: left;"|
| style="text-align: left;"|
| '''GND'''
| '''25'''
|
| '''26'''
| '''SPI1_CS1'''
| '''233'''
|-
| '''266'''
| '''PI10'''
| '''TWI2-SDA'''
| '''27'''
|
| '''28'''
| '''TWI2-SCL'''
| '''265'''
|-
| '''256'''
| '''PI0'''
| style="text-align: left;"|
| '''29'''
|
| '''30'''
| '''GND'''
| style="text-align: left;"|
|-
| '''271'''| '''PI15'''| style="text-align: left;"|| '''31'''|| '''32'''
| '''PWM1'''
| '''PI11'''
| '''267'''
|-
| '''268'''
| '''PI12'''
| '''PWM2'''
| '''33'''
|
| '''34'''
| '''GND'''
| style="text-align: left;"|
|-
| '''258'''
| '''PI2'''
| style="text-align: left;"|
| '''35'''
|
| '''36'''
| style="text-align: left;"|
| '''PC12'''
| '''76'''
|-
| '''38'''
| style="text-align: left;"|
| '''PI4'''
| '''260'''
|-
| '''40'''
| style="text-align: left;"|
| '''PI3'''
| '''259'''
|}
</div>
<ol start="2" style="list-style-type: decimal;">
<li>The device node corresponding to SPI1 CS0 uart2 is '''/dev/spidev1.0ttyAS2''', and the device node corresponding to SPI1 CS1 uart5 is '''/dev/spidev1.1ttyAS5'''</li>{| class="wikitable" style="width:800px;" |-| </olp> apollo-p2:/ # '''ls /dev/spidev1.ttyAS*'''</p><p>/dev/ttyAS0 &nbsp;&nbsp;&nbsp;&nbsp; /dev/ttyAS1 &nbsp;&nbsp;&nbsp;&nbsp; '''<span style="color:#FF0000">/dev/spidev1.0 ttyAS2 &nbsp;&nbsp;&nbsp;&nbsp; /dev/spidev1.1ttyAS5</span>'''</p>|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Here is a demonstration to test the SPI1 interface through the '''w25qxx''' module. First, connect the w25qxx module to open wiringOP APP on the SPI1 interface.desktop</li></ol> '''It doesn't matter if there is no w25qxx module, because there is a SPIFlash on the development board connected to SPI0, and the configuration of SPI0 is also turned on by default in Android, so we can also directly use the onboard SPIFlash for testing.'''
[[File:zero2w-img351.png]]
</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then click the '''UART_TEST'''button to open wiringOP APP on the desktopUART test interface</li></ol> [[File:zero2w-img351.png]]
[[File:zero2w-img359.png]]
</ol>
<ol start="5" style="list-style-type: decimal;">
<li>Then click the '''SPI_TEST''' button to open the SPI The serial port test interfaceof wiringOP is as shown in the figure below</li></ol> [[File:zero2w-img365.png]]
[[File:zero2w-img360.png]]
</ol>
<ol start="6" style="list-style-type: decimal;">
<li><p>Then select the spi device '''/dev/ttyAS2''' or'''/dev/ttyAS5''' node in the upper left cornerselection box</p><p>[[File:zero2w-img361. If png]]</p></li><li><p>Enter the baud rate you test want to set in the onboard SPIFlash directlyedit box, just keep and then click the default '''/dev/spidev0.0OPEN'''button to open the uart node. If After the opening is successful, the '''w25qxxOPEN''' module is connected to button becomes unselectable, and the 40pin spi1 cs0, then please select'''/dev/spidev1.0CLOSE''', if the w25qxx module is connected to the 40pin spi1 cs1, then please select button and '''/dev/spidev1.1SEND'''button become selectable.</p><div class="figure"/li>
[[File:zero2w-img366img362.png]]</ol><ol start="8" style="list-style-type: decimal;"><li><p>Then use Dupont wire to short the rx and tx pins of uart</p></li><li><p>Then you can enter a paragraph of characters in the send edit box below and click the '''SEND''' button to start sending.</p></li>
[[File:zero2w-img363.png]]</divol></liol start="10" style="list-style-type: decimal;"><li><p>Then click If everything is normal, the '''OPEN''' button to initialize received string will be displayed in the SPI</p>receiving box</li></ol>
[[File:zero2w-img367img364.png]]</ol><span id="pin-spi-test-method"></span>
<ol start="8" style="list-style-type: decimal;"><li>Then fill in the bytes that need to be sent, such as reading the ID information of the onboard SPIFlash, filling in the address 0x9f in data[0], and then click the '''TRANSFER''' button</li></ol>= 40pin SPI test method ===
[[File:zero2w-img368.png]]# As can be seen from the table below, the spi available for the 40pin interface is spi1, and there are two chip select pins cs0 and cs1
<ol start="9" div style="list-style-typedisplay: decimalflex;"><li>Finally, the APP will display the read ID information of the onboard SPI Flash.</li></ol> [[File:zero2w-img369.png]] <ol start:{| class="10wikitable" style="listwidth:390px;margin-styleright: 20px;text-typealign: decimalcenter;"><li>If the w25qxx module connected to 40pin SPI1 is read, the ID information of the onboard SPI Flash is also similar.</li></ol> <span id="pin-i2c-test-method"></span>=== 40pin I2C test method === # As can be seen from the table below, the Android12 TV system has i2c1 and i2c2 turned on by default. {| class="wikitable"
|-
| '''GPIO serial numberNO.'''
| '''GPIO'''
| '''Function'''
| '''pin'''|| '''pin'''| '''Function'''| '''GPIO'''| '''GPIO serial numberPin'''
|-
| style="text-align: left;"|
| '''3.3V'''
| '''1'''
|
| '''2'''
| '''5V'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''264'''
| '''TWI1-SDA'''
| '''3'''
|
| '''4'''
| '''5V'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''263'''
| '''TWI1-SCL'''
| '''5'''
|
| '''6'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''269'''
| '''PWM3'''
| '''7'''
|
| '''8'''
| '''UART0_TX'''
| '''PH0'''
| '''224'''
|-
| style="text-align: left;"|
| '''GND'''
| '''9'''
|
| '''10'''
| '''UART0_RX'''
| '''PH1'''
| '''225'''
|-
| '''226'''
| '''UART5_TX'''
| '''11'''
|
| '''12'''
| style="text-align: left;"|
| '''PI1'''
| '''257'''
|-
| '''227'''
| '''UART5_RX'''
| '''13'''
|
| '''14'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''261'''
| '''UART2_TX'''
| '''15'''
|| '''16'''| '''PWM4'''| '''PI14'''| '''270'''|-| style="text-align: left;"|
| style="text-align: left;"|
| '''3.3V'''
| '''17'''
|
| '''18'''
| style="text-align: left;"|
| '''PH4'''
| '''228'''
|-
| '''231'''
| '''SPI1_MOSI'''
| '''19'''
|
| '''20'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''232'''
| '''SPI1_MISO'''
| '''21'''
|
| '''22'''
| '''UART2_RX'''
| '''PI6'''
| '''262'''
|-
| '''230'''
| '''SPI1_CLK'''
| '''23'''
|
| '''24'''
| '''SPI1_CS0'''
| '''PH5'''
| '''229'''
|-
| style="text-align: left;"|
| '''GND'''
| '''25'''
|
| '''26'''
| '''SPI1_CS1'''
| '''PH9'''
| '''233'''
|-
| '''266'''
| '''TWI2-SDA'''
| '''27'''
|
| '''28'''
| '''TWI2-SCL'''
| '''PI9'''
| '''265'''
|-
| '''256'''
| style="text-align: left;"|
| '''29'''
|
| '''30'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''271'''
| style="text-align: left;"|
| '''31'''
|
| '''32'''
| '''PWM1'''
| '''PI11'''
| '''267'''
|-
| '''268'''
| '''PWM2'''
| '''33'''
|
| '''34'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''258'''
| style="text-align: left;"|
| '''35'''
|}{| '''36'''| class="wikitable" style="width:390px;margin-right: 20px;text-align: leftcenter;"|-| '''Pin'''| '''Function'''| '''PC12GPIO'''| '''76GPIO NO.'''
|-
| '''2722'''| '''PI165V'''| style="text-align: left;"|| style="text-align: left;"||-| '''4'''| '''5V'''
| style="text-align: left;"|
| '''37'''
|
| '''38'''
| style="text-align: left;"|
| '''PI4'''
| '''260'''
|-
| '''6'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''8'''
| '''UART0_TX'''
| '''PH0'''
| '''224'''
|-
| '''10'''
| '''UART0_RX'''
| '''PH1'''
| '''225'''
|-
| '''12'''
| style="text-align: left;"|
| '''PI1'''
| '''257'''
|-
| '''14'''
| '''GND'''
| '''39'''
|
| '''40'''
| style="text-align: left;"|
| '''PI3'''| '''259'''|} <ol start="2" style="list-style-type: decimal;"><li>The device node corresponding to i2c1 is '''/dev/i2c-1''', and the device node corresponding to i2c2 is '''/dev/i2c-2'''</li></ol> apollo-p2:/ # '''ls /dev/i2c-*''' '''/dev/i2c-1 /dev/i2c-2''' /dev/i2c-5 <ol start="3" style="list-style-type: decimal;"><li>First open wiringOP APP on the desktop</li></ol> [[File:zero2w-img351.png]] <ol start="4" style="list-style-type: decimal;"><li>Then click the '''I2C_TEST''' button to open the i2c test interface</li></ol> [[File:zero2w-img370.png]] <ol start="5" style="list-style-type: decimal;"><li>The i2c test interface of wiringOP is shown in the figure below</li></ol> [[File:zero2w-img371.png]] <ol start="6" style="listtext-style-typealign: decimal;"><li>Then click the device node selection box in the upper left corner to select the i2c you want to test</li></ol> [[File:zero2w-img372.png]] <ol start="7" style="list-style-type: decimal;"><li>Then connect an i2c device to the 40pin i2c pin. Here we take the ds1307 rtc module as an example.</li></ol> [[File:zero2w-img178.png]] <ol start="8" style="list-style-type: decimal;"><li><p>The i2c address of the ds1307 rtc module is 0x68. After connecting the lines, we can use the '''i2cdetect -y 1''' or '''i2cdetect -y 2''' command on the serial port command line to check whether the i2c address of the ds1307 rtc module can be scanned. If you can see the address 0x68, it means that the ds1307 rtc module is wired correctly.</p><p>apollo-p2:/ # '''i2cdetect -y 1'''</p><p>'''Or'''</p><p>apollo-p2:/ # '''i2cdetect -y 2'''</p><p>[[File:zero2w-img373.png]]</p></li><li><p>Then set the i2c address to 0x68 in wiringOP, and then click the '''OPEN''' button to open i2c</p><p>[[File:zero2w-img374.png]]</p></li><li><p>After clicking the '''OPEN''' button to open i2c, the display is as follows</p><p>[[File:zero2w-img375.png]]</p></li><li><p>Then we test writing a value to the register of the rtc module, for example, writing 0x55 to the 0x1c address</p><ol style="list-style-type: lower-alpha;"><li><p>We first set the address of the register to be written to 0x1c</p><p>[[File:zero2w-img376.png]]</p></li><li><p>Then set the value to be written to 0x55</p><p>[[File:zero2w-img377.png]]</p></li><li><p>Then click the '''WRITE BYTE''' button to perform the writing action</p><p>[[File:zero2w-img378.png]]</p></li></ol></li><li><p>Then click the '''READ BYTE''' button to read the value of the 0x1c register. If it displays 0x55, it means that the i2c read and write test has passed.</p><p>[[File:zero2w-img379.png]]</p></li></ol> <span id="pin-pwm-test"></span>=== 40pin PWM test === # As can be seen from the table below, the available pwm are pwm1, pwm2, pwm3 and pwm4. {| class="wikitable"|-| '''GPIO serial number'''| '''GPIO'''| '''Function'''| '''pin'''|| '''pin16'''| '''FunctionPWM4'''| '''GPIOPI14'''| '''GPIO serial number270'''
|-
| '''18'''
| style="text-align: left;"|
| style="text-align: left;"|| '''3.3V'''| '''1PH4'''|| '''2228'''| '''5V'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''26420'''| '''PI8'''| '''TWI1-SDA'''| '''3'''|| '''4'''| '''5VGND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''26322'''| '''PI7UART2_RX'''| '''TWI1PI6'''| '''262'''|-| '''24'''| '''SPI1_CS0'''| '''PH5'''| '''229'''|-| '''26'''| '''SPI1_CS1'''| '''PH9'''| '''233'''|-| '''28'''| '''TWI2-SCL'''| '''5PI9'''|'''265'''|-| '''630'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''26932'''| '''PI13PWM1'''| '''PWM3PI11'''| '''7'''|| '''8'''| '''UART0_TX'''| '''PH0'''| '''224267'''
|-
| '''34'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
| '''GND'''
| '''9'''
|
| '''10'''
| '''UART0_RX'''
| '''PH1'''
| '''225'''
|-
| '''226'''| '''PH2'''| '''UART5_TX'''| '''11'''|| '''1236'''
| style="text-align: left;"|
| '''PI1PC12'''| '''25776'''|}</div> <ol start="2" style="list-style-type: decimal;"><li>The device node corresponding to SPI1 CS0 is '''/dev/spidev1.0''', and the device node corresponding to SPI1 CS1 is '''/dev/spidev1.1'''</li>{| class="wikitable" style="width:800px;" |-| apollo-p2:/ # '''ls /dev/spidev1.*''' '''<span style="color:#FF0000">/dev/spidev1.0 &nbsp;&nbsp;&nbsp;&nbsp; /dev/spidev1.1</span>'''|}</ol><ol start="3" style="list-style-type: decimal;"><li>Here is a demonstration to test the SPI1 interface through the '''w25qxx''' module. First, connect the w25qxx module to the SPI1 interface.</li>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''It doesn't matter if there is no w25qxx module, because there is a SPIFlash on the development board connected to SPI0, and the configuration of SPI0 is also turned on by default in Android, so we can also directly use the onboard SPIFlash for testing.'''</big>|}</ol><ol start="4" style="list-style-type: decimal;"><li>Then open wiringOP APP on the desktop</li> [[File:zero2w-img351.png]]</ol><ol start="5" style="list-style-type: decimal;"><li>Then click the '''SPI_TEST''' button to open the SPI test interface</li> [[File:zero2w-img365.png]]</ol><ol start="6" style="list-style-type: decimal;"><li><p>Then select the spi device node in the upper left corner. If you test the onboard SPIFlash directly, just keep the default '''/dev/spidev0.0'''. If the '''w25qxx''' module is connected to the 40pin spi1 cs0, then please select'''/dev/spidev1.0''', if the w25qxx module is connected to the 40pin spi1 cs1, then please select '''/dev/spidev1.1'''</p><div class="figure"> [[File:zero2w-img366.png]] </div></li><li><p>Then click the '''OPEN''' button to initialize the SPI</p></li> [[File:zero2w-img367.png]]</ol><ol start="8" style="list-style-type: decimal;"><li>Then fill in the bytes that need to be sent, such as reading the ID information of the onboard SPIFlash, filling in the address 0x9f in data[0], and then click the '''TRANSFER''' button</li> [[File:zero2w-img368.png]]</ol><ol start="9" style="list-style-type: decimal;"><li>Finally, the APP will display the read ID information of the onboard SPI Flash.</li> [[File:zero2w-img369.png]]</ol><ol start="10" style="list-style-type: decimal;"><li>If the w25qxx module connected to 40pin SPI1 is read, the ID information of the onboard SPI Flash is also similar.</li></ol> <span id="pin-i2c-test-method"></span> === 40pin I2C test method === # As can be seen from the table below, the Android12 TV system has i2c1 and i2c2 turned on by default. <div style="display: flex;">::{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"|-| '''GPIO NO.'''| '''GPIO'''| '''Function'''| '''Pin'''
|-
| '''227'''
| '''PH3'''
| '''UART5_RX'''
| '''13'''
|
| '''14'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
| '''3.3V'''
| '''1'''
|-
| '''<span style="color:#FF0000">264</span>'''| '''<span style="color:#FF0000">PI8</span>'''| '''<span style="color:#FF0000">TWI1-SDA</span>'''| '''<span style="color:#FF0000">3</span>'''|-| '''<span style="color:#FF0000">263</span>'''| '''<span style="color:#FF0000">PI7</span>'''| '''<span style="color:#FF0000">TWI1-SCL</span>'''| '''<span style="color:#FF0000">5</span>'''|-| '''269'''| '''PI13'''| '''PWM3'''| '''7'''|-| style="text-align: left;"|| style="text-align: left;"|| '''GND'''| '''9'''|-| '''226'''| '''PH2'''| '''UART5_TX'''| '''11'''|-| '''227'''| '''PH3'''| '''UART5_RX'''| '''13'''|-| '''261'''| '''PI5'''
| '''UART2_TX'''
| '''15'''
|
| '''16'''
| '''PWM4'''
| '''PI14'''
| '''270'''
|-
| style="text-align: left;"|
| '''3.3V'''
| '''17'''
|
| '''18'''
| style="text-align: left;"|
| '''PH4'''
| '''228'''
|-
| '''231'''
| '''SPI1_MOSI'''
| '''19'''
|
| '''20'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''232'''
| '''SPI1_MISO'''
| '''21'''
|
| '''22'''
| '''UART2_RX'''
| '''PI6'''
| '''262'''
|-
| '''230'''
| '''SPI1_CLK'''
| '''23'''
|
| '''24'''
| '''SPI1_CS0'''
| '''PH5'''
| '''229'''
|-
| style="text-align: left;"|
| '''GND'''
| '''25'''
|
| '''26'''
| '''SPI1_CS1'''
| '''PH9'''
| '''233'''
|-
| '''<span style="color:#FF0000">266</span>'''| '''<span style="color:#FF0000">PI10</span>'''| '''<span style="color:#FF0000">TWI2-SDA</span>'''| '''<span style="color:#FF0000">27'''|| '''28'''| '''TWI2-SCL'''| '''PI9'''| '''265</span>'''
|-
| '''256'''
| style="text-align: left;"|
| '''29'''
|
| '''30'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''271'''
| style="text-align: left;"|
| '''31'''
|
| '''32'''
| '''PWM1'''
| '''PI11'''
| '''267'''
|-
| '''268'''
| '''PWM2'''
| '''33'''
|
| '''34'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''258'''
| style="text-align: left;"|
| '''35'''
|
| '''36'''
| style="text-align: left;"|
| '''PC12'''
| '''76'''
|-
| '''272'''
| style="text-align: left;"|
| '''37'''
|
| '''38'''
| style="text-align: left;"|
| '''PI4'''
| '''260'''
|-
| style="text-align: left;"|
| '''GND'''
| '''39'''
|}{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"|-| '''Pin'''| '''Function'''| '''GPIO'''| '''GPIO NO.'''|-| '''2'''| '''5V'''| style="text-align: left;"|| style="text-align: left;"||-| '''4'''| '''405V'''
| style="text-align: left;"|
| style="text-align: left;"||-| '''PI36'''| '''259GND'''|} <ol startstyle="2text-align: left;" || style="listtext-style-typealign: decimalleft;">||-| '''8'''| '''UART0_TX'''| '''PH0'''| '''224'''|-| '''10'''| '''UART0_RX'''<li>First click the wiringOP icon to open wiringOP APP</li></ol>| '''PH1'''| '''225'''[[File:zero2w|-img351.png]]| '''12'''<ol start="3" | style="list-styletext-typealign: decimalleft;">|<li>Then click the | '''PWM_TESTPI1''' button on the main interface of wiringOP to enter the PWM test interface</li></ol>| '''257'''[[File:zero2w|-img380.png]]| '''14'''| '''GND'''<ol start| style="4text-align: left;" || style="list-styletext-typealign: decimalleft;">||-<li>The PWM test interface is as follows</li></ol>| '''16'''| '''PWM4'''<div class="figure">| '''PI14'''| '''270'''[[File:zero2w|-img381.png]]| '''18'''</div><ol start="5" | style="listtext-style-typealign: decimalleft;">|<li>Then set which PWM you want to use in the Channel. The default is PWM1. If you want to set it to PWM2, just enter 2 in the Channel. PWM3 and PWM4 and so on.</li></ol>| '''PH4'''| '''228'''[[File:zero2w|-img382.png]]| '''20'''| '''GND'''<ol start| style="6text-align: left;" || style="listtext-style-typealign: decimalleft;">||-| '''22'''| '''UART2_RX'''| '''PI6'''| '''262'''|-| '''24'''<li>Then you can set the PWM period. The default configuration is | '''50000nsSPI1_CS0'''. The converted PWM frequency is | '''20KHzPH5'''</li></ol>| '''229'''[[File:zero2w|-img383.png]]| '''26'''| '''SPI1_CS1'''| '''PH9'''| '''233'''|-| '''<ol start="7" span style="list-style-typecolor: decimal;#FF0000">28<li/span>Then click the '''EXPORT| '''button to export PWM</lispan style="color:#FF0000">TWI2-SCL</olspan>''' [[File:zero2w-img384.png]] | '''<ol start="8" span style="list-style-typecolor: decimal;#FF0000">PI9<li/span>Then drag the progress bar below to change the PWM duty cycle, and then check '''Enable| ''' to output the PWM waveform.</lispan style="color:#FF0000">265</olspan>'''|-[[File:zero2w-img385.png]]| '''30'''| '''GND'''<ol start| style="9text-align: left;" || style="listtext-style-typealign: decimalleft;">||-| '''32'''| '''PWM1'''<li>Then use an oscilloscope to measure the corresponding pins in the 40pin development board and you can see the following waveform.</li></ol>| '''PI11'''| '''267'''[[File:zero2w|-img386.png]]| '''34'''<span id| '''GND'''| style="howtext-toalign: left;"|| style="text-compile-android-12-source-codealign: left;"></span>||-= | '''How to compile Android 12 source code36''' = <span id| style="downloadtext-the-source-code-of-android-12align: left;"></span>|| '''PC12'''| '''76'''== Download the source code of Android 12 ==|-| '''38'''<ol | style="list-styletext-typealign: decimalleft;">|| '''PI4'''| '''260'''|-<li><p>First download the compressed package of the Android 12 source code and the compressed package of the files modified by Orange Pi Zero2w from Google Cloud Drive</p>| '''40'''<ol | style="listtext-style-typealign: lower-alphaleft;">|| '''PI3'''| '''259'''<li>Google Cloud Drive</li></ol>|}</li></oldiv>
[[File:zero2w-img387.png]] <ol start="2" style="list-style-type: decimal;"><li>After downloading the compressed package of Android 12 source code, please check whether the MD5 checksum The device node corresponding to i2c1 is correct. If it is incorrect, please download the source code again. Here's how to check the MD5 checksum:<''/li><dev/ol> test@test:~$ i2c-1'''md5sum -c H618-Android12-Src.tar.gz.md5sum, and the device node corresponding to i2c2 is ''' H618/dev/i2c-Android12-Src.tar.gzaa: '''OK2'''</li>{| class="wikitable" style="width:800px;" H618|-Android12| apollo-Src.tar.gzabp2: / # '''OKls /dev/i2c-*''' ......
'''<span style="color:#FF0000">/dev/i2c-1 &nbsp;&nbsp;&nbsp;&nbsp; /dev/i2c-2</span>''' &nbsp;&nbsp;&nbsp;&nbsp; /dev/i2c-5
|}
</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then you need to merge multiple compressed files into one, and then extract First open wiringOP APP on the Android source code. The command looks like this:desktop</li></ol>
test@test[[File:~$ '''cat H618-Android12zero2w-Src.tarimg351.gza* &gt; H618png]]</ol><ol start="4" style="list-Android12style-Src.tar.gztype: decimal;"><li>Then click the '''I2C_TEST'''button to open the i2c test interface</li>
test@test[[File:~$ '''tar zero2w-xvf H618img370.png]]</ol><ol start="5" style="list-Android12style-Src.tar.gz'''type: decimal;"><li>The i2c test interface of wiringOP is shown in the figure below</li>
[[File:zero2w-img371.png]]</ol><ol start="46" style="list-style-type: decimal;"><li>Then unzip click the compressed package of device node selection box in the files modified by Orange Pi Zero2wupper left corner to select the i2c you want to test</li></ol>
test@test[[File:~$ '''tar zxf opizero2w_android12_patcheszero2w-img372.tarpng]]</ol><ol start="7" style="list-style-type: decimal;"><li>Then connect an i2c device to the 40pin i2c pin. Here we take the ds1307 rtc module as an example.gz'''</li>
[[File:zero2w-img178.png]]</ol><ol start="8" style="list-style-type: decimal;"><li><p>The i2c address of the ds1307 rtc module is 0x68. After connecting the lines, we can use the '''i2cdetect -y 1''' or '''i2cdetect -y 2''' command on the serial port command line to check whether the i2c address of the ds1307 rtc module can be scanned. If you can see the address 0x68, it means that the ds1307 rtc module is wired correctly.</p>{| class="wikitable" style="width:800px;" |-| <p>apollo-p2:/ # '''i2cdetect -y 1'''</p><p>'''Or'''</p><p>apollo-p2:/ # '''i2cdetect -y 2'''</p>|}<p>[[File:zero2w-img373.png]]</p></li><li><p>Then set the i2c address to 0x68 in wiringOP, and then click the '''OPEN''' button to open i2c</p><p>[[File:zero2w-img374.png]]</p></li><li><p>After clicking the '''OPEN''' button to open i2c, the display is as follows</p><p>[[File:zero2w-img375.png]]</p></li><li><p>Then we test@testwriting a value to the register of the rtc module, for example, writing 0x55 to the 0x1c address</p><ol style="list-style-type: lower-alpha;"><li><p>We first set the address of the register to be written to 0x1c</p><p>[[File:zero2w-img376.png]]</p></li><li><p>Then set the value to be written to 0x55</p><p>[[File:zero2w-img377.png]]</p></li><li><p>Then click the '''WRITE BYTE''' button to perform the writing action</p><p>[[File:~$ zero2w-img378.png]]</p></li></ol></li><li><p>Then click the '''lsREAD BYTE'''button to read the value of the 0x1c register. If it displays 0x55, it means that the i2c read and write test has passed.</p><p>[[File:zero2w-img379.png]]</p></li></ol>
'''opizero2w_android12_patches''' opizero2w_android12_patches.tar.gz<span id="pin-pwm-test"></span>
<ol start="5" style="list-style-type: decimal;"><li>Then copy the files modified by Orange Pi Zero2w to the Android source code</li></ol>= 40pin PWM test ===
test@test:~$ '''cp -rf opizero2w_android12_patches/* H618-Android12-Src/'''# As can be seen from the table below, the available pwm are pwm1, pwm2, pwm3 and pwm4.
<span iddiv style="display: flex;">::{| class="wikitable" style="compilewidth:390px;margin-theright: 20px;text-sourcealign: center;"|-code| '''GPIO NO.'''| '''GPIO'''| '''Function'''| '''Pin'''|-of| style="text-androidalign: left;"|| style="text-12align: left;"></span>|| '''3.3V'''== Compile the source code of Android 12 ==| '''1'''|-| '''Android12 is compiled on an x86_64 computer with Ubuntu 22.04 installed. Other versions of Ubuntu system package dependencies may have some differences. The image download address of the Ubuntu 22.04 amd64 version is as follows:264'''| '''PI8'''[https://repo.huaweicloud.com/ubuntu| '''TWI1-releases/22.04/ubuntuSDA'''| '''3'''|-22.04.2| '''263'''| '''PI7'''| '''TWI1-desktopSCL'''| '''5'''|-amd64.iso | '''<span style="color:#FF0000">269</span>'''| '''https<span style="color:#FF0000">PI13</span>'''| '''<span style="color:#FF0000">PWM3</repo.huaweicloud.comspan>'''| '''<span style="color:#FF0000">7</ubuntuspan>'''|-releases/22.04/ubuntu| style="text-22.04.2align: left;"|| style="text-desktopalign: left;"|| '''GND'''| '''9'''|-amd64.iso| '''226''']| '''PH2'''| '''The x86_64 computer hardware configuration for compiling Android12 source code recommends a memory of 16GB or more, and a hard disk space of 200GB or more is recommended. The more CPU cores, the better.UART5_TX'''| '''11'''# First install the software packages needed to compile Android12 source code|-| '''227'''test@test:~$ | '''sudo apt-get updatePH3'''| '''UART5_RX'''test@test:~$ | '''13'''sudo apt|-get install -y git gnupg flex bison gperf build-essential \| '''261'''| '''PI5'''| '''UART2_TX'''| '''15'''zip curl zlib1g|-dev gcc| style="text-multilib g++align: left;"|| style="text-multilib libc6align: left;"|| '''3.3V'''| '''17'''|-dev| '''231'''| '''PH7'''| '''SPI1_MOSI'''| '''19'''|-i386 \| '''232'''| '''PH8'''| '''SPI1_MISO'''| '''21''lib32ncurses5'|-dev x11proto| '''230'''| '''PH6'''| '''SPI1_CLK'''| '''23'''|-core| style="text-dev libx11align: left;"|| style="text-dev lib32z1align: left;"|| '''GND'''| '''25'''|-dev ccache \| '''266'''| '''PI10'''| '''libgl1TWI2-mesa-dev libxml2-utils xsltproc unzip u-boot-tools python-is-python3 \SDA'''| '''27'''|-| '''libssl-dev libncurses5 clang gawk256'''| '''PI0'''<ol start| style="2text-align: left;" || '''29'''|-| '''271'''| '''PI15'''| style="listtext-style-typealign: decimalleft;">|| '''31'''|-| '''<lispan style="color:#FF0000"><p>Then compile the code in the longan folder, which mainly contains u-boot and linux kernel268</pspan>'''| '''<ol span style="list-style-typecolor: lower-alpha;#FF0000">PI12<li/span>First run '''./build.sh config| ''' to set compilation options</lispan style="color:#FF0000">PWM2</olspan>'''| '''</lispan style="color:#FF0000">33</olspan>'''|-| '''258'''| '''PI2'''test@test| style="text-align:~$ left;"|| '''35'''cd H618|-Android12| '''272'''| '''PI16'''| style="text-Src/longanalign: left;"|| '''37'''|-test@test| style="text-align:~/H618left;"|| style="text-Android12-Src/longan$ align: left;"|| '''GND'''| '''./build.sh config39'''|}Welcome to mkscript setup progress{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"|-| '''Pin'''All available platform:| '''Function'''| '''GPIO'''0| '''GPIO NO. android'''|-| '''2'''1. linux| '''5V'''| style="text-align: left;"|Choice [android]| style="text-align: left;"||-| '''04'''| '''5V'''All available ic| style="text-align:left;"|| style="text-align: left;"|0. h618|-| '''6'''Choice [h618]: | '''0GND'''| style="text-align: left;"|All available board| style="text-align:left;"||-| '''8'''0. ft| '''UART0_TX'''| '''PH0'''| '''224'''1. p1|-| '''10'''2. p2| '''UART0_RX'''| '''PH1'''3. p7| '''225'''|-4. p7l| '''12'''| style="text-align: left;"|5. perf1| '''PI1'''| '''257'''6. perf2|-| '''14'''7. perf3| '''GND'''| style="text-align: left;"|8. qa| style="text-align: left;"||-Choice [p2]| '''<span style="color: #FF0000">16</span>'''| '''2<span style="color:#FF0000">PWM4</span>'''| '''<span style="color:#FF0000">PI14</span>'''All available flash| '''<span style="color:#FF0000">270</span>'''|-| '''18'''0. default| style="text-align: left;"|| '''PH4'''1. nor| '''228'''|-Choice [default]: | '''020'''| '''GND'''All available kern_ver| style="text-align:left;"|| style="text-align: left;"|0. linux|-5.4| '''22'''| '''UART2_RX'''| '''PI6'''| '''262'''Choice [linux|-5.4]: | '''024'''| '''SPI1_CS0'''All available arch:| '''PH5'''| '''229'''0. arm|-| '''26'''1. arm64| '''SPI1_CS1'''| '''PH9'''Choice [arm64]: | '''1233'''|-| '''......28'''| '''TWI2-SCL'''*** Default configuration is based on | '''PI9''sun50iw9p1smp_h618_android_defconfig'| '''265'''#|-| '''30'''# configuration written to .config| '''GND'''| style="text-align: left;"|#| style="text-align: left;"||-make[1]| '''<span style="color: Leaving directory #FF0000">32</span>'''| '''<span style="color:#FF0000">PWM1</homespan>'''| '''<span style="color:#FF0000">PI11</testspan>'''| '''<span style="color:#FF0000">267</H618span>'''|-Android12-Src/longan/out/kernel/build| '''34'''| '''GND'''| style="text-align: left;"|make| style="text-align: Leaving directory left;"||-| '/home/test/H618''36'''| style="text-Android12align: left;"|| '''PC12'''| '''76'''|-Src/longan/kernel/linux| '''38'''| style="text-5.4align: left;"|| '''PI4'''| '''260'''|-| '''40'''INFO| style="text-align: clean buildserverleft;"|| '''PI3'''| '''259'''|}INFO: prepare_buildserver</div> <ol start="2" style="list-style-type: lowerdecimal;"><li>First click the wiringOP icon to open wiringOP APP</li> [[File:zero2w-img351.png]]</ol><ol start="3" style="list-style-alphatype: decimal;"><li>Then run click the '''./build.shPWM_TEST''' script button on the main interface of wiringOP to start compilation.enter the PWM test interface</li></oltest@test[[File:~/H618-Android12zero2w-Src/longan$ '''img380.png]]</build.sh'''ol><ol start="34" style="list-style-type: lower-alphadecimal;"><li>After compilation The PWM test interface is completed, you will see the following outputas follows</li> </oldiv class="figure"sun50iw9p1 compile Kernel successful INFO[[File: Prepare toolchain ... '''......''' INFO: build kernel OKzero2w-img381.png]]
INFO</div></ol><ol start="5" style="list-style-type: build rootfs decimal;"><li>Then set which PWM you want to use in the Channel.The default is PWM1.If you want to set it to PWM2, just enter 2 in the Channel.PWM3 and PWM4 and so on.</li>
INFO[[File: skip make rootfs for androidzero2w-img382.png]]</ol><ol start="6" style="list-style-type: decimal;"><li>Then you can set the PWM period. The default configuration is '''50000ns'''. The converted PWM frequency is '''20KHz'''</li>
[[File:zero2w-img383.png]]</ol><ol start="7" style="list-style-type: decimal;"><li>Then click the '''EXPORT'''button to export PWM</li> [[File:zero2w-img384.png]]</ol><ol start="8" style="list-style-type: decimal;"><li>Then drag the progress bar below to change the PWM duty cycle, and then check '''Enable''' to output the PWM waveform.</li> [[File:zero2w-img385.png]]</ol><ol start="9" style="list-style-type: decimal;"><li>Then use an oscilloscope to measure the corresponding pins in the 40pin development board and you can see the following waveform.</li> [[File:zero2w-img386.png]]</ol><span id="how-to-compile-android-12-source-code"></span> = '''How to compile Android 12 source code''' = <span id="download-the-source-code-of-android-12"></span>== Download the source code of Android 12 == <ol style="list-style-type: decimal;"><li><p>First download the compressed package of the Android 12 source code and the compressed package of the files modified by Orange Pi Zero2w from Google Cloud Drive</p><ol style="list-style-type: lower-alpha;"><li>Google Cloud Drive</li> [[File:zero2w-img387.png]]</ol></li></ol><ol start="2" style="list-style-type: decimal;"><li>After downloading the compressed package of Android 12 source code, please check whether the MD5 checksum is correct. If it is incorrect, please download the source code again. Here's how to check the MD5 checksum:</li>{| class="wikitable" style="width:800px;" |-| test@test:~$ '''md5sum -c H618-Android12-Src.tar.gz.md5sum''' H618-Android12-Src.tar.gzaa: '''<span style="color:#FF0000">OK</span>''' H618-Android12-Src.tar.gzab: '''<span style="color:#FF0000">OK</span>''' ......|}</ol><ol start="3" style="list-style-type: decimal;"><li>Then you need to merge multiple compressed files into one, and then extract the Android source code. The command looks like this:</li>{| class="wikitable" style="width:800px;" |-| test@test:~$ '''cat H618-Android12-Src.tar.gz<span style="color:#FF0000">a</span>* &gt; H618-Android12-Src.tar.gz''' test@test:~$ '''tar -xvf H618-Android12-Src.tar.gz'''|}</ol><ol start="4" style="list-style-type: decimal;"><li>Then unzip the compressed package of the files modified by Orange Pi Zero2w</li>{| class="wikitable" style="width:800px;" |-| test@test:~$ '''tar zxf opizero2w_android12_patches.tar.gz''' test@test:~$ '''ls''' '''opizero2w_android12_patches''' opizero2w_android12_patches.tar.gz|}</ol><ol start="5" style="list-style-type: decimal;"><li>Then copy the files modified by Orange Pi Zero2w to the Android source code</li>{| class="wikitable" style="width:800px;" |-| test@test:~$ '''cp -rf opizero2w_android12_patches/* H618-Android12-Src/'''|}</ol><span id="compile-the-source-code-of-android-12"></span> == Compile the source code of Android 12 == {| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Android12 is compiled on an x86_64 computer with <span style="color:#FF0000">Ubuntu 22.04</span> installed. Other versions of Ubuntu system package dependencies may have some differences. The image download address of the Ubuntu 22.04 <span style="color:#FF0000">amd64</span> version is as follows:''' [https://repo.huaweicloud.com/ubuntu-releases/22.04/ubuntu-22.04.2-desktop-amd64.iso '''https://repo.huaweicloud.com/ubuntu-releases/22.04/ubuntu-22.04.2-desktop-amd64.iso'''] '''The x86_64 computer hardware configuration for compiling Android12 source code recommends a memory of 16GB or more, and a hard disk space of 200GB or more is recommended. The more CPU cores, the better.'''</big>|} # First install the software packages needed to compile Android12 source code ::{| class="wikitable" style="width:800px;" |-| test@test:~$ '''sudo apt-get update''' test@test:~$ '''sudo apt-get install -y git gnupg flex bison gperf build-essential \''' '''zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \''' '''lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev ccache \''' '''libgl1-mesa-dev libxml2-utils xsltproc unzip u-boot-tools python-is-python3 \''' '''libssl-dev libncurses5 clang gawk'''|} <ol start="2" style="list-style-type: decimal;"><li><p>Then compile the code in the longan folder, which mainly contains u-boot and linux kernel</p><ol style="list-style-type: lower-alpha;"><li>First run '''./build.sh config''' to set compilation options</li>{| class="wikitable" style="width:800px;" |-| <p>test@test:~$ '''cd H618-Android12-Src/longan'''</p><p>test@test:~/H618-Android12-Src/longan$ '''./build.sh config'''</p>  <p>Welcome to mkscript setup progress</p><p>All available platform:</p>:<p>0. android</p>:<p>1. linux</p><p>Choice [android]: '''<span style="color:#FF0000">0</span>'''</p><p>All available ic:</p>:<p>0. h618</p><p>Choice [h618]: '''<span style="color:#FF0000">0</span>'''</p><p>All available board:</p>:<p>0. ft</p>:<p>1. p1</p>:<p>2. p2</p>:<p>3. p7</p>:<p>4. p7l</p>:<p>5. perf1</p>:<p>6. perf2</p>:<p>7. perf3</p>:<p>8. qa</p><p>Choice [p2]: '''<span style="color:#FF0000">2</span>'''</p><p>All available flash:</p>:<p>0. default</p>:<p>1. nor</p><p>Choice [default]: '''<span style="color:#FF0000">0</span>'''</p><p>All available kern_ver:</p>:<p>0. linux-5.4</p><p>Choice [linux-5.4]: '''<span style="color:#FF0000">0</span>'''</p><p>All available arch:</p>:<p>0. arm</p>:<p>1. arm64</p><p>Choice [arm64]: '''<span style="color:#FF0000">1</span>'''</p><p>'''......'''</p><p>*** Default configuration is based on 'sun50iw9p1smp_h618_android_defconfig'</p><p>#</p><p># configuration written to .config</p><p>#</p><p>make[1]: Leaving directory '/home/test/H618-Android12-Src/longan/out/kernel/build'</p><p>make: Leaving directory '/home/test/H618-Android12-Src/longan/kernel/linux-5.4'</p><p>INFO: clean buildserver</p><p>INFO: prepare_buildserver</p>|}</ol><ol start="2" style="list-style-type: lower-alpha;"><li>Then run the '''./build.sh''' script to start compilation.</li>{| class="wikitable" style="width:800px;" |-| test@test:~/H618-Android12-Src/longan$ '''./build.sh'''|}</ol><ol start="3" style="list-style-type: lower-alpha;"><li>After compilation is completed, you will see the following output</li>{| class="wikitable" style="width:800px;" |-| sun50iw9p1 compile Kernel successful INFO: Prepare toolchain ... '''......''' INFO: build kernel OK. INFO: build rootfs ... INFO: skip make rootfs for android INFO: ----------------------------------------
INFO: build lichee OK.
INFO: ----------------------------------------|}</ol></li></ol><ol start="3" style="list-style-type: decimal;"><li>Then use the following command to compile the Android source code and generate the final Android image</li></ol>{| class="wikitable" style="width:800px;" |-| test@test:~$ '''cd H618-Android12-Src''' test@test:~/H618-Android12-Src$ '''source build/envsetup.sh''' test@test:~/H618-Android12-Src$ '''lunch apollo_p2-userdebug''' test@test:~/H618-Android12-Src$ '''make -j8''' test@test:~/H618-Android12-Src$ '''pack'''|}</ol><ol start="4" style="list-style-type: decimal;"><li><p>The storage path of the Android image generated by compilation is:</p>{| class="wikitable" style="width:800px;" |-| <p>'''longan/out/h618_android12_p2_uart0.img'''</p>|}</li></ol> <span id="appendix"></span> = '''Appendix''' = <span id="user-manual-update-history"></span>== User manual update history == {| class="wikitable" style="width:800px;text-align: center;"|-| '''Version'''| '''Date'''| '''Release Notes'''|-| v1.0| 2023-09-14| initial version|} <span id="image-update-history"></span>== Image update history == {| class="wikitable" style="width:800px;"|-| style="text-align: center;"| '''Date''' | style="text-align: center;"| '''Release Notes'''|-| 202 3style="text-align: center;"| 2023-09-14| orangepizero2w_1.0.0_debian_bullseye_server_linux5.4.125.7z orangepizero2w_1.0.0_ubuntu_focal_server_linux5.4.125.7z orangepizero2w_1.0.0_ubuntu_focal_desktop_xfce_linux5.4.125.7z orangepizero2w_1.0.0_debian_bullseye_desktop_xfce_linux5.4.125.7z  orangepizero2w_1.0.0_ubuntu_jammy_server_linux6.1.31.7z orangepizero2w_1.0.0_debian_bookworm_server_linux6.1.31.7z orangepizero2w_1.0.0_debian_bullseye_server_linux6.1.31.7z orangepizero2w_1.0.0_ubuntu_jammy_desktop_xfce_linux6.1.31.7z orangepizero2w_1.0.0_debian_bookworm_desktop_xfce_linux6.1.31.7z orangepizero2w_1.0.0_debian_bullseye_desktop_xfce_linux6.1.31.7z  OrangePi_Zero2w_Android12_v1.0.tar.gz 
Opios-arch-aarch64-xfce-opizero2w-23.09-linux6.1.31.img.xz