Difference between revisions of "Orange Pi Zero 2W"

From Wiki-Orange Pi
Jump to: navigation, search
(Appendix)
(Download orangepi-build from github)
 
(202 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Basic features of Orange Pi Zero 2w =
+
= '''Basic features of Orange Pi Zero 2w''' =
  
 
<span id="what-is-orange-pi-zero-2w"></span>
 
<span id="what-is-orange-pi-zero-2w"></span>
Line 16: Line 16:
 
* Android TV TV box
 
* Android TV TV box
  
'''Of course, there are more functions. Relying on a powerful ecosystem and a variety of expansion accessories, Orange Pi can help users easily achieve delivery from ideas to prototypes to mass production. It is an ideal choice for makers, dreamers, and hobbyists. An ideal creative platform for readers.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''Of course, there are more functions. Relying on a powerful ecosystem and a variety of expansion accessories, Orange Pi can help users easily achieve delivery from ideas to prototypes to mass production. It is an ideal choice for makers, dreamers, and hobbyists. An ideal creative platform for readers.'''</big>
 +
|}
  
 
<span id="who-is-orange-pi-zero-2w-designed-for"></span>
 
<span id="who-is-orange-pi-zero-2w-designed-for"></span>
 +
 
== Who is Orange Pi Zero 2w designed for? ==
 
== Who is Orange Pi Zero 2w designed for? ==
  
Line 26: Line 31:
 
== Hardware features of Orange Pi Zero 2w ==
 
== Hardware features of Orange Pi Zero 2w ==
  
{| class="wikitable"
+
{| class="wikitable" style="width:800px;text-align: center;"
 
|-
 
|-
| '''Introduction to hardware features'''
+
| colspan=2|
|
+
<div style="text-align:center"><big>'''Introduction to hardware features'''</big></div>
 
|-
 
|-
| CPU
+
| style="width:150px;" | CPU
| Allwinner H618 quad-core 64-bit 1.5GHz high-performance Cortex-A53 processor
+
|  
 +
Allwinner H618 quad-core 64-bit 1.5GHz high-performance Cortex-A53 processor
 
|-
 
|-
 
| GPU
 
| GPU
| Mali G31 MP2
+
|  
 +
Mali G31 MP2
  
 
Supports OpenGL ES 1.0/2.0/3.2、OpenCL 2.0
 
Supports OpenGL ES 1.0/2.0/3.2、OpenCL 2.0
Line 41: Line 48:
 
|-
 
|-
 
| Memory
 
| Memory
| 1GB/1.5GB/2GB/4GB LPDDR4 (shared with GPU)
+
|  
 +
1GB/1.5GB/2GB/4GB LPDDR4 (shared with GPU)
 
|-
 
|-
 
| Onboard storage
 
| Onboard storage
| TF card slot, 16MB SPI Flash
+
|  
 +
TF card slot, 16MB SPI Flash
 
|-
 
|-
 
| WIFI+BT
 
| WIFI+BT
| • 20U5622 chip, supports IEEE 802.11 a/b/g/n/ac, BT5.0
+
|  
 +
• 20U5622 chip, supports IEEE 802.11 a/b/g/n/ac, BT5.0
 
|-
 
|-
 
| Video Output
 
| Video Output
| • Mini HDMI 2.0 interface
+
|  
 +
• Mini HDMI 2.0 interface
 
|-
 
|-
 
| Audio Output
 
| Audio Output
| • Mini HDMI output
+
|  
 +
• Mini HDMI output
 
|-
 
|-
 
| Power Supply
 
| Power Supply
| Type-C 5V/2A
+
|  
 +
Type-C 5V/2A
 
|-
 
|-
 
| USB 2.0 port
 
| USB 2.0 port
| Type-C USB2.0 x 2
+
|  
 +
Type-C USB2.0 x 2
 
|-
 
|-
 
| 40pinexpansion interface
 
| 40pinexpansion interface
| Used to expand GPIO, UART, I2C, SPI, PWM
+
|  
 +
Used to expand GPIO, UART, I2C, SPI, PWM
 
|-
 
|-
 
| 24pinexpansion interface
 
| 24pinexpansion interface
| Used to expand USB2.0 x 2, 100M Ethernet, infrared reception, audio output, TV-OUT output, power on/off button, LRADC button x 2
+
|  
 +
Used to expand USB2.0 x 2, 100M Ethernet, infrared reception, audio output, TV-OUT output, power on/off button, LRADC button x 2
 
|-
 
|-
 
| LED Light
 
| LED Light
| Power light and status light
+
|  
 +
Power light and status light
 
|-
 
|-
 
| Supported OS
 
| Supported OS
| Android 12 TV, Debi an11, Debian12, Ubuntu22.04, Ubuntu20.04, Orange Pi OS(Arch)etc.
+
|  
 +
Android 12 TV, Debi an11, Debian12, Ubuntu22.04, Ubuntu20.04, Orange Pi OS(Arch)etc.
 
|-
 
|-
| '''Appearance specifications introduction'''
+
| colspan=2|
|
+
<div style="text-align:center"><big>'''Appearance specifications introduction'''</big></div>
 
|-
 
|-
 
| PCB Size
 
| PCB Size
| 30mm x 65mm x 1.2mm
+
|  
 +
30mm x 65mm x 1.2mm
 
|-
 
|-
 
| Weight
 
| Weight
| 12.5g
+
|  
 +
12.5g
 
|}
 
|}
  
 
<span id="top-view-and-bottom-view-of-orange-pi-zero-2w"></span>
 
<span id="top-view-and-bottom-view-of-orange-pi-zero-2w"></span>
 +
 
== Top view and bottom view of Orange Pi Zero 2w ==
 
== Top view and bottom view of Orange Pi Zero 2w ==
  
Top view''': '''
+
<big>'''Top view: '''</big>
  
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image3.png]]
+
[[File:zero2w-img3.png|800px]]
  
 
</div>
 
</div>
Bottom view''': '''
+
<big>'''Bottom view: '''</big>
  
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image4.png]]
+
[[File:zero2w-img4.png|800px]]
  
 
</div>
 
</div>
 
<span id="orange-pi-zero-2w-interface-details"></span>
 
<span id="orange-pi-zero-2w-interface-details"></span>
 +
 
== Orange Pi Zero 2w interface details ==
 
== Orange Pi Zero 2w interface details ==
  
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image5.png]]
+
[[File:zero2w-img5.png|800px]]
  
 
</div>
 
</div>
 
<span id="orange-pi-zero-2w-24pin-expansion-board-interface-details"></span>
 
<span id="orange-pi-zero-2w-24pin-expansion-board-interface-details"></span>
 +
 
== Orange Pi Zero 2w 24pin expansion board interface details ==
 
== Orange Pi Zero 2w 24pin expansion board interface details ==
  
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image6.png]]
+
[[File:zero2w-img6.png|800px]]
  
 
</div>
 
</div>
[[File:media/image7.png]]
+
[[File:zero2w-img7.png|800px]]
  
'''The diameters of the four positioning holes are all 3.0mm.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''The diameters of the four positioning holes are all 3.0mm.'''</big>
 +
|}
  
 
<span id="introduction-to-the-use-of-development-boards"></span>
 
<span id="introduction-to-the-use-of-development-boards"></span>
 +
 
= '''Introduction to the use of development boards''' =
 
= '''Introduction to the use of development boards''' =
  
Line 128: Line 156:
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>TF card, high-speed SanDisk card with minimum capacity of 8GB, class 10 or above</p>
 
<li><p>TF card, high-speed SanDisk card with minimum capacity of 8GB, class 10 or above</p>
<p>[[File:media/image8.png]]</p>
+
<p>[[File:zero2w-img8.png]]</p>
<p>'''When using other brands of TF cards (non-SanDisk TF cards), as shown in the picture below (including but not limited to these cards), some friends have reported that problems will occur during system startup, such as the system getting stuck halfway through startup. Or the reboot command cannot be used normally, and it was finally solved after replacing the SanDisk TF card. Therefore, if you are using a non-SanDisk TF card and find problems with system startup or use, please replace it with a SanDisk TF card and then test again.'''</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
<p>[[File:media/image9.png]][[File:media/image10.png]][[File:media/image11.png]][[File:media/image12.png]]</p>
+
|-
<p>'''There are currently reports that some TF cards have problems booting on Orange Pi Zero 2w.'''</p>
+
|
<p>'''In addition, TF cards that can be used normally on other types of development boards are not guaranteed to be able to start normally on Orange Pi Zero 2w. Please pay special attention to this point.'''</p></li>
+
<big><p>'''When using other brands of TF cards (non-SanDisk TF cards), as shown in the picture below (including but not limited to these cards), some friends have reported that problems will occur during system startup, such as the system getting stuck halfway through startup. Or the reboot command cannot be used normally, and it was finally solved after replacing the SanDisk TF card. Therefore, if you are using a non-SanDisk TF card and find problems with system startup or use, please replace it with a SanDisk TF card and then test again.'''</p></big>
 +
<p>[[File:zero2w-img9.png]][[File:zero2w-img10.png]][[File:zero2w-img11.png]][[File:zero2w-img12.png]]</p>
 +
<p style="text-align: center;">'''There are currently reports that some TF cards have problems booting on Orange Pi Zero 2w.'''</p>
 +
<big><p>'''In addition, TF cards that can be used normally on other types of development boards are not guaranteed to be able to start normally on Orange Pi Zero 2w. Please pay special attention to this point.'''</p></big>
 +
|}
 +
</li>
 
<li><p>TF card reader, used to read and write TF cards</p>
 
<li><p>TF card reader, used to read and write TF cards</p>
<p>[[File:media/image13.png]]</p></li>
+
<p>[[File:zero2w-img13.png]]</p></li>
<li><p>Mini HDMI to HDMI cable, used to connect the development board to an HDMI monitor or TV for display</p></li></ol>
+
<li><p>Mini HDMI to HDMI cable, used to connect the development board to an HDMI monitor or TV for display</p></li>
  
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image14.png]]
+
[[File:zero2w-img14.png]]
  
</div>
+
</div></ol>
 
<ol start="4" style="list-style-type: decimal;">
 
<ol start="4" style="list-style-type: decimal;">
 
<li><p>Power supply. If you have a 5V/2A or 5V/3A power supply, you only need to prepare a USB to Type C interface data cable as shown in the picture on the left below. You can also use a cable similar to the picture on the right below. 5V/2A or 5V/3A high-quality USB Type C interface power adapter integrated with the power head.</p>
 
<li><p>Power supply. If you have a 5V/2A or 5V/3A power supply, you only need to prepare a USB to Type C interface data cable as shown in the picture on the left below. You can also use a cable similar to the picture on the right below. 5V/2A or 5V/3A high-quality USB Type C interface power adapter integrated with the power head.</p>
<p>[[File:media/image15.png]] [[File:media/image16.png]]</p>
+
<p>[[File:zero2w-img15.png]] [[File:zero2w-img16.png]]</p>
<p>'''Both Type-C interfaces on the development board can be used for power supply.'''</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''Both Type-C interfaces on the development board can be used for power supply.'''</p></big>
 +
 
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image17.png|252x143px|003]]
+
[[File:zero2w-img17.png]]
  
</div></li>
+
</div>
 +
|}
 +
</li>
 
<li><p>24pin expansion board</p>
 
<li><p>24pin expansion board</p>
<p>[[File:media/image18.png|211x110px]]</p></li>
+
<p>[[File:zero2w-img18.png]]</p></li>
 
<li><p>USB interface mouse and keyboard, as long as it is a standard USB interface mouse and keyboard, the mouse and keyboard can be used to control the Orange Pi development board</p></li>
 
<li><p>USB interface mouse and keyboard, as long as it is a standard USB interface mouse and keyboard, the mouse and keyboard can be used to control the Orange Pi development board</p></li>
 
<li><p>Infrared remote control, mainly used to control Android TV system</p>
 
<li><p>Infrared remote control, mainly used to control Android TV system</p>
<p>[[File:media/image19.png|170x173px]]</p>
+
<p>[[File:zero2w-img19.png]]</p>
<p>'''Note that the remote control of the air conditioner or the TV cannot control the Orange Pi development board. By default, only the remote control provided by Orange Pi can.'''</p></li>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''Note that the remote control of the air conditioner or the TV cannot control the Orange Pi development board. By default, only the remote control provided by Orange Pi can.'''</p></big>
 +
|}
 +
</li>
 
<li><p>Network cable to connect the development board to the Internet</p></li>
 
<li><p>Network cable to connect the development board to the Internet</p></li>
 
<li><p>AV video cable. If you want to display video through the TV-OUT interface instead of the HDMI interface, you need to connect the development board to the TV through the AV video cable.</p>
 
<li><p>AV video cable. If you want to display video through the TV-OUT interface instead of the HDMI interface, you need to connect the development board to the TV through the AV video cable.</p>
<p>[[File:media/image20.png|217x218px]]</p></li>
+
<p>[[File:zero2w-img20.png]]</p></li>
 
<li><p>Heat sink. If you are worried that the temperature of the development board is too high, you can add some heat sinks and stick the heat sinks on the H618 chip and memory chip.</p>
 
<li><p>Heat sink. If you are worried that the temperature of the development board is too high, you can add some heat sinks and stick the heat sinks on the H618 chip and memory chip.</p>
<p>[[File:media/image21.png|162x133px]] [[File:media/image22.png|287x143px]]</p></li>
+
<p>[[File:zero2w-img21.png]] [[File:zero2w-img22.png]]</p></li>
 
<li><p>5V cooling fan, as shown in the figure below. There are 5V and GND pins on the 40pin interface of the development board that can be connected to the cooling fan. The spacing of the 40pin pins is 2.54mm. The power interface of the cooling fan can be purchased according to this specification.</p>
 
<li><p>5V cooling fan, as shown in the figure below. There are 5V and GND pins on the 40pin interface of the development board that can be connected to the cooling fan. The spacing of the 40pin pins is 2.54mm. The power interface of the cooling fan can be purchased according to this specification.</p>
<p>[[File:media/image23.png|263x142px]]</p>
+
<p>[[File:zero2w-img23.png]]</p>
<p>'''Note that the 5V pin can be used directly after the development board is plugged in and no other settings are required. In addition, the voltage output by the 5V pin cannot be adjusted or turned off through software.'''</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
<p>'''The pin headers on the 40pin interface are not soldered by default, and you need to solder them yourself before you can use them.'''</p></li>
+
|-
 +
|
 +
<big><p>'''Note that the 5V pin can be used directly after the development board is plugged in and no other settings are required. In addition, the voltage output by the 5V pin cannot be adjusted or turned off through software.'''</p>
 +
<p>'''The pin headers on the 40pin interface are not soldered by default, and you need to solder them yourself before you can use them.'''</p></big>
 +
|}
 +
</li>
 
<li><p>Type-C to USB cable for connecting USB devices</p>
 
<li><p>Type-C to USB cable for connecting USB devices</p>
<p>[[File:media/image24.png|193x127px]]</p></li>
+
<p>[[File:zero2w-img24.png]]</p></li>
 
<li><p>USB to TTL module and Dupont cable. When using the serial port debugging function, a USB to TTL module and Dupont cable are needed to connect the development board and the computer.</p>
 
<li><p>USB to TTL module and Dupont cable. When using the serial port debugging function, a USB to TTL module and Dupont cable are needed to connect the development board and the computer.</p>
<p>[[File:media/image25.png|176x118px]] [[File:media/image26.png|305x110px]]</p>
+
<p>[[File:zero2w-img25.png]] [[File:zero2w-img26.png]]</p>
<p>'''Note that the TTL level used by the development board is 3.3v. In addition to the USB to TTL module shown in the picture above, other similar 3.3v USB to TTL modules are generally available.'''</p></li>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
<li><p>X64 computer with Ubuntu and Windows operating systems installed</p></li></ol>
+
|-
 +
|
 +
<big><p>'''Note that the TTL level used by the development board is 3.3v. In addition to the USB to TTL module shown in the picture above, other similar 3.3v USB to TTL modules are generally available.'''</p></big>
 +
|}
 +
</li>
 +
<li><p>X64 computer with Ubuntu and Windows operating systems installed</p></li>
  
{| class="wikitable"
+
{| class="wikitable" style="width:800px;text-align: center;"
 
|-
 
|-
 
| 1
 
| 1
Line 183: Line 237:
 
| For burning Android and Linux images
 
| For burning Android and Linux images
 
|}
 
|}
 +
</ol>
 +
<span id="download-the-development-board-image-and-related-information"></span>
  
<span id="download-the-development-board-image-and-related-information"></span>
 
 
== Download the development board image and related information ==
 
== Download the development board image and related information ==
  
 
# The download URL for the Chinese version of the information is
 
# The download URL for the Chinese version of the information is
  
[http://www.orangepi.cn/downloadresourcescn/ '''http://www.orangepi.cn/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero-2W.html''']
+
::{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
[http://www.orangepi.cn/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero-2W.html '''http://www.orangepi.cn/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero-2W.html''']
 +
|}
  
 
<ol start="2" style="list-style-type: decimal;">
 
<ol start="2" style="list-style-type: decimal;">
 
<li><p>The download URL for the English version of the information is</p>
 
<li><p>The download URL for the English version of the information is</p>
<p>[http://www.orangepi.org/downloadresources/ '''http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero-2W.html''']</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>[http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero-2W.html '''http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero-2W.html''']</p>
 +
|}
 +
</li>
 
<li><p>The information mainly includes</p>
 
<li><p>The information mainly includes</p>
<p>a.'''Android source code''': saved on Google Cloud Drive</p>
+
:<p>a. '''Android source code''': saved on Google Cloud Drive</p>
<p>b.'''Linux source code''': saved on Github</p>
+
:<p>b. '''Linux source code''': saved on Github</p>
<p>c.'''Android image''': saved on Google Cloud Drive</p>
+
:<p>c. '''Android image''': saved on Google Cloud Drive</p>
<p>d.'''Ubuntu image''': saved on Google Cloud Drive</p>
+
:<p>d. '''Ubuntu image''': saved on Google Cloud Drive</p>
<p>e.'''Debian image''': saved on Google Cloud Drive</p>
+
:<p>e. '''Debian image''': saved on Google Cloud Drive</p>
<p>f.'''Orange Pi OS (Arch) image''': saved on Google Cloud Drive</p>
+
:<p>f. '''Orange Pi OS (Arch) image''': saved on Google Cloud Drive</p>
<p>g. '''User manual and schematic diagram''': chip-related data manuals will also be placed here</p>
+
:<p>g. '''User manual and schematic diagram''': chip-related data manuals will also be placed here</p>
<p>h.'''Official tools''': mainly include software needed when using the development board</p></li></ol>
+
:<p>h. '''Official tools''': mainly include software needed when using the development board</p></li></ol>
  
 
<span id="method-of-burning-linux-image-to-tf-card-based-on-windows-pc"></span>
 
<span id="method-of-burning-linux-image-to-tf-card-based-on-windows-pc"></span>
 +
 
== Method of burning Linux image to TF card based on Windows PC ==
 
== Method of burning Linux image to TF card based on Windows PC ==
  
'''Note that the Linux image mentioned here specifically refers to the Linux distribution image such as Debian or Ubuntu downloaded from the Orange Pi information download page.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''Note that the Linux image mentioned here specifically refers to the Linux distribution image such as Debian or Ubuntu downloaded from the Orange Pi information download page.'''</big>
 +
|}
  
 
<span id="how-to-burn-linux-image-using-balenaetcher"></span>
 
<span id="how-to-burn-linux-image-using-balenaetcher"></span>
=== '''How to burn Linux image using balenaEtcher''' ===
+
=== How to burn Linux image using balenaEtcher ===
  
 
# First prepare a TF card with 8GB or larger capacity. The transmission speed of the TF card must be class10 or above. It is recommended to use TF cards from SanDisk and other brands.
 
# First prepare a TF card with 8GB or larger capacity. The transmission speed of the TF card must be class10 or above. It is recommended to use TF cards from SanDisk and other brands.
 
# Then use the card reader to insert the TF card into the computer
 
# Then use the card reader to insert the TF card into the computer
# Download the compressed package of the Linux operating system image file you want to burn from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi information download page'''], and then use the decompression software to decompress it. In the decompressed file, the file ending with &quot;.img&quot; is the image file of the operating system. The size is generally above 1GB
+
# Download the compressed package of the Linux operating system image file you want to burn from the [http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero-2W.html '''Orange Pi information download page'''], and then use the decompression software to decompress it. In the decompressed file, the file ending with &quot;.img&quot; is the image file of the operating system. The size is generally above 1GB
 
# Then download the Linux image burning software-'''balenaEtcher''', the download address is
 
# Then download the Linux image burning software-'''balenaEtcher''', the download address is
  
 +
::{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
[https://www.balena.io/etcher/ '''https://www.balena.io/etcher/''']
 
[https://www.balena.io/etcher/ '''https://www.balena.io/etcher/''']
 +
|}
  
 
<ol start="5" style="list-style-type: decimal;">
 
<ol start="5" style="list-style-type: decimal;">
 
<li><p>After entering the balenaEtcher download page, click the green download button to jump to the software download location.</p>
 
<li><p>After entering the balenaEtcher download page, click the green download button to jump to the software download location.</p>
<p>[[File:media/image27.png|456x219px]]</p></li>
+
<p>[[File:zero2w-img27.png]]</p></li>
 
<li><p>Then you can choose to download the Portable version of balenaEtcher software. The Portable version does not need to be installed. You can use it by double-clicking to open it.</p>
 
<li><p>Then you can choose to download the Portable version of balenaEtcher software. The Portable version does not need to be installed. You can use it by double-clicking to open it.</p>
<p>[[File:media/image28.png|468x173px]]</p></li>
+
<p>[[File:zero2w-img28.png]]</p></li>
 
<li><p>If you downloaded the version of balenaEtcher that needs to be installed, please install it first and then use it. If you downloaded the Portable version of balenaEtcher, just double-click to open it. The balenaEtcher interface after opening is as shown below.</p>
 
<li><p>If you downloaded the version of balenaEtcher that needs to be installed, please install it first and then use it. If you downloaded the Portable version of balenaEtcher, just double-click to open it. The balenaEtcher interface after opening is as shown below.</p>
<p>[[File:media/image29.png|335x211px]]</p></li></ol>
+
<p>[[File:zero2w-img29.png]]</p></li>
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''If the following error is prompted when opening balenaEtcher:'''</big>
  
'''If the following error is prompted when opening balenaEtcher:'''
+
[[File:zero2w-img30.png|center]]
  
[[File:media/image30.png|206x162px]]
+
<big>'''Please select balenaEtcher, right-click, and select Run as administrator.'''</big>
 
 
'''Please select balenaEtcher, right-click, and select Run as administrator.'''
 
 
 
[[File:media/image31.png|114x37px]]
 
  
 +
[[File:zero2w-img31.png|center]]
 +
|}
 +
</ol>
 
<ol start="8" style="list-style-type: decimal;">
 
<ol start="8" style="list-style-type: decimal;">
 
<li><p>The specific steps to use balenaEtcher to burn a Linux image are as follows</p>
 
<li><p>The specific steps to use balenaEtcher to burn a Linux image are as follows</p>
<p>a. First select the path of the Linux image file to be burned.</p>
+
:<p>a. First select the path of the Linux image file to be burned.</p>
<p>b. Then select the drive letter of the TF card</p>
+
:<p>b. Then select the drive letter of the TF card</p>
<p>c. Finally click Flash and it will start burning the Linux image to the TF card.</p>
+
:<p>c. Finally click Flash and it will start burning the Linux image to the TF card.</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image32.png|501x281px|03]]
+
:[[File:zero2w-img32.png]]
  
 
</div></li>
 
</div></li>
 
<li><p>The interface displayed during the process of burning the Linux image by balenaEtcher is as shown in the figure below. In addition, the progress bar displays purple to indicate that the Linux image is being burned into the TF card.</p>
 
<li><p>The interface displayed during the process of burning the Linux image by balenaEtcher is as shown in the figure below. In addition, the progress bar displays purple to indicate that the Linux image is being burned into the TF card.</p>
<p>[[File:media/image33.png|506x317px]]</p></li>
+
<p>[[File:zero2w-img33.png]]</p></li>
 
<li><p>After the Linux image is burned, balenaEtcher will also verify the image burned into the TF card by default to ensure that there are no problems during the burning process. As shown in the figure below, a green progress bar indicates that the image has been burned, and balenaEtcher is verifying the burned image.</p>
 
<li><p>After the Linux image is burned, balenaEtcher will also verify the image burned into the TF card by default to ensure that there are no problems during the burning process. As shown in the figure below, a green progress bar indicates that the image has been burned, and balenaEtcher is verifying the burned image.</p>
<p>[[File:media/image34.png|519x325px]]</p></li>
+
<p>[[File:zero2w-img34.png]]</p></li>
 
<li><p>After successful burning, the display interface of balenaEtcher is as shown below. If the green indicator icon is displayed, it means that the image burning is successful. At this time, you can exit balenaEtcher, then pull out the TF card and insert it into the TF card slot of the development board for use.</p>
 
<li><p>After successful burning, the display interface of balenaEtcher is as shown below. If the green indicator icon is displayed, it means that the image burning is successful. At this time, you can exit balenaEtcher, then pull out the TF card and insert it into the TF card slot of the development board for use.</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image35.png|523x324px|04]]
+
[[File:zero2w-img35.png]]
  
 
</div></li></ol>
 
</div></li></ol>
  
 
<span id="how-to-burn-linux-image-using-win32diskimager"></span>
 
<span id="how-to-burn-linux-image-using-win32diskimager"></span>
=== '''How to burn Linux image using Win32Diskimager''' ===
+
 
 +
=== How to burn Linux image using Win32Diskimager ===
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
Line 264: Line 341:
 
<li><p>Then format the TF card</p>
 
<li><p>Then format the TF card</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li>You can use the '''SD Card Formatter''' software to format the TF card. Its download address is:</li></ol>
+
<li>You can use the '''SD Card Formatter''' software to format the TF card. Its download address is:</li>
</li></ol>
+
{| class="wikitable" style="width:800px;"
 
+
|-
 +
|
 
[https://www.sdcard.org/downloads/formatter/eula_windows/SDCardFormatterv5_WinEN.zip '''https://www.sdcard.org/downloads/formatter/eula_windows/SDCardFormatterv5_WinEN.zip''']
 
[https://www.sdcard.org/downloads/formatter/eula_windows/SDCardFormatterv5_WinEN.zip '''https://www.sdcard.org/downloads/formatter/eula_windows/SDCardFormatterv5_WinEN.zip''']
 
+
|}
 +
</ol>
 
<ol start="2" style="list-style-type: lower-alpha;">
 
<ol start="2" style="list-style-type: lower-alpha;">
 
<li><p>After downloading, just unzip and install it, and then open the software.</p></li>
 
<li><p>After downloading, just unzip and install it, and then open the software.</p></li>
Line 274: Line 353:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image36.png|209x228px|选区_199]]
+
[[File:zero2w-img36.png]]
  
 
</div></li>
 
</div></li>
<li><p>Then click &quot;'''Format'''&quot;. A warning box will pop up before formatting. After selecting &quot;'''Yes (Y)'''&quot;, formatting will begin.</p></li></ol>
+
<li><p>Then click &quot;'''Format'''&quot;. A warning box will pop up before formatting. After selecting &quot;'''Yes (Y)'''&quot;, formatting will begin.</p></li>
 
 
[[File:media/image37.png|304x147px]]
 
  
 +
[[File:zero2w-img37.png]]
 +
</ol>
 
<ol start="5" style="list-style-type: lower-alpha;">
 
<ol start="5" style="list-style-type: lower-alpha;">
 
<li><p>After formatting the TF card, the information shown in the picture below will pop up, click OK.</p>
 
<li><p>After formatting the TF card, the information shown in the picture below will pop up, click OK.</p>
<p>[[File:media/image38.png|186x149px]]</p></li></ol>
+
<p>[[File:zero2w-img38.png]]</p></li></ol>
 
+
</li></ol>
<!-- -->
 
 
<ol start="4" style="list-style-type: decimal;">
 
<ol start="4" style="list-style-type: decimal;">
<li><p>Download the compressed package of the Linux operating system image file you want to burn from the '''Orange Pi information download page''', and then use the decompression software to decompress it. In the decompressed file, the file ending with &quot;.img&quot; is the image file of the operating system. The size is generally above 1GB</p></li>
+
<li><p>Download the compressed package of the Linux operating system image file you want to burn from the [http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero-2W.html '''Orange Pi information download page'''], and then use the decompression software to decompress it. In the decompressed file, the file ending with &quot;.img&quot; is the image file of the operating system. The size is generally above 1GB</p></li>
 
<li><p>Use '''Win32Diskimager''' to burn the Linux image to the TF card</p>
 
<li><p>Use '''Win32Diskimager''' to burn the Linux image to the TF card</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li>The download page of Win32Diskimager is</li></ol>
+
<li>The download page of Win32Diskimager is</li>
</li></ol>
+
{| class="wikitable" style="width:800px;"
 
+
|-
 +
|
 
[http://sourceforge.net/projects/win32diskimager/files/Archive/ '''http://sourceforge.net/projects/win32diskimager/files/Archive/''']
 
[http://sourceforge.net/projects/win32diskimager/files/Archive/ '''http://sourceforge.net/projects/win32diskimager/files/Archive/''']
 
+
|}
 +
</ol>
 
<ol start="2" style="list-style-type: lower-alpha;">
 
<ol start="2" style="list-style-type: lower-alpha;">
 
<li><p>After downloading, you can install it directly. The Win32Diskimager interface is as follows</p>
 
<li><p>After downloading, you can install it directly. The Win32Diskimager interface is as follows</p>
Line 302: Line 382:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image39.png|297x206px|C:\Users\orangepi\Desktop\用户手册插图\Pi5 Plus\a8fda8737c5b0b3b38fbb75ef68acfc.pnga8fda8737c5b0b3b38fbb75ef68acfc]]
+
[[File:zero2w-img39.png]]
  
 
</div></li>
 
</div></li>
 
<li><p>After the image writing is completed, click the &quot;'''Exit'''&quot; button to exit. Then you can pull out the TF card and insert it into the development board to start.</p></li></ol>
 
<li><p>After the image writing is completed, click the &quot;'''Exit'''&quot; button to exit. Then you can pull out the TF card and insert it into the development board to start.</p></li></ol>
 +
</li></ol>
 +
<span id="method-to-burn-linux-image-to-tf-card-based-on-ubuntu-pc"></span>
  
<span id="method-to-burn-linux-image-to-tf-card-based-on-ubuntu-pc"></span>
 
 
== Method to burn Linux image to TF card based on Ubuntu PC ==
 
== Method to burn Linux image to TF card based on Ubuntu PC ==
  
'''Note that the Linux image mentioned here specifically refers to the Linux distribution image such as Debian or Ubuntu downloaded from the Orange Pi information download page. Ubuntu PC refers to the personal computer with the Ubuntu system installed.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''Note that the Linux image mentioned here specifically refers to the Linux distribution image such as Debian or Ubuntu downloaded from the Orange Pi information download page. Ubuntu PC refers to the personal computer with the Ubuntu system installed.'''</big>
 +
|}
  
 
# First prepare a TF card with 8GB or larger capacity. The transmission speed of the TF card must be class10 or above. It is recommended to use TF cards from SanDisk and other brands.
 
# First prepare a TF card with 8GB or larger capacity. The transmission speed of the TF card must be class10 or above. It is recommended to use TF cards from SanDisk and other brands.
Line 316: Line 401:
 
# Download the balenaEtcher software, the download address is
 
# Download the balenaEtcher software, the download address is
  
 +
::{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
[https://www.balena.io/etcher/ '''https://www.balena.io/etcher/''']
 
[https://www.balena.io/etcher/ '''https://www.balena.io/etcher/''']
 +
|}
  
 
<ol start="4" style="list-style-type: decimal;">
 
<ol start="4" style="list-style-type: decimal;">
 
<li><p>After entering the balenaEtcher download page, click the green download button to jump to the software download place.</p>
 
<li><p>After entering the balenaEtcher download page, click the green download button to jump to the software download place.</p>
<p>[[File:media/image27.png|489x235px]]</p></li>
+
<p>[[File:zero2w-img27.png]]</p></li>
 
<li><p>Then choose to download the Linux version of the software</p>
 
<li><p>Then choose to download the Linux version of the software</p>
<p>[[File:media/image40.png|485x184px]]</p></li>
+
<p>[[File:zero2w-img40.png]]</p></li>
<li><p>Download the compressed package of the Linux operating system image file you want to burn from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi information download page'''], and then use the decompression software to decompress it. In the decompressed file, the file ending with &quot;.img&quot; is the image file of the operating system. The size is generally above 1GB. The decompression command for the compressed package ending in 7z is as follows:</p>
+
<li><p>Download the compressed package of the Linux operating system image file you want to burn from the [http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero-2W.html '''Orange Pi information download page'''], and then use the decompression software to decompress it. In the decompressed file, the file ending with &quot;.img&quot; is the image file of the operating system. The size is generally above 1GB. The decompression command for the compressed package ending in 7z is as follows:</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>test@test:~$ '''7z x orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.7z'''</p>
 
<p>test@test:~$ '''7z x orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.7z'''</p>
 
<p>test@test:~$ '''ls orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.*'''</p>
 
<p>test@test:~$ '''ls orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.*'''</p>
<p>orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.7z '''orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.sha''' #Checksum file</p>
+
<p>orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.7z </p>
<p>'''orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.img''' #Image file</p></li>
+
<p>'''orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.sha''' #Checksum file</p>
 +
<p>'''orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.img''' #Image file</p>
 +
|}
 +
</li>
 
<li><p>After decompressing the image, you can first use the '''sha256sum -c *.sha''' command to calculate whether the checksum is '''correct'''. If it prompts that it is successful, it means that the downloaded image is correct, and you can burn it to the TF card with confidence. If it prompts that the '''checksum does not match''', it means There is a problem with the downloaded image, please try downloading again</p>
 
<li><p>After decompressing the image, you can first use the '''sha256sum -c *.sha''' command to calculate whether the checksum is '''correct'''. If it prompts that it is successful, it means that the downloaded image is correct, and you can burn it to the TF card with confidence. If it prompts that the '''checksum does not match''', it means There is a problem with the downloaded image, please try downloading again</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>test@test:~$ '''sha256sum -c *.sha'''</p>
 
<p>test@test:~$ '''sha256sum -c *.sha'''</p>
<p>orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.img: '''successful'''</p></li>
+
<p>orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.img: '''successful'''</p>
 +
|}
 +
</li>
 
<li><p>Then double-click '''balenaEtcher-1.14.3-x64.AppImage''' on the graphical interface of Ubuntu PC to open balenaEtcher '''(no installation required)'''. The interface after balenaEtcher is opened is as shown below</p>
 
<li><p>Then double-click '''balenaEtcher-1.14.3-x64.AppImage''' on the graphical interface of Ubuntu PC to open balenaEtcher '''(no installation required)'''. The interface after balenaEtcher is opened is as shown below</p>
<p>[[File:media/image41.png|423x251px]]</p></li>
+
<p>[[File:zero2w-img41.png]]</p></li>
 
<li><p>The specific steps to use balenaEtcher to burn a Linux image are as follows</p>
 
<li><p>The specific steps to use balenaEtcher to burn a Linux image are as follows</p>
 
<p>a. First select the path of the Linux image file to be burned.</p>
 
<p>a. First select the path of the Linux image file to be burned.</p>
Line 339: Line 439:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image32.png|501x281px|03]]
+
[[File:zero2w-img32.png]]
  
 
</div></li>
 
</div></li>
 
<li><p>The interface displayed during the process of burning the Linux image by balenaEtcher is as shown in the figure below. In addition, the progress bar displays purple to indicate that the Linux image is being burned into the TF card.</p>
 
<li><p>The interface displayed during the process of burning the Linux image by balenaEtcher is as shown in the figure below. In addition, the progress bar displays purple to indicate that the Linux image is being burned into the TF card.</p>
<p>[[File:media/image42.png|576x247px]]</p></li>
+
<p>[[File:zero2w-img42.png]]</p></li>
 
<li><p>After the Linux image is burned, balenaEtcher will also verify the image burned into the TF card by default to ensure that there are no problems during the burning process. As shown in the figure below, a green progress bar indicates that the image has been burned, and balenaEtcher is verifying the burned image.</p>
 
<li><p>After the Linux image is burned, balenaEtcher will also verify the image burned into the TF card by default to ensure that there are no problems during the burning process. As shown in the figure below, a green progress bar indicates that the image has been burned, and balenaEtcher is verifying the burned image.</p>
<p>[[File:media/image43.png|576x252px]]</p></li>
+
<p>[[File:zero2w-img43.png]]</p></li>
 
<li><p>After successful burning, the display interface of balenaEtcher is as shown below. If a green indicator icon is displayed, it means that the image burning is successful. At this time, you can exit balenaEtcher, then pull out the TF card and insert it into the TF card slot of the development board for use.</p>
 
<li><p>After successful burning, the display interface of balenaEtcher is as shown below. If a green indicator icon is displayed, it means that the image burning is successful. At this time, you can exit balenaEtcher, then pull out the TF card and insert it into the TF card slot of the development board for use.</p>
<p>[[File:media/image44.png|576x340px]]</p></li></ol>
+
<p>[[File:zero2w-img44.png]]</p></li></ol>
  
 
<span id="method-of-burning-android-image-to-tf-card"></span>
 
<span id="method-of-burning-android-image-to-tf-card"></span>
 +
 
== Method of burning Android image to TF card ==
 
== Method of burning Android image to TF card ==
  
'''The Android image of the development board can only be burned to the TF card using the PhoenixCard software under the Windows platform. The version of the PhoenixCard software must be PhonixCard-4.2.8.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''The Android image of the development board can only be burned to the TF card using the <span style="color:#FF0000">PhoenixCard</span> software under the Windows platform. The version of the PhoenixCard software must be <span style="color:#FF0000">PhonixCard-4.2.8</span>.'''
  
 
'''Please do not use software to burn Linux images, such as Win32Diskimager or balenaEtcher to burn Android images.'''
 
'''Please do not use software to burn Linux images, such as Win32Diskimager or balenaEtcher to burn Android images.'''
  
'''In addition, PhoenixCard software does not have versions for Linux and Mac platforms, so it is impossible to burn Android images to TF cards under Linux and Mac platforms.'''
+
'''In addition, PhoenixCard software does not have versions for Linux and Mac platforms, so it is impossible to burn Android images to TF cards under Linux and Mac platforms.'''</big>
 +
|}
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>First, please make sure that '''Microsoft Visual C++ 2008 Redistrbutable - x86'''</p>
 
<li><p>First, please make sure that '''Microsoft Visual C++ 2008 Redistrbutable - x86'''</p>
 
<p>is installed on your Windows system.</p>
 
<p>is installed on your Windows system.</p>
<p>[[File:media/image45.png|449x293px]]</p></li>
+
<p>[[File:zero2w-img45.png]]</p></li>
<li><p>If '''Microsoft Visual C++ 2008 Redistrbutable - x86''' is not installed</p>
+
<li><p>If '''Microsoft Visual C++ 2008 Redistrbutable - x86''' is not installed, using '''PhoenixCard''' to format the TF card or burn the Android image will prompt the following error</p>
<p>, using '''PhoenixCard''' to format the TF card or burn the Android image will prompt the following error</p>
 
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image46.png|522x395px|NUQB$Q%(){1CV6M6WK4N`5J]]
+
[[File:zero2w-img46.png]]
  
 
</div></li>
 
</div></li>
<li><p>'''Microsoft Visual C++ 2008 Redistrbutable - x86''' installation package can be downloaded from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''official tool'''] of Orange Pi Zero 2w, or you can download it from [https://www.microsoft.com/zh-cn/download/details.aspx?id=26368 '''Microsoft's official website''']</p>
+
<li><p>'''Microsoft Visual C++ 2008 Redistrbutable - x86''' installation package can be downloaded from the [http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero-2W.html '''official tool'''] of Orange Pi Zero 2w, or you can download it from [https://www.microsoft.com/zh-cn/download/details.aspx?id=26368 '''Microsoft's official website''']</p>
<p>[[File:media/image47.png|242x52px]] [[File:media/image48.png|200x95px]]</p></li>
+
<p>[[File:zero2w-img47.png]] [[File:zero2w-img48.png]]</p></li>
 
<li><p>Then prepare a TF card with 8GB or larger capacity. The transmission speed of the TF card must be class10 or above. It is recommended to use TF cards from SanDisk and other brands.</p></li>
 
<li><p>Then prepare a TF card with 8GB or larger capacity. The transmission speed of the TF card must be class10 or above. It is recommended to use TF cards from SanDisk and other brands.</p></li>
 
<li><p>Then use the card reader to insert the TF card into the computer</p></li>
 
<li><p>Then use the card reader to insert the TF card into the computer</p></li>
<li><p>Download the Android image and PhoenixCard burning tool from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi download page''']. Please ensure that the version of the PhonenixCrad tool is '''PhonixCard-4.2.8. Please do not use PhonixCard software with a version lower than 4.2.8 to burn the Android image'''. Low There may be problems with the Android image programmed with this version of PhonixCard tool.</p>
+
<li><p>Download the Android image and PhoenixCard burning tool from the [http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero-2W.html '''Orange Pi download page''']. Please ensure that the version of the PhonenixCrad tool is '''<span style="color:#FF0000">PhonixCard-4.2.8. Please do not use PhonixCard software with a version lower than 4.2.8 to burn the Android image</span>'''. Low There may be problems with the Android image programmed with this version of PhonixCard tool.</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image49.png|575x169px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-6.jpg未标题-6]]
+
[[File:zero2w-img49.png]]
  
 
</div></li>
 
</div></li>
<li><p>Then use decompression software to decompress the compressed package of the downloaded Android image. In the decompressed file, the file ending with &quot;'''.img'''&quot; is the Android image file, with a size of more than 1GB. If you don’t know how to decompress the Android image compressed package, you can install a '''360 compression software''' to decompress the image.</p>
+
<li><p>Then use decompression software to decompress the compressed package of the downloaded Android image. In the decompressed file, the file ending with &quot;'''.img'''&quot; is the Android image file, with a size of more than 1GB. If you don't know how to decompress the Android image compressed package, you can install a '''360 compression software''' to decompress the image.</p>
<p>[[File:media/image50.png|438x158px]]</p></li>
+
<p>[[File:zero2w-img50.png]]</p></li>
 
<li><p>Then use decompression software to decompress '''PhonixCard4.2.8.zip'''. This software does not need to be installed. Just find PhoenixCard in the decompressed folder and open it.</p>
 
<li><p>Then use decompression software to decompress '''PhonixCard4.2.8.zip'''. This software does not need to be installed. Just find PhoenixCard in the decompressed folder and open it.</p>
<p>[[File:media/image51.png|576x113px]]</p></li>
+
<p>[[File:zero2w-img51.png]]</p></li>
<li><p>After opening PhoenixCard, if the TF card is recognized normally, the drive letter and capacity of the TF card will be displayed in the middle list. '''Please make sure that the displayed drive letter is consistent with the drive letter of the TF card you want to burn'''. If If there is no display, you can try to remove the TF card, or click the &quot;'''Refresh Drive Letter'''&quot; button in PhoenixCard.</p></li></ol>
+
<li><p>After opening PhoenixCard, if the TF card is recognized normally, the drive letter and capacity of the TF card will be displayed in the middle list. '''<span style="color:#FF0000">Please make sure that the displayed drive letter is consistent with the drive letter of the TF card you want to burn</span>'''. If If there is no display, you can try to remove the TF card, or click the &quot;'''Refresh Drive Letter'''&quot; button in PhoenixCard.</p></li>
 
 
[[File:media/image52.png|575x137px]]
 
  
 +
[[File:zero2w-img52.png]]
 +
</ol>
 
<ol start="10" style="list-style-type: decimal;">
 
<ol start="10" style="list-style-type: decimal;">
 
<li><p>After confirming the drive letter, format the TF card first and click the &quot;'''Restore Card'''&quot; button in PhoenixCard (if the &quot;'''Restore Card'''&quot; button is gray and cannot be pressed, you can click the &quot;'''Refresh Drive Letter'''&quot; button first)</p>
 
<li><p>After confirming the drive letter, format the TF card first and click the &quot;'''Restore Card'''&quot; button in PhoenixCard (if the &quot;'''Restore Card'''&quot; button is gray and cannot be pressed, you can click the &quot;'''Refresh Drive Letter'''&quot; button first)</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image53.png|575x316px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-1.jpg未标题-1]]
+
[[File:zero2w-img53.png]]
  
 
</div>
 
</div>
<p>'''If there is a problem with formatting, please try to remove the TF card and then test again. If there is still a problem after re-inserting the TF card, you can restart the Windows computer or try another computer.'''</p></li>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''If there is a problem with formatting, please try to remove the TF card and then test again. If there is still a problem after re-inserting the TF card, you can restart the Windows computer or try another computer.'''</p></big>
 +
|}
 +
</li>
 
<li><p>Then start writing the Android image to the TF card</p>
 
<li><p>Then start writing the Android image to the TF card</p>
 
<p>a. First select the path to the Android image in the &quot;'''Firmware'''&quot; column</p>
 
<p>a. First select the path to the Android image in the &quot;'''Firmware'''&quot; column</p>
 
<p>b. Select &quot;'''Start Card'''&quot; in &quot;'''Card Type'''&quot;</p>
 
<p>b. Select &quot;'''Start Card'''&quot; in &quot;'''Card Type'''&quot;</p>
 
<p>c. Then click the &quot;'''Burn Card'''&quot; button to start burning.</p>
 
<p>c. Then click the &quot;'''Burn Card'''&quot; button to start burning.</p>
<p>[[File:media/image54.png|576x431px]]</p></li>
+
<p>[[File:zero2w-img54.png]]</p></li>
 
<li><p>After burning, the display of PhoenixCard is as shown below. At this time, click the &quot;'''Close'''&quot; button to exit PhoenixCard, and then you can pull out the TF card from the computer and insert it into the development board to start.</p>
 
<li><p>After burning, the display of PhoenixCard is as shown below. At this time, click the &quot;'''Close'''&quot; button to exit PhoenixCard, and then you can pull out the TF card from the computer and insert it into the development board to start.</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image55.png|575x358px|1]]
+
[[File:zero2w-img55.png]]
  
 
</div>
 
</div>
<p>'''After burning the Android system, you can only see a 128 MB partition on the TF card in Windows. The displayed partition is as shown below (some computers may pop up more than twenty disk partitions, but they can only open the 128 MB one. partition), please note that this is normal, please do not think that the TF card is burned out. The reason for this is that there are more than twenty partitions in the Android system, but most of them cannot be recognized normally in the Windows system. At this time, please feel free to unplug the TF card and insert it into the development board to start.'''</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
<p>[[File:media/image56.png|193x45px]]</p>
+
|-
<p>'''After the Android system starts, you can use the following command to see the twenty partitions in the TF card:'''</p>
+
|
<p>[[File:media/image57.png|368x131px]]</p>
+
<big><p>'''After burning the Android system, you can only see a 128 MB partition on the TF card in Windows. The displayed partition is as shown below (some computers may pop up more than twenty disk partitions, but they can only open the 128 MB one. partition), please note that this is normal, please do not think that the TF card is burned out. The reason for this is that there are more than twenty partitions in the Android system, but most of them cannot be recognized normally in the Windows system. At this time, please feel free to unplug the TF card and insert it into the development board to start.'''</p></big>
<p>'''Using the df -h command, you can see that after burning the Android system on the 16GB TF card, there is about 11 GB of space available (not all of the more than twenty partitions will be mounted to the Android system, focus on these to see to the partition you want to reach).'''</p>
+
<p>[[File:zero2w-img56.png|center]]</p>
<p>[[File:media/image58.png|391x220px]]</p></li></ol>
+
<big><p>'''After the Android system starts, you can use the following command to see the twenty partitions in the TF card:'''</p></big>
 +
<p>[[File:zero2w-img57.png|center]]</p>
 +
<big><p>'''Using the df -h command, you can see that after burning the Android system on the 16GB TF card, there is about 11 GB of space available (not all of the more than twenty partitions will be mounted to the Android system, focus on these to see to the partition you want to reach).'''</p></big>
 +
<p>[[File:zero2w-img58.png|center]]</p>
 +
|}
 +
</li></ol>
  
 
<span id="instructions-for-using-micro-linux-system-in-onboard-spi-flash"></span>
 
<span id="instructions-for-using-micro-linux-system-in-onboard-spi-flash"></span>
 +
 
== Instructions for using micro-linux system in onboard SPI Flash ==
 
== Instructions for using micro-linux system in onboard SPI Flash ==
  
 
There is a 16MB SPI Flash on the development board, and its location is shown in the figure below:
 
There is a 16MB SPI Flash on the development board, and its location is shown in the figure below:
  
[[File:media/image59.png|284x124px]]
+
[[File:zero2w-img59.png]]
  
 
A micro Linux system is programmed into SPI Flash by default. This system is mainly used to prove that the development board can start normally. After getting the development board, there is no need to burn the system into the TF card. You only need to connect the Type-C power supply to the development board to start the micro Linux system in the SPI Flash. The main functions of this system are:
 
A micro Linux system is programmed into SPI Flash by default. This system is mainly used to prove that the development board can start normally. After getting the development board, there is no need to burn the system into the TF card. You only need to connect the Type-C power supply to the development board to start the micro Linux system in the SPI Flash. The main functions of this system are:
Line 424: Line 539:
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>After booting into the kernel, the green LED light will flash;</p></li>
 
<li><p>After booting into the kernel, the green LED light will flash;</p></li>
<li><p>If the development board is connected to an HDMI screen, after the &gt; system startup is completed, the command line interface of the &gt; micro Linux system can be seen on the HDMI screen.</p>
+
<li><p>If the development board is connected to an HDMI screen, after the system startup is completed, the command line interface of the micro Linux system can be seen on the HDMI screen.</p></li></ol>
<p>'''I would like to emphasize again that the micro Linux system in SPI Flash is only used to prove that the development board can start normally (you can light up the development board without burning the system). If you find that there are other problems with the system in SPI Flash (such as serial port Unable to log in), please ignore it.'''</p>
+
<p>'''<span style="color:#FF0000">I would like to emphasize again that the micro Linux system in SPI Flash is only used to prove that the development board can start normally (you can light up the development board without burning the system). If you find that there are other problems with the system in SPI Flash (such as serial port Unable to log in), please ignore it.</span>'''</p>
<p>If you want to use the development board normally, please burn Ubuntu, Debian and other Linux images or Android images to the TF card, and then use it.</p></li></ol>
+
<p>If you want to use the development board normally, please burn Ubuntu, Debian and other Linux images or Android images to the TF card, and then use it.</p>
  
 
<span id="start-the-orange-pie-development-board"></span>
 
<span id="start-the-orange-pie-development-board"></span>
 +
 
== Start the Orange Pie development board ==
 
== Start the Orange Pie development board ==
  
Line 437: Line 553:
 
# Connect a high-quality power adapter with a 5V/2A (5V/3A is also available) USB Type C interface
 
# Connect a high-quality power adapter with a 5V/2A (5V/3A is also available) USB Type C interface
  
'''Remember not to plug in a power adapter with a voltage output greater than 5V, as it will burn out the development board.'''
+
::{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''<span style="color:#FF0000">Remember not to plug in a power adapter with a voltage output greater than 5V, as it will burn out the development board.</span>'''
  
'''Many unstable phenomena during system power-on and startup are basically caused by power supply problems, so a reliable power adapter is very important. If you find that you are constantly restarting during the startup process, please replace the power supply or Type C data cable and try again.'''
+
'''<span style="color:#FF0000">Many unstable phenomena during system power-on and startup are basically caused by power supply problems, so a reliable power adapter is very important. If you find that you are constantly restarting during the startup process, please replace the power supply or Type C data cable and try again.</span>'''</big>
 
+
|}
'''Both Type-C interfaces on the development board can be used for power supply.'''
+
::{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''Both Type-C interfaces on the development board can be used for power supply.'''</big>
  
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image17.png|258x146px|003]]
+
[[File:zero2w-img17.png|center]]
  
 
</div>
 
</div>
 +
|}
 +
 
<ol start="6" style="list-style-type: decimal;">
 
<ol start="6" style="list-style-type: decimal;">
 
<li><p>Then turn on the power adapter. If everything is normal, the system startup screen will be visible on the HDMI monitor.</p></li>
 
<li><p>Then turn on the power adapter. If everything is normal, the system startup screen will be visible on the HDMI monitor.</p></li>
<li><p>If you want to view the output information of the system through the debugging serial port, please use the serial port cable to connect the development board to the computer. For the serial port connection method, please refer to the '''section on how to use the debugging serial port'''.</p></li></ol>
+
<li><p>If you want to view the output information of the system through the debugging serial port, please use the serial port cable to connect the development board to the computer. For the serial port connection method, please refer to the [[Orange Pi Zero 2W#How to use the debugging serial port | '''section on how to use the debugging serial port''']].</p></li></ol>
  
 
<span id="how-to-use-the-debugging-serial-port"></span>
 
<span id="how-to-use-the-debugging-serial-port"></span>
 +
 
== How to use the debugging serial port ==
 
== How to use the debugging serial port ==
  
Line 462: Line 587:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image60.png|552x110px|7]]
+
[[File:zero2w-img60.png]]
  
 
</div></li>
 
</div></li>
 
<li><p>The corresponding relationship between the GND, TX and RX pins of the debugging serial port of the development board is shown in the figure below</p>
 
<li><p>The corresponding relationship between the GND, TX and RX pins of the debugging serial port of the development board is shown in the figure below</p>
<p>[[File:media/image61.png|345x156px]]</p>
+
<p>[[File:zero2w-img61.png]]</p>
<p>'''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.'''</p></li>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''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.'''</p></big>
 +
|}
 +
</li>
 
<li><p>The GND, TX and RX pins of the USB to TTL module need to be connected to the debugging serial port of the development board through Dupont lines.</p>
 
<li><p>The GND, TX and RX pins of the USB to TTL module need to be connected to the debugging serial port of the development board through Dupont lines.</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>Connect the GND of the USB to TTL module to the GND of the &gt; development board</p></li>
+
<li><p>Connect the GND of the USB to TTL module to the GND of the development board</p></li>
<li><p>'''Connect the RX of the USB to TTL module to the TX of the &gt; development board'''</p></li>
+
<li><p>'''<span style="color:#FF0000">Connect the RX of the USB to TTL module to the TX of the development board</span>'''</p></li>
<li><p>'''Connect the TX of the USB to TTL module to the RX of the &gt; development board'''</p></li></ol>
+
<li><p>'''<span style="color:#FF0000">Connect the TX of the USB to TTL module to the RX of the development board</span>'''</p></li></ol>
 
</li>
 
</li>
 
<li><p>The schematic diagram of connecting the USB to TTL module to the computer and Orange Pi development board is as shown below</p>
 
<li><p>The schematic diagram of connecting the USB to TTL module to the computer and Orange Pi development board is as shown below</p>
<p>[[File:media/image62.png|553x204px]]</p>
+
<p>[[File:zero2w-img62.png]]</p>
<p>'''The TX and RX of the serial port need to be cross-connected. If you don’t want to carefully distinguish the order of TX and RX, you can casually connect the TX and RX of the serial port first. If there is no output from the test serial port, then exchange the order of TX and RX, so that the There is a right order.'''</p></li></ol>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''The TX and RX of the serial port need to be cross-connected. If you don't want to carefully distinguish the order of TX and RX, you can casually connect the TX and RX of the serial port first. If there is no output from the test serial port, then exchange the order of TX and RX, so that the There is a right order.'''</p></big>
 +
|}
 +
</li></ol>
  
 
<span id="how-to-use-the-debugging-serial-port-on-ubuntu-platform"></span>
 
<span id="how-to-use-the-debugging-serial-port-on-ubuntu-platform"></span>
 +
 
=== How to use the debugging serial port on Ubuntu platform ===
 
=== How to use the debugging serial port on Ubuntu platform ===
  
'''There are many serial port debugging software that can be used under Linux, such as putty, minicom, etc. The following demonstrates how to use putty.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''There are many serial port debugging software that can be used under Linux, such as putty, minicom, etc. The following demonstrates how to use putty.'''</big>
 +
|}
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>First insert the USB to TTL module into the USB interface of the Ubuntu computer. If the USB to TTL module is connected and recognized normally, you can see the corresponding device node name under '''/dev''' of the Ubuntu PC. Remember this node name and set the serial port later. software will be used</p>
 
<li><p>First insert the USB to TTL module into the USB interface of the Ubuntu computer. If the USB to TTL module is connected and recognized normally, you can see the corresponding device node name under '''/dev''' of the Ubuntu PC. Remember this node name and set the serial port later. software will be used</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>test@test:~$ '''ls /dev/ttyUSB*'''</p>
 
<p>test@test:~$ '''ls /dev/ttyUSB*'''</p>
<p>'''/dev/ttyUSB0'''</p></li>
+
<p>'''/dev/ttyUSB0'''</p>
 +
|}
 +
</li>
 
<li><p>Then use the following command to install putty on Ubuntu PC</p>
 
<li><p>Then use the following command to install putty on Ubuntu PC</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>test@test:~$ '''sudo apt update'''</p>
 
<p>test@test:~$ '''sudo apt update'''</p>
<p>test@test:~$ '''sudo apt install -y putty'''</p></li>
+
<p>test@test:~$ '''sudo apt install -y putty'''</p>
<li><p><span class="mark">Then run putty,</span> '''remember to add sudo permissions'''</p>
+
|}
<p>test@test:~$ '''sudo putty'''</p></li>
+
</li>
 +
<li><p><span class="mark">Then run putty,</span> '''<span style="color:#FF0000">remember to add sudo permissions</span>'''</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>test@test:~$ '''sudo putty'''</p>
 +
|}
 +
</li>
 
<li><p>After executing the putty command, the following interface will pop up</p>
 
<li><p>After executing the putty command, the following interface will pop up</p>
<p>[[File:media/image63.png|332x290px]]</p></li>
+
<p>[[File:zero2w-img63.png]]</p></li>
 
<li><p>First select the serial port setting interface</p>
 
<li><p>First select the serial port setting interface</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image64.png|337x297px|9]]
+
[[File:zero2w-img64.png]]
  
 
</div></li>
 
</div></li>
 
<li><p>Then set the parameters of the serial port</p>
 
<li><p>Then set the parameters of the serial port</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>Set the '''Serial line to connect to''' to '''/dev/ttyUSB0''' &gt; (modify to the corresponding node name, usually &gt; '''/dev/ttyUSB0''')</p></li>
+
<li><p>Set the '''Serial line to connect to''' to '''/dev/ttyUSB0''' (modify to the corresponding node name, usually '''/dev/ttyUSB0''')</p></li>
 
<li><p>Set '''Speed(baud)''' to '''115200''' (baud rate of the serial port)</p></li>
 
<li><p>Set '''Speed(baud)''' to '''115200''' (baud rate of the serial port)</p></li>
 
<li><p>Set '''Flow control''' to '''None'''</p>
 
<li><p>Set '''Flow control''' to '''None'''</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image65.png|366x359px|未标题-17]]
+
[[File:zero2w-img65.png]]
  
 
</div></li></ol>
 
</div></li></ol>
Line 517: Line 672:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image66.png|375x333px|11]]
+
[[File:zero2w-img66.png]]
  
 
</div></li></ol>
 
</div></li></ol>
 
</li>
 
</li>
 
<li><p>Then start the development board, and you can see the Log information output by the system from the open serial terminal.</p>
 
<li><p>Then start the development board, and you can see the Log information output by the system from the open serial terminal.</p>
<p>[[File:media/image67.png|376x249px]]</p></li></ol>
+
<p>[[File:zero2w-img67.png]]</p></li></ol>
  
 
<span id="how-to-use-the-debugging-serial-port-on-windows-platform"></span>
 
<span id="how-to-use-the-debugging-serial-port-on-windows-platform"></span>
 +
 
=== How to use the debugging serial port on Windows platform ===
 
=== How to use the debugging serial port on Windows platform ===
  
'''There are many serial port debugging software that can be used under Windows, such as SecureCRT, MobaXterm, etc. The following demonstrates how to use MobaXterm. This software has a free version and can be used without purchasing a serial number.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''There are many serial port debugging software that can be used under Windows, such as SecureCRT, MobaXterm, etc. The following demonstrates how to use MobaXterm. This software has a free version and can be used without purchasing a serial number.'''</big>
 +
|}
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
Line 533: Line 693:
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>Download MobaXterm URL as follows</p>
 
<li><p>Download MobaXterm URL as follows</p>
<p>[https://mobaxterm.mobatek.net/ '''https://mobaxterm.mobatek.net/''']</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>[https://mobaxterm.mobatek.net/ '''https://mobaxterm.mobatek.net/''']</p>
 +
|}
 +
</li>
 
<li><p>Enter the MobaXterm download webpage and click '''GET XOBATERM &gt; NOW!'''</p>
 
<li><p>Enter the MobaXterm download webpage and click '''GET XOBATERM &gt; NOW!'''</p>
<p>[[File:media/image68.png|382x233px]]</p></li>
+
<p>[[File:zero2w-img68.png]]</p></li>
 
<li><p>Then choose to download the Home version</p>
 
<li><p>Then choose to download the Home version</p>
<p>[[File:media/image69.png|353x231px]]</p></li>
+
<p>[[File:zero2w-img69.png]]</p></li>
 
<li><p>Then select the Portable version. There is no need to install it after downloading. You can open it directly and use it.</p>
 
<li><p>Then select the Portable version. There is no need to install it after downloading. You can open it directly and use it.</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image70.png|322x175px|选区_232]]
+
[[File:zero2w-img70.png]]
  
 
</div></li></ol>
 
</div></li></ol>
 
</li>
 
</li>
 
<li><p>After downloading, use decompression software to decompress the downloaded compressed package to get the executable software of MobaXterm, and then double-click to open it.</p>
 
<li><p>After downloading, use decompression software to decompress the downloaded compressed package to get the executable software of MobaXterm, and then double-click to open it.</p>
<p>[[File:media/image71.png|576x83px]]</p></li>
+
<p>[[File:zero2w-img71.png]]</p></li>
 
<li><p>After opening the software, the steps to set up the serial port connection are as follows:</p>
 
<li><p>After opening the software, the steps to set up the serial port connection are as follows:</p>
<p>a. Open the session settings interface</p>
+
:<p>a. Open the session settings interface</p>
<p>b. Select the serial port type</p>
+
:<p>b. Select the serial port type</p>
<p>c. Select the port number of the serial port (select the corresponding port number according to the actual situation). If you cannot see the port number, please use '''360 Driver Master''' to scan and install the driver for the USB to TTL serial port chip.</p>
+
:<p>c. Select the port number of the serial port (select the corresponding port number according to the actual situation). If you cannot see the port number, please use '''360 Driver Master''' to scan and install the driver for the USB to TTL serial port chip.</p>
<p>d.Select the baud rate of the serial port to '''115200'''</p>
+
:<p>d. Select the baud rate of the serial port to '''115200'''</p>
<p>e. Finally click the &quot;'''OK'''&quot; button to complete the settings</p></li></ol>
+
:<p>e. Finally click the &quot;'''OK'''&quot; button to complete the settings</p></li>
  
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image72.png|553x280px|12]]
+
::[[File:zero2w-img72.png]]
  
</div>
+
</div></ol>
 
<ol start="4" style="list-style-type: decimal;">
 
<ol start="4" style="list-style-type: decimal;">
 
<li><p>After clicking the &quot;'''OK'''&quot; button, you will enter the following interface. At this time, start the development board and you can see the output information of the serial port.</p>
 
<li><p>After clicking the &quot;'''OK'''&quot; button, you will enter the following interface. At this time, start the development board and you can see the output information of the serial port.</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image73.png|628x318px|13]]
+
[[File:zero2w-img73.png]]
  
 
</div></li></ol>
 
</div></li></ol>
  
 
<span id="instructions-for-using-the-5v-pin-in-the-40pin-interface-of-the-development-board-for-power-supply"></span>
 
<span id="instructions-for-using-the-5v-pin-in-the-40pin-interface-of-the-development-board-for-power-supply"></span>
 +
 
== Instructions for using the 5v pin in the 40pin interface of the development board for power supply ==
 
== Instructions for using the 5v pin in the 40pin interface of the development board for power supply ==
  
'''The power supply method we recommend for the development board is to use a 5V/2A or 5V/3A Type C interface power cord and plug it into the development board's Type C power interface. If you need to use the 5V pin in the 40-pin interface to power the development board, please ensure that the power cable used can meet the power supply requirements of the development board. If the use is unstable, please switch to Type C power supply.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
+
|-
'''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>'''The power supply method we recommend for the development board is to use a 5V/2A or 5V/3A Type C interface power cord and plug it into the development board's Type C power interface. If you need to use the 5V pin in the 40-pin interface to power the development board, please ensure that the power cable used can meet the power supply requirements of the development board. If the use is unstable, please switch to Type C power supply.'''</big>
 +
|}
 +
{| 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>
 +
|}
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
Line 578: Line 751:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image74.png|223x160px|图片4]]
+
[[File:zero2w-img74.png]]
  
 
</div>
 
</div>
<p>'''The power cord shown in the picture above can be purchased on Taobao, please search and buy it yourself.'''</p></li>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''The power cord shown in the picture above can be purchased on Taobao, please search and buy it yourself.'''</p></big>
 +
|}
 +
</li>
 
<li><p>Use the 5V pin in the 40pin interface to power the development board. The power cord connection is as follows:</p>
 
<li><p>Use the 5V pin in the 40pin interface to power the development board. The power cord connection is as follows:</p>
 
<p>a. The USB-A port of the power cord shown in the picture above needs to be plugged into the 5V/2A or 5V/3A power adapter connector.</p>
 
<p>a. The USB-A port of the power cord shown in the picture above needs to be plugged into the 5V/2A or 5V/3A power adapter connector.</p>
 
<p>b. The red DuPont wire needs to be plugged into the 5V pin of the 40pin interface of the development board</p>
 
<p>b. The red DuPont wire needs to be plugged into the 5V pin of the 40pin interface of the development board</p>
 
<p>c. The black DuPont wire needs to be plugged into the GND pin of the 40pin interface</p>
 
<p>c. The black DuPont wire needs to be plugged into the GND pin of the 40pin interface</p>
<p>d. The positions of the 5V pin and GND pin of the 40pin interface in the development board are as shown in the figure below. '''Remember not to connect them reversely.'''</p>
+
<p>d. The positions of the 5V pin and GND pin of the 40pin interface in the development board are as shown in the figure below. '''<span style="color:#FF0000">Remember not to connect them reversely.</span>'''</p>
<p>[[File:media/image23.png|345x187px]]</p></li></ol>
+
<p>[[File:zero2w-img23.png]]</p></li></ol>
  
 
<span id="debianubuntu-server-and-xfce-desktop-system-usage-instructions"></span>
 
<span id="debianubuntu-server-and-xfce-desktop-system-usage-instructions"></span>
= Debian/Ubuntu Server and Xfce desktop system usage instructions =
+
 
 +
= '''Debian/Ubuntu Server and Xfce desktop system usage instructions''' =
  
 
<span id="supported-linux-image-types-and-kernel-versions"></span>
 
<span id="supported-linux-image-types-and-kernel-versions"></span>
 
== Supported linux image types and kernel versions ==
 
== Supported linux image types and kernel versions ==
  
{| class="wikitable"
+
{| class="wikitable" style="width:800px;text-align: center;"
 
|-
 
|-
 
| '''Linux image type'''
 
| '''Linux image type'''
Line 628: Line 807:
 
|}
 
|}
  
After entering the download page of the corresponding development board on the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi data download page'''], you can see the following download options. In the description below, '''Ubuntu images and Debian images are generally referred to as Linux images'''.
+
After entering the download page of the corresponding development board on the [http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero-2W.html '''Orange Pi data download page'''], you can see the following download options. In the description below, '''Ubuntu images and Debian images are generally referred to as Linux images'''.
  
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image75.png|242x135px|1695354537340]]
+
[[File:zero2w-img75.png]]
  
 
</div>
 
</div>
 
The naming rules for Linux images are:
 
The naming rules for Linux images are:
  
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
'''Development board model_version number_Linux distribution type_distribution code_server or desktop_kernel version'''
 
'''Development board model_version number_Linux distribution type_distribution code_server or desktop_kernel version'''
 +
|}
  
 
a. '''Development board models''': all are '''orangepizero2w'''. The model names of different development boards are generally different. Before burning the image, please make sure that the model name of the selected image matches the development board.
 
a. '''Development board models''': all are '''orangepizero2w'''. The model names of different development boards are generally different. Before burning the image, please make sure that the model name of the selected image matches the development board.
Line 652: Line 835:
  
 
<span id="linux-kernel-driver-adaptation-situation"></span>
 
<span id="linux-kernel-driver-adaptation-situation"></span>
 +
 
== Linux kernel driver adaptation situation ==
 
== Linux kernel driver adaptation situation ==
  
{| class="wikitable"
+
{| class="wikitable" style="width:800px;text-align: center;"
 
|-
 
|-
 
| '''Board functions'''
 
| '''Board functions'''
Line 721: Line 905:
 
|-
 
|-
 
| '''Mali GPU'''
 
| '''Mali GPU'''
| '''NO'''
+
| '''<span style="color:#FF0000">NO</span>'''
| '''NO'''
+
| '''<span style="color:#FF0000">NO</span>'''
 
|-
 
|-
 
| '''Video codec'''
 
| '''Video codec'''
| '''NO'''
+
| '''<span style="color:#FF0000">NO</span>'''
| '''NO'''
+
| '''<span style="color:#FF0000">NO</span>'''
 
|}
 
|}
  
{| class="wikitable"
+
{| class="wikitable" style="width:800px;text-align: center;"
 
|-
 
|-
 
| '''24pin expansion board function'''
 
| '''24pin expansion board function'''
Line 764: Line 948:
 
|-
 
|-
 
| '''TV-OUT'''
 
| '''TV-OUT'''
| '''NO'''
+
| '''<span style="color:#FF0000">NO</span>'''
| '''NO'''
+
| '''<span style="color:#FF0000">NO</span>'''
 
|}
 
|}
  
 
<span id="linux-command-format-description-in-this-manual"></span>
 
<span id="linux-command-format-description-in-this-manual"></span>
 +
 
== Linux command format description in this manual ==
 
== Linux command format description in this manual ==
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>All commands that need to be entered in the Linux system in this manual will be enclosed in the following boxes</p>
 
<li><p>All commands that need to be entered in the Linux system in this manual will be enclosed in the following boxes</p>
<p>As shown below, the content in the yellow box indicates content that requires special attention, except for the commands inside.</p></li>
+
{| class="wikitable" style="width:800px;height:40px;"
 +
|-
 +
|
 +
 
 +
|}
 +
<p>As shown below, the content in the yellow box indicates content that requires special attention, except for the commands inside.</p>
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;height:40px;"
 +
|-
 +
|
 +
 
 +
|}
 +
</li>
 
<li><p>Description of the prompt type before the command</p>
 
<li><p>Description of the prompt type before the command</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>The prompt in front of the command refers to the red part in the &gt; box below. This part is not part of the Linux command. &gt; Therefore, when entering commands in the Linux system, please &gt; do not also enter the content in the red font.</p>
+
<li><p>The prompt in front of the command refers to the red part in the box below. This part is not part of the Linux command. Therefore, when entering commands in the Linux system, please do not also enter the content in the red font.</p>
<p>'''orangepi@orangepi:~$ sudo apt update'''</p>
+
{| class="wikitable" style="width:800px;"
<p>'''root@orangepi:~#''' '''vim /boot/boot.cmd'''</p>
+
|-
<p>'''test@test:~$ ssh [mailto:root@192.168.1.36 root@192.168.1.]xxx'''</p>
+
|
<p>'''root@test:~# ls'''</p></li>
+
<p>'''<span style="color:#FF0000">orangepi@orangepi:~$</span> sudo apt update'''</p>
<li><p>'''root@orangepi:~$''' prompt indicates that this command is &gt; entered in the '''Linux system of the development board'''. The &gt; '''$''' at the end of the prompt indicates that the current &gt; user of the system is an ordinary user. When executing a &gt; privileged command, '''sudo''' needs to be added.</p></li>
+
<p>'''<span style="color:#FF0000">root@orangepi:~#</span>''' '''vim /boot/boot.cmd'''</p>
<li><p>'''root@orangepi:~#''' The prompt indicates that this command is &gt; entered in the '''Linux system of the development board'''. The &gt; '''#''' at the end of the prompt indicates that the current &gt; user of the system is the root user and can execute any &gt; command you want to execute.</p></li>
+
<p>'''<span style="color:#FF0000">test@test:~$</span> ssh root@192.168.1.xxx'''</p>
<li><p>'''test@test:~$''' prompt indicates that this command was &gt; entered in the Ubuntu PC or Ubuntu virtual machine, not the &gt; Linux system of the development board. The '''$''' at the end &gt; of the prompt indicates that the current user of the system is &gt; an ordinary user. When executing privileged commands, sudo &gt; needs to be added.</p></li>
+
<p>'''<span style="color:#FF0000">root@test:~#</span> ls'''</p>
<li><p>'''root@test:~#''' prompt indicates that this command is entered &gt; in the Ubuntu PC or Ubuntu virtual machine, not the Linux &gt; system of the development board. The '''#''' at the end of the &gt; prompt indicates that the current user of the system is the &gt; root user and can execute any command you want to execute.</p></li></ol>
+
|}
 +
</li>
 +
<li><p>'''<span style="color:#FF0000">root@orangepi:~$</span>''' prompt indicates that this command is entered in the '''Linux system of the development board'''. The '''<span style="color:#FF0000">$</span>''' at the end of the prompt indicates that the current user of the system is an ordinary user. When executing a privileged command, '''sudo''' needs to be added.</p></li>
 +
<li><p>'''<span style="color:#FF0000">root@orangepi:~#</span>''' The prompt indicates that this command is entered in the '''Linux system of the development board'''. The '''<span style="color:#FF0000">#</span>''' at the end of the prompt indicates that the current user of the system is the root user and can execute any command you want to execute.</p></li>
 +
<li><p>'''<span style="color:#FF0000">test@test:~$</span>''' prompt indicates that this command was entered in the Ubuntu PC or Ubuntu virtual machine, not the Linux system of the development board. The '''<span style="color:#FF0000">$</span>''' at the end of the prompt indicates that the current user of the system is an ordinary user. When executing privileged commands, sudo needs to be added.</p></li>
 +
<li><p>'''<span style="color:#FF0000">root@test:~#</span>''' prompt indicates that this command is entered in the Ubuntu PC or Ubuntu virtual machine, not the Linux system of the development board. The '''<span style="color:#FF0000">#</span>''' at the end of the prompt indicates that the current user of the system is the root user and can execute any command you want to execute.</p></li></ol>
 
</li>
 
</li>
 
<li><p>What are the commands that need to be entered?</p>
 
<li><p>What are the commands that need to be entered?</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>As shown below, the '''bold black part''' is the command that &gt; needs to be input. The content below the command is the output &gt; content (some commands have output, and some may not output). &gt; This part of the content does not need to be input.</p>
+
<li><p>As shown below, the '''bold black part''' is the command that needs to be input. The content below the command is the output content (some commands have output, and some may not output). This part of the content does not need to be input.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>root@orangepi:~# '''cat /boot/orangepiEnv.txt'''</p>
 
<p>root@orangepi:~# '''cat /boot/orangepiEnv.txt'''</p>
<p>'''verbosity=7'''</p>
+
<p>'''<span style="color:#FF0000">verbosity=7</span>'''</p>
 
<p>bootlogo=false</p>
 
<p>bootlogo=false</p>
<p>'''console=serial'''</p></li>
+
<p>'''<span style="color:#FF0000">console=serial</span>'''</p>
<li></li>
+
|}
<li><p>As shown below, some commands that cannot be written in one line &gt; will be placed on the next line. As long as the black and bold &gt; parts are the commands that need to be entered. When these &gt; commands are entered into one line, the &quot;\&quot; at the end of &gt; each line needs to be removed. This is not part of the &gt; command. In addition, different parts of the command have &gt; spaces, please don’t miss them.</p>
+
</li>
 +
<li><p>As shown below, some commands that cannot be written in one line will be placed on the next line. As long as the black and bold parts are the commands that need to be entered. When these commands are entered into one line, the &quot;\&quot; at the end of each line needs to be removed. This is not part of the command. In addition, different parts of the command have spaces, please don't miss them.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''echo \'''</p>
 
<p>orangepi@orangepi:~$ '''echo \'''</p>
 
<p>'''&quot;deb [arch=$(dpkg --print-architecture) \'''</p>
 
<p>'''&quot;deb [arch=$(dpkg --print-architecture) \'''</p>
 
<p>'''signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \'''</p>
 
<p>'''signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \'''</p>
 
<p>'''https://download.docker.com/linux/debian \'''</p>
 
<p>'''https://download.docker.com/linux/debian \'''</p>
<p>'''$(lsb_release -cs) stable&quot; | sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null'''</p></li></ol>
+
<p>'''$(lsb_release -cs) stable&quot; | sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null'''</p>
 +
|}
 +
</li></ol>
 
</li></ol>
 
</li></ol>
  
 
<span id="linux-system-login-instructions"></span>
 
<span id="linux-system-login-instructions"></span>
 +
 
== Linux system login instructions ==
 
== Linux system login instructions ==
  
Line 808: Line 1,019:
 
=== Linux system default login account and password ===
 
=== Linux system default login account and password ===
  
{| class="wikitable"
+
{| class="wikitable" style="width:800px;text-align: center;"
 
|-
 
|-
 
| '''Account'''
 
| '''Account'''
Line 820: Line 1,031:
 
|}
 
|}
  
'''Note that when entering a password, the specific content of the entered password will not be displayed on the screen. Please do not think that there is any malfunction. Just press Enter after entering the password.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''Note that when entering a password, <span style="color:#FF0000">the specific content of the entered password will not be displayed on the screen</span>. Please do not think that there is any malfunction. Just press Enter after entering the password.'''</big>
 +
|}
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''When you are prompted for an incorrect password or there is a problem with the ssh connection, please note that as long as you are using the Linux image provided by Orange Pi, <span style="color:#FF0000">please do not suspect that the above password is incorrect</span>, but look for other reasons.'''</big>
 +
|}
  
'''When you are prompted for an incorrect password or there is a problem with the ssh connection, please note that as long as you are using the Linux image provided by Orange Pi, please do not suspect that the above password is incorrect, but look for other reasons.'''
+
<span id="how-to-set-up-automatic-login-of-linux-system-terminal"></span>
  
<span id="how-to-set-up-automatic-login-of-linux-system-terminal"></span>
 
 
=== How to set up automatic login of Linux system terminal ===
 
=== How to set up automatic login of Linux system terminal ===
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
<li><p>The Linux system automatically logs in to the terminal by default. The default login user name is '''orangepi'''</p>
+
<li><p>The Linux system automatically logs in to the terminal by default. The default login user name is '''<span style="color:#FF0000">orangepi</span>'''</p>
<p>[[File:media/image76.png|475x240px]]</p></li>
+
<p>[[File:zero2w-img76.png]]</p></li>
 
<li><p>Use the following command to set the root user to automatically log in to the terminal</p>
 
<li><p>Use the following command to set the root user to automatically log in to the terminal</p>
<p>orangepi@orangepi:~$ '''sudo auto_login_cli.sh root'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo auto_login_cli.sh root'''</p>
 +
|}
 +
</li>
 
<li><p>Use the following command to disable automatic login to the terminal</p>
 
<li><p>Use the following command to disable automatic login to the terminal</p>
<p>orangepi@orangepi:~$ '''sudo auto_login_cli.sh -d'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo auto_login_cli.sh -d'''</p>
 +
|}
 +
</li>
 
<li><p>Use the following command to set the orangepi user to automatically log in to the terminal again</p>
 
<li><p>Use the following command to set the orangepi user to automatically log in to the terminal again</p>
<p>orangepi@orangepi:~$ '''sudo auto_login_cli.sh orangepi'''</p></li></ol>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo auto_login_cli.sh orangepi'''</p>
 +
|}
 +
</li></ol>
  
 
<span id="instructions-for-automatic-login-of-linux-desktop-version-system"></span>
 
<span id="instructions-for-automatic-login-of-linux-desktop-version-system"></span>
 +
 
=== Instructions for automatic login of Linux desktop version system ===
 
=== Instructions for automatic login of Linux desktop version system ===
  
Line 844: Line 1,079:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image77.png|576x324px|1]]
+
[[File:zero2w-img77.png]]
  
 
</div></li>
 
</div></li>
 
<li><p>Run the following command to prevent the desktop system from automatically logging into the desktop.</p>
 
<li><p>Run the following command to prevent the desktop system from automatically logging into the desktop.</p>
<p>orangepi@orangepi:~$ '''sudo disable_desktop_autologin.sh'''</p></li>
+
{| class="wikitable" style="width:800px;"
<li><p>Then restart the system and a login dialog box will appear. At this time, you need to enter a password to enter the system.</p></li></ol>
+
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo disable_desktop_autologin.sh'''</p>
 +
|}
 +
</li>
 +
<li><p>Then restart the system and a login dialog box will appear. At this time, you need to enter a password to enter the system.</p></li>
  
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image78.png|569x320px|IMG_256]]
+
[[File:zero2w-img78.png]]
  
</div>
+
</div></ol>
 
<span id="setting-method-for-automatic-login-of-root-user-in-linux-desktop-system"></span>
 
<span id="setting-method-for-automatic-login-of-root-user-in-linux-desktop-system"></span>
 +
 
=== Setting method for automatic login of root user in Linux desktop system ===
 
=== Setting method for automatic login of root user in Linux desktop system ===
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>Execute the following command to set the desktop version of the system to automatically log in using the root user</p>
 
<li><p>Execute the following command to set the desktop version of the system to automatically log in using the root user</p>
<p>orangepi@orangepi:~$ '''sudo desktop_login.sh root'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo desktop_login.sh root'''</p>
 +
|}
 +
</li>
 
<li><p>Then restart the system and you will automatically log in to the desktop as the root user.</p>
 
<li><p>Then restart the system and you will automatically log in to the desktop as the root user.</p>
<p>[[File:media/image79.png|294x123px]]</p>
+
<p>[[File:zero2w-img79.png]]</p>
<p>'''Note that if you use the root user to log in to the desktop system, you cannot use pulseaudio in the upper right corner to manage audio devices.'''</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
<p>'''Also please note that this is not a bug, because pulseaudio is not allowed to run under the root user.'''</p></li>
+
|-
 +
|
 +
<big><p>'''Note that if you use the root user to log in to the desktop system, you cannot use pulseaudio in the upper right corner to manage audio devices.'''</p>
 +
<p>'''Also please note that this is not a bug, because pulseaudio is not allowed to run under the root user.'''</p></big>
 +
|}
 +
</li>
 
<li><p>Execute the following command to set up the desktop version of the system again to use the orangepi user to automatically log in</p>
 
<li><p>Execute the following command to set up the desktop version of the system again to use the orangepi user to automatically log in</p>
<p>orangepi@orangepi:~$ '''sudo desktop_login.sh orangepi'''</p></li></ol>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo desktop_login.sh orangepi'''</p>
 +
|}
 +
</li></ol>
  
 
<span id="how-to-disable-the-desktop-in-linux-desktop-system"></span>
 
<span id="how-to-disable-the-desktop-in-linux-desktop-system"></span>
 +
 
=== How to disable the desktop in Linux desktop system ===
 
=== How to disable the desktop in Linux desktop system ===
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
<li><p>First enter the following command on the command line, '''please remember to add sudo permissions'''</p>
+
<li><p>First enter the following command on the command line, '''<span style="color:#FF0000">please remember to add sudo permissions</span>'''</p>
<p>orangepi@orangepi:~$ '''sudo systemctl disable lightdm.service'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo systemctl disable lightdm.service'''</p>
 +
|}
 +
</li>
 
<li><p>Then restart the Linux system and you will find that the desktop will not be displayed.</p>
 
<li><p>Then restart the Linux system and you will find that the desktop will not be displayed.</p>
<p>orangepi@orangepi:~$ '''sudo reboot'''</p></li>
+
{| class="wikitable" style="width:800px;"
<li><p>'''The command to reopen the desktop is as follows, please remember to add sudo permissions'''</p>
+
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo reboot'''</p>
 +
|}
 +
</li>
 +
<li><p>'''The command to reopen the desktop is as follows, <span style="color:#FF0000">please remember to add sudo permissions</span>'''</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo systemctl start lightdm.service'''</p>
 
<p>orangepi@orangepi:~$ '''sudo systemctl start lightdm.service'''</p>
<p>orangepi@orangepi:~$ '''sudo systemctl enable lightdm.service'''</p></li></ol>
+
<p>orangepi@orangepi:~$ '''sudo systemctl enable lightdm.service'''</p>
 +
|}
 +
</li></ol>
  
 
<span id="onboard-led-light-test-instructions"></span>
 
<span id="onboard-led-light-test-instructions"></span>
 +
 
== Onboard LED light test instructions ==
 
== Onboard LED light test instructions ==
  
 
# There are two LED lights on the development board, one green light and one red light. The default display of the LED lights when the system is started is as follows:
 
# There are two LED lights on the development board, one green light and one red light. The default display of the LED lights when the system is started is as follows:
  
{| class="wikitable"
+
::{| class="wikitable" style="width:800px;text-align: center;"
 
|-
 
|-
 
|
 
|
Line 900: Line 1,173:
 
| '''Bright'''
 
| '''Bright'''
 
|}
 
|}
 
+
::{| class="wikitable" style="background-color:#ffffdc;width:800px;"
'''The green light on the development board can be controlled through software. The red light will be on continuously after power is turned on and cannot be controlled through software.'''
+
|-
 +
|
 +
<big>'''The green light on the development board can be controlled through software. The red light will be on continuously after power is turned on and cannot be controlled through software.'''
  
 
'''When you get the development board, you may find that even if the TF card with the system burned is not inserted into the development board, the green light will flash after connecting the power supply to the development board. This is because the 16MB SPI Flash on the development board is factory default. A miniature Linux system will be burned. This system will set the green light to flash after entering the kernel.'''
 
'''When you get the development board, you may find that even if the TF card with the system burned is not inserted into the development board, the green light will flash after connecting the power supply to the development board. This is because the 16MB SPI Flash on the development board is factory default. A miniature Linux system will be burned. This system will set the green light to flash after entering the kernel.'''
  
'''If the Linux system in the SPI Flash is cleared, then without inserting the TF card with the system programmed in it, you will only see a steady red light on the development board after turning on the power.'''
+
'''If the Linux system in the SPI Flash is cleared, then without inserting the TF card with the system programmed in it, you will only see a steady red light on the development board after turning on the power.'''</big>
 +
|}
  
 
<ol start="2" style="list-style-type: decimal;">
 
<ol start="2" style="list-style-type: decimal;">
 
<li><p>The method of setting the green light to turn on and off and flash is as follows:</p>
 
<li><p>The method of setting the green light to turn on and off and flash is as follows:</p>
<p>'''Note that the following operations should be performed under the root user.'''</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''Note that the following operations should be performed under the root user.'''</p></big>
 +
|}
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>First enter the setting directory of the green light</p>
 
<li><p>First enter the setting directory of the green light</p>
<p>root@orangepi:~# '''cd /sys/class/leds/green_led'''</p></li>
+
{| class="wikitable" style="width:800px;"
<li><p>The command to set the green light to stop flashing is as &gt; follows:</p>
+
|-
<p>root@orangepi:/sys/class/leds/green_led# '''echo none &gt; trigger'''</p></li>
+
|
 +
<p>root@orangepi:~# '''cd /sys/class/leds/green_led'''</p>
 +
|}
 +
</li>
 +
<li><p>The command to set the green light to stop flashing is as follows:</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>root@orangepi:/sys/class/leds/green_led# '''echo none &gt; trigger'''</p>
 +
|}
 +
</li>
 
<li><p>The command to set the green light to be always on is as &gt; follows:</p>
 
<li><p>The command to set the green light to be always on is as &gt; follows:</p>
<p>root@orangepi:/sys/class/leds/green_led# '''echo default-on &gt; trigger'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>root@orangepi:/sys/class/leds/green_led# '''echo default-on &gt; trigger'''</p>
 +
|}
 +
</li>
 
<li><p>The command to set the green light flashing is as follows:</p>
 
<li><p>The command to set the green light flashing is as follows:</p>
<p>root@orangepi:/sys/class/leds/green_led# '''echo heartbeat &gt; trigger'''</p></li></ol>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>root@orangepi:/sys/class/leds/green_led# '''echo heartbeat &gt; trigger'''</p>
 +
|}
 +
</li></ol>
 
</li>
 
</li>
 
<li><p>If you do not need the LED light to flash after powering on, you can use the following method to turn off the green light flashing</p>
 
<li><p>If you do not need the LED light to flash after powering on, you can use the following method to turn off the green light flashing</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users remember to add &gt; '''sudo''' permissions.</p>
+
<li><p>First run '''orangepi-config'''. Ordinary users remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p>
 +
|}
 +
</li>
 
<li><p>Then select '''System'''</p>
 
<li><p>Then select '''System'''</p>
<p>[[File:media/image80.png|389x192px]]</p></li>
+
<p>[[File:zero2w-img80.png]]</p></li>
 
<li><p>Then select '''Hardware'''</p>
 
<li><p>Then select '''Hardware'''</p>
<p>[[File:media/image81.png|393x202px]]</p></li>
+
<p>[[File:zero2w-img81.png]]</p></li>
<li><p>Then use the keyboard's arrow keys to locate the position shown &gt; in the picture below, and then use the space to select &gt; '''disable-leds'''</p>
+
<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 '''disable-leds'''</p>
<p>[[File:media/image82.png|397x35px]]</p></li>
+
<p>[[File:zero2w-img82.png]]</p></li>
<li><p>Then select '''&lt;Save&gt;'''to save</p>
+
<li><p>Then select '''&lt;Save&gt;''' to save</p>
<p>[[File:media/image83.png|397x92px]]</p></li>
+
<p>[[File:zero2w-img83.png]]</p></li>
 
<li><p>Then select '''&lt;Back&gt;'''</p>
 
<li><p>Then select '''&lt;Back&gt;'''</p>
<p>[[File:media/image84.png|395x91px]]</p></li>
+
<p>[[File:zero2w-img84.png]]</p></li>
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system to make the &gt; configuration take effect.</p>
+
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system to make the configuration take effect.</p>
<p>[[File:media/image85.png|374x187px]]</p></li>
+
<p>[[File:zero2w-img85.png]]</p></li>
<li><p>After restarting and entering the system, you can see that the &gt; green LED light on the development board will no longer light &gt; up.</p></li></ol>
+
<li><p>After restarting and entering the system, you can see that the green LED light on the development board will no longer light up.</p></li></ol>
 
</li></ol>
 
</li></ol>
  
 
<span id="operation-instructions-for-rootfs-partition-capacity-of-linux-system-in-tf-card"></span>
 
<span id="operation-instructions-for-rootfs-partition-capacity-of-linux-system-in-tf-card"></span>
 +
 
== Operation instructions for rootfs partition capacity of Linux system in TF card ==
 
== Operation instructions for rootfs partition capacity of Linux system in TF card ==
  
Line 946: Line 1,252:
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
<li><p>After burning the Linux image of the development board into the TF card, you can check the usage of the TF card capacity on the '''Ubuntu computer'''. The steps are as follows:</p>
+
<li><p>After burning the Linux image of the development board into the TF card, you can check the usage of the TF card capacity on the '''<span style="color:#FF0000">Ubuntu computer</span>'''. The steps are as follows:</p>
<p>'''Note that failure to perform this step will not affect the automatic expansion of the Linux system of the development board. Here I just want to explain how to check the capacity of the TF card after burning the Linux image on the TF card.'''</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''Note that failure to perform this step will not affect the automatic expansion of the Linux system of the development board. Here I just want to explain how to check the capacity of the TF card after burning the Linux image on the TF card.'''</p></big>
 +
|}
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>First install the gparted software on your Ubuntu computer</p>
 
<li><p>First install the gparted software on your Ubuntu computer</p>
<p>test@test:~$ '''sudo apt install -y gparted'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>test@test:~$ '''sudo apt install -y gparted'''</p>
 +
|}
 +
</li>
 
<li><p>Then open gparted</p>
 
<li><p>Then open gparted</p>
<p>test@test:~$ '''sudo gparted'''</p></li>
+
{| class="wikitable" style="width:800px;"
<li><p>After opening gparted, you can select the TF card in the upper &gt; right corner, and then you can see the usage of the TF card &gt; capacity.</p>
+
|-
<p>[[File:media/image86.png|575x210px]]</p></li>
+
|
<li><p>The picture above shows the situation of the TF card after &gt; burning the Linux desktop system. It can be seen that although &gt; the total capacity of the TF card is 16GB (displayed as &gt; 14.84GiB in GParted), the rootfs partition (/dev/ sdc1) Only &gt; 4.05GiB is actually allocated, leaving 10.79GiB unallocated</p></li></ol>
+
<p>test@test:~$ '''sudo gparted'''</p>
 +
|}
 
</li>
 
</li>
<li><p>Then you can insert the TF card with the Linux system burned into the development board to start. When the TF card starts the Linux system for the first time, it will automatically call the '''orangepi-resize-filesystem''' script through the '''orangepi-resize-filesystem.service''' systemd service. Expansion of rootfs partition, '''so there is no need to manually expand it'''</p></li>
+
<li><p>After opening gparted, you can select the TF card in the upper right corner, and then you can see the usage of the TF card capacity.</p>
<li><p>After logging in to the system, you can use the '''df -h''' command to check the size of rootfs. If it is consistent with the actual capacity of the TF card, it means that the automatic expansion is running correctly.</p></li></ol>
+
<p>[[File:zero2w-img86.png]]</p></li>
 
+
<li><p>The picture above shows the situation of the TF card after burning the Linux desktop system. It can be seen that although the total capacity of the TF card is 16GB (displayed as 14.84GiB in GParted), the rootfs partition (/dev/ sdc1) Only 4.05GiB is actually allocated, leaving 10.79GiB unallocated</p></li></ol>
orangepi@orangepi:~$ '''df -h'''
+
</li>
 
+
<li><p>Then you can insert the TF card with the Linux system burned into the development board to start. When the TF card starts the Linux system for the first time, it will automatically call the '''orangepi-resize-filesystem''' script through the '''orangepi-resize-filesystem.service''' systemd service. Expansion of rootfs partition, '''<span style="color:#FF0000">so there is no need to manually expand it</span>'''</p></li>
Filesystem Size Used Avail Use% Mounted on
+
<li><p>After logging in to the system, you can use the '''df -h''' command to check the size of rootfs. If it is consistent with the actual capacity of the TF card, it means that the automatic expansion is running correctly.</p></li>
 
+
{| class="wikitable" style="width:800px;"
udev 430M 0 430M 0% /dev
+
|-
 
+
|
tmpfs 100M 5.6M 95M 6% /run
+
<p>orangepi@orangepi:~$ '''df -h'''</p>
 
+
<span style="margin-right: 80px;">Filesystem </span><span style="margin-right: 50px;">Size </span><span style="margin-right: 30px;">Used </span><span style="margin-right: 30px;">Avail</span><span style="margin-right: 50px;">Use% Mounted on</span><br>
'''/dev/mmcblk0p1 15G 915M 14G 7% /'''
+
<span style="margin-right: 110px;">udev</span><span style="margin-right: 60px;">430M</span><span style="margin-right: 50px;">0</span><span style="margin-right: 70px;">430M </span><span style="margin-right: 90px;">0% /dev</span><br>
 
+
<span style="margin-right: 100px;">tmpfs </span><span style="margin-right: 50px;">100M </span><span style="margin-right: 30px;">5.6M </span><span style="margin-right: 70px;">95M </span><span style="margin-right: 90px;">6% /run</span><br>
tmpfs 500M 0 500M 0% /dev/shm
+
<span style="margin-right: 25px;color:#FF0000">'''/dev/mmcblk0p1'''</span><span style="margin-right: 50px;color:#FF0000">'''15G'''</span><span style="margin-right: 35px;color:#FF0000">'''915M'''</span><span style="margin-right: 80px;color:#FF0000">'''14G'''</span><span style="margin-right: 90px;color:#FF0000">'''7% /'''</span><br>
 
+
<span style="margin-right: 100px;">tmpfs </span><span style="margin-right: 60px;">500M </span><span style="margin-right: 50px;">0</span><span style="margin-right: 50px;">500M </span><span style="margin-right: 90px;">0% /dev/shm</span><br>
 +
|}
 +
</ol>
 
<ol start="4" style="list-style-type: decimal;">
 
<ol start="4" style="list-style-type: decimal;">
<li><p>After starting the Linux system for the first time, we can also remove the TF card from the development board and reinsert it into the '''Ubuntu computer''', and then use gparted again to check the status of the TF card, as shown in the figure below, rootfs partition (/dev/ The capacity of sdc1) has been expanded to 14.69GiB</p>
+
<li><p>After starting the Linux system for the first time, we can also remove the TF card from the development board and reinsert it into the '''<span style="color:#FF0000">Ubuntu computer</span>''', and then use gparted again to check the status of the TF card, as shown in the figure below, rootfs partition (/dev/ The capacity of sdc1) has been expanded to 14.69GiB</p>
<p>[[File:media/image87.png|575x211px]]</p></li></ol>
 
  
'''It should be noted that the Linux system has only one ext4 format partition and does not use a separate BOOT partition to store files such as kernel images, so there is no problem of BOOT partition expansion.'''
+
<p>[[File:zero2w-img87.png]]</p>
  
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''It should be noted that the Linux system has only one ext4 format partition and does not use a separate BOOT partition to store files such as kernel images, so there is no problem of BOOT partition expansion.'''</big>
 +
|}
 +
</li></ol>
 
<span id="method-to-prohibit-automatic-expansion-of-rootfs-partition-capacity-in-tf-card"></span>
 
<span id="method-to-prohibit-automatic-expansion-of-rootfs-partition-capacity-in-tf-card"></span>
 +
 
=== Method to prohibit automatic expansion of rootfs partition capacity in TF card ===
 
=== Method to prohibit automatic expansion of rootfs partition capacity in TF card ===
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
<li><p>First, burn the Linux image of the development board into the TF card on the '''Ubuntu computer''' (Windows is not available), and '''then unplug and insert the TF card again'''.</p></li>
+
<li><p>First, burn the Linux image of the development board into the TF card on the '''<span style="color:#FF0000">Ubuntu computer</span>''' (Windows is not available), and '''<span style="color:#FF0000">then unplug and insert the TF card again</span>'''.</p></li>
 
<li><p>Then the Ubuntu computer will usually automatically mount the partition of the TF card. If the automatic mounting is normal, use the ls command to see the following output.</p>
 
<li><p>Then the Ubuntu computer will usually automatically mount the partition of the TF card. If the automatic mounting is normal, use the ls command to see the following output.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>test@test:~$ '''ls /media/test/opi_root/'''</p>
 
<p>test@test:~$ '''ls /media/test/opi_root/'''</p>
<p>bin boot dev etc home lib lost+found media mnt opt proc root run sbin selinux srv sys tmp usr var</p></li>
+
<p>bin &nbsp;&nbsp; boot &nbsp;&nbsp; dev &nbsp;&nbsp; etc &nbsp;&nbsp; home &nbsp;&nbsp; lib &nbsp;&nbsp; lost+found &nbsp;&nbsp; media &nbsp;&nbsp; mnt &nbsp;&nbsp; opt &nbsp;&nbsp; proc &nbsp;&nbsp; root &nbsp;&nbsp; run <br> sbin &nbsp;&nbsp; selinux &nbsp;&nbsp; srv &nbsp;&nbsp; sys &nbsp;&nbsp; tmp &nbsp;&nbsp; usr &nbsp;&nbsp; var</p>
 +
|}
 +
</li>
 
<li><p>Then switch the current user to the root user on the Ubuntu computer</p>
 
<li><p>Then switch the current user to the root user on the Ubuntu computer</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>test@test:~$ '''sudo -i'''</p>
 
<p>test@test:~$ '''sudo -i'''</p>
<p>[sudo] test 的密码: </p>
+
<p>[sudo] test 的密码:</p>
<p>root@test:~'''#'''</p></li>
+
<p>root@test:~'''<span style="color:#FF0000">#</span>'''</p>
 +
|}
 +
</li>
 
<li><p>Then enter the root directory of the Linux system in the TF card and create a new file named '''.no_rootfs_resize'''</p>
 
<li><p>Then enter the root directory of the Linux system in the TF card and create a new file named '''.no_rootfs_resize'''</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>root@test:~# '''cd /media/test/opi_root/'''</p>
 
<p>root@test:~# '''cd /media/test/opi_root/'''</p>
 
<p>root@test:/media/test/opi_root/# '''cd root'''</p>
 
<p>root@test:/media/test/opi_root/# '''cd root'''</p>
 
<p>root@test:/media/test/opi_root/root# '''touch .no_rootfs_resize'''</p>
 
<p>root@test:/media/test/opi_root/root# '''touch .no_rootfs_resize'''</p>
 
<p>root@test:/media/test/opi_root/root# '''ls .no_rootfs*'''</p>
 
<p>root@test:/media/test/opi_root/root# '''ls .no_rootfs*'''</p>
<p>'''.no_rootfs_resize'''</p></li>
+
<p>'''.no_rootfs_resize'''</p>
 +
|}
 +
</li>
 
<li><p>Then you can uninstall the TF card, then pull out the TF card and insert it into the development board to start. When the Linux system starts, when the '''.no_rootfs_resize''' file is detected in the '''/root''' directory, rootfs will not be automatically expanded.</p></li>
 
<li><p>Then you can uninstall the TF card, then pull out the TF card and insert it into the development board to start. When the Linux system starts, when the '''.no_rootfs_resize''' file is detected in the '''/root''' directory, rootfs will not be automatically expanded.</p></li>
 
<li><p>After disabling the automatic expansion of rootfs, you can enter the Linux system and you can see that the total capacity of the rootfs partition is only 4GB (the image tested here is the desktop version), which is much smaller than the actual capacity of the TF card, indicating that the automatic expansion of rootfs has been successfully disabled.</p>
 
<li><p>After disabling the automatic expansion of rootfs, you can enter the Linux system and you can see that the total capacity of the rootfs partition is only 4GB (the image tested here is the desktop version), which is much smaller than the actual capacity of the TF card, indicating that the automatic expansion of rootfs has been successfully disabled.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''df -h'''</p>
 
<p>orangepi@orangepi:~$ '''df -h'''</p>
<p>Filesystem Size Used Avail Use% Mounted on</p>
+
<span style="margin-right: 80px;">Filesystem </span><span style="margin-right: 50px;">Size </span><span style="margin-right: 30px;">Used </span><span style="margin-right: 30px;">Avail</span><span style="margin-right: 50px;">Use% Mounted on</span><br>
<p>udev 925M 0 925M 0% /dev</p>
+
<span style="margin-right: 110px;">udev</span><span style="margin-right: 60px;">925M </span><span style="margin-right: 50px;">0</span><span style="margin-right: 70px;">925M </span><span style="margin-right: 90px;">0% /dev</span><br>
<p>tmpfs 199M 3.2M 196M 2% /run</p>
+
<span style="margin-right: 100px;">tmpfs </span><span style="margin-right: 50px;">199M </span><span style="margin-right: 30px;">3.2M </span><span style="margin-right: 70px;">196M </span><span style="margin-right: 90px;">2% /run</span><br>
<p>'''/dev/mmcblk0p1 4.0G 3.2G 686M 83% /'''</p></li>
+
<span style="margin-right: 25px;color:#FF0000">'''/dev/mmcblk0p1'''</span><span style="margin-right: 50px;color:#FF0000">'''4.0G '''</span><span style="margin-right: 35px;color:#FF0000">'''3.2G '''</span><span style="margin-right: 80px;color:#FF0000">'''686M '''</span><span style="margin-right: 90px;color:#FF0000">'''83% /'''</span><br>
<li><p>If you need to re-expand the capacity of the rootfs partition in the TF card, just execute the following command and then restart the Linux system of the development board.</p></li></ol>
+
|}
 
+
</li>
'''Note, please execute the following command under the root user.'''
+
<li><p>If you need to re-expand the capacity of the rootfs partition in the TF card, just execute the following command and then restart the Linux system of the development board.</p>
 
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''Note, please execute the following command under the root user.'''</big>
 +
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
root@orangepi:~# '''rm /root/.no_rootfs_resize'''
 
root@orangepi:~# '''rm /root/.no_rootfs_resize'''
  
Line 1,012: Line 1,361:
  
 
root@orangepi:~# '''sudo reboot'''
 
root@orangepi:~# '''sudo reboot'''
 +
|}
  
 
After restarting, enter the Linux system of the development board again and you will see that the rootfs partition has been expanded to the actual capacity of the TF card.
 
After restarting, enter the Linux system of the development board again and you will see that the rootfs partition has been expanded to the actual capacity of the TF card.
  
root@orangepi:~# '''df -h'''
+
{| class="wikitable" style="width:800px;"
 
+
|-
Filesystem Size Used Avail Use% Mounted on
+
|
 
+
<p>root@orangepi:~$ '''df -h'''</p>
udev 925M 0 925M 0% /dev
+
<span style="margin-right: 80px;">Filesystem </span><span style="margin-right: 50px;">Size </span><span style="margin-right: 30px;">Used </span><span style="margin-right: 30px;">Avail</span><span style="margin-right: 50px;">Use% Mounted on</span><br>
 
+
<span style="margin-right: 110px;">udev</span><span style="margin-right: 60px;">925M </span><span style="margin-right: 50px;">0</span><span style="margin-right: 70px;">925M </span><span style="margin-right: 90px;">0% /dev</span><br>
tmpfs 199M 3.2M 196M 2% /run
+
<span style="margin-right: 100px;">tmpfs </span><span style="margin-right: 50px;">199M </span><span style="margin-right: 30px;">3.2M </span><span style="margin-right: 70px;">196M </span><span style="margin-right: 90px;">2% /run</span><br>
 
+
<span style="margin-right: 25px;color:#FF0000">'''/dev/mmcblk0p1'''</span><span style="margin-right: 50px;color:#FF0000">'''15G'''</span><span style="margin-right: 35px;color:#FF0000">'''3.2G '''</span><span style="margin-right: 80px;color:#FF0000">'''12G '''</span><span style="margin-right: 90px;color:#FF0000">'''23% /'''</span><br>
'''/dev/mmcblk0p1 15G 3.2G 12G 23% /'''
+
|}
 +
</li></ol>
 +
<span id="method-to-manually-expand-the-capacity-of-rootfs-partition-in-tf-card"></span>
  
<span id="method-to-manually-expand-the-capacity-of-rootfs-partition-in-tf-card"></span>
 
 
=== Method to manually expand the capacity of rootfs partition in TF card ===
 
=== Method to manually expand the capacity of rootfs partition in TF card ===
  
'''If the total capacity of the TF card is large, such as 128GB, and you do not want the rootfs partition of the Linux system to use all the capacity of the TF card, you only want to allocate a part of the capacity, such as 16GB, to the Linux system, and then the remaining capacity of the TF card can be used for other purposes. use. Then you can use the content introduced in this section to manually expand the capacity of the rootfs partition in TF.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''If the total capacity of the TF card is large, such as 128GB, and you do not want the rootfs partition of the Linux system to use all the capacity of the TF card, you only want to allocate a part of the capacity, such as 16GB, to the Linux system, and then the remaining capacity of the TF card can be used for other purposes. use. Then you can use the content introduced in this section to manually expand the capacity of the rootfs partition in TF.'''</big>
 +
|}
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
<li><p>First, burn the Linux image of the development board into the TF card on the '''Ubuntu computer''' (Windows is not available), and '''then unplug and insert the TF card again'''.</p></li>
+
<li><p>First, burn the Linux image of the development board into the TF card on the '''<span style="color:#FF0000">Ubuntu computer</span>''' (Windows is not available), and '''<span style="color:#FF0000">then unplug and insert the TF card again</span>'''.</p></li>
 
<li><p>Then the Ubuntu computer will usually automatically mount the partition of the TF card. If the automatic mounting is normal, use the ls command to see the following output.</p>
 
<li><p>Then the Ubuntu computer will usually automatically mount the partition of the TF card. If the automatic mounting is normal, use the ls command to see the following output.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>test@test:~$ '''ls /media/test/opi_root/'''</p>
 
<p>test@test:~$ '''ls /media/test/opi_root/'''</p>
<p>bin boot dev etc home lib lost+found media mnt opt proc root run sbin selinux srv sys tmp usr var</p></li>
+
<p>bin &nbsp;&nbsp; boot &nbsp;&nbsp; dev &nbsp;&nbsp; etc &nbsp;&nbsp; home &nbsp;&nbsp; lib &nbsp;&nbsp; lost+found &nbsp;&nbsp; media &nbsp;&nbsp; mnt &nbsp;&nbsp; opt &nbsp;&nbsp; proc &nbsp;&nbsp; root &nbsp;&nbsp; run <br> sbin &nbsp;&nbsp; selinux &nbsp;&nbsp; srv &nbsp;&nbsp; sys &nbsp;&nbsp; tmp &nbsp;&nbsp; usr &nbsp;&nbsp; var</p>
 +
|}
 +
</li>
 
<li><p>Then switch the current user to the root user on the Ubuntu computer</p>
 
<li><p>Then switch the current user to the root user on the Ubuntu computer</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>test@test:~$ '''sudo -i'''</p>
 
<p>test@test:~$ '''sudo -i'''</p>
<p>[sudo] test 的密码: </p>
+
<p>[sudo] test 的密码:</p>
<p>root@test:~'''#'''</p></li>
+
<p>root@test:~'''<span style="color:#FF0000">#</span>'''</p>
 +
|}
 +
</li>
 
<li><p>Then enter the root directory of the Linux system in the TF card and create a new file named '''.no_rootfs_resize'''</p>
 
<li><p>Then enter the root directory of the Linux system in the TF card and create a new file named '''.no_rootfs_resize'''</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>root@test:~# '''cd /media/test/opi_root/'''</p>
 
<p>root@test:~# '''cd /media/test/opi_root/'''</p>
 
<p>root@test:/media/test/opi_root/# '''cd root'''</p>
 
<p>root@test:/media/test/opi_root/# '''cd root'''</p>
 
<p>root@test:/media/test/opi_root/root# '''touch .no_rootfs_resize'''</p>
 
<p>root@test:/media/test/opi_root/root# '''touch .no_rootfs_resize'''</p>
 
<p>root@test:/media/test/opi_root/root# '''ls .no_rootfs*'''</p>
 
<p>root@test:/media/test/opi_root/root# '''ls .no_rootfs*'''</p>
<p>'''.no_rootfs_resize'''</p></li></ol>
+
<p>'''.no_rootfs_resize'''</p>
 +
|}
 +
</li></ol>
  
<!-- -->
 
 
<ol start="5" style="list-style-type: decimal;">
 
<ol start="5" style="list-style-type: decimal;">
 
<li><p>Then install the gparted software on your Ubuntu computer</p>
 
<li><p>Then install the gparted software on your Ubuntu computer</p>
<p>test@test:~$ '''sudo apt install -y gparted'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>test@test:~$ '''sudo apt install -y gparted'''</p>
 +
|}
 +
</li>
 
<li><p>Then open gparted</p>
 
<li><p>Then open gparted</p>
<p>test@test:~$ '''sudo gparted'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>test@test:~$ '''sudo gparted'''</p>
 +
|}
 +
</li>
 
<li><p>After opening gparted, you can select the TF card in the upper right corner, and then you can see the usage of the TF card capacity. The picture below shows the situation of the TF card after burning the Linux desktop system. It can be seen that although the total capacity of the TF card is 16GB (displayed as 14.84GiB in GParted), the rootfs partition (/dev/sdc1) Only 4.05GiB is actually allocated, leaving 10.79GiB unallocated</p>
 
<li><p>After opening gparted, you can select the TF card in the upper right corner, and then you can see the usage of the TF card capacity. The picture below shows the situation of the TF card after burning the Linux desktop system. It can be seen that although the total capacity of the TF card is 16GB (displayed as 14.84GiB in GParted), the rootfs partition (/dev/sdc1) Only 4.05GiB is actually allocated, leaving 10.79GiB unallocated</p>
<p>[[File:media/image86.png|575x210px]]</p></li>
+
<p>[[File:zero2w-img86.png]]</p></li>
 
<li><p>Then select the rootfs partition (/dev/sdc1)</p>
 
<li><p>Then select the rootfs partition (/dev/sdc1)</p>
<p>[[File:media/image88.png|575x211px]]</p></li>
+
<p>[[File:zero2w-img88.png]]</p></li>
 
<li><p>Right-click the mouse again to see the operation options shown in the picture below. If the TF card has been mounted, you first need to Umount the rootfs partition of the TF card.</p>
 
<li><p>Right-click the mouse again to see the operation options shown in the picture below. If the TF card has been mounted, you first need to Umount the rootfs partition of the TF card.</p>
<p>[[File:media/image89.png|436x298px]]</p></li>
+
<p>[[File:zero2w-img89.png]]</p></li>
 
<li><p>Then select the rootfs partition again, right-click, and select '''Resize/Move''' to start expanding the size of the rootfs partition.</p>
 
<li><p>Then select the rootfs partition again, right-click, and select '''Resize/Move''' to start expanding the size of the rootfs partition.</p>
<p>[[File:media/image90.png|444x302px]]</p></li>
+
<p>[[File:zero2w-img90.png]]</p></li>
 
<li><p>After the '''Resize/Move''' option is turned on, the following setting interface will pop up.</p>
 
<li><p>After the '''Resize/Move''' option is turned on, the following setting interface will pop up.</p>
<p>[[File:media/image91.png|315x193px]]</p></li>
+
<p>[[File:zero2w-img91.png]]</p></li>
 
<li><p>Then you can directly drag the position shown in the figure below to set the size of the capacity, or you can set the size of the rootfs partition by setting the number in '''New size(MiB)'''</p>
 
<li><p>Then you can directly drag the position shown in the figure below to set the size of the capacity, or you can set the size of the rootfs partition by setting the number in '''New size(MiB)'''</p>
<p>[[File:media/image92.png|320x191px]]</p></li>
+
<p>[[File:zero2w-img92.png]]</p></li>
 
<li><p>After setting the capacity, click '''Resize/Move''' in the lower right corner.</p>
 
<li><p>After setting the capacity, click '''Resize/Move''' in the lower right corner.</p>
<p>[[File:media/image93.png|327x196px]]</p></li>
+
<p>[[File:zero2w-img93.png]]</p></li>
<li><p>After final confirmation, click the green '''√''' shown in the picture below.</p>
+
<li><p>After final confirmation, click the green '''<span style="color:green"></span>''' shown in the picture below.</p>
<p>[[File:media/image94.png|392x270px]]</p></li>
+
<p>[[File:zero2w-img94.png]]</p></li>
 
<li><p>Then select '''Apply''', and the capacity expansion of the rootfs partition will officially begin.</p>
 
<li><p>Then select '''Apply''', and the capacity expansion of the rootfs partition will officially begin.</p>
<p>[[File:media/image95.png|399x116px]]</p></li>
+
<p>[[File:zero2w-img95.png]]</p></li>
 
<li><p>After the expansion is completed, click '''Close''' to close it.</p>
 
<li><p>After the expansion is completed, click '''Close''' to close it.</p>
<p>[[File:media/image96.png|399x172px]]</p></li>
+
<p>[[File:zero2w-img96.png]]</p></li>
 
<li><p>Then you can unplug the TF card and insert it into the development board to start. After entering the Linux system of the development board, if you use the '''df -h''' command to see that the size of the rootfs partition is consistent with the size set previously, it means manual Expansion successful</p>
 
<li><p>Then you can unplug the TF card and insert it into the development board to start. After entering the Linux system of the development board, if you use the '''df -h''' command to see that the size of the rootfs partition is consistent with the size set previously, it means manual Expansion successful</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>root@orangepi:~# '''df -h'''</p>
 
<p>root@orangepi:~# '''df -h'''</p>
<p>Filesystem Size Used Avail Use% Mounted on</p>
+
<span style="margin-right: 80px;">Filesystem </span><span style="margin-right: 50px;">Size </span><span style="margin-right: 30px;">Used </span><span style="margin-right: 30px;">Avail</span><span style="margin-right: 50px;">Use% Mounted on</span><br>
<p>udev 925M 0 925M 0% /dev</p>
+
<span style="margin-right: 110px;">udev</span><span style="margin-right: 60px;">925M </span><span style="margin-right: 50px;">0</span><span style="margin-right: 70px;">925M </span><span style="margin-right: 90px;">0% /dev</span><br>
<p>tmpfs 199M 3.2M 196M 2% /run</p>
+
<span style="margin-right: 100px;">tmpfs </span><span style="margin-right: 50px;">199M </span><span style="margin-right: 30px;">3.2M </span><span style="margin-right: 70px;">196M </span><span style="margin-right: 90px;">2% /run</span><br>
<p>'''/dev/mmcblk0p1 7.7G 3.2G 4.4G 42% /'''</p></li></ol>
+
<span style="margin-right: 25px;color:#FF0000">'''/dev/mmcblk0p1'''</span><span style="margin-right: 50px;color:#FF0000">'''7.7G '''</span><span style="margin-right: 35px;color:#FF0000">'''3.2G '''</span><span style="margin-right: 80px;color:#FF0000">'''4.4G '''</span><span style="margin-right: 90px;color:#FF0000">'''42% /'''</span><br>
 +
|}
 +
</li></ol>
  
 
<span id="method-to-reduce-the-capacity-of-rootfs-partition-in-tf-card"></span>
 
<span id="method-to-reduce-the-capacity-of-rootfs-partition-in-tf-card"></span>
 +
 
=== Method to reduce the capacity of rootfs partition in TF card ===
 
=== Method to reduce the capacity of rootfs partition in TF card ===
  
'''After configuring the application or other development environment in the Linux system of the TF card, if you want to back up the Linux system in the TF card, you can use the method in this section to reduce the size of the rootfs partition first, and then start the backup.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''After configuring the application or other development environment in the Linux system of the TF card, if you want to back up the Linux system in the TF card, you can use the method in this section to reduce the size of the rootfs partition first, and then start the backup.'''</big>
 +
|}
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
<li><p>First, insert the TF card you want to operate on your '''Ubuntu computer''' (not Windows)</p></li>
+
<li><p>First, insert the TF card you want to operate on your '''<span style="color:#FF0000">Ubuntu computer</span>''' (not Windows)</p></li>
 
<li><p>Then install the gparted software on your Ubuntu computer</p>
 
<li><p>Then install the gparted software on your Ubuntu computer</p>
<p>test@test:~$ '''sudo apt install -y gparted'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>test@test:~$ '''sudo apt install -y gparted'''</p>
 +
|}
 +
</li>
 
<li><p>Then open gparted</p>
 
<li><p>Then open gparted</p>
<p>test@test:~$ '''sudo gparted'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>test@test:~$ '''sudo gparted'''</p>
 +
|}
 +
</li>
 
<li><p>After opening gparted, you can select the TF card in the upper right corner, and then you can see the usage of the TF card capacity.</p>
 
<li><p>After opening gparted, you can select the TF card in the upper right corner, and then you can see the usage of the TF card capacity.</p>
<p>[[File:media/image97.png|575x217px]]</p></li>
+
<p>[[File:zero2w-img97.png]]</p></li>
 
<li><p>Then select the rootfs partition (/dev/sdc1)</p>
 
<li><p>Then select the rootfs partition (/dev/sdc1)</p>
<p>[[File:media/image98.png|575x217px]]</p></li>
+
<p>[[File:zero2w-img98.png]]</p></li>
 
<li><p>Right-click the mouse again to see the operation options shown in the picture below. If the TF card is already mounted, you first need to Umount the rootfs partition of the TF card.</p>
 
<li><p>Right-click the mouse again to see the operation options shown in the picture below. If the TF card is already mounted, you first need to Umount the rootfs partition of the TF card.</p>
<p>[[File:media/image99.png|400x274px]]</p></li>
+
<p>[[File:zero2w-img99.png]]</p></li>
 
<li><p>Then select the rootfs partition again, right-click the mouse, and select '''Resize/Move''' to start setting the size of the rootfs partition.</p>
 
<li><p>Then select the rootfs partition again, right-click the mouse, and select '''Resize/Move''' to start setting the size of the rootfs partition.</p>
<p>[[File:media/image100.png|399x273px]]</p></li>
+
<p>[[File:zero2w-img100.png]]</p></li>
 
<li><p>After the '''Resize/Move''' option is turned on, the following setting interface will pop up.</p>
 
<li><p>After the '''Resize/Move''' option is turned on, the following setting interface will pop up.</p>
<p>[[File:media/image101.png|315x188px]]</p></li>
+
<p>[[File:zero2w-img101.png]]</p></li>
 
<li><p>Then you can directly drag the position shown in the figure below to set the size of the capacity, or you can set the size of the rootfs partition by setting the number in '''New sieze(MiB)'''</p>
 
<li><p>Then you can directly drag the position shown in the figure below to set the size of the capacity, or you can set the size of the rootfs partition by setting the number in '''New sieze(MiB)'''</p>
<p>[[File:media/image92.png|318x190px]]</p></li>
+
<p>[[File:zero2w-img92.png]]</p></li>
 
<li><p>After setting the capacity, click '''Resize/Move''' in the lower right corner.</p>
 
<li><p>After setting the capacity, click '''Resize/Move''' in the lower right corner.</p>
<p>[[File:media/image93.png|327x196px]]</p></li>
+
<p>[[File:zero2w-img93.png]]</p></li>
<li><p>After final confirmation, click the green '''√''' as shown in the picture below.</p>
+
<li><p>After final confirmation, click the green '''<span style="color:green"></span>''' as shown in the picture below.</p>
<p>[[File:media/image94.png|392x270px]]</p></li>
+
<p>[[File:zero2w-img94.png]]</p></li>
 
<li><p>Then select '''Apply''', and the capacity expansion of the rootfs partition will officially begin.</p>
 
<li><p>Then select '''Apply''', and the capacity expansion of the rootfs partition will officially begin.</p>
<p>[[File:media/image95.png|365x106px]]</p></li>
+
<p>[[File:zero2w-img95.png]]</p></li>
 
<li><p>After the expansion is completed, click '''Close''' to close it.</p>
 
<li><p>After the expansion is completed, click '''Close''' to close it.</p>
<p>[[File:media/image96.png|379x164px]]</p></li>
+
<p>[[File:zero2w-img96.png]]</p></li>
 
<li><p>Then you can unplug the TF card and insert it into the development board to start. After entering the Linux system of the development board, if you use the '''df -h''' command, you can see that the size of the rootfs partition is consistent with the size set previously, which means it has been reduced capacity success</p>
 
<li><p>Then you can unplug the TF card and insert it into the development board to start. After entering the Linux system of the development board, if you use the '''df -h''' command, you can see that the size of the rootfs partition is consistent with the size set previously, which means it has been reduced capacity success</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>root@orangepi:~# '''df -h'''</p>
 
<p>root@orangepi:~# '''df -h'''</p>
<p>Filesystem Size Used Avail Use% Mounted on</p>
+
<span style="margin-right: 80px;">Filesystem </span><span style="margin-right: 50px;">Size </span><span style="margin-right: 30px;">Used </span><span style="margin-right: 30px;">Avail</span><span style="margin-right: 50px;">Use% Mounted on</span><br>
<p>udev 925M 0 925M 0% /dev</p>
+
<span style="margin-right: 110px;">udev</span><span style="margin-right: 60px;">925M </span><span style="margin-right: 50px;">0</span><span style="margin-right: 70px;">925M </span><span style="margin-right: 90px;">0% /dev</span><br>
<p>tmpfs 199M 3.2M 196M 2% /run</p>
+
<span style="margin-right: 100px;">tmpfs </span><span style="margin-right: 50px;">199M </span><span style="margin-right: 30px;">3.2M </span><span style="margin-right: 70px;">196M </span><span style="margin-right: 90px;">2% /run</span><br>
<p>'''/dev/mmcblk0p1 7.7G 3.2G 4.4G 42% /'''</p></li></ol>
+
<span style="margin-right: 25px;color:#FF0000">'''/dev/mmcblk0p1'''</span><span style="margin-right: 50px;color:#FF0000">'''7.7G '''</span><span style="margin-right: 35px;color:#FF0000">'''3.2G '''</span><span style="margin-right: 80px;color:#FF0000">'''4.4G '''</span><span style="margin-right: 90px;color:#FF0000">'''42% /'''</span><br>
 +
|}</li></ol>
  
 
<span id="pin-expansion-board-interface-pin-description"></span>
 
<span id="pin-expansion-board-interface-pin-description"></span>
 +
 
== 24Pin expansion board interface pin description ==
 
== 24Pin expansion board interface pin description ==
  
Line 1,124: Line 1,528:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image102.png|263x86px|002]]
+
[[File:zero2w-img102.png]]
  
 
</div></li>
 
</div></li>
 
<li><p>The schematic diagram of the 24pin expansion board interface of the development board is as follows</p>
 
<li><p>The schematic diagram of the 24pin expansion board interface of the development board is as follows</p>
<p>[[File:media/image103.png|337x230px]]</p></li>
+
<p>[[File:zero2w-img103.png]]</p></li>
 
<li><p>The way to connect the expansion board to the development board is as follows. Please pay attention to the forward and reverse directions of the cable and do not plug it in backwards.</p>
 
<li><p>The way to connect the expansion board to the development board is as follows. Please pay attention to the forward and reverse directions of the cable and do not plug it in backwards.</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image104.png|357x207px|_MG_2148]]
+
[[File:zero2w-img104.png]]
  
 
</div></li>
 
</div></li>
Line 1,138: Line 1,542:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image105.png|403x223px|1695354662277]]
+
[[File:zero2w-img105.png]]
  
</div></li></ol>
+
</div></li>
  
{| class="wikitable"
+
{| class="wikitable" style="width:800px;text-align: center;"
 
|-
 
|-
| 1
+
| style="width:50px;" | 1
| 100M network port
+
| style="width:200px;" | 100M network port
 
| Used to connect to a wired network to access the Internet
 
| Used to connect to a wired network to access the Internet
 
|-
 
|-
Line 1,168: Line 1,572:
 
| The default settings of the Linux system are KEY_1 (Number 1 key) and KEY_ENTER (Enter key), which can be customized as other function keys by modifying the dts configuration.
 
| The default settings of the Linux system are KEY_1 (Number 1 key) and KEY_ENTER (Enter key), which can be customized as other function keys by modifying the dts configuration.
 
|}
 
|}
 
+
</ol>
 
<ol start="5" style="list-style-type: decimal;">
 
<ol start="5" style="list-style-type: decimal;">
<li>The adaptation of Linux5.4 and Linux6.1 systems to expansion boards is shown in the following table</li></ol>
+
<li>The adaptation of Linux5.4 and Linux6.1 systems to expansion boards is shown in the following table</li>
  
{| class="wikitable"
+
{| class="wikitable" style="width:800px;text-align: center;"
 
|-
 
|-
 
| '''24pin expansion board function'''
 
| '''24pin expansion board function'''
Line 1,207: Line 1,611:
 
|-
 
|-
 
| '''TV-OUT'''
 
| '''TV-OUT'''
| '''NO'''
+
| '''<span style="color:#FF0000">NO</span>'''
| '''NO'''
+
| '''<span style="color:#FF0000">NO</span>'''
 
|}
 
|}
 +
</ol>
 +
<span id="how-to-use-the-two-lradc-buttons-on-the-24pin-expansion-board"></span>
  
<span id="how-to-use-the-two-lradc-buttons-on-the-24pin-expansion-board"></span>
 
 
== How to use the two LRADC buttons on the 24pin expansion board ==
 
== How to use the two LRADC buttons on the 24pin expansion board ==
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>There are two LRADC buttons on the 24pin expansion board, and their locations are as shown in the figure below:</p>
 
<li><p>There are two LRADC buttons on the 24pin expansion board, and their locations are as shown in the figure below:</p>
<p>[[File:media/image106.png|346x182px]]</p></li>
+
<p>[[File:zero2w-img106.png]]</p></li>
<li><p>In the Linux system, the default key values of KEY1 and KEY2 are</p></li></ol>
+
<li><p>In the Linux system, the default key values of KEY1 and KEY2 are</p></li>
  
{| class="wikitable"
+
{| class="wikitable" style="width:800px;text-align: center;"
 
|-
 
|-
 
| '''Linux kernel'''
 
| '''Linux kernel'''
Line 1,233: Line 1,638:
 
| '''KEY_ENTER, the enter key'''
 
| '''KEY_ENTER, the enter key'''
 
|}
 
|}
 
+
</ol>
 
<ol start="3" style="list-style-type: decimal;">
 
<ol start="3" style="list-style-type: decimal;">
 
<li><p>Through the '''evtest''' command, we can check the key values reported after KEY1 and KEY2 are pressed.</p>
 
<li><p>Through the '''evtest''' command, we can check the key values reported after KEY1 and KEY2 are pressed.</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>linux5.4</p>
 
<li><p>linux5.4</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepizero2w:~$ '''evtest'''</p>
 
<p>orangepi@orangepizero2w:~$ '''evtest'''</p>
 
<p>No device specified, trying to scan all of /dev/input/event*</p>
 
<p>No device specified, trying to scan all of /dev/input/event*</p>
 
<p>Not running as root, no devices may be available.</p>
 
<p>Not running as root, no devices may be available.</p>
 
<p>Available devices:</p>
 
<p>Available devices:</p>
<p>'''/dev/input/event0: sunxi-keyboard'''</p>
+
<p>'''/dev/input/event<span style="color:#FF0000">0</span>: <span style="color:#FF0000">sunxi-keyboard</span>'''</p>
 
<p>/dev/input/event1: sunxi-ir</p>
 
<p>/dev/input/event1: sunxi-ir</p>
 
<p>/dev/input/event2: axp2101-pek</p>
 
<p>/dev/input/event2: axp2101-pek</p>
Line 1,250: Line 1,658:
 
<p>/dev/input/event6: PixArt USB Optical Mouse</p>
 
<p>/dev/input/event6: PixArt USB Optical Mouse</p>
 
<p>/dev/input/event7: BRLTTY 6.3 Linux Screen Driver Keyboard</p>
 
<p>/dev/input/event7: BRLTTY 6.3 Linux Screen Driver Keyboard</p>
<p>Select the device event number [0-7]: '''0 #You need to enter the serial number corresponding to sunxi-keyboard'''</p>
+
<p>Select the device event number [0-7]: '''<span style="color:#FF0000">0</span> #You need to enter the serial number corresponding to sunxi-keyboard'''</p>
 
<p>Input driver version is 1.0.1</p>
 
<p>Input driver version is 1.0.1</p>
 
<p>Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100</p>
 
<p>Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100</p>
 
<p>Input device name: &quot;sunxi-keyboard&quot;</p>
 
<p>Input device name: &quot;sunxi-keyboard&quot;</p>
 
<p>Supported events:</p>
 
<p>Supported events:</p>
<p>Event type 0 (EV_SYN)</p>
+
:<p>Event type 0 (EV_SYN)</p>
<p>Event type 1 (EV_KEY)</p>
+
:<p>Event type 1 (EV_KEY)</p>
<p>Event code 2 (KEY_1)</p>
+
::<p>Event code 2 (KEY_1)</p>
<p>Event code 28 (KEY_ENTER)</p>
+
::<p>Event code 28 (KEY_ENTER)</p>
 
<p>Properties:</p>
 
<p>Properties:</p>
 
<p>Testing ... (interrupt to exit)</p>
 
<p>Testing ... (interrupt to exit)</p>
 +
 +
 
<p>'''#The following are the key values reported after pressing KEY1 and KEY2'''</p>
 
<p>'''#The following are the key values reported after pressing KEY1 and KEY2'''</p>
 +
 +
 
<p>Event: time 1693555298.132314, type 1 (EV_KEY), code 2 (KEY_1), value 1</p>
 
<p>Event: time 1693555298.132314, type 1 (EV_KEY), code 2 (KEY_1), value 1</p>
 
<p>Event: time 1693555298.132314, -------------- SYN_REPORT ------------</p>
 
<p>Event: time 1693555298.132314, -------------- SYN_REPORT ------------</p>
Line 1,269: Line 1,681:
 
<p>Event: time 1693555298.601042, -------------- SYN_REPORT ------------</p>
 
<p>Event: time 1693555298.601042, -------------- SYN_REPORT ------------</p>
 
<p>Event: time 1693555298.710415, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0</p>
 
<p>Event: time 1693555298.710415, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0</p>
<p>Event: time 1693555298.710415, -------------- SYN_REPORT ------------</p></li>
+
<p>Event: time 1693555298.710415, -------------- SYN_REPORT ------------</p>
 +
|}</li>
 
<li><p>linux6.1</p>
 
<li><p>linux6.1</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepizero2w:~$ evtest</p>
 
<p>orangepi@orangepizero2w:~$ evtest</p>
 
<p>No device specified, trying to scan all of /dev/input/event*</p>
 
<p>No device specified, trying to scan all of /dev/input/event*</p>
Line 1,276: Line 1,692:
 
<p>Available devices:</p>
 
<p>Available devices:</p>
 
<p>/dev/input/event0: axp20x-pek</p>
 
<p>/dev/input/event0: axp20x-pek</p>
<p>'''/dev/input/event1: 5070800.lradc'''</p>
+
<p>'''/dev/input/event<span style="color:#FF0000">1</span>: <span style="color:#FF0000">5070800.lradc</span>'''</p>
 
<p>/dev/input/event2: SONiX USB Keyboard</p>
 
<p>/dev/input/event2: SONiX USB Keyboard</p>
 
<p>/dev/input/event3: SONiX USB Keyboard Consumer Control</p>
 
<p>/dev/input/event3: SONiX USB Keyboard Consumer Control</p>
Line 1,282: Line 1,698:
 
<p>/dev/input/event5: PixArt USB Optical Mouse</p>
 
<p>/dev/input/event5: PixArt USB Optical Mouse</p>
 
<p>/dev/input/event6: sunxi-ir</p>
 
<p>/dev/input/event6: sunxi-ir</p>
<p>Select the device event number [0-6]: '''1 #You need to enter the serial number corresponding to 5070800.lradc'''</p>
+
<p>Select the device event number [0-6]: '''<span style="color:#FF0000">1</span> #You need to enter the serial number corresponding to 5070800.lradc'''</p>
 
<p>Input driver version is 1.0.1</p>
 
<p>Input driver version is 1.0.1</p>
 
<p>Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100</p>
 
<p>Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100</p>
 
<p>Input device name: &quot;5070800.lradc&quot;</p>
 
<p>Input device name: &quot;5070800.lradc&quot;</p>
 
<p>Supported events:</p>
 
<p>Supported events:</p>
<p>Event type 0 (EV_SYN)</p>
+
:<p>Event type 0 (EV_SYN)</p>
<p>Event type 1 (EV_KEY)</p>
+
:<p>Event type 1 (EV_KEY)</p>
<p>Event code 2 (KEY_1)</p>
+
::<p>Event code 2 (KEY_1)</p>
<p>Event code 28 (KEY_ENTER)</p>
+
::<p>Event code 28 (KEY_ENTER)</p>
 
<p>Properties:</p>
 
<p>Properties:</p>
 
<p>Testing ... (interrupt to exit)</p>
 
<p>Testing ... (interrupt to exit)</p>
 +
 +
 
<p>'''#The following are the key values reported after pressing KEY1 and KEY2'''</p>
 
<p>'''#The following are the key values reported after pressing KEY1 and KEY2'''</p>
 +
 +
 
<p>Event: time 1694075818.810877, type 1 (EV_KEY), code 2 (KEY_1), value 1</p>
 
<p>Event: time 1694075818.810877, type 1 (EV_KEY), code 2 (KEY_1), value 1</p>
 
<p>Event: time 1694075818.810877, -------------- SYN_REPORT ------------</p>
 
<p>Event: time 1694075818.810877, -------------- SYN_REPORT ------------</p>
Line 1,301: Line 1,721:
 
<p>Event: time 1694075819.536128, -------------- SYN_REPORT ------------</p>
 
<p>Event: time 1694075819.536128, -------------- SYN_REPORT ------------</p>
 
<p>Event: time 1694075819.705009, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0</p>
 
<p>Event: time 1694075819.705009, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0</p>
<p>Event: time 1694075819.705009, -------------- SYN_REPORT ------------</p></li></ol>
+
<p>Event: time 1694075819.705009, -------------- SYN_REPORT ------------</p>
 +
|}</li></ol>
 
</li>
 
</li>
 
<li><p>If you need to modify the key values reported after KEY1 and KEY2 are pressed, you can use the following method:</p>
 
<li><p>If you need to modify the key values reported after KEY1 and KEY2 are pressed, you can use the following method:</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>There is a '''sun50i-h618-lradc-keys.dts''' file under the &gt; '''/usr/src/''' path, through which we can define KEY1 and KEY2 &gt; as the desired key values.</p>
+
<li><p>There is a '''sun50i-h618-lradc-keys.dts''' file under the '''/usr/src/''' path, through which we can define KEY1 and KEY2 as the desired key values.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepizero2w:~$ '''cd /usr/src/'''</p>
 
<p>orangepi@orangepizero2w:~$ '''cd /usr/src/'''</p>
 
<p>orangepi@orangepizero2w:/usr/src$ '''ls *.dts'''</p>
 
<p>orangepi@orangepizero2w:/usr/src$ '''ls *.dts'''</p>
<p>sun50i-h618-lradc-keys.dts</p></li>
+
<p>sun50i-h618-lradc-keys.dts</p>
<li><p>The contents of the '''sun50i-h618-lradc-keys.dts''' file in the &gt; linux5.4 system are as follows:</p>
+
|}</li>
<ol style="list-style-type: lower-alpha;">
+
<li><p>The contents of the '''sun50i-h618-lradc-keys.dts''' file in the linux5.4 system are as follows:</p>
<li><p>KEY1 correspondence: modify '''key0 = &lt;600 2&gt;;''' where 2 is &gt; the number corresponding to the desired key value</p></li>
+
<ol style="list-style-type: none;">
<li><p>KEY2 correspondence: modify '''key1 = &lt;800 28&gt;;''' where 28 &gt; is the number corresponding to the desired key value</p>
+
<li><p>a) KEY1 correspondence: modify '''key0 = &lt;600 2&gt;;''' where 2 is the number corresponding to the desired key value</p></li>
 +
<li><p>b) KEY2 correspondence: modify '''key1 = &lt;800 28&gt;;''' where 28 is the number corresponding to the desired key value</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepizero2w:/usr/src$ '''sudo vim sun50i-h618-lradc-keys.dts'''</p>
 
<p>orangepi@orangepizero2w:/usr/src$ '''sudo vim sun50i-h618-lradc-keys.dts'''</p>
 
<p>/dts-v1/;</p>
 
<p>/dts-v1/;</p>
 
<p>/plugin/;</p>
 
<p>/plugin/;</p>
 +
 +
 
<p>/ {</p>
 
<p>/ {</p>
<p>fragment@0 {</p>
+
:<p>fragment@0 {</p>
<p>target = &lt;&amp;keyboard&gt;;</p>
+
::<p>target = &lt;&amp;keyboard&gt;;</p>
<p>__overlay__ {</p>
+
 
<p>status = &quot;okay&quot;;</p>
+
 
<p>'''key0 = &lt;600 2&gt;;'''</p>
+
::<p>__overlay__ {</p>
<p>'''key1 = &lt;800 28&gt;;'''</p>
+
:::<p>status = &quot;okay&quot;;</p>
 +
 
 +
 
 +
:::<p>'''key0 = &lt;600 <span style="color:#FF0000">2</span>&gt;;'''</p>
 +
:::<p>'''key1 = &lt;800 <span style="color:#FF0000">28</span>&gt;;'''</p>
 +
::<p>};</p>
 +
:<p>};</p>
 
<p>};</p>
 
<p>};</p>
<p>};</p>
+
|}
<p>};</p></li></ol>
+
</li></ol>
 
</li>
 
</li>
<li><p>The contents of the c.linux6.1 system &gt; '''sun50i-h618-lradc-keys.dts''' file are as follows:</p>
+
<li><p>The contents of the c.linux6.1 system '''sun50i-h618-lradc-keys.dts''' file are as follows:</p>
<ol style="list-style-type: lower-alpha;">
+
<ol style="list-style-type: none;">
<li><p>KEY1 corresponding: modify '''linux,code = &lt;2&gt;;''' the 2 in &gt; it is the number corresponding to the desired key value</p></li>
+
<li><p>a) KEY1 corresponding: modify '''linux,code = &lt;2&gt;;''' the 2 in &gt; it is the number corresponding to the desired key value</p></li>
<li><p>KEY2 correspondence: modify '''linux,code = &lt;28&gt;;''' the 28 &gt; in it is the number corresponding to the desired key value</p>
+
<li><p>b) KEY2 correspondence: modify '''linux,code = &lt;28&gt;;''' the 28 &gt; in it is the number corresponding to the desired key value</p>
<p>orangepi@orangepizero2w:/usr/src$ '''sudo vim sun50i-h618-lradc-keys.dts'''</p>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepizero2w:/usr/src$ '''sudo''' '''vim''' '''sun50i-h618-lradc-keys.dts'''</p>
 
<p>/dts-v1/;</p>
 
<p>/dts-v1/;</p>
 
<p>/plugin/;</p>
 
<p>/plugin/;</p>
 +
 +
 
<p>/ {</p>
 
<p>/ {</p>
<p>fragment@0 {</p>
+
:<p>fragment@0 {</p>
<p>target = &lt;&amp;r_lradc&gt;;</p>
+
::<p>target = &lt;&amp;r_lradc&gt;;</p>
<p>__overlay__ {</p>
+
 
<p>status = &quot;okay&quot;;</p>
+
 
<p>button-500 {</p>
+
::<p>__overlay__ {</p>
<p>label = &quot;KEY_1&quot;;</p>
+
:::<p>status = &quot;okay&quot;;</p>
<p>'''linux,code = &lt;2&gt;;'''</p>
+
 
 +
 
 +
:::<p>button-500 {</p>
 +
::::<p>label = &quot;KEY_1&quot;;</p>
 +
::::<p>'''linux,code = &lt;<span style="color:#FF0000">2</span>&gt;;'''</p>
 +
:::<p>};</p>
 +
 
 +
 
 +
:::<p>button-800 {</p>
 +
::::<p>label = &quot;KEY_ENTER&quot;;</p>
 +
::::<p>'''linux,code = &lt;<span style="color:#FF0000">28</span>&gt;;'''</p>
 +
:::<p>};</p>
 +
::<p>};</p>
 +
:<p>};</p>
 
<p>};</p>
 
<p>};</p>
<p>button-800 {</p>
+
|}
<p>label = &quot;KEY_ENTER&quot;;</p>
+
</li></ol>
<p>'''linux,code = &lt;28&gt;;'''</p>
 
<p>};</p>
 
<p>};</p>
 
<p>};</p>
 
<p>};</p></li></ol>
 
 
</li>
 
</li>
<li><p>For the key values that can be set, please refer to the macro &gt; definition in the '''input-event-codes.h''' header file. Its &gt; path in the kernel source code is:</p>
+
<li><p>For the key values that can be set, please refer to the macro definition in the '''input-event-codes.h''' header file. Its path in the kernel source code is:</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orange-pi-5.4-sun50iw9/include/uapi/linux/input-event-codes.h</p>
 
<p>orange-pi-5.4-sun50iw9/include/uapi/linux/input-event-codes.h</p>
<p>orange-pi-6.1-sun50iw9/include/uapi/linux/input-event-codes.h</p></li>
+
<p>orange-pi-6.1-sun50iw9/include/uapi/linux/input-event-codes.h</p>
<li><p>After modification, use the '''orangepi-add-overlay''' command to &gt; add the sun50i-h618-lradc-keys.dts configuration to the &gt; system.</p>
+
|}
 +
</li>
 +
<li><p>After modification, use the '''orangepi-add-overlay''' command to add the sun50i-h618-lradc-keys.dts configuration to the system.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepizero2w:/usr/src$ '''sudo orangepi-add-overlay sun50i-h618-lradc-keys.dts'''</p>
 
<p>orangepi@orangepizero2w:/usr/src$ '''sudo orangepi-add-overlay sun50i-h618-lradc-keys.dts'''</p>
 
<p>Compiling the overlay</p>
 
<p>Compiling the overlay</p>
 
<p>Copying the compiled overlay file to /boot/overlay-user/</p>
 
<p>Copying the compiled overlay file to /boot/overlay-user/</p>
<p>Reboot is required to apply the changes</p></li>
+
<p>Reboot is required to apply the changes</p>
<li><p>Then restart the system and the customized key values will take &gt; effect.</p></li></ol>
+
|}
 +
</li>
 +
<li><p>Then restart the system and the customized key values will take effect.</p></li></ol>
 
</li></ol>
 
</li></ol>
  
 
<span id="network-connection-test"></span>
 
<span id="network-connection-test"></span>
 +
 
== Network connection test ==
 
== Network connection test ==
  
Line 1,370: Line 1,830:
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>There is no wired network interface on the main board of the development board. We can expand the 100M wired network interface through a 24pin expansion board.</p>
 
<li><p>There is no wired network interface on the main board of the development board. We can expand the 100M wired network interface through a 24pin expansion board.</p>
<p>[[File:media/image107.png|338x229px]]</p></li>
+
<p>[[File:zero2w-img107.png]]</p></li>
 
<li><p>Then plug one end of the network cable into the Ethernet interface of the expansion board, and the other end of the network cable into the router, and make sure the network is smooth.</p></li>
 
<li><p>Then plug one end of the network cable into the Ethernet interface of the expansion board, and the other end of the network cable into the router, and make sure the network is smooth.</p></li>
<li><p>After the system starts, it will automatically assign an IP address to the Ethernet card through '''DHCP''', '''and no other configuration is required.'''</p></li>
+
<li><p>After the system starts, it will automatically assign an IP address to the Ethernet card through '''DHCP''', '''<span style="color:#FF0000">and no other configuration is required.</span>'''</p></li>
 
<li><p>The command to view the IP address in the Linux system of the development board is as follows:</p>
 
<li><p>The command to view the IP address in the Linux system of the development board is as follows:</p>
<p>'''Please do not copy the following commands. For example, the network node name in debian12 is end0, and the following command needs to be modified to ip a s end0.'''</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''Please do not copy the following commands. For example, the network node name in debian12 is end0, and the following command needs to be modified to ip a s end0.'''</p></big>
 +
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''ip a s eth0'''</p>
 
<p>orangepi@orangepi:~$ '''ip a s eth0'''</p>
 
<p>3: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000</p>
 
<p>3: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000</p>
<p>link/ether 5e:ac:14:a5:93:b3 brd ff:ff:ff:ff:ff:ff</p>
+
:<p>link/ether 5e:ac:14:a5:93:b3 brd ff:ff:ff:ff:ff:ff</p>
<p>inet '''192.168.1.16'''/24 brd 192.168.1.255 scope global dynamic noprefixroute eth0</p>
+
:<p>inet '''<span style="color:#FF0000">192.168.1.16</span>'''/24 brd 192.168.1.255 scope global dynamic noprefixroute eth0</p>
<p>valid_lft 259174sec preferred_lft 259174sec</p>
+
::<p>valid_lft 259174sec preferred_lft 259174sec</p>
<p>inet6 240e:3b7:3240:c3a0:e269:8305:dc08:135e/64 scope global dynamic noprefixroute</p>
+
:<p>inet6 240e:3b7:3240:c3a0:e269:8305:dc08:135e/64 scope global dynamic noprefixroute</p>
<p>valid_lft 259176sec preferred_lft 172776sec</p>
+
::<p>valid_lft 259176sec preferred_lft 172776sec</p>
<p>inet6 fe80::957d:bbbd:4928:3604/64 scope link noprefixroute</p>
+
:<p>inet6 fe80::957d:bbbd:4928:3604/64 scope link noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p>
+
::<p>valid_lft forever preferred_lft forever</p>
<p>'''There are three ways to check the IP address after the development board is started:'''</p>
+
|}
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''There are three ways to check the IP address after the development board is started:'''</p>
 
<p>'''1. Connect the HDMI display, then log in to the system and use the ip a s eth0 command to check the IP address.'''</p>
 
<p>'''1. Connect the HDMI display, then log in to the system and use the ip a s eth0 command to check the IP address.'''</p>
 
<p>'''2. Enter the ip a s eth0 command in the debugging serial terminal to view the IP address.'''</p>
 
<p>'''2. Enter the ip a s eth0 command in the debugging serial terminal to view the IP address.'''</p>
 
<p>'''3. If there is no debugging serial port or HDMI display, you can also check the IP address of the development board's network port through the router's management interface. However, with this method, people often fail to see the IP address of the development board. If you can't see it, here's how to debug it:'''</p>
 
<p>'''3. If there is no debugging serial port or HDMI display, you can also check the IP address of the development board's network port through the router's management interface. However, with this method, people often fail to see the IP address of the development board. If you can't see it, here's how to debug it:'''</p>
<p>'''A) First check whether the Linux system has started normally. If the green light of the development board flashes, it usually means that it has started normally. If only the red light is on, or the red and green lights are not on, it means that the system has not started normally;'''</p>
+
:<p>'''A) First check whether the Linux system has started normally. If the green light of the development board flashes, it usually means that it has started normally. If only the red light is on, or the red and green lights are not on, it means that the system has not started normally;'''</p>
<p>'''B) Check whether the network cable is plugged in tightly, or try another network cable;'''</p>
+
:<p>'''B) Check whether the network cable is plugged in tightly, or try another network cable;'''</p>
<p>'''C) Try another router (I have encountered many problems with routers, such as the router being unable to assign an IP address normally, or the IP address being assigned normally but not being visible in the router);'''</p>
+
:<p>'''C) Try another router (I have encountered many problems with routers, such as the router being unable to assign an IP address normally, or the IP address being assigned normally but not being visible in the router);'''</p>
<p>'''D) If there is no router to replace, you can only connect an HDMI display or use the debugging serial port to check the IP address.'''</p>
+
:<p>'''D) If there is no router to replace, you can only connect an HDMI display or use the debugging serial port to check the IP address.'''</p>
<p>'''In addition, it should be noted that the development board's DHCP automatic allocation of IP addresses does not require any settings.'''</p></li>
+
 
 +
 
 +
<p>'''In addition, it should be noted that the development board's DHCP automatic allocation of IP addresses does not require any settings.'''</p></big>
 +
|}
 +
</li>
 
<li><p>The command to test network connectivity is as follows. The '''ping''' command can be interrupted by pressing the '''Ctrl+C''' shortcut key.</p>
 
<li><p>The command to test network connectivity is as follows. The '''ping''' command can be interrupted by pressing the '''Ctrl+C''' shortcut key.</p>
<p>'''Please do not copy the following commands. For example, the network node name in debian12 is end0. The following command needs to be modified to ping www.baidu.com -I end0.'''</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''Please do not copy the following commands. For example, the network node name in debian12 is end0. The following command needs to be modified to ping www.baidu.com -I end0.'''</p></big>
 +
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''ping www.baidu.com -I eth0'''</p>
 
<p>orangepi@orangepi:~$ '''ping www.baidu.com -I eth0'''</p>
 
<p>PING www.a.shifen.com (14.215.177.38) from 192.168.1.12 eth0: 56(84) bytes of data.</p>
 
<p>PING www.a.shifen.com (14.215.177.38) from 192.168.1.12 eth0: 56(84) bytes of data.</p>
Line 1,404: Line 1,886:
 
<p>--- www.a.shifen.com ping statistics ---</p>
 
<p>--- www.a.shifen.com ping statistics ---</p>
 
<p>4 packets transmitted, 4 received, 0% packet loss, time 3002ms</p>
 
<p>4 packets transmitted, 4 received, 0% packet loss, time 3002ms</p>
<p>rtt min/avg/max/mdev = 6.260/6.770/7.275/0.373 ms</p></li></ol>
+
<p>rtt min/avg/max/mdev = 6.260/6.770/7.275/0.373 ms</p>
 +
|}
 +
</li></ol>
  
 
<span id="wifi-connection-test"></span>
 
<span id="wifi-connection-test"></span>
 +
 
=== WIFI connection test ===
 
=== WIFI connection test ===
  
'''Please do not connect to WIFI by modifying the /etc/network/interfaces configuration file. There will be problems in connecting to the WIFI network in this way.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''Please do not connect to WIFI by modifying the /etc/network/interfaces configuration file. There will be problems in connecting to the WIFI network in this way.'''</big>
 +
|}
  
 
<span id="server-version-image-connects-to-wifi-through-commands"></span>
 
<span id="server-version-image-connects-to-wifi-through-commands"></span>
 
==== Server version image connects to WIFI through commands ====
 
==== Server version image connects to WIFI through commands ====
  
'''When the development board is not connected to Ethernet or HDMI display, but only to the serial port, it is recommended to use the commands demonstrated in this section to connect to the WIFI network. Because nmtui can only display characters in some serial port software (such as minicom) and cannot display the graphical interface normally. Of course, if the development board is connected to an Ethernet or HDMI display, you can also use the commands demonstrated in this section to connect to the WIFI network.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''When the development board is not connected to Ethernet or HDMI display, but only to the serial port, it is recommended to use the commands demonstrated in this section to connect to the WIFI network. Because nmtui can only display characters in some serial port software (such as minicom) and cannot display the graphical interface normally. Of course, if the development board is connected to an Ethernet or HDMI display, you can also use the commands demonstrated in this section to connect to the WIFI network.'''</big>
 +
|}
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>First log in to the Linux system, there are three ways:</p>
 
<li><p>First log in to the Linux system, there are three ways:</p>
<p>a. If the development board is connected to a network cable, you can remotely log in to '''[[\l|the Linux system through ssh]].'''</p>
+
<p>a. If the development board is connected to a network cable, you can remotely log in to '''[[Orange Pi Zero 2W#SSH remote login development board|the Linux system through ssh]].'''</p>
 
<p>b. If the development board is connected to the debugging serial port, you can use the serial port terminal to log in to the Linux system.</p>
 
<p>b. If the development board is connected to the debugging serial port, you can use the serial port terminal to log in to the Linux system.</p>
 
<p>c. If the development board is connected to an HDMI display, you can log in to the Linux system through the HDMI display terminal.</p></li></ol>
 
<p>c. If the development board is connected to an HDMI display, you can log in to the Linux system through the HDMI display terminal.</p></li></ol>
  
<!-- -->
+
<ol start="2" style="list-style-type: decimal;">
<ol style="list-style-type: decimal;">
 
 
<li><p>First use the '''nmcli dev wifi''' command to scan the surrounding WIFI hotspots</p>
 
<li><p>First use the '''nmcli dev wifi''' command to scan the surrounding WIFI hotspots</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''nmcli dev wifi'''</p>
 
<p>orangepi@orangepi:~$ '''nmcli dev wifi'''</p>
 +
|}
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image108.png|575x250px|选区_011]]
+
[[File:zero2w-img108.png]]
  
 
</div></li>
 
</div></li>
 
<li><p>Then use the '''nmcli''' command to connect to the scanned WIFI hotspot, where:</p>
 
<li><p>Then use the '''nmcli''' command to connect to the scanned WIFI hotspot, where:</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>'''wifi_name''' needs to be replaced with the name of the WIFI &gt; hotspot you want to connect to</p></li>
+
<li><p>'''wifi_name''' needs to be replaced with the name of the WIFI hotspot you want to connect to</p></li>
<li><p>'''wifi_passwd''' needs to be replaced with the password of the &gt; WIFI hotspot you want to connect to.</p>
+
<li><p>'''wifi_passwd''' needs to be replaced with the password of the WIFI hotspot you want to connect to.</p>
<p>orangepi@orangepi:~$ '''sudo nmcli dev wifi connect wifi_name password wifi_passwd'''</p>
+
{| class="wikitable" style="width:800px;"
<p>Device 'wlan0' successfully activated with 'cf937f88-ca1e-4411-bb50-61f402eef293'.</p></li></ol>
+
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo nmcli dev wifi connect <span style="color:#FF0000">wifi_name</span> password <span style="color:#FF0000">wifi_passwd</span>'''</p>
 +
<p>Device 'wlan0' successfully activated with 'cf937f88-ca1e-4411-bb50-61f402eef293'.</p>
 +
|}
 +
</li></ol>
 
</li>
 
</li>
 
<li><p>You can check the IP address of the wifi through the '''ip addr show wlan0''' command</p>
 
<li><p>You can check the IP address of the wifi through the '''ip addr show wlan0''' command</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''ip a s wlan0'''</p>
 
<p>orangepi@orangepi:~$ '''ip a s wlan0'''</p>
 
<p>11: wlan0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000</p>
 
<p>11: wlan0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000</p>
<p>link/ether 23:8c:d6:ae:76:bb brd ff:ff:ff:ff:ff:ff</p>
+
:<p>link/ether 23:8c:d6:ae:76:bb brd ff:ff:ff:ff:ff:ff</p>
<p>inet '''192.168.1.11'''/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0</p>
+
:<p>inet '''<span style="color:#FF0000">192.168.1.11</span>'''/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0</p>
<p>valid_lft 259192sec preferred_lft 259192sec</p>
+
::<p>valid_lft 259192sec preferred_lft 259192sec</p>
<p>inet6 240e:3b7:3240:c3a0:c401:a445:5002:ccdd/64 scope global dynamic noprefixroute</p>
+
:<p>inet6 240e:3b7:3240:c3a0:c401:a445:5002:ccdd/64 scope global dynamic noprefixroute</p>
<p>valid_lft 259192sec preferred_lft 172792sec</p>
+
::<p>valid_lft 259192sec preferred_lft 172792sec</p>
<p>inet6 fe80::42f1:6019:a80e:4c31/64 scope link noprefixroute</p>
+
:<p>inet6 fe80::42f1:6019:a80e:4c31/64 scope link noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p></li>
+
::<p>valid_lft forever preferred_lft forever</p>
 +
|}
 +
</li>
 
<li><p>Use the '''ping''' command to test the connectivity of the wifi network. The '''ping''' command can be interrupted by pressing the '''Ctrl+C''' shortcut key.</p>
 
<li><p>Use the '''ping''' command to test the connectivity of the wifi network. The '''ping''' command can be interrupted by pressing the '''Ctrl+C''' shortcut key.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''ping www.orangepi.org -I wlan0'''</p>
 
<p>orangepi@orangepi:~$ '''ping www.orangepi.org -I wlan0'''</p>
 
<p>PING www.orangepi.org (182.92.236.130) from 192.168.1.49 wlan0: 56(84) bytes of data.</p>
 
<p>PING www.orangepi.org (182.92.236.130) from 192.168.1.49 wlan0: 56(84) bytes of data.</p>
Line 1,459: Line 1,968:
 
<p>--- www.orangepi.org ping statistics ---</p>
 
<p>--- www.orangepi.org ping statistics ---</p>
 
<p>5 packets transmitted, 5 received, 0% packet loss, time 4006ms</p>
 
<p>5 packets transmitted, 5 received, 0% packet loss, time 4006ms</p>
<p>rtt min/avg/max/mdev = 41.321/44.864/48.834/2.484 ms</p></li></ol>
+
<p>rtt min/avg/max/mdev = 41.321/44.864/48.834/2.484 ms</p>
 +
|}
 +
</li></ol>
  
 
<span id="server-version-image-connects-to-wifi-graphically"></span>
 
<span id="server-version-image-connects-to-wifi-graphically"></span>
 +
 
==== Server version image connects to WIFI graphically ====
 
==== Server version image connects to WIFI graphically ====
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>First log in to the Linux system, there are three ways:</p>
 
<li><p>First log in to the Linux system, there are three ways:</p>
<p>a. If the development board is connected to a network cable, you can remotely log in to '''[[\l|the Linux system through ssh]].'''</p>
+
<p>a. If the development board is connected to a network cable, you can remotely log in to '''[[Orange Pi Zero 2W#SSH remote login development board|the Linux system through ssh]].'''</p>
 
<p>b. If the development board is connected to the debugging serial port, you can use the serial port terminal to log in to the Linux system (please use MobaXterm for the serial port software, the graphical interface cannot be displayed using minicom)</p>
 
<p>b. If the development board is connected to the debugging serial port, you can use the serial port terminal to log in to the Linux system (please use MobaXterm for the serial port software, the graphical interface cannot be displayed using minicom)</p>
 
<p>c. If the development board is connected to an HDMI display, you can log in to the Linux system through the HDMI display terminal.</p></li>
 
<p>c. If the development board is connected to an HDMI display, you can log in to the Linux system through the HDMI display terminal.</p></li>
 
<li><p>Then enter the nmtui command in the command line to open the wifi connection interface</p>
 
<li><p>Then enter the nmtui command in the command line to open the wifi connection interface</p>
<p>orangepi@orangepi:~$ '''sudo nmtui'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo nmtui'''</p>
 +
|}
 +
</li>
 
<li><p>Enter the nmtui command to open the interface as shown below</p>
 
<li><p>Enter the nmtui command to open the interface as shown below</p>
<p>[[File:media/image109.png|345x215px]]</p></li>
+
<p>[[File:zero2w-img109.png]]</p></li>
 
<li><p>Select '''Activate a connect''' and press Enter</p>
 
<li><p>Select '''Activate a connect''' and press Enter</p>
<p>[[File:media/image110.png|349x216px]]</p></li>
+
<p>[[File:zero2w-img110.png]]</p></li>
 
<li><p>Then you can see all the searched WIFI hotspots</p>
 
<li><p>Then you can see all the searched WIFI hotspots</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image111.png|426x270px|16]]
+
[[File:zero2w-img111.png]]
  
 
</div></li>
 
</div></li>
Line 1,484: Line 2,001:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image112.png|474x298px|17]]
+
[[File:zero2w-img112.png]]
  
 
</div></li>
 
</div></li>
Line 1,490: Line 2,007:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image113.png|480x308px|18]]
+
[[File:zero2w-img113.png]]
  
 
</div></li>
 
</div></li>
Line 1,496: Line 2,013:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image114.png|443x283px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-9.jpg未标题-9]]
+
[[File:zero2w-img114.png]]
  
 
</div></li>
 
</div></li>
 
<li><p>You can check the IP address of the wifi through the '''ip a s wlan0''' command</p>
 
<li><p>You can check the IP address of the wifi through the '''ip a s wlan0''' command</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''ip a s wlan0'''</p>
 
<p>orangepi@orangepi:~$ '''ip a s wlan0'''</p>
 
<p>11: wlan0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000</p>
 
<p>11: wlan0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000</p>
<p>link/ether 24:8c:d3:aa:76:bb brd ff:ff:ff:ff:ff:ff</p>
+
:<p>link/ether 24:8c:d3:aa:76:bb brd ff:ff:ff:ff:ff:ff</p>
<p>inet '''192.168.1.11'''/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0</p>
+
:<p>inet '''<span style="color:#FF0000">192.168.1.11</span>'''/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0</p>
<p>valid_lft 259069sec preferred_lft 259069sec</p>
+
::<p>valid_lft 259069sec preferred_lft 259069sec</p>
<p>inet6 240e:3b7:3240:c4a0:c401:a445:5002:ccdd/64 scope global dynamic noprefixroute</p>
+
:<p>inet6 240e:3b7:3240:c4a0:c401:a445:5002:ccdd/64 scope global dynamic noprefixroute</p>
<p>valid_lft 259071sec preferred_lft 172671sec</p>
+
::<p>valid_lft 259071sec preferred_lft 172671sec</p>
<p>inet6 fe80::42f1:6019:a80e:4c31/64 scope link noprefixroute</p>
+
:<p>inet6 fe80::42f1:6019:a80e:4c31/64 scope link noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p></li>
+
::<p>valid_lft forever preferred_lft forever</p>
 +
|}
 +
</li>
 
<li><p>Use the '''ping''' command to test the connectivity of the wifi network. The '''ping''' command can be interrupted by pressing the '''Ctrl+C''' shortcut key.</p>
 
<li><p>Use the '''ping''' command to test the connectivity of the wifi network. The '''ping''' command can be interrupted by pressing the '''Ctrl+C''' shortcut key.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''ping www.orangepi.org -I wlan0'''</p>
 
<p>orangepi@orangepi:~$ '''ping www.orangepi.org -I wlan0'''</p>
 
<p>PING www.orangepi.org (182.92.236.130) from 192.168.1.49 wlan0: 56(84) bytes of data.</p>
 
<p>PING www.orangepi.org (182.92.236.130) from 192.168.1.49 wlan0: 56(84) bytes of data.</p>
Line 1,520: Line 2,045:
 
<p>--- www.orangepi.org ping statistics ---</p>
 
<p>--- www.orangepi.org ping statistics ---</p>
 
<p>5 packets transmitted, 5 received, 0% packet loss, time 4006ms</p>
 
<p>5 packets transmitted, 5 received, 0% packet loss, time 4006ms</p>
<p>rtt min/avg/max/mdev = 41.321/44.864/48.834/2.484 ms</p></li></ol>
+
<p>rtt min/avg/max/mdev = 41.321/44.864/48.834/2.484 ms</p>
 +
|}
 +
</li></ol>
  
 
<span id="test-method-for-desktop-image"></span>
 
<span id="test-method-for-desktop-image"></span>
 +
 
==== Test method for desktop image ====
 
==== Test method for desktop image ====
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>Click the network configuration icon in the upper right corner of the desktop (please do not connect the network cable when testing WIFI)</p>
 
<li><p>Click the network configuration icon in the upper right corner of the desktop (please do not connect the network cable when testing WIFI)</p>
<p>[[File:media/image115.png|275x121px]]</p></li>
+
<p>[[File:zero2w-img115.png]]</p></li>
 
<li><p>Click '''More networks''' in the pop-up drop-down box to see all scanned WIFI hotspots, and then select the WIFI hotspot you want to connect to.</p>
 
<li><p>Click '''More networks''' in the pop-up drop-down box to see all scanned WIFI hotspots, and then select the WIFI hotspot you want to connect to.</p>
<p>[[File:media/image116.png|576x353px]]</p></li>
+
<p>[[File:zero2w-img116.png]]</p></li>
 
<li><p>Then enter the password of the WIFI hotspot and click '''Connect''' to start connecting to WIFI</p>
 
<li><p>Then enter the password of the WIFI hotspot and click '''Connect''' to start connecting to WIFI</p>
<p>[[File:media/image117.png|288x147px]]</p></li>
+
<p>[[File:zero2w-img117.png]]</p></li>
 
<li><p>After connecting to WIFI, you can open the browser to check whether you can access the Internet. The browser entrance is as shown below</p>
 
<li><p>After connecting to WIFI, you can open the browser to check whether you can access the Internet. The browser entrance is as shown below</p>
<p>[[File:media/image118.png|465x249px]]</p></li>
+
<p>[[File:zero2w-img118.png]]</p></li>
 
<li><p>If you can open other web pages after opening the browser, it means the WIFI connection is normal.</p>
 
<li><p>If you can open other web pages after opening the browser, it means the WIFI connection is normal.</p>
<p>[[File:media/image119.png|575x172px]]</p></li></ol>
+
<p>[[File:zero2w-img119.png]]</p></li></ol>
  
 
<span id="method-to-create-wifi-hotspot-through-create_ap"></span>
 
<span id="method-to-create-wifi-hotspot-through-create_ap"></span>
 +
 
=== Method to create WIFI hotspot through create_ap ===
 
=== Method to create WIFI hotspot through create_ap ===
  
'''create_ap is a script that helps quickly create WIFI hotspots on Linux, and supports bridge and NAT modes. It can automatically combine hostapd, dnsmasq and iptables to complete the setting of WIFI hotspots, avoiding users from complicated configurations. The github address is as follows: '''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''create_ap is a script that helps quickly create WIFI hotspots on Linux, and supports bridge and NAT modes. It can automatically combine hostapd, dnsmasq and iptables to complete the setting of WIFI hotspots, avoiding users from complicated configurations. The github address is as follows: '''
  
[https://github.com/oblique/create_ap '''https://github.com/oblique/create_ap''']
+
[https://github.com/oblique/create_ap '''https://github.com/oblique/create_ap''']</big>
 +
|}
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''The Linux image released by OPi has been pre-installed with the create_ap script. You can use the create_ap command to create a WIFI hotspot. The basic command format of create_ap is as follows: '''
  
'''The Linux image released by OPi has been pre-installed with the create_ap script. You can use the create_ap command to create a WIFI hotspot. The basic command format of create_ap is as follows: '''
 
  
 
'''create_ap [options] &lt;wifi-interface&gt; [&lt;interface-with-internet&gt;] [&lt;access-point-name&gt; [&lt;passphrase&gt;]]'''
 
'''create_ap [options] &lt;wifi-interface&gt; [&lt;interface-with-internet&gt;] [&lt;access-point-name&gt; [&lt;passphrase&gt;]]'''
 +
  
 
'''* options: You can use this parameter to specify the encryption method, frequency band of WIFI hotspot, bandwidth mode, network sharing method, etc. You can get the options through create_ap -h.'''
 
'''* options: You can use this parameter to specify the encryption method, frequency band of WIFI hotspot, bandwidth mode, network sharing method, etc. You can get the options through create_ap -h.'''
Line 1,556: Line 2,093:
 
'''* access-point-name: Hotspot name'''
 
'''* access-point-name: Hotspot name'''
  
'''* passphrase: hotspot password'''
+
'''* passphrase: hotspot password'''</big>
 +
|}
  
 
<span id="create_ap-method-to-create-wifi-hotspot-in-nat-mode"></span>
 
<span id="create_ap-method-to-create-wifi-hotspot-in-nat-mode"></span>
Line 1,563: Line 2,101:
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>Enter the following command to create a WIFI hotspot with the name '''orangepi''' and password '''orangepi''' in NAT mode</p>
 
<li><p>Enter the following command to create a WIFI hotspot with the name '''orangepi''' and password '''orangepi''' in NAT mode</p>
<p>'''Note that in the following command, Debian12 needs to modify eth0 to end0'''</p></li></ol>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
+
|-
 +
|
 +
<big><p>'''Note that in the following command, Debian12 needs to modify eth0 to end0'''</p></big>
 +
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --no-virt'''
 
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --no-virt'''
 +
|}
 +
</li></ol>
  
 
<ol start="2" style="list-style-type: decimal;">
 
<ol start="2" style="list-style-type: decimal;">
 
<li><p>If the following information is output, it means that the WIFI hotspot is successfully created.</p>
 
<li><p>If the following information is output, it means that the WIFI hotspot is successfully created.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --no-virt'''</p>
 
<p>orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --no-virt'''</p>
 
<p>Config dir: /tmp/create_ap.wlan0.conf.TQkJtsz1</p>
 
<p>Config dir: /tmp/create_ap.wlan0.conf.TQkJtsz1</p>
Line 1,581: Line 2,130:
 
<p>wlan0: STA ce:bd:9a:dd:a5:86 RADIUS: starting accounting session D4FBF7E5C604F169</p>
 
<p>wlan0: STA ce:bd:9a:dd:a5:86 RADIUS: starting accounting session D4FBF7E5C604F169</p>
 
<p>wlan0: STA ce:bd:9a:dd:a5:86 WPA: pairwise key handshake completed (RSN)</p>
 
<p>wlan0: STA ce:bd:9a:dd:a5:86 WPA: pairwise key handshake completed (RSN)</p>
<p>wlan0: EAPOL-4WAY-HS-COMPLETED ce:bd:9a:dd:a5:86</p></li>
+
<p>wlan0: EAPOL-4WAY-HS-COMPLETED ce:bd:9a:dd:a5:86</p>
 +
|}
 +
</li>
 
<li><p>At this time, take out your mobile phone and find the WIFI hotspot named '''orangepi''' created by the development board in the searched WIFI list. Then you can click '''orangepi''' to connect to the hotspot. The password is '''orangepi''' set above.</p>
 
<li><p>At this time, take out your mobile phone and find the WIFI hotspot named '''orangepi''' created by the development board in the searched WIFI list. Then you can click '''orangepi''' to connect to the hotspot. The password is '''orangepi''' set above.</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image120.png|230x171px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-10.jpg未标题-10]]
+
[[File:zero2w-img120.png]]
  
 
</div></li>
 
</div></li>
Line 1,591: Line 2,142:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image121.png|224x111px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-11.jpg未标题-11]]
+
[[File:zero2w-img121.png]]
  
 
</div></li>
 
</div></li>
 
<li><p>In NAT mode, the wireless device connected to the development board's hotspot requests an IP address from the development board's DHCP service, so there will be two different network segments. For example, the development board's IP here is 192.168.1.X</p>
 
<li><p>In NAT mode, the wireless device connected to the development board's hotspot requests an IP address from the development board's DHCP service, so there will be two different network segments. For example, the development board's IP here is 192.168.1.X</p>
<p>'''Note that in the following command, Debian12 needs to modify eth0 to end0.'''</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''Note that in the following command, Debian12 needs to modify eth0 to end0.'''</p></big>
 +
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo ifconfig eth0'''</p>
 
<p>orangepi@orangepi:~$ '''sudo ifconfig eth0'''</p>
 
<p>eth0: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt; mtu 1500</p>
 
<p>eth0: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt; mtu 1500</p>
<p>inet '''192.168.1.150''' netmask 255.255.255.0 broadcast 192.168.1.255</p>
+
::<p>inet '''<span style="color:#FF0000">192.168.1.150</span>''' netmask 255.255.255.0 broadcast 192.168.1.255</p>
<p>inet6 fe80::938f:8776:5783:afa2 prefixlen 64 scopeid 0x20&lt;link&gt;</p>
+
::<p>inet6 fe80::938f:8776:5783:afa2 prefixlen 64 scopeid 0x20&lt;link&gt;</p>
<p>ether 4a:a0:c8:25:42:82 txqueuelen 1000 (Ethernet)</p>
+
::<p>ether 4a:a0:c8:25:42:82 txqueuelen 1000 (Ethernet)</p>
<p>RX packets 25370 bytes 2709590 (2.7 MB)</p>
+
::<p>RX packets 25370 bytes 2709590 (2.7 MB)</p>
<p>RX errors 0 dropped 50 overruns 0 frame 0</p>
+
::<p>RX errors 0 dropped 50 overruns 0 frame 0</p>
<p>TX packets 3798 bytes 1519493 (1.5 MB)</p>
+
::<p>TX packets 3798 bytes 1519493 (1.5 MB)</p>
<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p>
+
::<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p>
<p>device interrupt 83</p>
+
::<p>device interrupt 83</p>
 +
|}
 
<p>The DHCP service of the development board will assign the IP address of '''192.168.12.0/24''' to the device connected to the hotspot by default. At this time, click on the connected WIFI hotspot '''orangepi''', and then you can see that the IP address of the mobile phone is '''192.168.12.X'''.</p>
 
<p>The DHCP service of the development board will assign the IP address of '''192.168.12.0/24''' to the device connected to the hotspot by default. At this time, click on the connected WIFI hotspot '''orangepi''', and then you can see that the IP address of the mobile phone is '''192.168.12.X'''.</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image121.png|272x135px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-11.jpg未标题-11]]
+
[[File:zero2w-img121.png]]
  
 
</div>
 
</div>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image122.png|274x155px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-12.jpg未标题-12]]
+
[[File:zero2w-img122.png]]
  
 
</div></li>
 
</div></li>
<li><p>If you want to specify a different network segment for the connected device, you can specify it through the -g parameter. For example, use the -g parameter to specify the network segment of the access point AP as 192.168.2.1.</p></li></ol>
+
<li><p>If you want to specify a different network segment for the connected device, you can specify it through the -g parameter. For example, use the -g parameter to specify the network segment of the access point AP as 192.168.2.1.</p>
 
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
'''Note that in the following command, Debian12 needs to modify eth0 to end0.'''
+
|-
 
+
|
 +
<big>'''Note that in the following command, Debian12 needs to modify eth0 to end0.'''</big>
 +
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi -g 192.168.2.1 --no-virt'''
 
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi -g 192.168.2.1 --no-virt'''
 +
|}
  
 
At this time, after connecting to the hotspot through the mobile phone, click on the connected WIFI hotspot '''orangepi''', and then you can see that the IP address of the mobile phone is '''192.168.2.X'''
 
At this time, after connecting to the hotspot through the mobile phone, click on the connected WIFI hotspot '''orangepi''', and then you can see that the IP address of the mobile phone is '''192.168.2.X'''
Line 1,627: Line 2,192:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image121.png|295x147px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-11.jpg未标题-11]]
+
[[File:zero2w-img121.png]]
  
 
</div>
 
</div>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image122.png|296x167px|未标题-12]]
+
[[File:zero2w-img122.png]]
  
 
</div>
 
</div>
 +
</li></ol>
 
<ol start="7" style="list-style-type: decimal;">
 
<ol start="7" style="list-style-type: decimal;">
 
<li><p>Without specifying the '''--freq-band''' parameter, the hotspot created by default is in the 2.4G frequency band. If you want to create a hotspot in the 5G frequency band, you can specify it through the '''--freq-band 5''' parameter. The specific command is as follows</p>
 
<li><p>Without specifying the '''--freq-band''' parameter, the hotspot created by default is in the 2.4G frequency band. If you want to create a hotspot in the 5G frequency band, you can specify it through the '''--freq-band 5''' parameter. The specific command is as follows</p>
<p>'''Note that in the following command, Debian12 needs to modify eth0 to end0'''</p></li></ol>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
+
|-
 +
|
 +
<big><p>'''Note that in the following command, Debian12 needs to modify eth0 to end0'''</p></big>
 +
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --freq-band 5 --no-virt'''
 
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --freq-band 5 --no-virt'''
 +
|}
 +
</li></ol>
  
 
<ol start="8" style="list-style-type: decimal;">
 
<ol start="8" style="list-style-type: decimal;">
 
<li><p>If you need to hide the SSID, you can specify the '''--hidden''' parameter. The specific command is as follows</p>
 
<li><p>If you need to hide the SSID, you can specify the '''--hidden''' parameter. The specific command is as follows</p>
<p>'''Note that in the following command, Debian12 needs to modify eth0 to end0.'''</p></li></ol>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
+
|-
 +
|
 +
<big><p>'''Note that in the following command, Debian12 needs to modify eth0 to end0.'''</p></big>
 +
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --hidden --no-virt'''
 
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --hidden --no-virt'''
 +
|}
  
 
At this time, the mobile phone cannot search for WIFI hotspots. You need to manually specify the WIFI hotspot name and enter the password to connect to the WIFI hotspot.
 
At this time, the mobile phone cannot search for WIFI hotspots. You need to manually specify the WIFI hotspot name and enter the password to connect to the WIFI hotspot.
Line 1,651: Line 2,232:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image123.png|254x197px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-14.jpg未标题-14]]
+
[[File:zero2w-img123.png]]
  
 
</div>
 
</div>
 +
</li></ol>
 
<span id="create_ap-method-to-create-wifi-hotspot-in-bridge-mode"></span>
 
<span id="create_ap-method-to-create-wifi-hotspot-in-bridge-mode"></span>
 +
 
==== create_ap method to create WIFI hotspot in bridge mode ====
 
==== create_ap method to create WIFI hotspot in bridge mode ====
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>Enter the following command to create a WIFI hotspot with the name '''orangepi''' and password '''orangepi''' in bridge mode</p>
 
<li><p>Enter the following command to create a WIFI hotspot with the name '''orangepi''' and password '''orangepi''' in bridge mode</p>
<p>'''Note that in the following command, Debian12 needs to modify eth0 to end0.'''</p></li></ol>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
+
|-
 +
|
 +
<big><p>'''Note that in the following command, Debian12 needs to modify eth0 to end0.'''</p></big>
 +
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --no-virt'''
 
orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --no-virt'''
 +
|}
 +
</li></ol>
  
 
<ol start="2" style="list-style-type: decimal;">
 
<ol start="2" style="list-style-type: decimal;">
 
<li><p>If the following information is output, it means that the WIFI hotspot is successfully created.</p>
 
<li><p>If the following information is output, it means that the WIFI hotspot is successfully created.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --no-virt'''</p>
 
<p>orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --no-virt'''</p>
 
<p>Config dir: /tmp/create_ap.wlan0.conf.zAcFlYTx</p>
 
<p>Config dir: /tmp/create_ap.wlan0.conf.zAcFlYTx</p>
Line 1,678: Line 2,272:
 
<p>wlan0: STA ce:bd:9a:dd:a5:86 RADIUS: starting accounting session 937BF40E51897A7B</p>
 
<p>wlan0: STA ce:bd:9a:dd:a5:86 RADIUS: starting accounting session 937BF40E51897A7B</p>
 
<p>wlan0: STA ce:bd:9a:dd:a5:86 WPA: pairwise key handshake completed (RSN)</p>
 
<p>wlan0: STA ce:bd:9a:dd:a5:86 WPA: pairwise key handshake completed (RSN)</p>
<p>wlan0: EAPOL-4WAY-HS-COMPLETED ce:bd:9a:dd:a5:86</p></li>
+
<p>wlan0: EAPOL-4WAY-HS-COMPLETED ce:bd:9a:dd:a5:86</p>
 +
|}
 +
</li>
 
<li><p>At this time, take out your mobile phone and find the WIFI hotspot named '''orangepi''' created by the development board in the searched WIFI list. Then you can click '''orangepi''' to connect to the hotspot. The password is '''orangepi''' set above.</p>
 
<li><p>At this time, take out your mobile phone and find the WIFI hotspot named '''orangepi''' created by the development board in the searched WIFI list. Then you can click '''orangepi''' to connect to the hotspot. The password is '''orangepi''' set above.</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image120.png|265x198px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-10.jpg未标题-10]]
+
[[File:zero2w-img120.png]]
  
 
</div></li>
 
</div></li>
Line 1,688: Line 2,284:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image121.png|262x130px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-11.jpg未标题-11]]
+
[[File:zero2w-img121.png]]
  
 
</div></li>
 
</div></li>
 
<li><p>In bridge mode, the wireless device connected to the hotspot of the development board also requests an IP address from the DHCP service of the main router (the router to which the development board is connected). For example, the IP of the development board here is '''192.168.1.X'''</p>
 
<li><p>In bridge mode, the wireless device connected to the hotspot of the development board also requests an IP address from the DHCP service of the main router (the router to which the development board is connected). For example, the IP of the development board here is '''192.168.1.X'''</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo ifconfig eth0'''</p>
 
<p>orangepi@orangepi:~$ '''sudo ifconfig eth0'''</p>
 
<p>eth0: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt; mtu 1500</p>
 
<p>eth0: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt; mtu 1500</p>
<p>inet '''192.168.1.150''' netmask 255.255.255.0 broadcast 192.168.1.255</p>
+
::<p>inet '''<span style="color:#FF0000">192.168.1.150</span>''' netmask 255.255.255.0 broadcast 192.168.1.255</p>
<p>inet6 fe80::938f:8776:5783:afa2 prefixlen 64 scopeid 0x20&lt;link&gt;</p>
+
::<p>inet6 fe80::938f:8776:5783:afa2 prefixlen 64 scopeid 0x20&lt;link&gt;</p>
<p>ether 4a:a0:c8:25:42:82 txqueuelen 1000 (Ethernet)</p>
+
::<p>ether 4a:a0:c8:25:42:82 txqueuelen 1000 (Ethernet)</p>
<p>RX packets 25370 bytes 2709590 (2.7 MB)</p>
+
::<p>RX packets 25370 bytes 2709590 (2.7 MB)</p>
<p>RX errors 0 dropped 50 overruns 0 frame 0</p>
+
::<p>RX errors 0 dropped 50 overruns 0 frame 0</p>
<p>TX packets 3798 bytes 1519493 (1.5 MB)</p>
+
::<p>TX packets 3798 bytes 1519493 (1.5 MB)</p>
<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p>
+
::<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p>
<p>device interrupt 83</p>
+
::<p>device interrupt 83</p>
 +
|}
 
<p>The IP of the device connected to the WIFI hotspot is also assigned by the main router, so the mobile phone connected to the WIFI hotspot and the development board are in the same network segment. At this time, click on the connected WIFI hotspot '''orangepi''', and then you can see the IP address of the mobile phone. Also '''192.168.1.X'''.</p>
 
<p>The IP of the device connected to the WIFI hotspot is also assigned by the main router, so the mobile phone connected to the WIFI hotspot and the development board are in the same network segment. At this time, click on the connected WIFI hotspot '''orangepi''', and then you can see the IP address of the mobile phone. Also '''192.168.1.X'''.</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image121.png|283x140px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-11.jpg未标题-11]]
+
[[File:zero2w-img121.png]]
  
 
</div>
 
</div>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image122.png|281x159px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-12.jpg未标题-12]]
+
[[File:zero2w-img122.png]]
  
 
</div></li>
 
</div></li>
 
<li><p>Without specifying the '''--freq-band''' parameter, the hotspot created by default is in the 2.4G frequency band. If you want to create a hotspot in the 5G frequency band, you can specify it through the '''--freq-band''' parameter. The specific command is as follows</p>
 
<li><p>Without specifying the '''--freq-band''' parameter, the hotspot created by default is in the 2.4G frequency band. If you want to create a hotspot in the 5G frequency band, you can specify it through the '''--freq-band''' parameter. The specific command is as follows</p>
<p>'''Note that in the following command, Debian12 needs to modify eth0 to end0.'''</p></li></ol>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
+
|-
 +
|
 +
<big><p>'''Note that in the following command, Debian12 needs to modify eth0 to end0.'''</p></big>
 +
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --freq-band 5 --no-virt'''
 
orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --freq-band 5 --no-virt'''
 +
|}
 +
</li></ol>
  
 
<ol start="7" style="list-style-type: decimal;">
 
<ol start="7" style="list-style-type: decimal;">
 
<li><p>If you need to hide the SSID, you can specify the '''--hidden''' parameter. The specific command is as follows</p>
 
<li><p>If you need to hide the SSID, you can specify the '''--hidden''' parameter. The specific command is as follows</p>
<p>'''Note that in the following command, Debian12 needs to modify eth0 to end0.'''</p></li></ol>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
+
|-
 +
|
 +
<big><p>'''Note that in the following command, Debian12 needs to modify eth0 to end0.'''</p></big>
 +
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --hidden --no-virt'''
 
orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --hidden --no-virt'''
 +
|}
  
 
At this time, the mobile phone cannot search for WIFI hotspots. You need to manually specify the WIFI hotspot name and enter the password to connect to the WIFI hotspot.
 
At this time, the mobile phone cannot search for WIFI hotspots. You need to manually specify the WIFI hotspot name and enter the password to connect to the WIFI hotspot.
Line 1,728: Line 2,343:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image123.png|228x177px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-14.jpg未标题-14]]
+
[[File:zero2w-img123.png]]
  
 
</div>
 
</div>
 +
</li></ol>
 
<span id="how-to-set-a-static-ip-address"></span>
 
<span id="how-to-set-a-static-ip-address"></span>
 +
 
=== How to set a static IP address ===
 
=== How to set a static IP address ===
  
'''Please do not set a static IP address by modifying the /etc/network/interfaces configuration file.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''Please do not set a static IP address by modifying the /etc/network/interfaces configuration file.'''</big>
 +
|}
  
 
<span id="use-the-nmtui-command-to-set-a-static-ip-address"></span>
 
<span id="use-the-nmtui-command-to-set-a-static-ip-address"></span>
Line 1,741: Line 2,362:
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>First run the '''nmtui''' command</p>
 
<li><p>First run the '''nmtui''' command</p>
<p>orangepi@orangepi:~$ '''sudo nmtui'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo nmtui'''</p>
 +
|}
 +
</li>
 
<li><p>Then select '''Edit a connection''' and press the Enter key</p>
 
<li><p>Then select '''Edit a connection''' and press the Enter key</p>
<p>[[File:media/image124.png|227x247px]]</p></li>
+
<p>[[File:zero2w-img124.png]]</p></li>
 
<li><p>Then select the network interface for which a static IP address needs to be set. For example, to set the static IP address of the '''Ethernet''' interface, select '''Wired connection 1'''.</p>
 
<li><p>Then select the network interface for which a static IP address needs to be set. For example, to set the static IP address of the '''Ethernet''' interface, select '''Wired connection 1'''.</p>
<p>[[File:media/image125.png|310x149px]]</p></li>
+
<p>[[File:zero2w-img125.png]]</p></li>
 
<li><p>Then select '''Edit''' via the '''Tab''' key and press the Enter key</p>
 
<li><p>Then select '''Edit''' via the '''Tab''' key and press the Enter key</p>
<p>[[File:media/image126.png|316x144px]]</p></li>
+
<p>[[File:zero2w-img126.png]]</p></li>
 
<li><p>Then use the Tab key to move the cursor to the '''&lt;Automatic&gt;''' position shown in the figure below to configure IPv4</p>
 
<li><p>Then use the Tab key to move the cursor to the '''&lt;Automatic&gt;''' position shown in the figure below to configure IPv4</p>
<p>[[File:media/image127.png|575x240px]]</p></li>
+
<p>[[File:zero2w-img127.png]]</p></li>
 
<li><p>Then press Enter, select '''Manual''' through the up and down arrow keys, and then press Enter to confirm.</p>
 
<li><p>Then press Enter, select '''Manual''' through the up and down arrow keys, and then press Enter to confirm.</p>
<p>[[File:media/image128.png|576x237px]]</p></li>
+
<p>[[File:zero2w-img128.png]]</p></li>
 
<li><p>The display after selection is as shown below</p>
 
<li><p>The display after selection is as shown below</p>
<p>[[File:media/image129.png|575x240px]]</p></li>
+
<p>[[File:zero2w-img129.png]]</p></li>
 
<li><p>Then move the cursor to '''&lt;Show&gt;''' via the Tab key</p>
 
<li><p>Then move the cursor to '''&lt;Show&gt;''' via the Tab key</p>
<p>[[File:media/image130.png|576x241px]]</p></li>
+
<p>[[File:zero2w-img130.png]]</p></li>
 
<li><p>Then press Enter. After pressing Enter, the following setting interface will pop up.</p>
 
<li><p>Then press Enter. After pressing Enter, the following setting interface will pop up.</p>
<p>[[File:media/image131.png|575x450px]]</p></li>
+
<p>[[File:zero2w-img131.png]]</p></li>
<li><p>Then you can set the IP address (Addresses), gateway (Gateway) and DNS server address as shown in the figure below (there are many other setting options, please explore by yourself), please set according to your specific needs. The values set in the image below are just an example</p>
+
<li><p>Then you can set the IP address (Addresses), gateway (Gateway) and DNS server address as shown in the figure below (there are many other setting options, please explore by yourself), <span style="color:#FF0000">please set according to your specific needs. The values set in the image below are just an example</span></p>
<p>[[File:media/image132.png|576x233px]]</p></li>
+
<p>[[File:zero2w-img132.png]]</p></li>
 
<li><p>After setting, move the cursor to '''&lt;OK&gt;''' in the lower right corner, and then press Enter to confirm.</p>
 
<li><p>After setting, move the cursor to '''&lt;OK&gt;''' in the lower right corner, and then press Enter to confirm.</p>
<p>[[File:media/image133.png|576x116px]]</p></li>
+
<p>[[File:zero2w-img133.png]]</p></li>
 
<li><p>Then click '''&lt;Back&gt;''' to return to the previous level selection interface</p>
 
<li><p>Then click '''&lt;Back&gt;''' to return to the previous level selection interface</p>
<p>[[File:media/image134.png|330x325px]]</p></li>
+
<p>[[File:zero2w-img134.png]]</p></li>
 
<li><p>Then select '''Activate a connection''', then move the cursor to '''&lt;OK&gt;''', and finally click Enter</p>
 
<li><p>Then select '''Activate a connection''', then move the cursor to '''&lt;OK&gt;''', and finally click Enter</p>
<p>[[File:media/image135.png|331x248px]]</p></li>
+
<p>[[File:zero2w-img135.png]]</p></li>
 
<li><p>Then select the network interface that needs to be set, such as '''Wired connection 1''', then move the cursor to '''&lt;Deactivate&gt;''', and then press the Enter key to disable '''Wired connection 1'''</p>
 
<li><p>Then select the network interface that needs to be set, such as '''Wired connection 1''', then move the cursor to '''&lt;Deactivate&gt;''', and then press the Enter key to disable '''Wired connection 1'''</p>
<p>[[File:media/image136.png|576x224px]]</p></li>
+
<p>[[File:zero2w-img136.png]]</p></li>
 
<li><p>Then please do not move the cursor, and then press the Enter key to re-enable '''Wired connection 1''', so that the static IP address set previously will take effect.</p>
 
<li><p>Then please do not move the cursor, and then press the Enter key to re-enable '''Wired connection 1''', so that the static IP address set previously will take effect.</p>
<p>[[File:media/image137.png|576x224px]]</p></li>
+
<p>[[File:zero2w-img137.png]]</p></li>
 
<li><p>Then you can exit nmtui through the '''&lt;Back&gt;''' and '''Quit''' buttons</p>
 
<li><p>Then you can exit nmtui through the '''&lt;Back&gt;''' and '''Quit''' buttons</p>
<p>[[File:media/image138.png|300x253px]] [[File:media/image139.png|227x252px]]</p></li>
+
<p>[[File:zero2w-img138.png]] [[File:zero2w-img139.png]]</p></li>
 
<li><p>Then through '''ip a s eth0''' you can see that the IP address of the network port has become the static IP address set previously.</p>
 
<li><p>Then through '''ip a s eth0''' you can see that the IP address of the network port has become the static IP address set previously.</p>
<p>'''Note that in the following command, Debian12 needs to modify eth0 to end0.'''</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''Note that in the following command, Debian12 needs to modify eth0 to end0.'''</p></big>
 +
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''ip a s eth0'''</p>
 
<p>orangepi@orangepi:~$ '''ip a s eth0'''</p>
 
<p>3: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000</p>
 
<p>3: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000</p>
<p>link/ether 5e:ac:14:a5:92:b3 brd ff:ff:ff:ff:ff:ff</p>
+
:<p>link/ether 5e:ac:14:a5:92:b3 brd ff:ff:ff:ff:ff:ff</p>
<p>inet '''192.168.1.177'''/24 brd 192.168.1.255 scope global noprefixroute eth0</p>
+
:<p>inet '''<span style="color:#FF0000">192.168.1.177</span>'''/24 brd 192.168.1.255 scope global noprefixroute eth0</p>
<p>valid_lft forever preferred_lft forever</p>
+
::<p>valid_lft forever preferred_lft forever</p>
<p>inet6 241e:3b8:3240:c3a0:e269:8305:dc08:135e/64 scope global dynamic noprefixroute</p>
+
:<p>inet6 241e:3b8:3240:c3a0:e269:8305:dc08:135e/64 scope global dynamic noprefixroute</p>
<p>valid_lft 259149sec preferred_lft 172749sec</p>
+
::<p>valid_lft 259149sec preferred_lft 172749sec</p>
<p>inet6 fe80::957d:bbbe:4928:3604/64 scope link noprefixroute</p>
+
:<p>inet6 fe80::957d:bbbe:4928:3604/64 scope link noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p></li>
+
::<p>valid_lft forever preferred_lft forever</p>
 +
|}
 +
</li>
 
<li><p>Then you can test the network connectivity to check whether the IP address is configured OK. The '''ping''' command can be interrupted by using the '''Ctrl+C''' shortcut key.</p>
 
<li><p>Then you can test the network connectivity to check whether the IP address is configured OK. The '''ping''' command can be interrupted by using the '''Ctrl+C''' shortcut key.</p>
<p>'''Note that in the following command, Debian12 needs to modify eth0 to end0.'''</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''Note that in the following command, Debian12 needs to modify eth0 to end0.'''</p></big>
 +
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''ping 192.168.1.177 -I eth0'''</p>
 
<p>orangepi@orangepi:~$ '''ping 192.168.1.177 -I eth0'''</p>
 
<p>PING 192.168.1.47 (192.168.1.47) from 192.168.1.188 eth0: 56(84) bytes of data.</p>
 
<p>PING 192.168.1.47 (192.168.1.47) from 192.168.1.188 eth0: 56(84) bytes of data.</p>
Line 1,795: Line 2,437:
 
<p>--- 192.168.1.47 ping statistics ---</p>
 
<p>--- 192.168.1.47 ping statistics ---</p>
 
<p>5 packets transmitted, 5 received, 0% packet loss, time 4042ms</p>
 
<p>5 packets transmitted, 5 received, 0% packet loss, time 4042ms</p>
<p>rtt min/avg/max/mdev = 0.233/0.262/0.275/0.015 ms</p></li></ol>
+
<p>rtt min/avg/max/mdev = 0.233/0.262/0.275/0.015 ms</p>
 +
|}
 +
</li></ol>
  
 
<span id="use-nmcli-command-to-set-static-ip-address"></span>
 
<span id="use-nmcli-command-to-set-static-ip-address"></span>
 +
 
==== Use nmcli command to set static IP address ====
 
==== Use nmcli command to set static IP address ====
  
Line 1,804: Line 2,449:
 
<li><p>Then you can view the name of the network device through the '''nmcli con show''' command, as shown below</p>
 
<li><p>Then you can view the name of the network device through the '''nmcli con show''' command, as shown below</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>'''orangepi''' is the name of the WIFI network interface (the &gt; names are not necessarily the same)</p></li>
+
<li><p>'''orangepi''' is the name of the WIFI network interface (the names are not necessarily the same)</p></li>
 
<li><p>'''Wired connection 1''' is the name of the Ethernet interface</p>
 
<li><p>'''Wired connection 1''' is the name of the Ethernet interface</p>
<p>orangepi@orangepi:~$ '''nmcli con show'''</p>
+
{| class="wikitable" style="width:800px;"
<p>NAME UUID TYPE DEVICE</p>
+
|-
<p>'''orangepi''' cfc4f922-ae48-46f1-84e1-2f19e9ec5e2a wifi wlan0</p>
+
|
<p>'''Wired connection 1''' 9db058b7-7701-37b8-9411-efc2ae8bfa30 ethernet eth0</p></li></ol>
+
orangepi@orangepi:~$ '''nmcli con show'''<br>
 +
<span style="margin-right: 180px;">NAME</span><span style="margin-right: 260px;">UUID </span><span style="margin-right: 45px;">TYPE </span><span style="margin-right: 50px;">DEVICE</span><br>
 +
<span style="margin-right: 125px;">'''orangepi'''</span><span style="margin-right: 70px;">cfc4f922-ae48-46f1-84e1-2f19e9ec5e2a</span><span style="margin-right: 50px;">wifi </span><span style="margin-right: 50px;">wlan0</span><br>
 +
<span style="margin-right: 50px;">'''Wired connection 1'''</span><span style="margin-right: 50px;">9db058b7-7701-37b8-9411-efc2ae8bfa30</span><span style="margin-right: 30px;">ethernet </span><span style="margin-right: 50px;">eth0</span><br>
 +
|}</li></ol>
 
</li>
 
</li>
 
<li><p>中Then enter the following command, where</p>
 
<li><p>中Then enter the following command, where</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>'''&quot;Wired connection 1&quot;''' means setting the static IP address &gt; of the Ethernet port. If you need to set the static IP address &gt; of WIFI, please change it to the name corresponding to the &gt; WIFI network interface (can be obtained through the '''nmcli &gt; con show''' command)</p></li>
+
<li><p>'''&quot;Wired connection 1&quot;''' means setting the static IP address of the Ethernet port. If you need to set the static IP address of WIFI, please change it to the name corresponding to the WIFI network interface (can be obtained through the '''nmcli con show''' command)</p></li>
<li><p>'''ipv4.addresses''' is followed by the static IP address to be &gt; set, which can be modified to the value you want to set.</p></li>
+
<li><p>'''ipv4.addresses''' is followed by the static IP address to be set, which can be modified to the value you want to set.</p></li>
 
<li><p>'''ipv4.gateway''' represents the address of the gateway</p>
 
<li><p>'''ipv4.gateway''' represents the address of the gateway</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo nmcli con mod &quot;Wired connection 1&quot; \<br />
 
<p>orangepi@orangepi:~$ '''sudo nmcli con mod &quot;Wired connection 1&quot; \<br />
 
ipv4.addresses &quot;192.168.1.110&quot; \'''</p>
 
ipv4.addresses &quot;192.168.1.110&quot; \'''</p>
 
<p>'''ipv4.gateway &quot;192.168.1.1&quot; \'''</p>
 
<p>'''ipv4.gateway &quot;192.168.1.1&quot; \'''</p>
 
<p>'''ipv4.dns &quot;8.8.8.8&quot; \'''</p>
 
<p>'''ipv4.dns &quot;8.8.8.8&quot; \'''</p>
<p>'''ipv4.method &quot;manual&quot;'''</p></li></ol>
+
<p>'''ipv4.method &quot;manual&quot;'''</p>
 +
|}
 +
</li></ol>
 
</li>
 
</li>
 
<li><p>Then restart the linux system</p>
 
<li><p>Then restart the linux system</p>
<p>orangepi@orangepi:~$ '''sudo reboot'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo reboot'''</p>
 +
|}
 +
</li>
 
<li><p>Then re-enter the Linux system and use the '''ip addr show eth0''' command to see that the IP address has been set to the desired value.</p>
 
<li><p>Then re-enter the Linux system and use the '''ip addr show eth0''' command to see that the IP address has been set to the desired value.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''ip addr show eth0'''</p>
 
<p>orangepi@orangepi:~$ '''ip addr show eth0'''</p>
 
<p>3: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000</p>
 
<p>3: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000</p>
<p>link/ether 5e:ae:14:a5:91:b3 brd ff:ff:ff:ff:ff:ff</p>
+
:<p>link/ether 5e:ae:14:a5:91:b3 brd ff:ff:ff:ff:ff:ff</p>
<p>inet '''192.168.1.110'''/32 brd 192.168.1.110 scope global noprefixroute eth0</p>
+
:<p>inet '''<span style="color:#FF0000">192.168.1.110</span>'''/32 brd 192.168.1.110 scope global noprefixroute eth0</p>
<p>valid_lft forever preferred_lft forever</p>
+
::<p>valid_lft forever preferred_lft forever</p>
<p>inet6 240e:3b7:3240:c3a0:97de:1d01:b290:fe3a/64 scope global dynamic noprefixroute</p>
+
:<p>inet6 240e:3b7:3240:c3a0:97de:1d01:b290:fe3a/64 scope global dynamic noprefixroute</p>
<p>valid_lft 259183sec preferred_lft 172783sec</p>
+
::<p>valid_lft 259183sec preferred_lft 172783sec</p>
<p>inet6 fe80::3312:861a:a589:d3c/64 scope link noprefixroute</p>
+
:<p>inet6 fe80::3312:861a:a589:d3c/64 scope link noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p></li></ol>
+
::<p>valid_lft forever preferred_lft forever</p>
 +
|}
 +
</li></ol>
  
 
<span id="how-to-set-up-the-linux-system-to-automatically-connect-to-the-network-for-the-first-time"></span>
 
<span id="how-to-set-up-the-linux-system-to-automatically-connect-to-the-network-for-the-first-time"></span>
 +
 
=== How to set up the Linux system to automatically connect to the network for the first time ===
 
=== How to set up the Linux system to automatically connect to the network for the first time ===
  
'''The development board has an Ethernet port. If you want to remotely log in to the Linux system of the development board through the Ethernet port, you only need to plug in a network cable that can access the Internet normally. After starting the Linux system, it will automatically connect to the Ethernet port through DHCP. Assign an IP address, and then we can obtain the IP address of the Ethernet port through the HDMI screen, serial port, or view the router's background, and then log in to the Linux system remotely.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''The development board has an Ethernet port. If you want to remotely log in to the Linux system of the development board through the Ethernet port, you only need to plug in a network cable that can access the Internet normally. After starting the Linux system, it will automatically connect to the Ethernet port through DHCP. Assign an IP address, and then we can obtain the IP address of the Ethernet port through the HDMI screen, serial port, or view the router's background, and then log in to the Linux system remotely.'''
  
 
'''The development board also has wireless WIFI. If you want to remotely log in to the Linux system of the development board through WIFI, you need to remotely log in to the Linux system through ssh through the IP address of the Ethernet port and then use commands to connect to WIFI, or use commands on the HDMI screen or serial port. Connect to WIFI.'''
 
'''The development board also has wireless WIFI. If you want to remotely log in to the Linux system of the development board through WIFI, you need to remotely log in to the Linux system through ssh through the IP address of the Ethernet port and then use commands to connect to WIFI, or use commands on the HDMI screen or serial port. Connect to WIFI.'''
  
'''But if there is no HDMI screen and serial port module, although there is a network cable, the IP address of the development board cannot be viewed through the router background. Or if there is no HDMI screen, serial port module and network cable, and only WIFI can be connected, you can use the method introduced in this section to automatically connect to WIFI and set the static IP address of WIFI or automatically set the static IP address of the Ethernet port.'''
+
'''But if there is no HDMI screen and serial port module, although there is a network cable, the IP address of the development board cannot be viewed through the router background. Or if there is no HDMI screen, serial port module and network cable, and only WIFI can be connected, you can use the method introduced in this section to automatically connect to WIFI and set the static IP address of WIFI or automatically set the static IP address of the Ethernet port.'''</big>
 +
|}
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''To use the method in this section, you first need to prepare a Linux system machine. For example, a computer or virtual machine with Ubuntu system installed.'''
  
'''To use the method in this section, you first need to prepare a Linux system machine. For example, a computer or virtual machine with Ubuntu system installed.'''
+
'''Why do you need a Linux system machine? Because the root file system of the Linux system of the development board burned in the TF card is in ext4 format. The Linux system machine can mount it normally and then modify the configuration file in it.'''</big>
 +
|}
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''If you want to modify it in a Windows system, you can use the software Paragon ExtFS for Windows. Since this software requires payment, and there is currently no similar free software that is easy to use, I will not demonstrate it in detail here.'''
  
'''Why do you need a Linux system machine? Because the root file system of the Linux system of the development board burned in the TF card is in ext4 format. The Linux system machine can mount it normally and then modify the configuration file in it.'''
+
'''In addition, if you have any problems when trying to use Paragon ExtFS for Windows, please solve it yourself. We will not answer questions.'''</big>
 
+
|}
'''If you want to modify it in a Windows system, you can use the software Paragon ExtFS for Windows. Since this software requires payment, and there is currently no similar free software that is easy to use, I will not demonstrate it in detail here.'''
 
 
 
'''In addition, if you have any problems when trying to use Paragon ExtFS for Windows, please solve it yourself. We will not answer questions.'''
 
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>First burn the Linux image of the development board you want to use into a TF card, and then use a card reader to insert the TF card with the Linux image of the development board into a machine with a Linux system (such as a machine with Ubuntu system Computer, the following uses Ubuntu computer as an example for demonstration)</p></li>
 
<li><p>First burn the Linux image of the development board you want to use into a TF card, and then use a card reader to insert the TF card with the Linux image of the development board into a machine with a Linux system (such as a machine with Ubuntu system Computer, the following uses Ubuntu computer as an example for demonstration)</p></li>
 
<li><p>When the TF card is inserted into the Ubuntu computer, the Ubuntu computer will generally automatically mount the Linux root file system partition in the TF card. From the following command, we can know that '''/media/test/opi_root''' is the Linux root file in the TF card. System mounting path</p>
 
<li><p>When the TF card is inserted into the Ubuntu computer, the Ubuntu computer will generally automatically mount the Linux root file system partition in the TF card. From the following command, we can know that '''/media/test/opi_root''' is the Linux root file in the TF card. System mounting path</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>test@test:~$ '''df -h | grep &quot;media&quot;'''</p>
 
<p>test@test:~$ '''df -h | grep &quot;media&quot;'''</p>
<p>/dev/sdd1 1.4G 1.2G 167M 88% '''/media/test/opi_root'''</p>
+
<p>/dev/sdd1 &nbsp;&nbsp; 1.4G &nbsp;&nbsp; 1.2G &nbsp;&nbsp; 167M &nbsp;&nbsp; 88% '''<span style="color:#FF0000">/media/test/opi_root</span>'''</p>
 
<p>test@test:~$ '''ls /media/test/opi_root'''</p>
 
<p>test@test:~$ '''ls /media/test/opi_root'''</p>
<p>bin boot dev etc home lib lost+found media mnt opt proc root run sbin selinux srv sys tmp usr var</p></li>
+
<p>bin &nbsp;&nbsp; boot &nbsp;&nbsp; dev &nbsp;&nbsp; etc &nbsp;&nbsp; home &nbsp;&nbsp; lib &nbsp;&nbsp; lost+found &nbsp;&nbsp; media &nbsp;&nbsp; mnt &nbsp;&nbsp; opt &nbsp;&nbsp; proc &nbsp;&nbsp; root &nbsp;&nbsp; run <br> sbin &nbsp;&nbsp; selinux &nbsp;&nbsp; srv &nbsp;&nbsp; sys &nbsp;&nbsp; tmp &nbsp;&nbsp; usr &nbsp;&nbsp; var</p>
 +
|}
 +
</li>
 
<li><p>Then enter the '''/boot''' directory of the Linux system burned in the TF card</p>
 
<li><p>Then enter the '''/boot''' directory of the Linux system burned in the TF card</p>
<p>test@test:~$ '''cd /media/test/opi_root/boot/'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>test@test:~$ '''cd /media/test/opi_root/boot/'''</p>
 +
|}
 +
</li>
 
<li><p>Then copy the '''orangepi_first_run.txt.template''' to '''orangepi_first_run.txt'''. Through the orangepi_first_run.txt configuration file, you can set the development board to automatically connect to a WIFI hotspot when the Linux system starts for the first time. You can also set the WIFI or Ethernet port Static IP address.</p>
 
<li><p>Then copy the '''orangepi_first_run.txt.template''' to '''orangepi_first_run.txt'''. Through the orangepi_first_run.txt configuration file, you can set the development board to automatically connect to a WIFI hotspot when the Linux system starts for the first time. You can also set the WIFI or Ethernet port Static IP address.</p>
<p>test@test:/media/test/opi_root/boot$ '''sudo cp orangepi_first_run.txt.template orangepi_first_run.txt'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>test@test:/media/test/opi_root/boot$ '''sudo cp orangepi_first_run.txt.template orangepi_first_run.txt'''</p>
 +
|}
 +
</li>
 
<li><p>You can open the orangepi_first_run.txt file through the following command, and then you can view and modify the contents.</p>
 
<li><p>You can open the orangepi_first_run.txt file through the following command, and then you can view and modify the contents.</p>
<p>test@test:/media/test/opi_root/boot$ '''sudo vim orangepi_first_run.txt'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>test@test:/media/test/opi_root/boot$ '''sudo vim orangepi_first_run.txt'''</p>
 +
|}
 +
</li>
 
<li><p>Variable usage instructions in the orangepi_first_run.txt file</p>
 
<li><p>Variable usage instructions in the orangepi_first_run.txt file</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>'''FR_general_delete_this_file_after_completion''' The variable is &gt; used to set whether to delete the orangepi_first_run.txt file &gt; after the first startup. The default is 1, which means &gt; deletion. If set to 0, orangepi_first_run.txt will be renamed &gt; after the first startup.orangepi_first_run.txt.old, Generally, &gt; just keep the default value</p></li>
+
<li><p>'''FR_general_delete_this_file_after_completion''' The variable is used to set whether to delete the orangepi_first_run.txt file after the first startup. The default is 1, which means deletion. If set to 0, orangepi_first_run.txt will be renamed after the first startup.orangepi_first_run.txt.old, Generally, just keep the default value</p></li>
<li><p>'''FR_net_change_defaults''' The variable is used to set whether &gt; to change the default network settings. This must be set to 1, &gt; otherwise all network settings will not take effect.</p></li>
+
<li><p>'''FR_net_change_defaults''' The variable is used to set whether to change the default network settings. This must be set to 1, otherwise all network settings will not take effect.</p></li>
<li><p>'''FR_net_ethernet_enabled''' The variable is used to control &gt; whether to enable the configuration of the Ethernet port. If &gt; you need to set the static IP address of the Ethernet port, &gt; please set it to 1</p></li>
+
<li><p>'''FR_net_ethernet_enabled''' The variable is used to control whether to enable the configuration of the Ethernet port. If you need to set the static IP address of the Ethernet port, please set it to 1</p></li>
<li><p>'''FR_net_wifi_enabled''' The variable is used to control whether &gt; to enable WIFI configuration. If you need to set the &gt; development board to automatically connect to WIFI hotspots, &gt; you must set it to 1. Also please note that if this variable &gt; is set to 1, the Ethernet port settings will be invalid. That &gt; is to say, the WIFI and Ethernet ports cannot be set at the &gt; same time (why, because it is not necessary...)</p></li>
+
<li><p>'''FR_net_wifi_enabled''' The variable is used to control whether to enable WIFI configuration. If you need to set the development board to automatically connect to WIFI hotspots, you must set it to 1. Also please note that if this variable is set to 1, the Ethernet port settings will be invalid. That is to say, the WIFI and Ethernet ports cannot be set at the same time (why, because it is not necessary...)</p></li>
<li><p>'''FR_net_wifi_ssid''' Variable is used to set the name of the &gt; WIFI hotspot you want to connect to</p></li>
+
<li><p>'''FR_net_wifi_ssid''' Variable is used to set the name of the WIFI hotspot you want to connect to</p></li>
<li><p>'''FR_net_wifi_key''' Variable is used to set the password of the &gt; WIFI hotspot you want to connect to</p></li>
+
<li><p>'''FR_net_wifi_key''' Variable is used to set the password of the WIFI hotspot you want to connect to</p></li>
<li><p>'''FR_net_use_static''' Variables are used to set whether the &gt; static IP address of the WIFI or Ethernet port needs to be &gt; set.</p></li>
+
<li><p>'''FR_net_use_static''' Variables are used to set whether the static IP address of the WIFI or Ethernet port needs to be set.</p></li>
<li><p>'''FR_net_static_ip''' The variable is used to set the static IP &gt; address. Please set it according to your actual situation.</p></li>
+
<li><p>'''FR_net_static_ip''' The variable is used to set the static IP address. Please set it according to your actual situation.</p></li>
<li><p>'''FR_net_static_gateway''' Variables are used to set the gateway. &gt; Please set according to your actual situation.</p></li></ol>
+
<li><p>'''FR_net_static_gateway''' Variables are used to set the gateway. Please set according to your actual situation.</p></li></ol>
 
</li>
 
</li>
 
<li><p>Here are some specific setting examples:</p>
 
<li><p>Here are some specific setting examples:</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>For example, if you want the Linux system of the development &gt; board to automatically connect to the WIFI hotspot after it is &gt; started for the first time, you can set it like this: </p>
+
<li><p>For example, if you want the Linux system of the development board to automatically connect to the WIFI hotspot after it is started for the first time, you can set it like this: </p>
<ol style="list-style-type: lower-alpha;">
+
<ol style="list-style-type: none;">
<li><p>Set '''FR_net_change_defaults''' to 1</p></li>
+
<li><p>a) Set '''FR_net_change_defaults''' to 1</p></li>
<li><p>Set '''FR_net_wifi_enabled''' to '''1'''</p></li>
+
<li><p>b) Set '''FR_net_wifi_enabled''' to '''1'''</p></li>
<li><p>Set '''FR_net_wifi_ssid''' to the name of the WIFI hotspot you &gt; want to connect to</p></li>
+
<li><p>c) Set '''FR_net_wifi_ssid''' to the name of the WIFI hotspot you want to connect to</p></li>
<li><p>Set '''FR_net_wifi_key''' to the password of the WIFI hotspot &gt; you want to connect to</p></li></ol>
+
<li><p>d) Set '''FR_net_wifi_key''' to the password of the WIFI hotspot you want to connect to</p></li></ol>
 
</li>
 
</li>
<li><p>For example, you want the Linux system of the development board &gt; to automatically connect to the WIFI hotspot after the first &gt; startup, and set the WIFI IP address to a specific static IP &gt; address (so that when the Linux system starts, you can &gt; directly use the set static IP address to ssh remotely Log in &gt; to the development board, there is no need to check the IP &gt; address of the development board through the router &gt; background), you can set it like this:</p>
+
<li><p>For example, you want the Linux system of the development board to automatically connect to the WIFI hotspot after the first startup, and set the WIFI IP address to a specific static IP address (so that when the Linux system starts, you can directly use the set static IP address to ssh remotely Log in to the development board, there is no need to check the IP address of the development board through the router background), you can set it like this:</p>
<ol style="list-style-type: lower-alpha;">
+
<ol style="list-style-type: none;">
<li><p>Set '''FR_net_change_defaults''' to '''1'''</p></li>
+
<li><p>a) Set '''FR_net_change_defaults''' to '''1'''</p></li>
<li><p>Set '''FR_net_wifi_enabled''' to '''1'''</p></li>
+
<li><p>b) Set '''FR_net_wifi_enabled''' to '''1'''</p></li>
<li><p>Set '''FR_net_wifi_ssid''' to the name of the WIFI hotspot you &gt; want to connect to</p></li>
+
<li><p>c) Set '''FR_net_wifi_ssid''' to the name of the WIFI hotspot you want to connect to</p></li>
<li><p>Set '''FR_net_wifi_key''' to the password of the WIFI hotspot &gt; you want to connect to</p></li>
+
<li><p>d) Set '''FR_net_wifi_key''' to the password of the WIFI hotspot you want to connect to</p></li>
<li><p>Set '''FR_net_use_static''' to '''1'''</p></li>
+
<li><p>e) Set '''FR_net_use_static''' to '''1'''</p></li>
<li><p>Set '''FR_net_static_ip''' to the desired IP address</p></li>
+
<li><p>f) Set '''FR_net_static_ip''' to the desired IP address</p></li>
<li><p>Set '''R_net_static_gateway''' to the corresponding gateway &gt; address</p></li></ol>
+
<li><p>g) Set '''R_net_static_gateway''' to the corresponding gateway address</p></li></ol>
 
</li>
 
</li>
<li><p>For example, if you want the development board's Linux system &gt; to automatically set the IP address of the Ethernet port to &gt; the desired static IP address after it is started for the &gt; first time, you can set it like this</p>
+
<li><p>For example, if you want the development board's Linux system to automatically set the IP address of the Ethernet port to the desired static IP address after it is started for the first time, you can set it like this</p>
<ol style="list-style-type: lower-alpha;">
+
<ol style="list-style-type: none;">
<li><p>Set '''FR_net_change_default''' to '''1'''</p></li>
+
<li><p>a) Set '''FR_net_change_default''' to '''1'''</p></li>
<li><p>Set '''FR_net_ethernet_enabled''' to '''1'''</p></li>
+
<li><p>b) Set '''FR_net_ethernet_enabled''' to '''1'''</p></li>
<li><p>Set '''FR_net_use_static''' to '''1'''</p></li>
+
<li><p>c) Set '''FR_net_use_static''' to '''1'''</p></li>
<li><p>Set '''FR_net_static_ip''' to the desired IP address</p></li>
+
<li><p>d) Set '''FR_net_static_ip''' to the desired IP address</p></li>
<li><p>Set '''FR_net_static_gateway''' to the corresponding gateway &gt; address</p></li></ol>
+
<li><p>e) Set '''FR_net_static_gateway''' to the corresponding gateway address</p></li></ol>
 
</li></ol>
 
</li></ol>
 
</li>
 
</li>
 
<li><p>After modifying the orangepi_first_run.txt file, you can exit the /boot directory of the development board Linux system in the TF card, uninstall the TF card, and then insert the TF card into the development board to start.</p></li>
 
<li><p>After modifying the orangepi_first_run.txt file, you can exit the /boot directory of the development board Linux system in the TF card, uninstall the TF card, and then insert the TF card into the development board to start.</p></li>
<li><p>If a static IP address is not set, you still need to check the IP address through the router background. If a static IP address is set, you can ping the set static IP address on the computer. If you can ping, it means that the system has started normally, and The network has been set up correctly, and then you can use the set IP address to ssh to remotely log in to the Linux system of the development board.</p></li></ol>
+
<li><p>If a static IP address is not set, you still need to check the IP address through the router background. If a static IP address is set, you can ping the set static IP address on the computer. If you can ping, it means that the system has started normally, and The network has been set up correctly, and then you can use the set IP address to ssh to remotely log in to the Linux system of the development board.</p>
 
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
'''After the development board's Linux system is started for the first time, orangepi_first_run.txt will be deleted or renamed to orangepi_first_run.txt.old. At this time, even if the orangepi_first_run.txt configuration file is reset, and then the development board's Linux system is restarted, orangepi_first_run. The configuration in txt will not take effect again, because this configuration will only take effect when the Linux system is started for the first time after burning it. Please pay special attention to this point.'''
+
|-
 +
|
 +
<big>'''After the development board's Linux system is started for the first time, orangepi_first_run.txt will be deleted or renamed to orangepi_first_run.txt.old. At this time, even if the orangepi_first_run.txt configuration file is reset, and then the development board's Linux system is restarted, orangepi_first_run. The configuration in txt will not take effect again, because this configuration will only take effect when the Linux system is started for the first time after burning it. Please pay special attention to this point.'''</big>
 +
|}
 +
</li></ol>
 +
<span id="ssh-remote-login-development-board"></span>
  
<span id="ssh-remote-login-development-board"></span>
 
 
== SSH remote login development board ==
 
== SSH remote login development board ==
  
'''Linux systems enable ssh remote login by default and allow root users to log in to the system. Before ssh login, you first need to ensure that the Ethernet or wifi network is connected, and then use the ip addr command or obtain the IP address of the development board by checking the router'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''Linux systems enable ssh remote login by default and allow root users to log in to the system. Before ssh login, you first need to ensure that the Ethernet or wifi network is connected, and then use the ip addr command or obtain the IP address of the development board by checking the router'''</big>
 +
|}
  
 
<span id="ssh-remote-login-development-board-under-ubuntu"></span>
 
<span id="ssh-remote-login-development-board-under-ubuntu"></span>
Line 1,921: Line 2,624:
 
# Then you can remotely log in to the Linux system through the ssh command
 
# Then you can remotely log in to the Linux system through the ssh command
  
test@test:~$ '''ssh [mailto:root@192.168.1.36 orangepi@192.168.1.]xxx''' (Need to be replaced with the IP address of the development board)
+
::{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
test@test:~$ '''ssh [mailto:root@192.168.1.36 orangepi@192.168.1.]xxx''' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Need to be replaced with the IP address of the development board)
  
orangepi@192.168.1.xx's password: (iEnter your password here, the default password is orangepi)
+
orangepi@192.168.1.xx's password: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Enter your password here, the default password is orangepi)
 +
|}
 +
::{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''Note that when entering a password, <span style="color:#FF0000">the specific content of the entered password will not be displayed on the screen</span>. Please do not think that there is something wrong. Just press Enter after entering it.'''
  
'''Note that when entering a password, the specific content of the entered password will not be displayed on the screen. Please do not think that there is something wrong. Just press Enter after entering it.'''
+
'''If you are prompted to refuse the connection, as long as you are using the image provided by Orange Pi, <span style="color:#FF0000">please do not doubt whether the orangepi password is incorrect</span>, but look for other reasons.'''</big>
 
+
|}
'''f you are prompted to refuse the connection, as long as you are using the image provided by Orange Pi, please do not doubt whether the orangepi password is incorrect, but look for other reasons.'''
 
  
 
<ol start="3" style="list-style-type: decimal;">
 
<ol start="3" style="list-style-type: decimal;">
 
<li><p>After successfully logging into the system, the display is as shown below</p>
 
<li><p>After successfully logging into the system, the display is as shown below</p>
<p>[[File:media/image140.png|575x273px]]</p>
+
<p>[[File:zero2w-img140.png]]</p>
<p>'''If ssh cannot log in to the Linux system normally, first check whether the IP address of the development board can be pinged. If there is no problem with pinging, you can log in to the Linux system through the serial port or HDMI display and enter the following command on the development board before trying again. Can it be connected?: '''</p></li></ol>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''If ssh cannot log in to the Linux system normally, first check whether the IP address of the development board can be pinged. If there is no problem with pinging, you can log in to the Linux system through the serial port or HDMI display and enter the following command on the development board before trying again. Can it be connected?: '''</p>
 +
 
  
 
root@orangepi:~# '''reset_ssh.sh'''
 
root@orangepi:~# '''reset_ssh.sh'''
  
'''If it still doesn't work, please try restarting the system.'''
 
  
 +
'''If it still doesn't work, please try restarting the system.'''</big>
 +
|}
 +
</li></ol>
 
<span id="ssh-remote-login-development-board-under-windows"></span>
 
<span id="ssh-remote-login-development-board-under-windows"></span>
 +
 
=== SSH remote login development board under Windows ===
 
=== SSH remote login development board under Windows ===
  
Line 1,947: Line 2,664:
 
<li><p>Open '''Session'''</p></li>
 
<li><p>Open '''Session'''</p></li>
 
<li><p>Then select '''SSH''' in '''Session Setting'''</p></li>
 
<li><p>Then select '''SSH''' in '''Session Setting'''</p></li>
<li><p>Then enter the IP address of the development board in '''Remote &gt; host'''</p></li>
+
<li><p>Then enter the IP address of the development board in '''Remote host'''</p></li>
<li><p>Then enter the username '''root''' or '''orangepi''' of the linux &gt; system in '''Specify username'''.</p></li>
+
<li><p>Then enter the username '''root''' or '''orangepi''' of the linux system in '''Specify username'''.</p></li>
 
<li><p>Finally click '''OK'''</p>
 
<li><p>Finally click '''OK'''</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image141.png|553x280px|14]]
+
[[File:zero2w-img141.png]]
  
 
</div></li></ol>
 
</div></li></ol>
 
</li>
 
</li>
 
<li><p>You will then be prompted to enter a password. The default passwords for both root and orangepi users are orangepi.</p>
 
<li><p>You will then be prompted to enter a password. The default passwords for both root and orangepi users are orangepi.</p>
<p>'''Note that when entering a password, the specific content of the entered password will not be displayed on the screen. Please do not think that there is any malfunction. Just press Enter after entering the password.'''</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''Note that when entering a password, <span style="color:#FF0000">the specific content of the entered password will not be displayed on the screen</span>. Please do not think that there is any malfunction. Just press Enter after entering the password.'''</p></big>
 +
|}
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image142.png|553x151px|15]]
+
[[File:zero2w-img142.png]]
  
 
</div></li>
 
</div></li>
 
<li><p>After successfully logging into the system, the display is as shown below</p>
 
<li><p>After successfully logging into the system, the display is as shown below</p>
<p>[[File:media/image143.png|450x313px]]</p></li></ol>
+
<p>[[File:zero2w-img143.png]]</p></li></ol>
  
 
<span id="hdmi-test"></span>
 
<span id="hdmi-test"></span>
 +
 
== HDMI test ==
 
== HDMI test ==
  
Line 1,976: Line 2,698:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image14.png|148x132px|IMG_256]]
+
[[File:zero2w-img14.png]]
  
 
</div></li>
 
</div></li>
<li><p>After starting the Linux system, if there is image output on the HDMI display, it means that the HDMI interface is working normally.</p></li></ol>
+
<li><p>After starting the Linux system, if there is image output on the HDMI display, it means that the HDMI interface is working normally.</p>
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''Note that although many laptops have HDMI interfaces, the HDMI interface of the laptop generally only has the output function and does not have the HDMI in function, which means that the HDMI output of other devices cannot be displayed on the laptop screen'''
  
'''Note that although many laptops have HDMI interfaces, the HDMI interface of the laptop generally only has the output function and does not have the HDMI in function, which means that the HDMI output of other devices cannot be displayed on the laptop screen'''
+
'''When you want to connect the HDMI of the development board to the HDMI interface of your laptop, please first confirm that your laptop supports the HDMI in function'''</big>
 
+
|}
'''When you want to connect the HDMI of the development board to the HDMI interface of your laptop, please first confirm that your laptop supports the HDMI in function'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
+
|-
'''When HDMI does not display, please first check whether the HDMI cable is plugged in tightly. After confirming that the wiring is OK, you can try a different screen to see if there is any display.'''
+
|
 +
<big>'''When HDMI does not display, please first check whether the HDMI cable is plugged in tightly. After confirming that the wiring is OK, you can try a different screen to see if there is any display.'''</big>
 +
|}
 +
</li></ol>
 +
<span id="hdmi-to-vga-display-test"></span>
  
<span id="hdmi-to-vga-display-test"></span>
 
 
=== HDMI to VGA display test ===
 
=== HDMI to VGA display test ===
  
Line 1,994: Line 2,723:
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>HDMI to VGA converter</p>
 
<li><p>HDMI to VGA converter</p>
<p>[[File:media/image144.png|155x104px]]</p></li>
+
<p>[[File:zero2w-img144.png]]</p></li>
 
<li><p>A VGA cable and a Mini HDMI male to HDMI female adapter</p>
 
<li><p>A VGA cable and a Mini HDMI male to HDMI female adapter</p>
<p>[[File:media/image145.png|145x131px]] [[File:media/image146.png|225x128px]]</p></li>
+
<p>[[File:zero2w-img145.png]] [[File:zero2w-img146.png]]</p></li>
 
<li><p>A monitor or TV that supports VGA interface</p></li></ol>
 
<li><p>A monitor or TV that supports VGA interface</p></li></ol>
 
</li>
 
</li>
 
<li><p>HDMI to VGA display test is as follows</p>
 
<li><p>HDMI to VGA display test is as follows</p>
<p>[[File:media/image147.png|574x337px]]</p>
+
<p>[[File:zero2w-img147.png]]</p>
<p>'''When using HDMI to VGA display, the development board and the Linux 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.'''</p></li></ol>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''When using HDMI to VGA display, the development board and the Linux 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.'''</p></big>
 +
|}
 +
</li></ol>
  
 
<span id="how-to-set-hdmi-resolution-in-linux5.4-system"></span>
 
<span id="how-to-set-hdmi-resolution-in-linux5.4-system"></span>
 +
 
=== How to set HDMI resolution in Linux5.4 system ===
 
=== How to set HDMI resolution in Linux5.4 system ===
  
'''Note: This method is only applicable to systems with Linux 5.4 kernel.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''Note: This method is only applicable to systems with Linux 5.4 kernel.'''</big>
 +
|}
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>There is a disp_mode variable in '''/boot/orangepiEnv.txt''' of the Linux system, which can be used to set the resolution of HDMI output. The default resolution of the Linux system is 1080p60</p>
 
<li><p>There is a disp_mode variable in '''/boot/orangepiEnv.txt''' of the Linux system, which can be used to set the resolution of HDMI output. The default resolution of the Linux system is 1080p60</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''</p>
 
<p>orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''</p>
 
<p>verbosity=1</p>
 
<p>verbosity=1</p>
 
<p>console=both</p>
 
<p>console=both</p>
<p>disp_mode='''1080p60'''</p>
+
<p>disp_mode='''<span style="color:#FF0000">1080p60</span>'''</p>
 
<p>fb0_width=1920</p>
 
<p>fb0_width=1920</p>
<p>fb0_height=1080</p></li>
+
<p>fb0_height=1080</p>
<li><p>The disp_mode variable supports setting values as shown in the table below</p></li></ol>
+
|}
 +
</li>
 +
<li><p>The disp_mode variable supports setting values as shown in the table below</p></li>
  
{| class="wikitable"
+
{| class="wikitable" style="width:800px;text-align: center;"
 
|-
 
|-
 
| '''disp_mode supported values'''
 
| '''disp_mode supported values'''
Line 2,068: Line 2,812:
 
| '''60'''
 
| '''60'''
 
|}
 
|}
 
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
'''Note: Linux systems currently do not support 4K resolution.'''
+
|-
 
+
|
 +
<big>'''Note: Linux systems currently do not support 4K resolution.'''</big>
 +
|}
 +
</ol>
 
<ol start="3" style="list-style-type: decimal;">
 
<ol start="3" style="list-style-type: decimal;">
 
<li><p>Change the value of the disp_mode variable to the resolution you want to output, then restart the system, and HDMI will output the set resolution.</p></li>
 
<li><p>Change the value of the disp_mode variable to the resolution you want to output, then restart the system, and HDMI will output the set resolution.</p></li>
 
<li><p>The method of checking the HDMI output resolution is as follows. If the displayed resolution is the same as the set resolution, it means that the settings on the development board are correct.</p>
 
<li><p>The method of checking the HDMI output resolution is as follows. If the displayed resolution is the same as the set resolution, it means that the settings on the development board are correct.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo cat /sys/class/disp/disp/attr/sys'''</p>
 
<p>orangepi@orangepi:~$ '''sudo cat /sys/class/disp/disp/attr/sys'''</p>
<p>[[File:media/image148.png|575x84px]]</p></li></ol>
+
|}
 +
<p>[[File:zero2w-img148.png]]</p></li></ol>
  
 
<span id="how-to-modify-the-width-and-height-of-framebuffer-in-linux5.4-system"></span>
 
<span id="how-to-modify-the-width-and-height-of-framebuffer-in-linux5.4-system"></span>
 +
 
=== How to modify the width and height of Framebuffer in Linux5.4 system ===
 
=== How to modify the width and height of Framebuffer in Linux5.4 system ===
  
'''Note: This method is only applicable to systems with Linux 5.4 kernel.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''Note: This method is only applicable to systems with Linux 5.4 kernel.'''</big>
 +
|}
  
 
There are two variables, fb0_width and fb0_height, in '''/boot/orangepiEnv.txt''' of the Linux system. You can use them to set the width and height of the Framebuffer. The Linux system defaults to fb0_width=1920 and fb0_height=1080.
 
There are two variables, fb0_width and fb0_height, in '''/boot/orangepiEnv.txt''' of the Linux system. You can use them to set the width and height of the Framebuffer. The Linux system defaults to fb0_width=1920 and fb0_height=1080.
  
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''
 
orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''
  
Line 2,092: Line 2,851:
 
disp_mode=1080p60
 
disp_mode=1080p60
  
'''fb0_width=1920'''
+
'''<span style="color:#FF0000">fb0_width=1920</span>'''
  
'''fb0_height=1080'''
+
'''<span style="color:#FF0000">fb0_height=1080</span>'''
 +
|}
  
 
The reference values corresponding to different resolutions of fb0_width and fb0_height are as follows::  
 
The reference values corresponding to different resolutions of fb0_width and fb0_height are as follows::  
  
{| class="wikitable"
+
{| class="wikitable" style="width:800px;text-align: center;"
 
|-
 
|-
 
| '''HDMI resolution'''
 
| '''HDMI resolution'''
Line 2,124: Line 2,884:
  
 
<span id="framebuffer-cursor-setting"></span>
 
<span id="framebuffer-cursor-setting"></span>
 +
 
=== Framebuffer cursor setting ===
 
=== Framebuffer cursor setting ===
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>The softcursor used by Framebuffer, the method to set the cursor to blink or not to blink is as follows</p>
 
<li><p>The softcursor used by Framebuffer, the method to set the cursor to blink or not to blink is as follows</p>
<p>root@orangepi:~# '''echo 1 &gt; /sys/class/graphics/fbcon/cursor_blink #Cursor flashes'''</p>
+
{| class="wikitable" style="width:800px;"
<p>root@orangepi:~# '''echo 0 &gt; /sys/class/graphics/fbcon/cursor_blink #Cursor does not flash'''</p></li>
+
|-
 +
|
 +
<p>root@orangepi:~# '''echo <span style="color:#FF0000">1</span> &gt; /sys/class/graphics/fbcon/cursor_blink #Cursor flashes'''</p>
 +
<p>root@orangepi:~# '''echo <span style="color:#FF0000">0</span> &gt; /sys/class/graphics/fbcon/cursor_blink #Cursor does not flash'''</p>
 +
|}
 +
</li>
 
<li><p>If you need to hide the cursor, you can add vt.global_cursor_default=0 to the '''extraargs''' variable in '''/boot/orangepiEnv.txt''' (the value of extraargs will be assigned to the '''bootargs''' environment variable and eventually passed to the kernel) (if '''<span class="mark">vt.global_cursor_default=1</span>''', it will be displayed cursor), then restart the system and you will see that the cursor has disappeared.</p>
 
<li><p>If you need to hide the cursor, you can add vt.global_cursor_default=0 to the '''extraargs''' variable in '''/boot/orangepiEnv.txt''' (the value of extraargs will be assigned to the '''bootargs''' environment variable and eventually passed to the kernel) (if '''<span class="mark">vt.global_cursor_default=1</span>''', it will be displayed cursor), then restart the system and you will see that the cursor has disappeared.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''</p>
 
<p>orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''</p>
 
<p>verbosity=1</p>
 
<p>verbosity=1</p>
Line 2,137: Line 2,906:
 
<p>fb0_width=1920</p>
 
<p>fb0_width=1920</p>
 
<p>fb0_height=1080</p>
 
<p>fb0_height=1080</p>
<p>'''extraargs=vt.global_cursor_default=0'''</p></li></ol>
+
<p>'''<span style="color:#FF0000">extraargs=vt.global_cursor_default=0</span>'''</p>
 +
|}
 +
</li></ol>
  
 
<span id="how-to-use-bluetooth"></span>
 
<span id="how-to-use-bluetooth"></span>
 +
 
== How to use Bluetooth ==
 
== How to use Bluetooth ==
  
Line 2,147: Line 2,919:
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>Click the Bluetooth icon in the upper right corner of the desktop</p>
 
<li><p>Click the Bluetooth icon in the upper right corner of the desktop</p>
<p>[[File:media/image149.png|314x122px]]</p></li>
+
<p>[[File:zero2w-img149.png]]</p></li>
 
<li><p>Then select the adapter</p>
 
<li><p>Then select the adapter</p>
<p>[[File:media/image150.png|318x140px]]</p></li>
+
<p>[[File:zero2w-img150.png]]</p></li>
 
<li><p>If prompted with the following interface, please select '''Yes'''.</p>
 
<li><p>If prompted with the following interface, please select '''Yes'''.</p>
<p>[[File:media/image151.png|248x85px]]</p></li>
+
<p>[[File:zero2w-img151.png]]</p></li>
 
<li><p>Then set the '''Visibility Setting''' to '''Always visible''' in the Bluetooth adapter setting interface, and then turn it off.</p>
 
<li><p>Then set the '''Visibility Setting''' to '''Always visible''' in the Bluetooth adapter setting interface, and then turn it off.</p>
<p>[[File:media/image152.png|196x183px]]</p></li>
+
<p>[[File:zero2w-img152.png]]</p></li>
 
<li><p>Then open the configuration interface of the Bluetooth device</p>
 
<li><p>Then open the configuration interface of the Bluetooth device</p>
<p>[[File:media/image153.png|438x179px]]</p></li>
+
<p>[[File:zero2w-img153.png]]</p></li>
 
<li><p>Click '''Search''' to start scanning for surrounding Bluetooth devices</p>
 
<li><p>Click '''Search''' to start scanning for surrounding Bluetooth devices</p>
<p>[[File:media/image154.png|311x210px]]</p></li>
+
<p>[[File:zero2w-img154.png]]</p></li>
 
<li><p>Then select the Bluetooth device you want to connect, and then right-click the mouse to pop up the operation interface for the Bluetooth device. Select '''Pair''' to start pairing. The demonstration here is pairing with an Android phone.</p>
 
<li><p>Then select the Bluetooth device you want to connect, and then right-click the mouse to pop up the operation interface for the Bluetooth device. Select '''Pair''' to start pairing. The demonstration here is pairing with an Android phone.</p>
<p>[[File:media/image155.png|311x242px]]</p></li>
+
<p>[[File:zero2w-img155.png]]</p></li>
 
<li><p>When pairing, a pairing confirmation box will pop up in the upper right corner of the desktop. Just select '''Confirm''' to confirm. At this time, you also need to confirm on the mobile phone.</p>
 
<li><p>When pairing, a pairing confirmation box will pop up in the upper right corner of the desktop. Just select '''Confirm''' to confirm. At this time, you also need to confirm on the mobile phone.</p>
<p>[[File:media/image156.png|411x150px]]</p></li>
+
<p>[[File:zero2w-img156.png]]</p></li>
 
<li><p>After pairing with the mobile phone, you can select the paired Bluetooth device, then right-click and select '''Send a File''' to start sending a picture to the mobile phone.</p>
 
<li><p>After pairing with the mobile phone, you can select the paired Bluetooth device, then right-click and select '''Send a File''' to start sending a picture to the mobile phone.</p>
<p>[[File:media/image157.png|405x239px]]</p></li>
+
<p>[[File:zero2w-img157.png]]</p></li>
 
<li><p>The interface for sending pictures is as follows</p>
 
<li><p>The interface for sending pictures is as follows</p>
<p>[[File:media/image158.png|399x231px]]</p></li></ol>
+
<p>[[File:zero2w-img158.png]]</p></li></ol>
  
 
<span id="how-to-use-server-version-image"></span>
 
<span id="how-to-use-server-version-image"></span>
Line 2,172: Line 2,944:
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>After entering the system, you can first check whether there is a Bluetooth device node through the '''hciconfig''' command. If it exists, it means that the Bluetooth initialization is normal.</p>
 
<li><p>After entering the system, you can first check whether there is a Bluetooth device node through the '''hciconfig''' command. If it exists, it means that the Bluetooth initialization is normal.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo apt update &amp;&amp; sudo apt install -y bluez'''</p>
 
<p>orangepi@orangepi:~$ '''sudo apt update &amp;&amp; sudo apt install -y bluez'''</p>
 
<p>orangepi@orangepi:~$ '''hciconfig -a'''</p>
 
<p>orangepi@orangepi:~$ '''hciconfig -a'''</p>
 
<p>hci0: Type: Primary Bus: UART</p>
 
<p>hci0: Type: Primary Bus: UART</p>
<p>BD Address: 3E:61:3D:19:0E:52 ACL MTU: 1021:8 SCO MTU: 240:3</p>
+
:<p>BD Address: 3E:61:3D:19:0E:52 ACL MTU: 1021:8 SCO MTU: 240:3</p>
<p>UP RUNNING</p>
+
:<p>UP RUNNING</p>
<p>RX bytes:925 acl:0 sco:0 events:72 errors:0</p>
+
:<p>RX bytes:925 acl:0 sco:0 events:72 errors:0</p>
<p>TX bytes:5498 acl:0 sco:0 commands:72 errors:0</p>
+
:<p>TX bytes:5498 acl:0 sco:0 commands:72 errors:0</p>
<p>Features: 0xbf 0xff 0x8d 0xfe 0xdb 0x3d 0x7b 0xc7</p>
+
:<p>Features: 0xbf 0xff 0x8d 0xfe 0xdb 0x3d 0x7b 0xc7</p>
<p>Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3</p>
+
:<p>Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3</p>
<p>Link policy: RSWITCH SNIFF</p>
+
:<p>Link policy: RSWITCH SNIFF</p>
<p>Link mode: SLAVE ACCEPT</p>
+
:<p>Link mode: SLAVE ACCEPT</p>
<p>Name: 'orangepi'</p>
+
:<p>Name: 'orangepi'</p>
<p>Class: 0x3c0000</p>
+
:<p>Class: 0x3c0000</p>
<p>Service Classes: Rendering, Capturing, Object Transfer, Audio</p>
+
:<p>Service Classes: Rendering, Capturing, Object Transfer, Audio</p>
<p>Device Class: Miscellaneous,</p>
+
:<p>Device Class: Miscellaneous,</p>
<p>HCI Version: 5.0 (0x9) Revision: 0x400</p>
+
:<p>HCI Version: 5.0 (0x9) Revision: 0x400</p>
<p>LMP Version: 5.0 (0x9) Subversion: 0x400</p>
+
:<p>LMP Version: 5.0 (0x9) Subversion: 0x400</p>
<p>Manufacturer: Spreadtrum Communications Shanghai Ltd (492)</p></li>
+
:<p>Manufacturer: Spreadtrum Communications Shanghai Ltd (492)</p>
 +
|}</li>
 
<li><p>Use '''bluetoothctl''' to scan for Bluetooth devices</p>
 
<li><p>Use '''bluetoothctl''' to scan for Bluetooth devices</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo bluetoothctl'''</p>
 
<p>orangepi@orangepi:~$ '''sudo bluetoothctl'''</p>
 
<p>[NEW] Controller 10:11:12:13:14:15 orangepizero2w [default]</p>
 
<p>[NEW] Controller 10:11:12:13:14:15 orangepizero2w [default]</p>
Line 2,210: Line 2,989:
 
<p>Discovery stopped</p>
 
<p>Discovery stopped</p>
 
<p>[CHG] Controller 10:11:12:13:14:15 Discovering: no</p>
 
<p>[CHG] Controller 10:11:12:13:14:15 Discovering: no</p>
<p>[CHG] Device DC:72:9B:4C:F4:CF RSSI is nil</p></li>
+
<p>[CHG] Device DC:72:9B:4C:F4:CF RSSI is nil</p>
 +
|}
 +
</li>
 
<li><p>After scanning the device you want to pair, you can pair it. For pairing, you need to use the MAC address of the device.</p>
 
<li><p>After scanning the device you want to pair, you can pair it. For pairing, you need to use the MAC address of the device.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>[bluetooth]# '''pair DC:72:9B:4C:F4:CF''' '''#Pair using the MAC address of the scanned Bluetooth device'''</p>
 
<p>[bluetooth]# '''pair DC:72:9B:4C:F4:CF''' '''#Pair using the MAC address of the scanned Bluetooth device'''</p>
 
<p>Attempting to pair with DC:72:9B:4C:F4:CF</p>
 
<p>Attempting to pair with DC:72:9B:4C:F4:CF</p>
Line 2,223: Line 3,007:
 
<p>'''Pairing successful #Prompt pairing successful'''</p>
 
<p>'''Pairing successful #Prompt pairing successful'''</p>
 
<p>[CHG] Device DC:72:9B:4C:F4:CF ServicesResolved: no</p>
 
<p>[CHG] Device DC:72:9B:4C:F4:CF ServicesResolved: no</p>
<p>[CHG] Device DC:72:9B:4C:F4:CF Connected: no</p></li>
+
<p>[CHG] Device DC:72:9B:4C:F4:CF Connected: no</p>
 +
|}
 +
</li>
 
<li><p>After successful pairing, the Bluetooth interface of the mobile phone will appear as follows:</p>
 
<li><p>After successful pairing, the Bluetooth interface of the mobile phone will appear as follows:</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image159.png|241x136px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-15.jpg未标题-15]]
+
[[File:zero2w-img159.png]]
  
 
</div></li>
 
</div></li>
 
<li><p>To connect to a Bluetooth device, you need to install the '''pulseaudio-module-bluetooth''' software package, and then start the '''pulseaudio''' service</p>
 
<li><p>To connect to a Bluetooth device, you need to install the '''pulseaudio-module-bluetooth''' software package, and then start the '''pulseaudio''' service</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo apt update'''</p>
 
<p>orangepi@orangepi:~$ '''sudo apt update'''</p>
 
<p>orangepi@orangepi:~$ '''sudo''' '''apt -y install pulseaudio-module-bluetooth'''</p>
 
<p>orangepi@orangepi:~$ '''sudo''' '''apt -y install pulseaudio-module-bluetooth'''</p>
<p>orangepi@orangepi:~$ '''pulseaudio --start'''</p></li>
+
<p>orangepi@orangepi:~$ '''pulseaudio --start'''</p>
 +
|}
 +
</li>
 
<li><p>How to connect Bluetooth devices</p>
 
<li><p>How to connect Bluetooth devices</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo bluetoothctl'''</p>
 
<p>orangepi@orangepi:~$ '''sudo bluetoothctl'''</p>
 
<p>Agent registered</p>
 
<p>Agent registered</p>
Line 2,245: Line 3,039:
 
<p>[CHG] Device DC:72:9B:4C:F4:CF ServicesResolved: yes</p>
 
<p>[CHG] Device DC:72:9B:4C:F4:CF ServicesResolved: yes</p>
 
<p>[CHG] Controller 10:11:12:13:14:15 Discoverable: no</p>
 
<p>[CHG] Controller 10:11:12:13:14:15 Discoverable: no</p>
<p>'''[orangepi]# #If this prompt appears, the connection is successful.'''</p></li>
+
<p>'''[orangepi]# #If this prompt appears, the connection is successful.'''</p>
 +
|}
 +
</li>
 
<li><p>After connecting the Bluetooth device, you can see the prompt that the audio for calls and media has been '''connected in the Bluetooth configuration interface of the Android phone'''.</p>
 
<li><p>After connecting the Bluetooth device, you can see the prompt that the audio for calls and media has been '''connected in the Bluetooth configuration interface of the Android phone'''.</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image159.png|294x166px|未标题-15]]
+
[[File:zero2w-img159.png]]
  
 
</div></li></ol>
 
</div></li></ol>
  
 
<span id="usb-interface-test"></span>
 
<span id="usb-interface-test"></span>
 +
 
== USB interface test ==
 
== USB interface test ==
  
'''The USB interface can be connected to a USB hub to expand the number of USB interfaces.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''The USB interface can be connected to a USB hub to expand the number of USB interfaces.'''</big>
 +
|}
  
 
<span id="usb-interface-extension-description"></span>
 
<span id="usb-interface-extension-description"></span>
Line 2,263: Line 3,064:
 
As shown in the figure below, there are only two Type-C USB2.0 interfaces on the main board of the development board, which cannot directly connect USB Type-A mice, keyboards and other USB devices.
 
As shown in the figure below, there are only two Type-C USB2.0 interfaces on the main board of the development board, which cannot directly connect USB Type-A mice, keyboards and other USB devices.
  
[[File:media/image160.png|383x190px]]
+
[[File:zero2w-img160.png]]
  
 
If you only purchased the motherboard and not the 24pin expansion board, you can prepare a Type-C to USB cable as shown in the figure below, plug one end of the Type-C interface into the Type-C interface of the motherboard, and then plug the other end into You can connect USB devices such as mouse and keyboard. If you feel that one USB interface is not enough, you can also expand multiple USB interfaces through USB Hub.
 
If you only purchased the motherboard and not the 24pin expansion board, you can prepare a Type-C to USB cable as shown in the figure below, plug one end of the Type-C interface into the Type-C interface of the motherboard, and then plug the other end into You can connect USB devices such as mouse and keyboard. If you feel that one USB interface is not enough, you can also expand multiple USB interfaces through USB Hub.
  
[[File:media/image24.png|193x127px]]
+
[[File:zero2w-img24.png]]
  
 
If you purchase a 24pin expansion board, you do not need a Type-C to USB cable, because the 24pin expansion board can expand two USB2.0 interfaces.
 
If you purchase a 24pin expansion board, you do not need a Type-C to USB cable, because the 24pin expansion board can expand two USB2.0 interfaces.
  
[[File:media/image107.png|338x229px]]
+
[[File:zero2w-img107.png]]
  
 
<span id="how-to-set-usb0-to-host-mode"></span>
 
<span id="how-to-set-usb0-to-host-mode"></span>
Line 2,278: Line 3,079:
 
As shown in the figure below, there are two Type-C interfaces on the main board 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
 
As shown in the figure below, there are two Type-C interfaces on the main board 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
  
[[File:media/image160.png|346x171px]]
+
[[File:zero2w-img160.png]]
  
 
USB0 of the Linux system released by Orange Pi is set to Device mode by default, so when there is no need to use USB0 Device mode, it is recommended to use USB0 for power supply, so that USB1 can be used directly to connect USB devices
 
USB0 of the Linux system released by Orange Pi is set to Device mode by default, so when there is no need to use USB0 Device mode, it is recommended to use USB0 for power supply, so that USB1 can be used directly to connect USB devices
Line 2,285: Line 3,086:
  
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users remember to add &gt; '''sudo''' permissions.</p>
+
<li><p>First run '''orangepi-config'''. Ordinary users remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p>
 +
|}
 +
</li>
 
<li><p>Then select '''System'''</p>
 
<li><p>Then select '''System'''</p>
<p>[[File:media/image80.png|397x196px]]</p></li>
+
<p>[[File:zero2w-img80.png]]</p></li>
 
<li><p>Then select '''Hardware'''</p>
 
<li><p>Then select '''Hardware'''</p>
<p>[[File:media/image81.png|393x202px]]</p></li>
+
<p>[[File:zero2w-img81.png]]</p></li>
<li><p>Then use the keyboard’s arrow keys to locate the location shown in &gt; the picture below, and then use the space to select '''usb0-host'''</p>
+
<li><p>Then use the keyboard's arrow keys to locate the location shown in the picture below, and then use the space to select '''usb0-host'''</p>
<p>[[File:media/image161.png|400x58px]]</p></li>
+
<p>[[File:zero2w-img161.png]]</p></li>
 
<li><p>Then select '''&lt;Save&gt;'''to save</p>
 
<li><p>Then select '''&lt;Save&gt;'''to save</p>
<p>[[File:media/image83.png|397x92px]]</p></li>
+
<p>[[File:zero2w-img83.png]]</p></li>
 
<li><p>Then select '''&lt;Back&gt;'''</p>
 
<li><p>Then select '''&lt;Back&gt;'''</p>
<p>[[File:media/image84.png|395x91px]]</p></li>
+
<p>[[File:zero2w-img84.png]]</p></li>
<li><p>Then select '''&lt;Reboot&gt;'''to restart the system to make the &gt; configuration take effect.</p>
+
<li><p>Then select '''&lt;Reboot&gt;'''to restart the system to make the configuration take effect.</p>
<p>[[File:media/image85.png|281x140px]]</p></li>
+
<p>[[File:zero2w-img85.png]]</p></li>
<li><p>After restarting, USB0 can use USB devices such as mouse and &gt; keyboard normally.</p></li></ol>
+
<li><p>After restarting, USB0 can use USB devices such as mouse and keyboard normally.</p></li></ol>
  
 
<span id="connect-usb-mouse-or-keyboard-to-test"></span>
 
<span id="connect-usb-mouse-or-keyboard-to-test"></span>
 +
 
=== Connect USB mouse or keyboard to test ===
 
=== Connect USB mouse or keyboard to test ===
  
Line 2,314: Line 3,121:
 
# Execute the following command. If you can see the output of sdX, it means the USB disk is successfully recognized.
 
# Execute the following command. If you can see the output of sdX, it means the USB disk is successfully recognized.
  
orangepi@orangepi:~$ '''cat /proc/partitions | grep &quot;sd*&quot;'''
+
::{| class="wikitable" style="width:800px;"
 
+
|-
major minor #blocks name
+
|
 
+
orangepi@orangepi:~$ '''cat /proc/partitions | grep &quot;sd*&quot;'''<br>
8 0 30044160 '''sda'''
+
<span style="margin-right: 30px;">major </span><span style="margin-right: 40px;">minor </span><span style="margin-right: 30px;">#blocks</span><span style="margin-right: 50px;">name</span><br>
 
+
<span style="margin-right: 70px;">8</span><span style="margin-right: 60px;">0</span><span style="margin-right: 50px;">30044160 </span><span style="margin-right: 50px;color:#FF0000">'''sda'''</span><br>
8 1 30043119 '''sda1'''
+
<span style="margin-right: 70px;">8</span><span style="margin-right: 60px;">1</span><span style="margin-right: 50px;">30043119 </span><span style="margin-right: 50px;color:#FF0000">'''sda1'''</span><br>
 +
|}
  
 
<ol start="3" style="list-style-type: decimal;">
 
<ol start="3" style="list-style-type: decimal;">
<li>Use the mount command to mount the U disk to '''/mnt''', and then you can view the files in the U disk</li></ol>
+
<li>Use the mount command to mount the U disk to '''/mnt''', and then you can view the files in the U disk</li>
 
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
orangepi@orangepi:~$ '''sudo mount /dev/sda1 /mnt/'''
 
orangepi@orangepi:~$ '''sudo mount /dev/sda1 /mnt/'''
  
Line 2,330: Line 3,140:
  
 
test.txt
 
test.txt
 
+
|}
 +
</ol>
 
<ol start="4" style="list-style-type: decimal;">
 
<ol start="4" style="list-style-type: decimal;">
<li>After mounting, you can check the capacity usage and mount point of the U disk through the '''df -h''' command.</li></ol>
+
<li>After mounting, you can check the capacity usage and mount point of the U disk through the '''df -h''' command.</li>
 
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
orangepi@orangepi:~$ '''df -h | grep &quot;sd&quot;'''
 
orangepi@orangepi:~$ '''df -h | grep &quot;sd&quot;'''
  
/dev/sda1 29G 208K 29G 1% /mnt
+
/dev/sda1 &nbsp;&nbsp;&nbsp; 29G &nbsp;&nbsp; 208K &nbsp;&nbsp; 29G &nbsp;&nbsp; 1% /mnt
 +
|}
 +
</ol>
 +
<span id="usb-ethernet-card-test"></span>
  
<span id="usb-ethernet-card-test"></span>
 
 
=== USB Ethernet card test ===
 
=== USB Ethernet card test ===
  
 
# The '''currently tested''' and usable USB Ethernet cards are as follows. Among them, the RTL8153 USB Gigabit network card can be used normally when inserted into the USB 2.0 Host interface of the development board for testing, but the speed cannot reach Gigabit. Please note this.
 
# The '''currently tested''' and usable USB Ethernet cards are as follows. Among them, the RTL8153 USB Gigabit network card can be used normally when inserted into the USB 2.0 Host interface of the development board for testing, but the speed cannot reach Gigabit. Please note this.
  
{| class="wikitable"
+
::{| class="wikitable" style="width:800px;text-align: center;"
 
|-
 
|-
 
| serial number
 
| serial number
Line 2,357: Line 3,172:
 
<ol start="2" style="list-style-type: decimal;">
 
<ol start="2" style="list-style-type: decimal;">
 
<li><p>First insert the USB network card into the USB interface of the development board, and then insert the network cable into the USB network card to ensure that the network cable can access the Internet normally. If you can see the following log information through the '''dmesg''' command, it means that the USB network card is recognized normally.</p>
 
<li><p>First insert the USB network card into the USB interface of the development board, and then insert the network cable into the USB network card to ensure that the network cable can access the Internet normally. If you can see the following log information through the '''dmesg''' command, it means that the USB network card is recognized normally.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''dmesg | tail'''</p>
 
<p>orangepi@orangepi:~$ '''dmesg | tail'''</p>
 
<p>[ 121.985016] usb 3-1: USB disconnect, device number 2</p>
 
<p>[ 121.985016] usb 3-1: USB disconnect, device number 2</p>
Line 2,367: Line 3,185:
 
<p>[ 127.763031] IPv6: ADDRCONF(NETDEV_UP): enx00e04c362017: link is not ready</p>
 
<p>[ 127.763031] IPv6: ADDRCONF(NETDEV_UP): enx00e04c362017: link is not ready</p>
 
<p>[ 129.892465] r8152 3-1:1.0 enx00e04c362017: carrier on</p>
 
<p>[ 129.892465] r8152 3-1:1.0 enx00e04c362017: carrier on</p>
<p>[ 129.892583] IPv6: ADDRCONF(NETDEV_CHANGE): enx00e04c362017: link becomes ready</p></li>
+
<p>[ 129.892583] IPv6: ADDRCONF(NETDEV_CHANGE): enx00e04c362017: link becomes ready</p>
 +
|}
 +
</li>
 
<li><p>Then you can see the device node of the USB network card and the automatically assigned IP address through the ifconfig command</p>
 
<li><p>Then you can see the device node of the USB network card and the automatically assigned IP address through the ifconfig command</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo ifconfig'''</p>
 
<p>orangepi@orangepi:~$ '''sudo ifconfig'''</p>
 
<p>'''enx00e04c362017''': flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt; mtu 1500</p>
 
<p>'''enx00e04c362017''': flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt; mtu 1500</p>
<p>inet '''192.168.1.177''' netmask 255.255.255.0 broadcast 192.168.1.255</p>
+
::<p>inet '''192.168.1.177''' netmask 255.255.255.0 broadcast 192.168.1.255</p>
<p>inet6 fe80::681f:d293:4bc5:e9fd prefixlen 64 scopeid 0x20&lt;link&gt;</p>
+
::<p>inet6 fe80::681f:d293:4bc5:e9fd prefixlen 64 scopeid 0x20&lt;link&gt;</p>
<p>ether 00:e0:4c:36:20:17 txqueuelen 1000 (Ethernet)</p>
+
::<p>ether 00:e0:4c:36:20:17 txqueuelen 1000 (Ethernet)</p>
<p>RX packets 1849 bytes 134590 (134.5 KB)</p>
+
::<p>RX packets 1849 bytes 134590 (134.5 KB)</p>
<p>RX errors 0 dropped 125 overruns 0 frame 0</p>
+
::<p>RX errors 0 dropped 125 overruns 0 frame 0</p>
<p>TX packets 33 bytes 2834 (2.8 KB)</p>
+
::<p>TX packets 33 bytes 2834 (2.8 KB)</p>
<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p></li>
+
::<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p>
 +
|}
 +
</li>
 
<li><p>The command to test network connectivity is as follows</p>
 
<li><p>The command to test network connectivity is as follows</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''ping www.baidu.com -I enx00e04c362017'''</p>
 
<p>orangepi@orangepi:~$ '''ping www.baidu.com -I enx00e04c362017'''</p>
 
<p>PING www.a.shifen.com (14.215.177.38) from 192.168.1.12 eth0: 56(84) bytes of data.</p>
 
<p>PING www.a.shifen.com (14.215.177.38) from 192.168.1.12 eth0: 56(84) bytes of data.</p>
Line 2,388: Line 3,216:
 
<p>--- www.a.shifen.com ping statistics ---</p>
 
<p>--- www.a.shifen.com ping statistics ---</p>
 
<p>4 packets transmitted, 4 received, 0% packet loss, time 3002ms</p>
 
<p>4 packets transmitted, 4 received, 0% packet loss, time 3002ms</p>
<p>rtt min/avg/max/mdev = 6.260/6.770/7.275/0.373 ms</p></li></ol>
+
<p>rtt min/avg/max/mdev = 6.260/6.770/7.275/0.373 ms</p>
 +
|}
 +
</li></ol>
  
 
<span id="usb-camera-test"></span>
 
<span id="usb-camera-test"></span>
 +
 
=== USB camera test ===
 
=== USB camera test ===
  
Line 2,396: Line 3,227:
 
<li><p>First insert the USB camera into the USB interface of the Orange Pi development board</p></li>
 
<li><p>First insert the USB camera into the USB interface of the Orange Pi development board</p></li>
 
<li><p>Then you can see through the lsmod command that the kernel automatically loads the following modules</p>
 
<li><p>Then you can see through the lsmod command that the kernel automatically loads the following modules</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''lsmod'''</p>
 
<p>orangepi@orangepi:~$ '''lsmod'''</p>
<p>Module Size Used by</p>
+
<span style="margin-right: 100px;">Module </span><span style="margin-right: 50px;">Size </span><span style="margin-right: 45px;">Used by</span><br>
<p>'''uvcvideo 106496 0'''</p></li>
+
<span style="margin-right: 100px;">uvcvideo </span><span style="margin-right: 50px;">106496 </span><span style="margin-right: 50px;">0</span><br>
 +
|}
 +
</li>
 
<li><p>Through the v4l2-ctl command, you can see that the device node information of the USB camera is/dev/video0</p>
 
<li><p>Through the v4l2-ctl command, you can see that the device node information of the USB camera is/dev/video0</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo apt update'''</p>
 
<p>orangepi@orangepi:~$ '''sudo apt update'''</p>
 
<p>orangepi@orangepi:~$ '''sudo''' '''apt install -y v4l-utils'''</p>
 
<p>orangepi@orangepi:~$ '''sudo''' '''apt install -y v4l-utils'''</p>
 
<p>orangepi@orangepi:~$ '''v4l2-ctl --list-devices'''</p>
 
<p>orangepi@orangepi:~$ '''v4l2-ctl --list-devices'''</p>
 
<p>USB 2.0 Camera (usb-sunxi-ehci-1):</p>
 
<p>USB 2.0 Camera (usb-sunxi-ehci-1):</p>
<p>/dev/video0</p>
+
::<p>/dev/video0</p>
<p>'''Note that the l in v4l2 is the lowercase letter l, not the number 1.'''</p>
+
|}
<p>'''In addition, the serial number of the video may not always be video0, please refer to what you actually see.'''</p></li>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''Note that the l in v4l2 is the lowercase letter l, not the number 1.'''</p>
 +
<p>'''In addition, the serial number of the video may not always be video0, please refer to what you actually see.'''</p></big>
 +
|}
 +
</li>
 
<li><p>Use fswebcam to test the USB camera</p>
 
<li><p>Use fswebcam to test the USB camera</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>Install fswebcam</p>
 
<li><p>Install fswebcam</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo''' '''apt update'''</p>
 
<p>orangepi@orangepi:~$ '''sudo''' '''apt update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y fswebcam'''</p></li>
+
<p>orangepi@orangepi:~$ '''sudo apt-get install -y fswebcam'''</p>
<li><p>After installing fswebcam, you can use the following command to &gt; take pictures</p>
+
|}
<ol style="list-style-type: lower-alpha;">
+
</li>
<li><p>-d Option to specify the device node of the USB camera</p></li>
+
<li><p>After installing fswebcam, you can use the following command to take pictures</p>
<li><p>--no-banner Used to remove watermarks from photos</p></li>
+
<ol style="list-style-type: none;">
<li><p>-r option is used to specify the resolution of the photo</p></li>
+
<li><p>a) -d Option to specify the device node of the USB camera</p></li>
<li><p>-S Option to skip previous frames</p></li>
+
<li><p>b) --no-banner Used to remove watermarks from photos</p></li>
<li><p>./image.jpg Used to set the name and path of the generated &gt; photo</p>
+
<li><p>c) -r option is used to specify the resolution of the photo</p></li>
 +
<li><p>d) -S Option to skip previous frames</p></li>
 +
<li><p>e) ./image.jpg Used to set the name and path of the generated photo</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo''' '''fswebcam -d /dev/video0 \'''</p>
 
<p>orangepi@orangepi:~$ '''sudo''' '''fswebcam -d /dev/video0 \'''</p>
<p>'''--no-banner -r 1280x720 -S 5 ./image.jpg'''</p></li></ol>
+
<p>'''--no-banner -r 1280x720 -S 5 ./image.jpg'''</p>
 +
|}
 +
</li></ol>
 
</li>
 
</li>
<li><p>In the server version of Linux system, after taking the picture, &gt; you can use the scp command to transfer the taken picture to &gt; the Ubuntu PC for mirror viewing.</p>
+
<li><p>In the server version of Linux system, after taking the picture, you can use the scp command to transfer the taken picture to the Ubuntu PC for mirror viewing.</p>
<p>orangepi@orangepi:~$ '''scp image.jpg [mailto:test@192.168.1.55:/home/test test@192.168.1.55:/home/test] (Modify the IP address and path according to the actual situation)'''</p></li>
+
{| class="wikitable" style="width:800px;"
<li><p>In the desktop version of Linux system, you can directly view &gt; the captured pictures through the HDMI display</p></li></ol>
+
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''scp image.jpg [mailto:test@192.168.1.55:/home/test test@192.168.1.55:/home/test] (Modify the IP address and path according to the actual situation)'''</p>
 +
|}
 +
</li>
 +
<li><p>In the desktop version of Linux system, you can directly view the captured pictures through the HDMI display</p></li></ol>
 
</li>
 
</li>
 
<li><p>Use mjpg-streamer to test the USB camera</p>
 
<li><p>Use mjpg-streamer to test the USB camera</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>Download mjpg-streamer</p>
 
<li><p>Download mjpg-streamer</p>
<ol style="list-style-type: lower-alpha;">
+
<ol style="list-style-type: none;">
<li><p>Github download address:</p>
+
<li><p>a) Github download address:</p>
<p>orangepi@orangepi:~$ '''git clone https://github.com/jacksonliam/mjpg-streamer'''</p></li>
+
{| class="wikitable" style="width:800px;"
<li><p>The image download address of Gitee is:</p>
+
|-
<p>orangepi@orangepi:~$ '''git clone https://gitee.com/leeboby/mjpg-streamer'''</p></li></ol>
+
|
 +
<p>orangepi@orangepi:~$ '''git clone https://github.com/jacksonliam/mjpg-streamer'''</p>
 +
|}
 +
</li>
 +
<li><p>b) The image download address of Gitee is:</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''git clone https://gitee.com/leeboby/mjpg-streamer'''</p>
 +
|}
 +
</li></ol>
 
</li>
 
</li>
 
<li><p>Install dependent software packages</p>
 
<li><p>Install dependent software packages</p>
<ol style="list-style-type: lower-alpha;">
+
<ol style="list-style-type: none;">
<li><p>Ubuntu system</p>
+
<li><p>a) Ubuntu system</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y cmake libjpeg8-dev'''</p></li>
+
{| class="wikitable" style="width:800px;"
<li><p>Debian system</p>
+
|-
<p>orangepi@orangepi:~$ '''sudo apt-get install -y cmake libjpeg62-turbo-dev'''</p></li></ol>
+
|
 +
<p>orangepi@orangepi:~$ '''sudo apt-get install -y cmake libjpeg8-dev'''</p>
 +
|}
 +
</li>
 +
<li><p>b) Debian system</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo apt-get install -y cmake libjpeg62-turbo-dev'''</p>
 +
|}
 +
</li></ol>
 
</li>
 
</li>
 
<li><p>Compile and install mjpg-streamer</p>
 
<li><p>Compile and install mjpg-streamer</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''cd mjpg-streamer/mjpg-streamer-experimental'''</p>
 
<p>orangepi@orangepi:~$ '''cd mjpg-streamer/mjpg-streamer-experimental'''</p>
 
<p>orangepi@orangepi:~/mjpg-streamer/mjpg-streamer-experimental$ '''make -j4'''</p>
 
<p>orangepi@orangepi:~/mjpg-streamer/mjpg-streamer-experimental$ '''make -j4'''</p>
<p>orangepi@orangepi:~/mjpg-streamer/mjpg-streamer-experimental$ '''sudo make install'''</p></li>
+
<p>orangepi@orangepi:~/mjpg-streamer/mjpg-streamer-experimental$ '''sudo make install'''</p>
 +
|}
 +
</li>
 
<li><p>Then enter the following command to start mjpg_streamer</p>
 
<li><p>Then enter the following command to start mjpg_streamer</p>
<p>'''Note that the serial number of the video is not always video0, please refer to what you actually see.'''</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''Note that the serial number of the video is not always video0, please refer to what you actually see.'''</p></big>
 +
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~/mjpg-streamer/mjpg-streamer-experimental$ '''export LD_LIBRARY_PATH=.'''</p>
 
<p>orangepi@orangepi:~/mjpg-streamer/mjpg-streamer-experimental$ '''export LD_LIBRARY_PATH=.'''</p>
 
<p>orangepi@orangepi:~/mjpg-streamer/mjpg-streamer-experimental$ '''sudo ./mjpg_streamer -i &quot;./input_uvc.so -d \'''</p>
 
<p>orangepi@orangepi:~/mjpg-streamer/mjpg-streamer-experimental$ '''sudo ./mjpg_streamer -i &quot;./input_uvc.so -d \'''</p>
<p>'''/dev/video0 -u -f 30&quot; -o &quot;./output_http.so -w ./www&quot;'''</p></li>
+
<p>'''/dev/video0 -u -f 30&quot; -o &quot;./output_http.so -w ./www&quot;'''</p>
<li><p>Then enter ['''the IP address of the development board: 8080'''] &gt; in the Ubuntu PC or Windows PC or mobile phone browser on the &gt; same LAN as the development board to see the video output by &gt; the camera.</p>
+
|}
 +
</li>
 +
<li><p>Then enter ['''the IP address of the development board: 8080'''] in the Ubuntu PC or Windows PC or mobile phone browser on the same LAN as the development board to see the video output by the camera.</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image162.png|575x278px|图片9]]
+
[[File:zero2w-img162.png]]
  
 
</div></li></ol>
 
</div></li></ol>
Line 2,460: Line 3,354:
  
 
<span id="audio-test"></span>
 
<span id="audio-test"></span>
 +
 
== Audio test ==
 
== Audio test ==
  
Line 2,470: Line 3,365:
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>There is no headphone interface on the main board of the development board. We can expand it through a 24pin expansion board.</p>
 
<li><p>There is no headphone interface on the main board of the development board. We can expand it through a 24pin expansion board.</p>
<p>[[File:media/image107.png|338x229px]]</p></li>
+
<p>[[File:zero2w-img107.png]]</p></li>
 
<li><p>Use the '''aplay -l''' command to view the sound card devices supported by the Linux system</p>
 
<li><p>Use the '''aplay -l''' command to view the sound card devices supported by the Linux system</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>The output of the linux5.4 system is as follows, where '''card 0: &gt; audiocodec''' is the sound card device required for headphone &gt; playback</p>
+
<li><p>The output of the linux5.4 system is as follows, where '''card 0: audiocodec''' is the sound card device required for headphone playback</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>root@orangepi:~# '''aplay -l'''</p>
 
<p>root@orangepi:~# '''aplay -l'''</p>
 
<p>**** List of PLAYBACK Hardware Devices ****</p>
 
<p>**** List of PLAYBACK Hardware Devices ****</p>
 
<p>'''card 0: audiocodec [audiocodec], device 0: soc@3000000:codec_plat-5096000.codec 5096000.codec-0 []'''</p>
 
<p>'''card 0: audiocodec [audiocodec], device 0: soc@3000000:codec_plat-5096000.codec 5096000.codec-0 []'''</p>
<p>'''Subdevices: 1/1'''</p>
+
:<p>'''Subdevices: 1/1'''</p>
<p>'''Subdevice #0: subdevice #0'''</p></li>
+
:<p>'''Subdevice #0: subdevice #0'''</p>
<li><p>The output of the b.linux6.1 system is as follows, where &gt; '''audiocodec''' is the sound card device required for headphone &gt; playback.</p>
+
|}
 +
</li>
 +
<li><p>The output of the b.linux6.1 system is as follows, where '''audiocodec''' is the sound card device required for headphone playback.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>root@orangepi:~# '''aplay -l'''</p>
 
<p>root@orangepi:~# '''aplay -l'''</p>
 
<p>**** List of PLAYBACK Hardware Devices ****</p>
 
<p>**** List of PLAYBACK Hardware Devices ****</p>
 
<p>'''card 0: audiocodec [audiocodec], device 0: CDC PCM Codec-0 [CDC PCM Codec-0]'''</p>
 
<p>'''card 0: audiocodec [audiocodec], device 0: CDC PCM Codec-0 [CDC PCM Codec-0]'''</p>
<p>'''Subdevices: 1/1'''</p>
+
:<p>'''Subdevices: 1/1'''</p>
<p>'''Subdevice #0: subdevice #0'''</p></li></ol>
+
:<p>'''Subdevice #0: subdevice #0'''</p>
 +
|}
 +
</li></ol>
 
</li>
 
</li>
 
<li><p>Then use the '''aplay''' command to play the audio, and the sound can be heard through the headphones</p>
 
<li><p>Then use the '''aplay''' command to play the audio, and the sound can be heard through the headphones</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>root@orangepi:~# '''aplay -D hw:0,0 /usr/share/sounds/alsa/audio.wav'''</p>
 
<p>root@orangepi:~# '''aplay -D hw:0,0 /usr/share/sounds/alsa/audio.wav'''</p>
<p>Playing WAVE 'audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo</p></li></ol>
+
<p>Playing WAVE 'audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo</p>
 +
|}
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''If there is noise during the headphone test, please pull out some of the headphones and do not plug them all the way in.'''</big>
 +
|}
 +
</li></ol>
 +
<span id="hdmi-audio-playback-test"></span>
  
'''If there is noise during the headphone test, please pull out some of the headphones and do not plug them all the way in.'''
+
==== HDMI audio playback test ====
 
 
<span id="hdmi-audio-playback-test"></span>
 
==== HDMI audio playback test ====
 
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>First use the Mini HDMI to HDMI cable to connect the Orange Pi development board to the TV (other HDMI displays need to ensure that they can play audio)</p></li>
 
<li><p>First use the Mini HDMI to HDMI cable to connect the Orange Pi development board to the TV (other HDMI displays need to ensure that they can play audio)</p></li>
 
<li><p>HDMI audio playback does not require other settings, just use the '''aplay''' command to play directly</p>
 
<li><p>HDMI audio playback does not require other settings, just use the '''aplay''' command to play directly</p>
<p>root@orangepi:~# '''aplay -D hw:2,0 /usr/share/sounds/alsa/audio.wav'''</p></li></ol>
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>root@orangepi:~# '''aplay -D hw:2,0 /usr/share/sounds/alsa/audio.wav'''</p>
 +
|}
 +
</li></ol>
  
 
<span id="test-audio-methods-on-desktop-systems"></span>
 
<span id="test-audio-methods-on-desktop-systems"></span>
 +
 
=== Test audio methods on desktop systems ===
 
=== Test audio methods on desktop systems ===
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>First open the file manager</p>
 
<li><p>First open the file manager</p>
<p>[[File:media/image163.png|257x126px]]</p></li>
+
<p>[[File:zero2w-img163.png]]</p></li>
 
<li><p>Then find the following file (if there is no such audio file in the system, you can upload an audio file to the system yourself)</p>
 
<li><p>Then find the following file (if there is no such audio file in the system, you can upload an audio file to the system yourself)</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image164.png|236x186px|图片10]]
+
[[File:zero2w-img164.png]]
  
 
</div></li>
 
</div></li>
 
<li><p>Then select the audio.wav file, right-click and select open with vlc to start playing.</p>
 
<li><p>Then select the audio.wav file, right-click and select open with vlc to start playing.</p>
<p>[[File:media/image165.png|241x195px]]</p></li>
+
<p>[[File:zero2w-img165.png]]</p></li>
 
<li><p>How to switch between different audio devices such as HDMI playback and headphone playback</p>
 
<li><p>How to switch between different audio devices such as HDMI playback and headphone playback</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>First open the volume control interface</p>
 
<li><p>First open the volume control interface</p>
<p>[[File:media/image166.png|294x161px]]</p></li>
+
<p>[[File:zero2w-img166.png]]</p></li>
<li><p>When playing audio, the audio device options that can be used by &gt; the '''Playback''' software will be displayed in '''Playback''', &gt; as shown in the figure below. Here you can set which audio &gt; device needs to be played.</p>
+
<li><p>When playing audio, the audio device options that can be used by the '''Playback''' software will be displayed in '''Playback''', as shown in the figure below. Here you can set which audio device needs to be played.</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image167.png|576x324px|4]]
+
[[File:zero2w-img167.png]]
  
 
</div></li></ol>
 
</div></li></ol>
Line 2,527: Line 3,446:
  
 
<span id="infrared-reception-test"></span>
 
<span id="infrared-reception-test"></span>
 +
 
== Infrared reception test ==
 
== Infrared reception test ==
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li><p>There is no infrared receiver on the main board of the development board. We can expand it through a 24pin expansion board.</p>
 
<li><p>There is no infrared receiver on the main board of the development board. We can expand it through a 24pin expansion board.</p>
<p>[[File:media/image107.png|338x226px]]</p></li>
+
<p>[[File:zero2w-img107.png]]</p></li>
<li><p>Install ir-keytable infrared test software</p></li></ol>
+
<li><p>Install ir-keytable infrared test software</p></li>
 
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
orangepi@orangepi:~$ '''sudo''' '''apt update'''
 
orangepi@orangepi:~$ '''sudo''' '''apt update'''
  
 
orangepi@orangepi:~$ '''sudo''' '''apt-get install -y ir-keytable'''
 
orangepi@orangepi:~$ '''sudo''' '''apt-get install -y ir-keytable'''
 
+
|}
 +
</ol>
 
<ol start="3" style="list-style-type: decimal;">
 
<ol start="3" style="list-style-type: decimal;">
 
<li><p>Then execute ir-keytable to view the information of the infrared device</p>
 
<li><p>Then execute ir-keytable to view the information of the infrared device</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li>linux5.4 system output is as follows</li></ol>
+
<li>linux5.4 system output is as follows</li>
</li></ol>
+
{| class="wikitable" style="width:800px;"
 
+
|-
 +
|
 
orangepi@orangepi:~$ '''ir-keytable'''
 
orangepi@orangepi:~$ '''ir-keytable'''
  
 
Found /sys/class/rc/rc0/ with:
 
Found /sys/class/rc/rc0/ with:
  
Name: sunxi-ir
+
::Name: sunxi-ir
  
Driver: sunxi-rc-recv
+
::Driver: sunxi-rc-recv
  
Default keymap: rc_map_sunxi
+
::Default keymap: rc_map_sunxi
  
Input device: /dev/input/event1
+
::Input device: /dev/input/event1
  
LIRC device: /dev/lirc0
+
::LIRC device: /dev/lirc0
  
Attached BPF protocols: Operation not permitted
+
::Attached BPF protocols: Operation not permitted
  
Supported kernel protocols: lirc nec
+
::Supported kernel protocols: lirc nec
  
Enabled kernel protocols: lirc nec
+
::Enabled kernel protocols: lirc nec
  
bus: 25, vendor/product: 0001:0001, version: 0x0100
+
::bus: 25, vendor/product: 0001:0001, version: 0x0100
 
 
Repeat delay = 500 ms, repeat period = 125 ms
 
  
 +
::Repeat delay = 500 ms, repeat period = 125 ms
 +
|}
 +
</ol>
 
<ol start="2" style="list-style-type: lower-alpha;">
 
<ol start="2" style="list-style-type: lower-alpha;">
 
<li><p>The output of the linux6.1 system is as follows</p>
 
<li><p>The output of the linux6.1 system is as follows</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''ir-keytable'''</p>
 
<p>orangepi@orangepi:~$ '''ir-keytable'''</p>
 
<p>Found /sys/class/rc/rc0/ with:</p>
 
<p>Found /sys/class/rc/rc0/ with:</p>
<p>Name: sunxi-ir</p>
+
::<p>Name: sunxi-ir</p>
<p>Driver: sunxi-ir</p>
+
::<p>Driver: sunxi-ir</p>
<p>Default keymap: rc-empty</p>
+
::<p>Default keymap: rc-empty</p>
<p>Input device: /dev/input/event5</p>
+
::<p>Input device: /dev/input/event5</p>
<p>LIRC device: /dev/lirc0</p>
+
::<p>LIRC device: /dev/lirc0</p>
<p>Attached BPF protocols: Operation not permitted</p>
+
::<p>Attached BPF protocols: Operation not permitted</p>
<p>Supported kernel protocols: lirc rc-5 rc-5-sz jvc sony nec sanyo mce_kbd rc-6 sharp xmp imon rc-mm</p>
+
::<p>Supported kernel protocols: lirc rc-5 rc-5-sz jvc sony nec sanyo mce_kbd rc-6 sharp xmp imon rc-mm</p>
<p>Enabled kernel protocols: lirc</p>
+
::<p>Enabled kernel protocols: lirc</p>
<p>bus: 25, vendor/product: 0001:0001, version: 0x0100</p>
+
::<p>bus: 25, vendor/product: 0001:0001, version: 0x0100</p>
<p>Repeat delay = 500 ms, repeat period = 125 ms</p></li></ol>
+
::<p>Repeat delay = 500 ms, repeat period = 125 ms</p>
 
+
|}
<!-- -->
+
</li></ol>
 +
</li></ol>
 
<ol start="4" style="list-style-type: decimal;">
 
<ol start="4" style="list-style-type: decimal;">
<li><p>Before testing the infrared reception function, you need to prepare an Orange Pi-specific infrared remote control. '''<span class="mark">Other remote controls do not support it</span>'''.</p>
+
<li><p>Before testing the infrared reception function, you need to prepare an Orange Pi-specific infrared remote control. '''<span style="color:#FF0000">Other remote controls do not support it</span>'''.</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image168.png|140x131px|IMG_256]]
+
[[File:zero2w-img168.png]]
  
 
</div></li>
 
</div></li>
 
<li><p>Then enter the '''ir-keytable -t''' command in the terminal, and then use the infrared remote control to press the button against the infrared receiver of the Orange Pi development board to see the received key code in the terminal.</p>
 
<li><p>Then enter the '''ir-keytable -t''' command in the terminal, and then use the infrared remote control to press the button against the infrared receiver of the Orange Pi development board to see the received key code in the terminal.</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li>linux5.4 system output is as follows</li></ol>
+
<li>linux5.4 system output is as follows</li>
</li></ol>
+
{| class="wikitable" style="width:800px;"
 
+
|-
 +
|
 
orangepi@orangepi:~$ '''sudo ir-keytable -t'''
 
orangepi@orangepi:~$ '''sudo ir-keytable -t'''
  
Line 2,605: Line 3,535:
  
 
1598339152.914715: event type EV_MSC(0x04): scancode = 0xfb0410
 
1598339152.914715: event type EV_MSC(0x04): scancode = 0xfb0410
 
+
|}
 +
</ol>
 
<ol start="2" style="list-style-type: lower-alpha;">
 
<ol start="2" style="list-style-type: lower-alpha;">
 
<li><p>linux6.1 system output is as follows</p>
 
<li><p>linux6.1 system output is as follows</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''sudo ir-keytable -c -p NEC -t'''</p>
 
<p>orangepi@orangepi:~$ '''sudo ir-keytable -c -p NEC -t'''</p>
 
<p>Old keytable cleared</p>
 
<p>Old keytable cleared</p>
Line 2,614: Line 3,548:
 
<p>202.063219: lirc protocol(nec): scancode = 0x45c</p>
 
<p>202.063219: lirc protocol(nec): scancode = 0x45c</p>
 
<p>202.063249: event type EV_MSC(0x04): scancode = 0x45c</p>
 
<p>202.063249: event type EV_MSC(0x04): scancode = 0x45c</p>
<p>202.063249: event type EV_SYN(0x00).</p></li></ol>
+
<p>202.063249: event type EV_SYN(0x00).</p>
 +
|}
 +
</li></ol>
 +
</li></ol>
 +
<span id="temperature-sensor"></span>
  
<span id="temperature-sensor"></span>
 
 
== Temperature sensor ==
 
== Temperature sensor ==
  
Line 2,624: Line 3,561:
 
H618 has a total of 4 temperature sensors. The command to view the temperature is as follows:
 
H618 has a total of 4 temperature sensors. The command to view the temperature is as follows:
  
'''The displayed temperature value needs to be divided by 1000, and the unit is Celsius.'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''The displayed temperature value needs to be divided by 1000, and the unit is Celsius.'''</big>
 +
|}
  
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li>sensor0: CPU temperature sensor, the first command is used to view &gt; the type of temperature sensor, the second command is used to view &gt; the value of the temperature sensor</li></ol>
+
<li>sensor0: CPU temperature sensor, the first command is used to view the type of temperature sensor, the second command is used to view the value of the temperature sensor</li>
 
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone0/type'''
 
orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone0/type'''
  
Line 2,636: Line 3,579:
  
 
'''57734'''
 
'''57734'''
 
+
|}
 +
</ol>
 
<ol start="2" style="list-style-type: lower-alpha;">
 
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>sensor1: DDR temperature sensor, the first command is used to view &gt; the type of temperature sensor, the second command is used to view &gt; the value of the temperature sensor</p>
+
<li><p>sensor1: DDR temperature sensor, the first command is used to view the type of temperature sensor, the second command is used to view the value of the temperature sensor</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone1/type'''</p>
 
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone1/type'''</p>
 
<p>'''ddr'''_thermal_zone</p>
 
<p>'''ddr'''_thermal_zone</p>
 
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone1/temp'''</p>
 
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone1/temp'''</p>
<p>'''57410'''</p></li>
+
<p>'''57410'''</p>
<li><p>sensor2: GPU temperature sensor, the first command is used to view &gt; the type of temperature sensor, the second command is used to view &gt; the value of the temperature sensor</p>
+
|}
 +
</li>
 +
<li><p>sensor2: GPU temperature sensor, the first command is used to view the type of temperature sensor, the second command is used to view the value of the temperature sensor</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone2/type'''</p>
 
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone2/type'''</p>
 
<p>'''gpu'''_thermal_zone</p>
 
<p>'''gpu'''_thermal_zone</p>
 
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone2/temp'''</p>
 
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone2/temp'''</p>
<p>'''59273'''</p></li>
+
<p>'''59273'''</p>
<li><p>sensor3: VE’s temperature sensor. The first command is used to view &gt; the type of temperature sensor, and the second command is used to &gt; view the value of the temperature sensor.</p>
+
|}
 +
</li>
 +
<li><p>sensor3: VE's temperature sensor. The first command is used to view the type of temperature sensor, and the second command is used to view the value of the temperature sensor.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone3/type'''</p>
 
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone3/type'''</p>
 
<p>'''ve'''_thermal_zone</p>
 
<p>'''ve'''_thermal_zone</p>
 
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone3/temp'''</p>
 
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone3/temp'''</p>
<p>'''58949'''</p></li></ol>
+
<p>'''58949'''</p>
 +
|}
 +
</li></ol>
  
 
<span id="how-to-check-the-temperature-in-linux6.1-system"></span>
 
<span id="how-to-check-the-temperature-in-linux6.1-system"></span>
 +
 
=== How to check the temperature in linux6.1 system ===
 
=== How to check the temperature in linux6.1 system ===
  
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 
orangepi@orangepi:~$ '''sensors'''
 
orangepi@orangepi:~$ '''sensors'''
  
Line 2,663: Line 3,626:
 
Adapter: Virtual device
 
Adapter: Virtual device
  
temp1: +'''47.4°C''' (crit = +110.0°C)
+
temp1: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +'''<span style="color:#FF0000">47.4°C</span>''' (crit = +110.0°C)
 +
 
  
 
gpu_thermal-virtual-0
 
gpu_thermal-virtual-0
Line 2,669: Line 3,633:
 
Adapter: Virtual device
 
Adapter: Virtual device
  
temp1: +'''48.7°C''' (crit = +110.0°C)
+
temp1: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +'''<span style="color:#FF0000">48.7°C</span>''' (crit = +110.0°C)
 +
 
  
 
ddr_thermal-virtual-0
 
ddr_thermal-virtual-0
Line 2,675: Line 3,640:
 
Adapter: Virtual device
 
Adapter: Virtual device
  
temp1: +'''47.8°C''' (crit = +110.0°C)
+
temp1: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +'''<span style="color:#FF0000">47.8°C</span>''' (crit = +110.0°C)
 +
 
  
 
ve_thermal-virtual-0
 
ve_thermal-virtual-0
Line 2,681: Line 3,647:
 
Adapter: Virtual device
 
Adapter: Virtual device
  
temp1: +'''47.2°C''' (crit = +110.0°C)
+
temp1: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +'''<span style="color:#FF0000">47.2°C</span>''' (crit = +110.0°C)
 +
|}
  
 
<span id="pin-interface-pin-description"></span>
 
<span id="pin-interface-pin-description"></span>
 +
 
== 40 Pin Interface pin description ==
 
== 40 Pin Interface pin description ==
  
'''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.'''
+
{| 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>
 +
|}
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
Line 2,692: Line 3,664:
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image169.png|283x147px|004]]
+
[[File:zero2w-img169.png]]
  
 
</div></li>
 
</div></li>
<li><p>The functions of the 40 Pin interface pins on the development board are as shown in the table below</p></li></ol>
+
<li><p>The functions of the 40 Pin interface pins on the development board are as shown in the table below</p></li>
  
{| class="wikitable"
+
<div style="display: flex;">
 +
{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
 
|-
 
|-
| '''GPIO序号'''
+
| '''GPIO NO.'''
 
| '''GPIO'''
 
| '''GPIO'''
 
| '''Function'''
 
| '''Function'''
 
| '''pin'''
 
| '''pin'''
|
 
| '''pin'''
 
| '''Function'''
 
| '''GPIO'''
 
| '''GPIO NO'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
Line 2,713: Line 3,681:
 
| '''3.3V'''
 
| '''3.3V'''
 
| '''1'''
 
| '''1'''
|
 
| '''2'''
 
| '''5V'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''264'''
 
| '''264'''
Line 2,723: Line 3,686:
 
| '''TWI1-SDA'''
 
| '''TWI1-SDA'''
 
| '''3'''
 
| '''3'''
|
 
| '''4'''
 
| '''5V'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''263'''
 
| '''263'''
Line 2,733: Line 3,691:
 
| '''TWI1-SCL'''
 
| '''TWI1-SCL'''
 
| '''5'''
 
| '''5'''
|
 
| '''6'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''269'''
 
| '''269'''
Line 2,743: Line 3,696:
 
| '''PWM3/UART4_TX'''
 
| '''PWM3/UART4_TX'''
 
| '''7'''
 
| '''7'''
|
 
| '''8'''
 
| '''UART0_TX'''
 
| '''PH0'''
 
| '''224'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
Line 2,753: Line 3,701:
 
| '''GND'''
 
| '''GND'''
 
| '''9'''
 
| '''9'''
|
 
| '''10'''
 
| '''UART0_RX'''
 
| '''PH1'''
 
| '''225'''
 
 
|-
 
|-
 
| '''226'''
 
| '''226'''
Line 2,763: Line 3,706:
 
| '''UART5_TX'''
 
| '''UART5_TX'''
 
| '''11'''
 
| '''11'''
|
 
| '''12'''
 
| style="text-align: left;"|
 
| '''PI1'''
 
| '''257'''
 
 
|-
 
|-
 
| '''227'''
 
| '''227'''
Line 2,773: Line 3,711:
 
| '''UART5_RX'''
 
| '''UART5_RX'''
 
| '''13'''
 
| '''13'''
|
 
| '''14'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''261'''
 
| '''261'''
Line 2,783: Line 3,716:
 
| '''TWI0_SCL/UART2_TX'''
 
| '''TWI0_SCL/UART2_TX'''
 
| '''15'''
 
| '''15'''
|
 
| '''16'''
 
| '''PWM4/UART4_RX'''
 
| '''PI14'''
 
| '''270'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
Line 2,793: Line 3,721:
 
| '''3.3V'''
 
| '''3.3V'''
 
| '''17'''
 
| '''17'''
|
 
| '''18'''
 
| style="text-align: left;"|
 
| '''PH4'''
 
| '''228'''
 
 
|-
 
|-
 
| '''231'''
 
| '''231'''
Line 2,803: Line 3,726:
 
| '''SPI1_MOSI'''
 
| '''SPI1_MOSI'''
 
| '''19'''
 
| '''19'''
|
 
| '''20'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''232'''
 
| '''232'''
Line 2,813: Line 3,731:
 
| '''SPI1_MISO'''
 
| '''SPI1_MISO'''
 
| '''21'''
 
| '''21'''
|
 
| '''22'''
 
| '''TWI0_SDA/UART2_RX'''
 
| '''PI6'''
 
| '''262'''
 
 
|-
 
|-
 
| '''230'''
 
| '''230'''
Line 2,823: Line 3,736:
 
| '''SPI1_CLK'''
 
| '''SPI1_CLK'''
 
| '''23'''
 
| '''23'''
|
 
| '''24'''
 
| '''SPI1_CS0'''
 
| '''PH5'''
 
| '''229'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
Line 2,833: Line 3,741:
 
| '''GND'''
 
| '''GND'''
 
| '''25'''
 
| '''25'''
|
 
| '''26'''
 
| '''SPI1_CS1'''
 
| '''PH9'''
 
| '''233'''
 
 
|-
 
|-
 
| '''266'''
 
| '''266'''
Line 2,843: Line 3,746:
 
| '''TWI2-SDA/UART3_RX'''
 
| '''TWI2-SDA/UART3_RX'''
 
| '''27'''
 
| '''27'''
|
 
| '''28'''
 
| '''TWI2-SCL/UART3_TX'''
 
| '''PI9'''
 
| '''265'''
 
 
|-
 
|-
 
| '''256'''
 
| '''256'''
Line 2,853: Line 3,751:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''29'''
 
| '''29'''
|
 
| '''30'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''271'''
 
| '''271'''
Line 2,863: Line 3,756:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''31'''
 
| '''31'''
|
 
| '''32'''
 
| '''PWM1'''
 
| '''PI11'''
 
| '''267'''
 
 
|-
 
|-
 
| '''268'''
 
| '''268'''
Line 2,873: Line 3,761:
 
| '''PWM2'''
 
| '''PWM2'''
 
| '''33'''
 
| '''33'''
|
 
| '''34'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''258'''
 
| '''258'''
Line 2,883: Line 3,766:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''35'''
 
| '''35'''
|
 
| '''36'''
 
| style="text-align: left;"|
 
| '''PC12'''
 
| '''76'''
 
 
|-
 
|-
 
| '''272'''
 
| '''272'''
Line 2,893: Line 3,771:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''37'''
 
| '''37'''
|
 
| '''38'''
 
| style="text-align: left;"|
 
| '''PI4'''
 
| '''260'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
Line 2,903: Line 3,776:
 
| '''GND'''
 
| '''GND'''
 
| '''39'''
 
| '''39'''
|
+
|}
| '''40'''
+
{| 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'''
 +
| '''5V'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''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;"|
 
| style="text-align: left;"|
| '''PI3'''
+
| '''PI1'''
| '''259'''
+
| '''257'''
|}
 
 
 
<ol start="3" style="list-style-type: decimal;">
 
<li>There are a total of 28 GPIO ports in the 40pin interface. The high-level voltage of all GPIO ports is '''3.3v'''</li></ol>
 
 
 
<span id="how-to-install-wiringop"></span>
 
== How to install wiringOP ==
 
 
 
'''Note that wiringOP is already pre-installed in the linux image released by Orange Pi. Unless the wiringOP code is updated, there is no need to re-download, compile and install, you can just use it directly.'''
 
 
 
'''The storage path of the compiled wiringOP deb package in orangepi-build is: '''
 
 
 
'''orangepi-build/external/cache/debs/arm64/wiringpi_x.xx.deb'''
 
 
 
'''After entering the system, you can run the gpio readall command. If you can see the following output, it means that wiringOP has been pre-installed and can be used normally.'''
 
 
 
[[File:media/image170.png|576x405px]]
 
 
 
'''WiringOP currently mainly adapts to the functions of setting GPIO port input and output, setting GPIO port output high and low levels, and setting pull-up and pull-down resistors. Functions such as hardware PWM cannot be used.'''
 
 
 
<ol style="list-style-type: decimal;">
 
<li><p>Download the code of wiringOP</p>
 
<p>orangepi@orangepi:~$ '''sudo apt update'''</p>
 
<p>orangepi@orangepi:~$ '''sudo apt install -y git'''</p>
 
<p>orangepi@orangepi:~$ '''git clone https://github.com/orangepi-xunlong/wiringOP.git -b next'''</p>
 
<p>'''Note that the source code needs to download the code of wiringOP next branch. Please don’t miss the -b next parameter.'''</p>
 
<p>'''If there is a problem downloading the code from GitHub, you can directly use the wiringOP source code that comes with the Linux image. The storage location is: /usr/src/wiringOP.'''</p></li>
 
<li><p>Compile and install wiringOP</p>
 
<p>orangepi@orangepi:~$ '''cd wiringOP'''</p>
 
<p>orangepi@orangepi:~/wiringOP$ '''sudo ./build clean'''</p>
 
<p>orangepi@orangepi:~/wiringOP$ '''sudo ./build'''</p></li>
 
<li><p>The output of the test gpio readall command is as follows</p>
 
<p>[[File:media/image170.png|576x405px]]</p></li></ol>
 
 
 
<span id="pin-interface-gpio-i2c-uart-spi-and-pwm-testing"></span>
 
== 40pin interface GPIO, I2C, UART, SPI and PWM testing ==
 
 
 
'''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="pin-gpio-port-test"></span>
 
=== 40pin GPIO port test ===
 
 
 
<ol style="list-style-type: decimal;">
 
<li><p>The following uses pin No. 7 - corresponding to GPIO PI13 - corresponding to wPi serial number 2 - as an example to demonstrate how to set the high and low levels of the GPIO port.</p>
 
<p>[[File:media/image171.png|575x127px]]</p></li>
 
<li><p>First set the GPIO port to output mode, and the third parameter needs to be the serial number of the wPi corresponding to the input pin.</p>
 
<p>root@orangepi:~/wiringOP# '''gpio mode 2 out'''</p></li>
 
<li><p>Then set the GPIO port to output a 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 is set successfully.</p>
 
<p>root@orangepi:~/wiringOP# '''gpio write 2 0'''</p></li>
 
<li><p>Then set the GPIO port to output a high level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 3.3v, it means the setting of the high level is successful.</p>
 
<p>root@orangepi:~/wiringOP# '''gpio write 2 1'''</p></li>
 
<li><p>The setting method for other pins is similar. You only need to modify the serial number of wPi to the serial number corresponding to the pin.</p></li></ol>
 
 
 
<span id="how-to-set-the-pull-down-resistor-of-40-pin-gpio-port"></span>
 
=== How to set the pull-down resistor of 40 Pin GPIO port ===
 
 
 
<ol style="list-style-type: decimal;">
 
<li><p>The following uses pin No. 7—corresponding to GPIO PI13—corresponding to wPi serial number 2—as an example to demonstrate how to set the pull-up and pull-down resistors of the GPIO port.</p>
 
<p>[[File:media/image171.png|575x127px]]</p></li>
 
<li><p>First, you need to set the GPIO port to input mode, and the third parameter needs to be the serial number of the wPi corresponding to the input pin.</p>
 
<p>root@orangepi:~/wiringOP# '''gpio mode 2 in'''</p></li>
 
<li><p>After setting to input mode, execute the following command to set the GPIO port to pull-up mode.</p>
 
<p>root@orangepi:~/wiringOP# '''gpio mode 2 up'''</p></li>
 
<li><p>Then enter the following command to read the level of the GPIO port. If the level is 1, it means that the pull-up mode is set successfully.</p>
 
<p>root@orangepi:~/wiringOP# '''gpio read 2'''</p>
 
<p>'''1'''</p></li>
 
<li><p>Then execute the following command to set the GPIO port to pull-down mode</p>
 
<p>root@orangepi:~/wiringOP# '''gpio mode 2 down'''</p></li>
 
<li><p>Then enter the following command to read the level of the GPIO port. If the level is 0, it means that the pull-down mode is set successfully.</p>
 
<p>root@orangepi:~/wiringOP# '''gpio read 2'''</p>
 
<p>'''0'''</p></li></ol>
 
 
 
<span id="pin-spi-test"></span>
 
=== 40pin SPI test ===
 
 
 
# 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序号'''
 
| '''GPIO'''
 
| '''Function'''
 
| '''pin'''
 
|
 
| '''pin'''
 
| '''Function'''
 
| '''GPIO'''
 
| '''GPIO序号'''
 
 
|-
 
|-
 +
| '''14'''
 +
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''3.3V'''
+
|-
| '''1'''
+
| '''16'''
|
+
| '''PWM4/UART4_RX'''
| '''2'''
+
| '''PI14'''
| '''5V'''
+
| '''270'''
| style="text-align: left;"|
+
|-
 +
| '''18'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''PH4'''
 +
| '''228'''
 
|-
 
|-
| '''264'''
+
| '''20'''
| '''PI8'''
+
| '''GND'''
| '''TWI1-SDA'''
 
| '''3'''
 
|
 
| '''4'''
 
| '''5V'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
|-
 
|-
| '''263'''
+
| '''22'''
| '''PI7'''
+
| '''TWI0_SDA/UART2_RX'''
| '''TWI1-SCL'''
+
| '''PI6'''
| '''5'''
+
| '''262'''
|
+
|-
| '''6'''
+
| '''24'''
 +
| '''SPI1_CS0'''
 +
| '''PH5'''
 +
| '''229'''
 +
|-
 +
| '''26'''
 +
| '''SPI1_CS1'''
 +
| '''PH9'''
 +
| '''233'''
 +
|-
 +
| '''28'''
 +
| '''TWI2-SCL/UART3_TX'''
 +
| '''PI9'''
 +
| '''265'''
 +
|-
 +
| '''30'''
 
| '''GND'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
|-
 
|-
| '''269'''
+
| '''32'''
| '''PI13'''
+
| '''PWM1'''
| '''PWM3/UART4_TX'''
+
| '''PI11'''
| '''7'''
+
| '''267'''
|
 
| '''8'''
 
| '''UART0_TX'''
 
| '''PH0'''
 
| '''224'''
 
 
|-
 
|-
 +
| '''34'''
 +
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''GND'''
 
| '''9'''
 
|
 
| '''10'''
 
| '''UART0_RX'''
 
| '''PH1'''
 
| '''225'''
 
 
|-
 
|-
| '''226'''
+
| '''36'''
| '''PH2'''
 
| '''UART5_TX'''
 
| '''11'''
 
|
 
| '''12'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''PI1'''
+
| '''PC12'''
| '''257'''
+
| '''76'''
 
|-
 
|-
| '''227'''
+
| '''38'''
| '''PH3'''
 
| '''UART5_RX'''
 
| '''13'''
 
|
 
| '''14'''
 
| '''GND'''
 
| style="text-align: left;"|
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''PI4'''
 +
| '''260'''
 
|-
 
|-
| '''261'''
+
| '''40'''
| '''PI5'''
 
| '''TWI0_SCL/UART2_TX'''
 
| '''15'''
 
|
 
| '''16'''
 
| '''PWM4/UART4_RX'''
 
| '''PI14'''
 
| '''270'''
 
|-
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| style="text-align: left;"|
+
| '''PI3'''
| '''3.3V'''
+
| '''259'''
| '''17'''
+
|}
|
+
</div>
| '''18'''
+
</ol>
| style="text-align: left;"|
+
<ol start="3" style="list-style-type: decimal;">
| '''PH4'''
+
<li>There are a total of 28 GPIO ports in the 40pin interface. The high-level voltage of all GPIO ports is '''<span style="color:#FF0000">3.3v</span>'''</li></ol>
| '''228'''
+
 
 +
<span id="how-to-install-wiringop"></span>
 +
 
 +
== How to install wiringOP ==
 +
 
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
|-
 
|-
| '''231'''
+
|  
| '''PH7'''
+
<big>'''Note that wiringOP is already pre-installed in the linux image released by Orange Pi. Unless the wiringOP code is updated, there is no need to re-download, compile and install, you can just use it directly.'''
| '''SPI1_MOSI'''
+
 
| '''19'''
+
 
|
+
'''The storage path of the compiled wiringOP deb package in orangepi-build is: '''
| '''20'''
+
 
| '''GND'''
+
'''<span style="color:blue">orangepi-build/external/cache/debs/arm64/wiringpi_x.xx.deb</span>'''
| style="text-align: left;"|
+
 
| style="text-align: left;"|
+
 
 +
'''After entering the system, you can run the gpio readall command. If you can see the following output, it means that wiringOP has been pre-installed and can be used normally.'''</big>
 +
 
 +
[[File:zero2w-img170.png|center]]
 +
 
 +
<big>'''WiringOP currently mainly adapts to the functions of setting GPIO port input and output, setting GPIO port output high and low levels, and setting pull-up and pull-down resistors. Functions such as hardware PWM cannot be used.'''</big>
 +
|}
 +
 
 +
<ol style="list-style-type: decimal;">
 +
<li><p>Download the code of wiringOP</p>
 +
{| class="wikitable" style="width:800px;"  
 
|-
 
|-
| '''232'''
+
|  
| '''PH8'''
+
<p>orangepi@orangepi:~$ '''sudo apt update'''</p>
| '''SPI1_MISO'''
+
<p>orangepi@orangepi:~$ '''sudo apt install -y git'''</p>
| '''21'''
+
<p>orangepi@orangepi:~$ '''git clone https://github.com/orangepi-xunlong/wiringOP.git -b next'''</p>
|
+
|}
| '''22'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
| '''TWI0_SDA/UART2_RX'''
 
| '''PI6'''
 
| '''262'''
 
 
|-
 
|-
| '''230'''
+
|  
| '''PH6'''
+
<big><p>'''Note that the source code needs to download the code of wiringOP next branch. Please don't miss the -b next parameter.'''</p>
| '''SPI1_CLK'''
+
<p>'''If there is a problem downloading the code from GitHub, you can directly use the wiringOP source code that comes with the Linux image. The storage location is: /usr/src/wiringOP.'''</p></big>
| '''23'''
+
|}
|
+
</li>
| '''24'''
+
<li><p>Compile and install wiringOP</p>
| '''SPI1_CS0'''
+
{| class="wikitable" style="width:800px;"
| '''PH5'''
 
| '''229'''
 
 
|-
 
|-
| style="text-align: left;"|
+
|  
| style="text-align: left;"|
+
<p>orangepi@orangepi:~$ '''cd wiringOP'''</p>
| '''GND'''
+
<p>orangepi@orangepi:~/wiringOP$ '''sudo ./build clean'''</p>
| '''25'''
+
<p>orangepi@orangepi:~/wiringOP$ '''sudo ./build'''</p>
|
+
|}
| '''26'''
+
</li>
| '''SPI1_CS1'''
+
<li><p>The output of the test gpio readall command is as follows</p>
| '''PH9'''
+
<p>[[File:zero2w-img170.png]]</p></li></ol>
| '''233'''
+
 
 +
<span id="pin-interface-gpio-i2c-uart-spi-and-pwm-testing"></span>
 +
 
 +
== 40pin interface GPIO, I2C, UART, SPI and PWM testing ==
 +
 
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
|-
 
|-
| '''266'''
+
|  
| '''PI10'''
+
<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>
| '''TWI2-SDA/UART3_RX'''
+
|}
| '''27'''
+
 
|
+
<span id="pin-gpio-port-test"></span>
| '''28'''
+
=== 40pin GPIO port test ===
| '''TWI2-SCL/UART3_TX'''
+
 
| '''PI9'''
+
<ol style="list-style-type: decimal;">
| '''265'''
+
<li><p>The following uses pin No. 7 - corresponding to GPIO PI13 - corresponding to wPi serial number 2 - as an example to demonstrate how to set the high and low levels of the GPIO port.</p>
 +
<p>[[File:zero2w-img171.png]]</p></li>
 +
<li><p>First set the GPIO port to output mode, and the third parameter needs to be the serial number of the wPi corresponding to the input pin.</p>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''256'''
+
|  
| '''PI0'''
+
<p>root@orangepi:~/wiringOP# '''gpio mode <span style="color:#FF0000">2</span> out'''</p>
| style="text-align: left;"|
+
|}
| '''29'''
+
</li>
|
+
<li><p>Then set the GPIO port to output a 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 is set successfully.</p>
| '''30'''
+
{| class="wikitable" style="width:800px;"  
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
| '''271'''
+
|  
| '''PI15'''
+
<p>root@orangepi:~/wiringOP# '''gpio write 2 <span style="color:#FF0000">0</span>'''</p>
| style="text-align: left;"|
+
|}
| '''31'''
+
</li>
|
+
<li><p>Then set the GPIO port to output a high level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 3.3v, it means the setting of the high level is successful.</p>
| '''32'''
+
{| class="wikitable" style="width:800px;"
| '''PWM1'''
 
| '''PI11'''
 
| '''267'''
 
 
|-
 
|-
| '''268'''
+
|  
| '''PI12'''
+
<p>root@orangepi:~/wiringOP# '''gpio write 2 <span style="color:#FF0000">1</span>'''</p>
| '''PWM2'''
+
|}
| '''33'''
+
</li>
|
+
<li><p>The setting method for other pins is similar. You only need to modify the serial number of wPi to the serial number corresponding to the pin.</p></li></ol>
| '''34'''
+
 
| '''GND'''
+
<span id="how-to-set-the-pull-down-resistor-of-40-pin-gpio-port"></span>
| style="text-align: left;"|
+
 
| style="text-align: left;"|
+
=== How to set the pull-down resistor of 40 Pin GPIO port ===
 +
 
 +
<ol style="list-style-type: decimal;">
 +
<li><p>The following uses pin No. 7—corresponding to GPIO PI13—corresponding to wPi serial number 2—as an example to demonstrate how to set the pull-up and pull-down resistors of the GPIO port.</p>
 +
<p>[[File:zero2w-img171.png]]</p></li>
 +
<li><p>First, you need to set the GPIO port to input mode, and the third parameter needs to be the serial number of the wPi corresponding to the input pin.</p>
 +
{| class="wikitable" style="width:800px;"  
 
|-
 
|-
| '''258'''
+
|  
| '''PI2'''
+
<p>root@orangepi:~/wiringOP# '''gpio mode <span style="color:#FF0000">2</span> in'''</p>
| style="text-align: left;"|
+
|}
| '''35'''
+
</li>
|
+
<li><p>After setting to input mode, execute the following command to set the GPIO port to pull-up mode.</p>
| '''36'''
+
{| class="wikitable" style="width:800px;"  
| style="text-align: left;"|
 
| '''PC12'''
 
| '''76'''
 
 
|-
 
|-
| '''272'''
+
|  
| '''PI16'''
+
<p>root@orangepi:~/wiringOP# '''gpio mode <span style="color:#FF0000">2</span> up'''</p>
| style="text-align: left;"|
+
|}
| '''37'''
+
</li>
|
+
<li><p>Then enter the following command to read the level of the GPIO port. If the level is 1, it means that the pull-up mode is set successfully.</p>
| '''38'''
+
{| class="wikitable" style="width:800px;"  
| style="text-align: left;"|
 
| '''PI4'''
 
| '''260'''
 
 
|-
 
|-
| style="text-align: left;"|
+
|  
| style="text-align: left;"|
+
<p>root@orangepi:~/wiringOP# '''gpio read <span style="color:#FF0000">2</span>'''</p>
| '''GND'''
+
<p>'''<span style="color:#FF0000">1</span>'''</p>
| '''39'''
 
|
 
| '''40'''
 
| style="text-align: left;"|
 
| '''PI3'''
 
| '''259'''
 
 
|}
 
|}
 
+
</li>
<ol style="list-style-type: decimal;">
+
<li><p>Then execute the following command to set the GPIO port to pull-down mode</p>
<li><p>In Linux systems, spi1 is turned off by default and needs to be turned on manually before it can be used. The opening steps are as follows:</p>
+
{| class="wikitable" style="width:800px;"  
<ol style="list-style-type: lower-alpha;">
 
<li><p>First run '''orangepi-config'''. Ordinary users remember to add &gt; '''sudo''' permissions.</p>
 
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
 
<li><p>Then select '''System'''</p>
 
<p>[[File:media/image80.png|402x199px]]</p></li>
 
<li><p>Then select '''Hardware'''</p>
 
<p>[[File:media/image81.png|393x202px]]</p></li>
 
<li><p>Then use the keyboard's arrow keys to locate the position shown &gt; in the figure below, and then use the '''space''' to select the &gt; dtbo configuration of the SPI you want to open.</p></li></ol>
 
</li></ol>
 
 
 
{| class="wikitable"
 
 
|-
 
|-
| '''dtbo configuration'''
+
|  
| '''illustrate'''
+
<p>root@orangepi:~/wiringOP# '''gpio mode <span style="color:#FF0000">2</span> down'''</p>
 +
|}
 +
</li>
 +
<li><p>Then enter the following command to read the level of the GPIO port. If the level is 0, it means that the pull-down mode is set successfully.</p>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''spi1-cs0-cs1-spidev'''
+
|  
| '''Open cs0 and cs1 of spi1 at the same time'''
+
<p>root@orangepi:~/wiringOP# '''gpio read <span style="color:#FF0000">2</span>'''</p>
|-
+
<p>'''<span style="color:#FF0000">0</span>'''</p>
| '''spi1-cs0-spidev'''
 
| '''Only open cs0 of spi1'''
 
|-
 
| '''spi1-cs1-spidev'''
 
| '''Only open cs1 of spi1'''
 
 
|}
 
|}
 +
</li></ol>
  
[[File:media/image172.png|397x79px]]
+
<span id="pin-spi-test"></span>
  
<ol start="5" style="list-style-type: lower-alpha;">
+
=== 40pin SPI test ===
<li><p>Then select '''&lt;Save&gt;''' to save</p>
 
<p>[[File:media/image83.png|397x92px]]</p></li>
 
<li><p>Then select '''&lt;Back&gt;'''</p>
 
<p>[[File:media/image84.png|395x91px]]</p></li>
 
<li><p>Then select '''&lt;Reboot&gt;'''to restart the system to make the &gt; configuration take effect.</p>
 
<p>[[File:media/image85.png|374x187px]]</p></li></ol>
 
  
<!-- -->
+
# 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="2" style="list-style-type: decimal;">
 
<li><p>Then check whether there is a '''spidev1.x''' device node in the Linux system. If it exists, it means that the SPI1 configuration has taken effect.</p>
 
<p>orangepi@orangepi:~$ '''ls /dev/spidev1*'''</p>
 
<p>/dev/spidev1.0 /dev/spidev1.1</p>
 
<p>'''Note that only when you open spi1-cs0-cs1-spidev, you will see the device nodes of the two spi.'''</p></li>
 
<li><p>Next, start the spi loopback test. Do not short-circuit the mosi and miso pins of SPI1 first. The output result of running spidev_test is as follows. You can see that the data of TX and RX are inconsistent.</p>
 
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev1.0'''</p>
 
<p>spi mode: 0x0</p>
 
<p>bits per word: 8</p>
 
<p>max speed: 500000 Hz (500 KHz)</p>
 
<p>TX | FF FF FF FF FF FF '''40 00 00 00 00 95''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@.…▒..................▒.</p>
 
<p>RX | FF FF FF FF FF FF '''FF FF FF FF FF FF''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF | ............................….</p></li>
 
<li><p>Then short-circuit the two pins of SPI1 mosi (pin 19 in the 40pin interface) and miso (pin 21 in the 40pin interface) and then run spidev_test. The output is as follows. You can see the sending and receiving The data is the same, indicating that the loopback test passed.</p>
 
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev1.0'''</p>
 
<p>spi mode: 0x0</p>
 
<p>bits per word: 8</p>
 
<p>max speed: 500000 Hz (500 KHz)</p>
 
<p>TX | FF FF FF FF FF FF '''40 00 00 00 00 95''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@.…▒..................▒.</p>
 
<p>RX | FF FF FF FF FF FF '''40 00 00 00 00 95''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@.…▒..................▒.</p></li></ol>
 
  
<span id="pin-i2c-test"></span>
+
<div style="display: flex;">
=== 40pin I2C test ===
+
::{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
 
 
# As can be seen from the table below, the i2c available for the 40pin interface are i2c0, i2c1 and i2c2
 
 
 
{| class="wikitable"
 
 
|-
 
|-
| '''GPIO序号'''
+
| '''GPIO NO.'''
 
| '''GPIO'''
 
| '''GPIO'''
 
| '''Function'''
 
| '''Function'''
 
| '''pin'''
 
| '''pin'''
|
 
| '''pin'''
 
| '''Function'''
 
| '''GPIO'''
 
| '''GPIO NO.'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
Line 3,277: Line 4,041:
 
| '''3.3V'''
 
| '''3.3V'''
 
| '''1'''
 
| '''1'''
|
 
| '''2'''
 
| '''5V'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''264'''
 
| '''264'''
Line 3,287: Line 4,046:
 
| '''TWI1-SDA'''
 
| '''TWI1-SDA'''
 
| '''3'''
 
| '''3'''
|
 
| '''4'''
 
| '''5V'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''263'''
 
| '''263'''
Line 3,297: Line 4,051:
 
| '''TWI1-SCL'''
 
| '''TWI1-SCL'''
 
| '''5'''
 
| '''5'''
|
+
|-
| '''6'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
|-
 
 
| '''269'''
 
| '''269'''
 
| '''PI13'''
 
| '''PI13'''
 
| '''PWM3/UART4_TX'''
 
| '''PWM3/UART4_TX'''
 
| '''7'''
 
| '''7'''
|
 
| '''8'''
 
| '''UART0_TX'''
 
| '''PH0'''
 
| '''224'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
Line 3,317: Line 4,061:
 
| '''GND'''
 
| '''GND'''
 
| '''9'''
 
| '''9'''
|
 
| '''10'''
 
| '''UART0_RX'''
 
| '''PH1'''
 
| '''225'''
 
 
|-
 
|-
 
| '''226'''
 
| '''226'''
Line 3,327: Line 4,066:
 
| '''UART5_TX'''
 
| '''UART5_TX'''
 
| '''11'''
 
| '''11'''
|
 
| '''12'''
 
| style="text-align: left;"|
 
| '''PI1'''
 
| '''257'''
 
 
|-
 
|-
 
| '''227'''
 
| '''227'''
Line 3,337: Line 4,071:
 
| '''UART5_RX'''
 
| '''UART5_RX'''
 
| '''13'''
 
| '''13'''
|
 
| '''14'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''261'''
 
| '''261'''
Line 3,347: Line 4,076:
 
| '''TWI0_SCL/UART2_TX'''
 
| '''TWI0_SCL/UART2_TX'''
 
| '''15'''
 
| '''15'''
|
 
| '''16'''
 
| '''PWM4/UART4_RX'''
 
| '''PI14'''
 
| '''270'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
Line 3,357: Line 4,081:
 
| '''3.3V'''
 
| '''3.3V'''
 
| '''17'''
 
| '''17'''
|
 
| '''18'''
 
| style="text-align: left;"|
 
| '''PH4'''
 
| '''228'''
 
 
|-
 
|-
| '''231'''
+
| '''<span style="color:#FF0000">231</span>'''
| '''PH7'''
+
| '''<span style="color:#FF0000">PH7</span>'''
| '''SPI1_MOSI'''
+
| '''<span style="color:#FF0000">SPI1_MOSI</span>'''
| '''19'''
+
| '''<span style="color:#FF0000">19</span>'''
|
+
|-
| '''20'''
+
| '''<span style="color:#FF0000">232</span>'''
| '''GND'''
+
| '''<span style="color:#FF0000">PH8</span>'''
 +
| '''<span style="color:#FF0000">SPI1_MISO</span>'''
 +
| '''<span style="color:#FF0000">21</span>'''
 +
|-
 +
| '''<span style="color:#FF0000">230</span>'''
 +
| '''<span style="color:#FF0000">PH6</span>'''
 +
| '''<span style="color:#FF0000">SPI1_CLK</span>'''
 +
| '''<span style="color:#FF0000">23</span>'''
 +
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''GND'''
 +
| '''25'''
 +
|-
 +
| '''266'''
 +
| '''PI10'''
 +
| '''TWI2-SDA/UART3_RX'''
 +
| '''27'''
 
|-
 
|-
| '''232'''
+
| '''256'''
| '''PH8'''
 
| '''SPI1_MISO'''
 
| '''21'''
 
|
 
| '''22'''
 
| '''TWI0_SDA/UART2_RX'''
 
| '''PI6'''
 
| '''262'''
 
|-
 
| '''230'''
 
| '''PH6'''
 
| '''SPI1_CLK'''
 
| '''23'''
 
|
 
| '''24'''
 
| '''SPI1_CS0'''
 
| '''PH5'''
 
| '''229'''
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''GND'''
 
| '''25'''
 
|
 
| '''26'''
 
| '''SPI1_CS1'''
 
| '''PH9'''
 
| '''233'''
 
|-
 
| '''266'''
 
| '''PI10'''
 
| '''TWI2-SDA/UART3_RX'''
 
| '''27'''
 
|
 
| '''28'''
 
| '''TWI2-SCL/UART3_TX'''
 
| '''PI9'''
 
| '''265'''
 
|-
 
| '''256'''
 
 
| '''PI0'''
 
| '''PI0'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''29'''
 
| '''29'''
|
 
| '''30'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''271'''
 
| '''271'''
Line 3,427: Line 4,116:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''31'''
 
| '''31'''
|
 
| '''32'''
 
| '''PWM1'''
 
| '''PI11'''
 
| '''267'''
 
 
|-
 
|-
 
| '''268'''
 
| '''268'''
Line 3,437: Line 4,121:
 
| '''PWM2'''
 
| '''PWM2'''
 
| '''33'''
 
| '''33'''
|
 
| '''34'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''258'''
 
| '''258'''
Line 3,447: Line 4,126:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''35'''
 
| '''35'''
|
 
| '''36'''
 
| style="text-align: left;"|
 
| '''PC12'''
 
| '''76'''
 
 
|-
 
|-
 
| '''272'''
 
| '''272'''
Line 3,457: Line 4,131:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''37'''
 
| '''37'''
|
+
|-
| '''38'''
+
| style="text-align: left;"|
 +
| 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;"|
 
| style="text-align: left;"|
| '''PI4'''
 
| '''260'''
 
 
|-
 
|-
 +
| '''4'''
 +
| '''5V'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
|-
 +
| '''6'''
 
| '''GND'''
 
| '''GND'''
| '''39'''
 
|
 
| '''40'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''PI3'''
+
| style="text-align: left;"|
| '''259'''
 
|}
 
 
 
<ol start="2" style="list-style-type: decimal;">
 
<li><p>i2c is turned off by default in Linux systems and needs to be turned on manually to use it. The opening steps are as follows: </p>
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>First run '''orangepi-config'''. Ordinary users remember to add &gt; '''sudo''' permissions.</p>
 
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
 
<li><p>Then select '''System'''</p>
 
<p>[[File:media/image80.png|394x195px]]</p></li>
 
<li><p>Then select '''Hardware'''</p>
 
<p>[[File:media/image81.png|393x202px]]</p></li>
 
<li><p>Then use the keyboard’s arrow keys to locate the position shown &gt; in the picture below, and then use the '''space''' to select the &gt; corresponding i2c configuration in the picture below.</p></li></ol>
 
</li></ol>
 
 
 
{| class="wikitable"
 
 
|-
 
|-
| '''Multiplexing function in 40pin'''
+
| '''8'''
| '''Corresponding dtbo configuration'''
+
| '''UART0_TX'''
 +
| '''PH0'''
 +
| '''224'''
 
|-
 
|-
| '''40pin - i2c0'''
+
| '''10'''
| '''pi-i2c0'''
+
| '''UART0_RX'''
 +
| '''PH1'''
 +
| '''225'''
 
|-
 
|-
| '''40pin - i2c1'''
+
| '''12'''
| '''pi-i2c1'''
+
| style="text-align: left;"|
|-
+
| '''PI1'''
| '''40pin - i2c2'''
+
| '''257'''
| '''pi-i2c2'''
 
|}
 
 
 
[[File:media/image173.png|393x60px]]
 
 
 
<ol start="5" style="list-style-type: lower-alpha;">
 
<li><p>Then select <span class="mark">&lt;Save&gt;</span> to save</p>
 
<p>[[File:media/image83.png|395x91px]]</p></li>
 
<li><p>Then select '''&lt;Back&gt;'''</p>
 
<p>[[File:media/image84.png|395x91px]]</p></li>
 
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system to make the &gt; configuration take effect.</p>
 
<p>[[File:media/image85.png|374x187px]]</p></li></ol>
 
 
 
<!-- -->
 
<ol start="3" style="list-style-type: decimal;">
 
<li><p>After starting the Linux system, first confirm that there is an open i2c device node under /dev</p>
 
<p>orangepi@orangepi:~$ '''ls /dev/i2c-*'''</p>
 
<p>'''/dev/i2c-*'''</p>
 
<p>'''Sometimes the i2c device node and the i2c bus serial number do not correspond one to one. For example, the i2c device node of the i2c1 bus may be /dev/i2c-3.'''</p>
 
<p>'''The method to accurately confirm the device node under /dev corresponding to the i2c bus is: '''</p></li></ol>
 
 
 
<!-- -->
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>'''First run the following command to check the corresponding relationship of i2c'''</p>
 
<p>orangepi@orangepizero2w:~$ '''ls /sys/devices/platform/soc*/*/i2c-* | grep &quot;i2c-[0-9]&quot;'''</p>
 
<p>/sys/devices/platform/soc/5002000.i2c/i2c-0:</p>
 
<p>/sys/devices/platform/soc/5002400.i2c/i2c-3:</p>
 
<p>/sys/devices/platform/soc/5002800.i2c/i2c-4:</p>
 
<p>/sys/devices/platform/soc/5002c00.i2c/i2c-5:</p>
 
<p>/sys/devices/platform/soc/6000000.hdmi/i2c-2:</p>
 
<p>/sys/devices/platform/soc/7081400.i2c/i2c-1:</p></li>
 
<li><p>'''In the above output'''</p></li></ol>
 
 
 
<!-- -->
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>5002000 is the register base address of the i2c0 bus, and i2c-0 shown behind it is its corresponding i2c device node</p></li>
 
<li><p>5002400 is the register base address of the i2c1 bus, and i2c-3 shown behind it is its corresponding i2c device node</p></li>
 
<li><p>5002800 is the register base address of the i2c2 bus, and i2c-4 shown behind it is its corresponding i2c device node</p></li></ol>
 
 
 
<!-- -->
 
<ol start="4" style="list-style-type: decimal;">
 
<li><p>Then start testing i2c, first install i2c-tools</p>
 
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
 
<p>orangepi@orangepi:~$ '''sudo apt-get install -y i2c-tools'''</p></li>
 
<li><p>Then connect an i2c device to the i2c pin of the 40pin connector</p></li>
 
<li><p>Then use the '''i2cdetect -y x''' x command. If the address of the connected i2c device can be detected, it means that i2c can be used normally.</p>
 
<p>'''Note that x in the i2cdetect -y x command needs to be replaced with the serial number of the device node corresponding to the i2c bus.'''</p>
 
<p>'''Different i2c device addresses are different. The 0x50 address in the picture below is just an example. Please refer to what you actually see.'''</p>
 
<div class="figure">
 
 
 
[[File:media/image174.png|383x151px|选区_460]]
 
 
 
</div></li></ol>
 
 
 
<span id="pin-uart-test"></span>
 
=== 40pin UART test ===
 
 
 
# 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.
 
 
 
{| class="wikitable"
 
|-
 
| '''GPIO NO.'''
 
| '''GPIO'''
 
| '''Function'''
 
| '''pin'''
 
|
 
| '''pin'''
 
| '''Function'''
 
| '''GPIO'''
 
| '''GPIO NO.'''
 
 
|-
 
|-
 +
| '''14'''
 +
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''3.3V'''
+
|-
| '''1'''
+
| '''16'''
|
+
| '''PWM4/UART4_RX'''
| '''2'''
+
| '''PI14'''
| '''5V'''
+
| '''270'''
| style="text-align: left;"|
+
|-
 +
| '''18'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''PH4'''
 +
| '''228'''
 
|-
 
|-
| '''264'''
+
| '''20'''
| '''PI8'''
+
| '''GND'''
| '''TWI1-SDA'''
 
| '''3'''
 
|
 
| '''4'''
 
| '''5V'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
|-
 
|-
| '''263'''
+
| '''22'''
| '''PI7'''
+
| '''TWI0_SDA/UART2_RX'''
| '''TWI1-SCL'''
+
| '''PI6'''
| '''5'''
+
| '''262'''
|
+
|-
| '''6'''
+
| '''<span style="color:#FF0000">24</span>'''
 +
| '''<span style="color:#FF0000">SPI1_CS0</span>'''
 +
| '''<span style="color:#FF0000">PH5</span>'''
 +
| '''<span style="color:#FF0000">229</span>'''
 +
|-
 +
| '''<span style="color:#FF0000">26</span>'''
 +
| '''<span style="color:#FF0000">SPI1_CS1</span>'''
 +
| '''<span style="color:#FF0000">PH9</span>'''
 +
| '''<span style="color:#FF0000">233</span>'''
 +
|-
 +
| '''28'''
 +
| '''TWI2-SCL/UART3_TX'''
 +
| '''PI9'''
 +
| '''265'''
 +
|-
 +
| '''30'''
 
| '''GND'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
|-
 
|-
| '''269'''
+
| '''32'''
| '''PI13'''
+
| '''PWM1'''
| '''PWM3/UART4_TX'''
+
| '''PI11'''
| '''7'''
+
| '''267'''
|
 
| '''8'''
 
| '''UART0_TX'''
 
| '''PH0'''
 
| '''224'''
 
 
|-
 
|-
 +
| '''34'''
 +
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''GND'''
 
| '''9'''
 
|
 
| '''10'''
 
| '''UART0_RX'''
 
| '''PH1'''
 
| '''225'''
 
 
|-
 
|-
| '''226'''
+
| '''36'''
| '''PH2'''
+
| style="text-align: left;"|
| '''UART5_TX'''
+
| '''PC12'''
| '''11'''
+
| '''76'''
|
+
|-
| '''12'''
+
| '''38'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''PI1'''
+
| '''PI4'''
| '''257'''
+
| '''260'''
 
|-
 
|-
| '''227'''
+
| '''40'''
| '''PH3'''
 
| '''UART5_RX'''
 
| '''13'''
 
|
 
| '''14'''
 
| '''GND'''
 
| style="text-align: left;"|
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''PI3'''
 +
| '''259'''
 +
|}
 +
</div>
 +
 +
<ol style="list-style-type: decimal;">
 +
<li><p>In Linux systems, spi1 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-style-type: lower-alpha;">
 +
<li><p>First run '''orangepi-config'''. Ordinary users remember to add '''sudo''' permissions.</p>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''261'''
+
|  
| '''PI5'''
+
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p>
| '''TWI0_SCL/UART2_TX'''
+
|}
| '''15'''
+
</li>
|
+
<li><p>Then select '''System'''</p>
| '''16'''
+
<p>[[File:zero2w-img80.png]]</p></li>
| '''PWM4/UART4_RX'''
+
<li><p>Then select '''Hardware'''</p>
| '''PI14'''
+
<p>[[File:zero2w-img81.png]]</p></li>
| '''270'''
+
<li><p>Then use the keyboard's arrow keys to locate the position shown in the figure below, and then use the '''space''' to select the dtbo configuration of the SPI you want to open.</p></li>
 +
 
 +
{| class="wikitable" style="width:800px;text-align: center;"
 
|-
 
|-
| style="text-align: left;"|
+
| '''dtbo configuration'''
| style="text-align: left;"|
+
| '''illustrate'''
| '''3.3V'''
+
|-
| '''17'''
+
| '''spi1-cs0-cs1-spidev'''
|
+
| '''Open cs0 and cs1 of spi1 at the same time'''
| '''18'''
 
| style="text-align: left;"|
 
| '''PH4'''
 
| '''228'''
 
 
|-
 
|-
| '''231'''
+
| '''spi1-cs0-spidev'''
| '''PH7'''
+
| '''Only open cs0 of spi1'''
| '''SPI1_MOSI'''
 
| '''19'''
 
|
 
| '''20'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
| '''232'''
+
| '''spi1-cs1-spidev'''
| '''PH8'''
+
| '''Only open cs1 of spi1'''
| '''SPI1_MISO'''
+
|}
| '''21'''
+
 
|
+
[[File:zero2w-img172.png]]
| '''22'''
+
</ol>
| '''TWI0_SDA/UART2_RX'''
+
<ol start="5" style="list-style-type: lower-alpha;">
| '''PI6'''
+
<li><p>Then select '''&lt;Save&gt;''' to save</p>
| '''262'''
+
<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 make the configuration take effect.</p>
 +
<p>[[File:zero2w-img85.png]]</p></li></ol>
 +
</li></ol>
 +
<ol start="2" style="list-style-type: decimal;">
 +
<li><p>Then check whether there is a '''spidev1.x''' device node in the Linux system. If it exists, it means that the SPI1 configuration has taken effect.</p>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''230'''
+
|  
| '''PH6'''
+
<p>orangepi@orangepi:~$ '''ls /dev/spidev1*'''</p>
| '''SPI1_CLK'''
+
<p>/dev/spidev1.0 /dev/spidev1.1</p>
| '''23'''
+
|}
|
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
| '''24'''
 
| '''SPI1_CS0'''
 
| '''PH5'''
 
| '''229'''
 
 
|-
 
|-
| style="text-align: left;"|
+
|  
| style="text-align: left;"|
+
<big><p>'''Note that only when you open spi1-cs0-cs1-spidev, you will see the device nodes of the two spi.'''</p></big>
| '''GND'''
+
|}
| '''25'''
+
</li>
|
+
<li><p>Next, start the spi loopback test. Do not short-circuit the mosi and miso pins of SPI1 first. The output result of running spidev_test is as follows. You can see that the data of TX and RX are inconsistent.</p>
| '''26'''
+
{| class="wikitable" style="width:800px;"  
| '''SPI1_CS1'''
+
|-
| '''PH9'''
+
|  
| '''233'''
+
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev1.0'''</p>
 +
<p>spi mode: 0x0</p>
 +
<p>bits per word: 8</p>
 +
<p>max speed: 500000 Hz (500 KHz)</p>
 +
<p>TX | FF FF FF FF FF FF '''<span style="color:#FF0000">40 00 00 00 00 95</span>''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@.…▒..................▒.</p>
 +
<p>RX | FF FF FF FF FF FF '''<span style="color:#FF0000">FF FF FF FF FF FF</span>''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF | ............................….</p>
 +
|}
 +
</li>
 +
<li><p>Then short-circuit the two pins of SPI1 mosi (pin 19 in the 40pin interface) and miso (pin 21 in the 40pin interface) and then run spidev_test. The output is as follows. You can see the sending and receiving The data is the same, indicating that the loopback test passed.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev1.0'''</p>
 +
<p>spi mode: 0x0</p>
 +
<p>bits per word: 8</p>
 +
<p>max speed: 500000 Hz (500 KHz)</p>
 +
<p>TX | FF FF FF FF FF FF '''<span style="color:#FF0000">40 00 00 00 00 95</span>''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@.…▒..................▒.</p>
 +
<p>RX | FF FF FF FF FF FF '''<span style="color:#FF0000">40 00 00 00 00 95</span>''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@.…▒..................▒.</p>
 +
|}
 +
</li></ol>
 +
 
 +
<span id="pin-i2c-test"></span>
 +
 
 +
=== 40pin I2C test ===
 +
 
 +
# As can be seen from the table below, the i2c available for the 40pin interface are i2c0, i2c1 and i2c2
 +
 
 +
<div style="display: flex;">
 +
::{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
 
|-
 
|-
| '''266'''
+
| '''GPIO NO.'''
| '''PI10'''
+
| '''GPIO'''
| '''TWI2-SDA/UART3_RX'''
+
| '''Function'''
| '''27'''
+
| '''pin'''
|
 
| '''28'''
 
| '''TWI2-SCL/UART3_TX'''
 
| '''PI9'''
 
| '''265'''
 
 
|-
 
|-
| '''256'''
 
| '''PI0'''
 
| style="text-align: left;"|
 
| '''29'''
 
|
 
| '''30'''
 
| '''GND'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| 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">v</span>'''
 +
| '''<span style="color:#FF0000">TWI1-SCL</span>'''
 +
| '''<span style="color:#FF0000">5</span>'''
 
|-
 
|-
| '''271'''
+
| '''269'''
| '''PI15'''
+
| '''PI13'''
| style="text-align: left;"|
+
| '''PWM3/UART4_TX'''
| '''31'''
+
| '''7'''
|
 
| '''32'''
 
| '''PWM1'''
 
| '''PI11'''
 
| '''267'''
 
 
|-
 
|-
| '''268'''
 
| '''PI12'''
 
| '''PWM2'''
 
| '''33'''
 
|
 
| '''34'''
 
| '''GND'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''GND'''
 +
| '''9'''
 +
|-
 +
| '''226'''
 +
| '''PH2'''
 +
| '''UART5_TX'''
 +
| '''11'''
 +
|-
 +
| '''227'''
 +
| '''PH3'''
 +
| '''UART5_RX'''
 +
| '''13'''
 +
|-
 +
| '''<span style="color:#FF0000">261</span>'''
 +
| '''<span style="color:#FF0000">PI5</span>'''
 +
| '''<span style="color:#FF0000">TWI0_SCL</span>/UART2_TX'''
 +
| '''<span style="color:#FF0000">15</span>'''
 
|-
 
|-
| '''258'''
 
| '''PI2'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''35'''
 
|
 
| '''36'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''PC12'''
+
| '''3.3V'''
| '''76'''
+
| '''17'''
 +
|-
 +
| '''231'''
 +
| '''PH7'''
 +
| '''SPI1_MOSI'''
 +
| '''19'''
 +
|-
 +
| '''232'''
 +
| '''PH8'''
 +
| '''SPI1_MISO'''
 +
| '''21'''
 +
|-
 +
| '''230'''
 +
| '''PH6'''
 +
| '''SPI1_CLK'''
 +
| '''23'''
 
|-
 
|-
| '''272'''
 
| '''PI16'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''37'''
 
|
 
| '''38'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''PI4'''
+
| '''GND'''
| '''260'''
+
| '''25'''
 +
|-
 +
| '''<span style="color:#FF0000">266</span>'''
 +
| '''<span style="color:#FF0000">PI10</span>'''
 +
| '''<span style="color:#FF0000">TWI2-SDA</span>/UART3_RX'''
 +
| '''<span style="color:#FF0000">27</span>'''
 +
|-
 +
| '''256'''
 +
| '''PI0'''
 +
| style="text-align: left;"|
 +
| '''29'''
 +
|-
 +
| '''271'''
 +
| '''PI15'''
 +
| style="text-align: left;"|
 +
| '''31'''
 +
|-
 +
| '''268'''
 +
| '''PI12'''
 +
| '''PWM2'''
 +
| '''33'''
 +
|-
 +
| '''258'''
 +
| '''PI2'''
 +
| style="text-align: left;"|
 +
| '''35'''
 +
|-
 +
| '''272'''
 +
| '''PI16'''
 +
| style="text-align: left;"|
 +
| '''37'''
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
Line 3,763: Line 4,439:
 
| '''GND'''
 
| '''GND'''
 
| '''39'''
 
| '''39'''
|
 
| '''40'''
 
| style="text-align: left;"|
 
| '''PI3'''
 
| '''259'''
 
 
|}
 
|}
 
+
{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
<ol start="2" style="list-style-type: 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-style-type: lower-alpha;">
 
<li><p>First run '''orangepi-config'''. Ordinary users remember to add &gt; '''sudo''' permissions.</p>
 
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
 
<li><p>Then select '''System'''</p>
 
<p>[[File:media/image80.png|396x195px]]</p></li>
 
<li><p>Then select '''Hardware'''</p>
 
<p>[[File:media/image81.png|393x202px]]</p></li>
 
<li><p>Then use the keyboard’s arrow keys to locate the position shown &gt; 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 40pin'''
+
| '''pin'''
| '''Corresponding dtbo configuration'''
+
| '''Function'''
 +
| '''GPIO'''
 +
| '''GPIO NO.'''
 
|-
 
|-
| '''40pin - uart2'''
+
| '''2'''
| '''pi-uart2'''
+
| '''5V'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 
|-
 
|-
| '''40pin - uart3'''
+
| '''4'''
| '''pi-uart3'''
+
| '''5V'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 
|-
 
|-
| '''40pin - uart4'''
+
| '''6'''
| '''pi-uart4'''
+
| '''GND'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 
|-
 
|-
| '''40pin - uart5'''
+
| '''8'''
| '''ph-uart5'''
+
| '''UART0_TX'''
|}
+
| '''PH0'''
 
+
| '''224'''
[[File:media/image175.png|395x216px]]
 
 
 
<ol start="5" style="list-style-type: lower-alpha;">
 
<li><p>Then select '''&lt;Save&gt;''' to save</p>
 
<p>[[File:media/image83.png|397x92px]]</p></li>
 
<li><p>Then select '''&lt;Back&gt;'''</p>
 
<p>[[File:media/image84.png|395x91px]]</p></li>
 
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system to make the &gt; configuration take effect.</p>
 
<p>[[File:media/image85.png|374x187px]]</p></li></ol>
 
 
 
<!-- -->
 
<ol start="3" style="list-style-type: decimal;">
 
<li><p>After entering the Linux system, first confirm whether there is a uart5 device node under '''/dev'''</p>
 
<p>'''Note that the linux5.4 system is /dev/ttyASx.'''</p>
 
<p>orangepi@orangepi:~$ '''ls /dev/ttyS*'''</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></li>
 
<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.</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.'''</p>
 
<p>orangepi@orangepi:~$ '''gpio serial /dev/ttySx # linux-6.1 test command'''</p>
 
<p>orangepi@orangepi:~$ '''gpio serial /dev/ttyASx # linux-5.4 test command'''</p>
 
<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></ol>
 
 
 
<span id="pwm-test-method"></span>
 
=== PWM test method ===
 
 
 
# As can be seen from the following table, the available pwm are pwm1, pwm2, pwm3 and pwm4.
 
 
 
{| class="wikitable"
 
 
|-
 
|-
| '''GPIO NO.'''
+
| '''10'''
| '''GPIO'''
+
| '''UART0_RX'''
| '''Function'''
+
| '''PH1'''
| '''Pin'''
+
| '''225'''
|
 
| '''Pin'''
 
| '''Function'''
 
| '''GPIO'''
 
| '''GPIO NO.'''
 
 
|-
 
|-
 +
| '''12'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''PI1'''
 +
| '''257'''
 +
|-
 +
| '''14'''
 +
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''3.3V'''
 
| '''1'''
 
|
 
| '''2'''
 
| '''5V'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
|-
 +
| '''16'''
 +
| '''PWM4/UART4_RX'''
 +
| '''PI14'''
 +
| '''270'''
 +
|-
 +
| '''18'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''PH4'''
 +
| '''228'''
 
|-
 
|-
| '''264'''
+
| '''20'''
| '''PI8'''
+
| '''GND'''
| '''TWI1-SDA'''
 
| '''3'''
 
|
 
| '''4'''
 
| '''5V'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
|-
 
|-
| '''263'''
+
| '''<span style="color:#FF0000">22</span>'''
| '''PI7'''
+
| '''<span style="color:#FF0000">TWI0_SDA</span>/UART2_RX'''
| '''TWI1-SCL'''
+
| '''<span style="color:#FF0000">PI6</span>'''
| '''5'''
+
| '''<span style="color:#FF0000">262</span>'''
|
+
|-
| '''6'''
+
| '''24'''
 +
| '''SPI1_CS0'''
 +
| '''PH5'''
 +
| '''229'''
 +
|-
 +
| '''26'''
 +
| '''SPI1_CS1'''
 +
| '''PH9'''
 +
| '''233'''
 +
|-
 +
| '''<span style="color:#FF0000">28</span>'''
 +
| '''<span style="color:#FF0000">TWI2-SCL</span>/UART3_TX'''
 +
| '''<span style="color:#FF0000">PI9</span>'''
 +
| '''<span style="color:#FF0000">265</span>'''
 +
|-
 +
| '''30'''
 
| '''GND'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
|-
 
|-
| '''269'''
+
| '''32'''
| '''PI13'''
+
| '''PWM1'''
| '''PWM3/UART4_TX'''
+
| '''PI11'''
| '''7'''
+
| '''267'''
|
 
| '''8'''
 
| '''UART0_TX'''
 
| '''PH0'''
 
| '''224'''
 
 
|-
 
|-
 +
| '''34'''
 +
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''GND'''
 
| '''9'''
 
|
 
| '''10'''
 
| '''UART0_RX'''
 
| '''PH1'''
 
| '''225'''
 
 
|-
 
|-
| '''226'''
+
| '''36'''
| '''PH2'''
+
| style="text-align: left;"|
| '''UART5_TX'''
+
| '''PC12'''
| '''11'''
+
| '''76'''
|
+
|-
| '''12'''
+
| '''38'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''PI1'''
+
| '''PI4'''
| '''257'''
+
| '''260'''
 
|-
 
|-
| '''227'''
+
| '''40'''
| '''PH3'''
 
| '''UART5_RX'''
 
| '''13'''
 
|
 
| '''14'''
 
| '''GND'''
 
| style="text-align: left;"|
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''PI3'''
 +
| '''259'''
 +
|}
 +
</div>
 +
 +
<ol start="2" style="list-style-type: decimal;">
 +
<li><p>i2c is turned off by default in Linux systems and needs to be turned on manually to use it. The opening steps are as follows: </p>
 +
<ol style="list-style-type: lower-alpha;">
 +
<li><p>First run '''orangepi-config'''. Ordinary users remember to add '''sudo''' permissions.</p>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''261'''
+
|  
| '''PI5'''
+
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p>
| '''TWI0_SCL/UART2_TX'''
+
|}
| '''15'''
+
</li>
|
+
<li><p>Then select '''System'''</p>
| '''16'''
+
<p>[[File:zero2w-img80.png]]</p></li>
| '''PWM4/UART4_RX'''
+
<li><p>Then select '''Hardware'''</p>
| '''PI14'''
+
<p>[[File:zero2w-img81.png]]</p></li>
| '''270'''
+
<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 corresponding i2c configuration in the picture below.</p></li>
 +
 
 +
{| class="wikitable" style="width:800px;text-align: center;"
 
|-
 
|-
| style="text-align: left;"|
+
| '''Multiplexing function in 40pin'''
| style="text-align: left;"|
+
| '''Corresponding dtbo configuration'''
| '''3.3V'''
 
| '''17'''
 
|
 
| '''18'''
 
| style="text-align: left;"|
 
| '''PH4'''
 
| '''228'''
 
 
|-
 
|-
| '''231'''
+
| '''40pin - i2c0'''
| '''PH7'''
+
| '''pi-i2c0'''
| '''SPI1_MOSI'''
 
| '''19'''
 
|
 
| '''20'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
| '''232'''
+
| '''40pin - i2c1'''
| '''PH8'''
+
| '''pi-i2c1'''
| '''SPI1_MISO'''
 
| '''21'''
 
|
 
| '''22'''
 
| '''TWI0_SDA/UART2_RX'''
 
| '''PI6'''
 
| '''262'''
 
 
|-
 
|-
| '''230'''
+
| '''40pin - i2c2'''
| '''PH6'''
+
| '''pi-i2c2'''
| '''SPI1_CLK'''
+
|}
| '''23'''
+
 
|
+
[[File:zero2w-img173.png]]
| '''24'''
+
</ol>
| '''SPI1_CS0'''
+
<ol start="5" style="list-style-type: lower-alpha;">
| '''PH5'''
+
<li><p>Then select <span class="mark">&lt;Save&gt;</span> to save</p>
| '''229'''
+
<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 make the configuration take effect.</p>
 +
<p>[[File:zero2w-img85.png]]</p></li></ol>
 +
</li></ol>
 +
<ol start="3" style="list-style-type: decimal;">
 +
<li><p>After starting the Linux system, first confirm that there is an open i2c device node under /dev</p>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| style="text-align: left;"|
+
|  
| style="text-align: left;"|
+
<p>orangepi@orangepi:~$ '''ls /dev/i2c-*'''</p>
| '''GND'''
+
<p>'''/dev/i2c-*'''</p>
| '''25'''
+
|}
|
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
| '''26'''
 
| '''SPI1_CS1'''
 
| '''PH9'''
 
| '''233'''
 
 
|-
 
|-
| '''266'''
+
|  
| '''PI10'''
+
<big><p>'''Sometimes the i2c device node and the i2c bus serial number do not correspond one to one. For example, the i2c device node of the i2c1 bus may be /dev/i2c-3.'''</p>
| '''TWI2-SDA/UART3_RX'''
+
<p>'''The method to accurately confirm the device node under /dev corresponding to the i2c bus is: '''</p></big>
| '''27'''
+
 
|
+
 
| '''28'''
+
<ol style="list-style-type: lower-alpha;">
| '''TWI2-SCL/UART3_TX'''
+
<li><p>'''First run the following command to check the corresponding relationship of i2c'''</p>
| '''PI9'''
+
<p>orangepi@orangepizero2w:~$ '''ls /sys/devices/platform/soc*/*/i2c-* | grep &quot;i2c-[0-9]&quot;'''</p>
| '''265'''
+
<p>/sys/devices/platform/soc/5002000.i2c/i2c-0:</p>
 +
<p>/sys/devices/platform/soc/5002400.i2c/i2c-3:</p>
 +
<p>/sys/devices/platform/soc/5002800.i2c/i2c-4:</p>
 +
<p>/sys/devices/platform/soc/5002c00.i2c/i2c-5:</p>
 +
<p>/sys/devices/platform/soc/6000000.hdmi/i2c-2:</p>
 +
<p>/sys/devices/platform/soc/7081400.i2c/i2c-1:</p></li>
 +
 
 +
 
 +
<li><p>'''In the above output'''</p>
 +
<ol style="list-style-type: none;">
 +
<li><p>a) 5002000 is the register base address of the i2c0 bus, and i2c-0 shown behind it is its corresponding i2c device node</p></li>
 +
<li><p>b) 5002400 is the register base address of the i2c1 bus, and i2c-3 shown behind it is its corresponding i2c device node</p></li>
 +
<li><p>c) 5002800 is the register base address of the i2c2 bus, and i2c-4 shown behind it is its corresponding i2c device node</p></li></ol>
 +
</li></ol>
 +
|}
 +
</li></ol>
 +
<ol start="4" style="list-style-type: decimal;">
 +
<li><p>Then start testing i2c, first install i2c-tools</p>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''256'''
+
|  
| '''PI0'''
+
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
| style="text-align: left;"|
+
<p>orangepi@orangepi:~$ '''sudo apt-get install -y i2c-tools'''</p>
| '''29'''
+
|}
|
+
</li>
| '''30'''
+
<li><p>Then connect an i2c device to the i2c pin of the 40pin connector</p></li>
| '''GND'''
+
<li><p>Then use the '''i2cdetect -y x''' x command. If the address of the connected i2c device can be detected, it means that i2c can be used normally.</p>
| style="text-align: left;"|
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"  
| style="text-align: left;"|
 
 
|-
 
|-
| '''271'''
+
|  
| '''PI15'''
+
<big><p>'''Note that x in the i2cdetect -y x command needs to be replaced with the serial number of the device node corresponding to the i2c bus.'''</p>
| style="text-align: left;"|
+
<p>'''Different i2c device addresses are different. The 0x50 address in the picture below is just an example. Please refer to what you actually see.'''</p></big>
| '''31'''
+
|}
|
+
<div class="figure">
| '''32'''
+
 
| '''PWM1'''
+
[[File:zero2w-img174.png]]
| '''PI11'''
+
 
| '''267'''
+
</div></li></ol>
 +
 
 +
<span id="pin-uart-test"></span>
 +
 
 +
=== 40pin UART test ===
 +
 
 +
# 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.'''
 +
| '''GPIO'''
 +
| '''Function'''
 +
| '''pin'''
 
|-
 
|-
| '''268'''
 
| '''PI12'''
 
| '''PWM2'''
 
| '''33'''
 
|
 
| '''34'''
 
| '''GND'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''3.3V'''
 +
| '''1'''
 +
|-
 +
| '''264'''
 +
| '''PI8'''
 +
| '''TWI1-SDA'''
 +
| '''3'''
 
|-
 
|-
| '''258'''
+
| '''263'''
| '''PI2'''
+
| '''PI7'''
| style="text-align: left;"|
+
| '''TWI1-SCL'''
| '''35'''
+
| '''5'''
|
 
| '''36'''
 
| style="text-align: left;"|
 
| '''PC12'''
 
| '''76'''
 
 
|-
 
|-
| '''272'''
+
| '''269'''
| '''PI16'''
+
| '''PI13'''
| style="text-align: left;"|
+
| '''PWM3/UART4_TX'''
| '''37'''
+
| '''7'''
|
 
| '''38'''
 
| style="text-align: left;"|
 
| '''PI4'''
 
| '''260'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''GND'''
 
| '''GND'''
| '''39'''
+
| '''9'''
|
+
|-
| '''40'''
+
| '''226'''
 +
| '''PH2'''
 +
| '''UART5_TX'''
 +
| '''11'''
 +
|-
 +
| '''227'''
 +
| '''PH3'''
 +
| '''UART5_RX'''
 +
| '''13'''
 +
|-
 +
| '''261'''
 +
| '''PI5'''
 +
| '''TWI0_SCL/UART2_TX'''
 +
| '''15'''
 +
|-
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
| '''3.3V'''
 +
| '''17'''
 +
|-
 +
| '''231'''
 +
| '''PH7'''
 +
| '''SPI1_MOSI'''
 +
| '''19'''
 +
|-
 +
| '''232'''
 +
| '''PH8'''
 +
| '''SPI1_MISO'''
 +
| '''21'''
 +
|-
 +
| '''230'''
 +
| '''PH6'''
 +
| '''SPI1_CLK'''
 +
| '''23'''
 +
|-
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
| '''GND'''
 +
| '''25'''
 +
|-
 +
| '''266'''
 +
| '''PI10'''
 +
| '''TWI2-SDA/UART3_RX'''
 +
| '''27'''
 +
|-
 +
| '''256'''
 +
| '''PI0'''
 +
| style="text-align: left;"|
 +
| '''29'''
 +
|-
 +
| '''271'''
 +
| '''PI15'''
 +
| style="text-align: left;"|
 +
| '''31'''
 +
|-
 +
| '''268'''
 +
| '''PI12'''
 +
| '''PWM2'''
 +
| '''33'''
 +
|-
 +
| '''258'''
 +
| '''PI2'''
 +
| style="text-align: left;"|
 +
| '''35'''
 +
|-
 +
| '''272'''
 +
| '''PI16'''
 +
| style="text-align: left;"|
 +
| '''37'''
 +
|-
 +
| style="text-align: left;"|
 +
| 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'''
 +
| '''5V'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''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'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''16'''
 +
| '''PWM4/UART4_RX'''
 +
| '''PI14'''
 +
| '''270'''
 +
|-
 +
| '''18'''
 +
| style="text-align: left;"|
 +
| '''PH4'''
 +
| '''228'''
 +
|-
 +
| '''20'''
 +
| '''GND'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''22'''
 +
| '''TWI0_SDA/UART2_RX'''
 +
| '''PI6'''
 +
| '''262'''
 +
|-
 +
| '''24'''
 +
| '''SPI1_CS0'''
 +
| '''PH5'''
 +
| '''229'''
 +
|-
 +
| '''26'''
 +
| '''SPI1_CS1'''
 +
| '''PH9'''
 +
| '''233'''
 +
|-
 +
| '''28'''
 +
| '''TWI2-SCL/UART3_TX'''
 +
| '''PI9'''
 +
| '''265'''
 +
|-
 +
| '''30'''
 +
| '''GND'''
 +
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''PI3'''
 
| '''259'''
 
|}
 
 
<ol start="2" style="list-style-type: decimal;">
 
<li><p>pwm is turned off by default in Linux systems and needs to be turned on manually to use it. The opening steps are as follows:</p>
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>First run '''orangepi-config'''. Ordinary users remember to add &gt; '''sudo''' permissions.</p>
 
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
 
<li><p>Then select '''System'''</p>
 
<p>[[File:media/image80.png|393x194px]]</p></li>
 
<li><p>Then select '''Hardware'''</p>
 
<p>[[File:media/image81.png|393x202px]]</p></li>
 
<li><p>Then use the keyboard's arrow keys to locate the position shown &gt; in the figure below, and then use the '''space''' to select the &gt; configuration corresponding to the pwm you want to open.</p>
 
<p>[[File:media/image176.png|384x79px]]</p></li>
 
<li><p>Then select '''&lt;Save&gt;''' to save</p>
 
<p>[[File:media/image83.png|397x92px]]</p></li>
 
<li><p>Then select '''&lt;Back&gt;'''</p>
 
<p>[[File:media/image84.png|395x91px]]</p></li>
 
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system to make the &gt; configuration take effect.</p>
 
<p>[[File:media/image85.png|374x187px]]</p></li></ol>
 
</li>
 
<li><p>After restarting, you can start the PWM test</p>
 
<p>'''Please execute the following commands under the root user.'''</p>
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>Enter the following command on the command line to make pwm1 &gt; output a 50Hz square wave</p>
 
<p>root@orangepi:~# '''echo 1 &gt; /sys/class/pwm/pwmchip0/export'''</p>
 
<p>root@orangepi:~# '''echo 20000000 &gt; /sys/class/pwm/pwmchip0/pwm1/period'''</p>
 
<p>root@orangepi:~# '''echo 1000000 &gt; /sys/class/pwm/pwmchip0/pwm1/duty_cycle'''</p>
 
<p>root@orangepi:~# '''echo 1 &gt; /sys/class/pwm/pwmchip0/pwm1/enable'''</p></li>
 
<li><p>Enter the following command on the command line to make pwm2 &gt; output a 50Hz square wave</p></li></ol>
 
</li></ol>
 
 
root@orangepi:~# '''echo 2 &gt; /sys/class/pwm/pwmchip0/export'''
 
 
root@orangepi:~# '''echo 20000000 &gt; /sys/class/pwm/pwmchip0/pwm2/period'''
 
 
root@orangepi:~# '''echo 1000000 &gt; /sys/class/pwm/pwmchip0/pwm2/duty_cycle'''
 
 
root@orangepi:~# '''echo 1 &gt; /sys/class/pwm/pwmchip0/pwm2/enable'''
 
 
<ol start="3" style="list-style-type: lower-alpha;">
 
<li>Enter the following command on the command line to make pwm3 output &gt; a 50Hz square wave</li></ol>
 
 
root@orangepi:~# '''echo 3 &gt; /sys/class/pwm/pwmchip0/export'''
 
 
root@orangepi:~# '''echo 20000000 &gt; /sys/class/pwm/pwmchip0/pwm3/period'''
 
 
root@orangepi:~# '''echo 1000000 &gt; /sys/class/pwm/pwmchip0/pwm3/duty_cycle'''
 
 
root@orangepi:~# '''echo 1 &gt; /sys/class/pwm/pwmchip0/pwm3/enable'''
 
 
<ol start="4" style="list-style-type: lower-alpha;">
 
<li>Enter the following command on the command line to make pwm4 output &gt; a 50Hz square wave</li></ol>
 
 
root@orangepi:~# '''echo 4 &gt; /sys/class/pwm/pwmchip0/export'''
 
 
root@orangepi:~# '''echo 20000000 &gt; /sys/class/pwm/pwmchip0/pwm4/period'''
 
 
root@orangepi:~# '''echo 1000000 &gt; /sys/class/pwm/pwmchip0/pwm4/duty_cycle'''
 
 
root@orangepi:~# '''echo 1 &gt; /sys/class/pwm/pwmchip0/pwm4/enable'''
 
 
<div class="figure">
 
 
[[File:media/image177.png|574x344px|69D96433378187B10005CDD2A52881B0]]
 
 
</div>
 
<span id="how-to-install-and-use-wiringop-python"></span>
 
== How to install and use wiringOP-Python ==
 
 
'''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.'''
 
 
'''wiringOP-Python is the Python language version of wiringOP library, used to operate the development board's GPIO, I2C, SPI, UART and other hardware resources in the Python program'''
 
 
'''Also please note that all the following commands are operated under the root user.'''
 
 
<span id="how-to-install-wiringop-python"></span>
 
=== How to install wiringOP-Python ===
 
 
<ol style="list-style-type: decimal;">
 
<li><p>First install dependency packages</p>
 
<p>root@orangepi:~# '''sudo apt-get update'''</p>
 
<p>root@orangepi:~# '''sudo apt-get -y install git swig python3-dev python3-setuptools'''</p></li>
 
<li><p>Then use the following command to download the source code of wiringOP-Python</p></li></ol>
 
 
'''Note that the following git clone--recursive command will automatically download the source code of wiringOP, because wiringOP-Python depends on wiringOP. Please make sure there are no errors during the download process due to network problems.'''
 
 
If there is a problem downloading the code from GitHub, you can directly use the wiringOP-Python source code that comes with the Linux image. The storage location is: '''/usr/src/wiringOP-Python'''
 
 
root@orangepi:~# '''git clone --recursive https://github.com/orangepi-xunlong/wiringOP-Python -b next'''
 
 
root@orangepi:~# '''cd wiringOP-Python'''
 
 
root@orangepi:~/wiringOP-Python# '''git submodule update --init --remote'''
 
 
<ol start="3" style="list-style-type: decimal;">
 
<li><p>Then use the following command to compile wiringOP-Python and install it into the Linux system of the development board</p>
 
<p>root@orangepi:~# '''cd wiringOP-Python'''</p>
 
<p>root@orangepi:~/wiringOP-Python# '''python3 generate-bindings.py &gt; bindings.i'''</p>
 
<p>root@orangepi:~/wiringOP-Python# '''sudo python3 setup.py install'''</p></li>
 
<li><p>Then enter the following command. If helpful information is output, it means wiringOP-Python is successfully installed. Press the '''q''' key to exit the help information interface.</p></li></ol>
 
 
root@orangepi:~/wiringOP-Python# '''python3 -c &quot;import wiringpi; help(wiringpi)&quot;'''
 
 
Help on module wiringpi:
 
 
NAME
 
 
wiringpi
 
 
DESCRIPTION
 
 
# This file was automatically generated by SWIG (http://www.swig.org).
 
 
# Version 4.0.2
 
 
#
 
 
# Do not make changes to this file unless you know what you are doing--modify
 
 
# the SWIG interface file instead.
 
 
<ol start="5" style="list-style-type: decimal;">
 
<li><p>The steps to test whether wiringOP-Python is installed successfully under the python command line are as follows:</p>
 
<ol style="list-style-type: lower-alpha;">
 
<li>First use the python3 command to enter the command line mode of &gt; python3</li></ol>
 
</li></ol>
 
 
root@orangepi:~# '''python3'''
 
 
<ol start="2" style="list-style-type: lower-alpha;">
 
<li>Then import the python module of wiringpi</li></ol>
 
 
&gt;&gt;&gt; '''import wiringpi;'''
 
 
<ol start="3" style="list-style-type: lower-alpha;">
 
<li>Finally, enter the following command to view the help information of &gt; wiringOP-Python. Press the q key to exit the help information &gt; interface.</li></ol>
 
 
&gt;&gt;&gt; '''help(wiringpi)'''
 
 
Help on module wiringpi:
 
 
NAME
 
 
wiringpi
 
 
DESCRIPTION
 
 
# This file was automatically generated by SWIG (http://www.swig.org).
 
 
# Version 4.0.2
 
 
#
 
 
# Do not make changes to this file unless you know what you are doing--modify
 
 
# the SWIG interface file instead.
 
 
CLASSES
 
 
builtins.object
 
 
GPIO
 
 
I2C
 
 
Serial
 
 
nes
 
 
class GPIO(builtins.object)
 
 
| GPIO(pinmode=0)
 
 
|
 
 
&gt;&gt;&gt;
 
 
<span id="pin-gpio-port-test-1"></span>
 
=== 40pin GPIO port test ===
 
 
'''Like wiringOP, wiringOP-Python can also determine which GPIO pin to operate by specifying the wPi number. Because there is no command to view the wPi number in wiringOP-Python, you can only view the board's wPi number and physics through the gpio command in wiringOP Correspondence of pins.'''
 
 
[[File:media/image170.png|576x405px]]
 
 
<ol style="list-style-type: decimal;">
 
<li><p>The following uses pin No. 7 - corresponding to GPIO PI13 - corresponding to wPi serial number 2 - as an example to demonstrate how to set the high and low levels of the GPIO port.</p>
 
<p>[[File:media/image171.png|575x127px]]</p></li>
 
<li><p>The steps for testing directly with commands are as follows:</p>
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>First set the GPIO port to output mode, where the first &gt; parameter of the '''pinMode''' function is the serial number of &gt; the wPi corresponding to the pin, and the second parameter is &gt; the GPIO mode.</p>
 
<p>root@orangepi:~/wiringOP-Python# '''python3 -c &quot;import wiringpi; \'''</p>
 
<p>'''from wiringpi import GPIO; wiringpi.wiringPiSetup() ; \'''</p>
 
<p>'''wiringpi.pinMode(2, GPIO.OUTPUT) ; &quot;'''</p></li>
 
<li><p>Then set the GPIO port to output a low level. After setting, you &gt; can use a multimeter to measure the voltage value of the pin. &gt; If it is 0v, it means the low level is set successfully.</p>
 
<p>root@orangepi:~/wiringOP-Python# '''python3 -c &quot;import wiringpi; \'''</p>
 
<p>'''from wiringpi import GPIO; wiringpi.wiringPiSetup() ;\'''</p>
 
<p>'''wiringpi.digitalWrite(2, GPIO.LOW)&quot;'''</p></li>
 
<li><p>Then set the GPIO port to output a high level. After setting, &gt; you can use a multimeter to measure the voltage value of the &gt; pin. If it is 3.3v, it means the setting of the high level is &gt; successful.</p>
 
<p>root@orangepi:~/wiringOP-Python# '''python3 -c &quot;import wiringpi; \'''</p>
 
<p>'''from wiringpi import GPIO; wiringpi.wiringPiSetup() ;\'''</p>
 
<p>'''wiringpi.digitalWrite(2, GPIO.HIGH)&quot;'''</p></li></ol>
 
</li>
 
<li><p>The steps for testing in the command line of python3 are as follows:</p>
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>First use the python3 command to enter the command line mode of &gt; python3</p>
 
<p>root@orangepi:~# '''python3'''</p></li>
 
<li><p>Then import the python module of wiringpi</p>
 
<p>&gt;&gt;&gt; '''import wiringpi'''</p>
 
<p>&gt;&gt;&gt; '''from wiringpi import GPIO'''</p></li>
 
<li><p>Then set the GPIO port to output mode, where the first parameter &gt; of the '''pinMode'''function is the serial number of the wPi &gt; corresponding to the pin, and the second parameter is the GPIO &gt; mode.</p>
 
<p>&gt;&gt;&gt; '''wiringpi.wiringPiSetup()'''</p>
 
<p>0</p>
 
<p>&gt;&gt;&gt; '''wiringpi.pinMode(2, GPIO.OUTPUT)'''</p></li>
 
<li><p>Then set the GPIO port to output a low level. After setting, you &gt; can use a multimeter to measure the voltage value of the pin. &gt; If it is 0v, it means the low level is set successfully.</p>
 
<p>&gt;&gt;&gt; '''wiringpi.digitalWrite(2, GPIO.LOW)'''</p></li>
 
<li><p>Then set the GPIO port to output a high level. After setting, &gt; you can use a multimeter to measure the voltage value of the &gt; pin. If it is 3.3v, it means the setting of the high level is &gt; successful.</p>
 
<p>&gt;&gt;&gt; '''wiringpi.digitalWrite(2, GPIO.HIGH)'''</p></li></ol>
 
</li>
 
<li><p>For wiringOP-Python to set the GPIO high and low levels in the python code, you can refer to the '''blink.py''' test program in the examples. The '''blink.py''' test program will set the voltage of all GPIO ports in the 40 Pin of the development board to continuously change high and low.</p>
 
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p>
 
<p>root@orangepi:~/wiringOP-Python/examples# '''ls blink.py'''</p>
 
<p>'''blink.py'''</p>
 
<p>root@orangepi:~/wiringOP-Python/examples'''# python3 blink.py'''</p></li></ol>
 
 
<span id="pin-spi-test-1"></span>
 
=== 40pin SPI test ===
 
 
# 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 NO.'''
+
| '''32'''
| '''GPIO'''
+
| '''PWM1'''
| '''Function'''
+
| '''PI11'''
| '''Pin'''
+
| '''267'''
|
 
| '''Pin'''
 
| '''Function'''
 
| '''GPIO'''
 
| '''GPIO NO.'''
 
 
|-
 
|-
 +
| '''34'''
 +
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''3.3V'''
+
|-
| '''1'''
+
| '''36'''
|
 
| '''2'''
 
| '''5V'''
 
| style="text-align: left;"|
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''PC12'''
 +
| '''76'''
 
|-
 
|-
| '''264'''
+
| '''38'''
| '''PI8'''
 
| '''TWI1-SDA'''
 
| '''3'''
 
|
 
| '''4'''
 
| '''5V'''
 
| style="text-align: left;"|
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''PI4'''
 +
| '''260'''
 
|-
 
|-
| '''263'''
+
| '''40'''
| '''PI7'''
 
| '''TWI1-SCL'''
 
| '''5'''
 
|
 
| '''6'''
 
| '''GND'''
 
| style="text-align: left;"|
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''PI3'''
 +
| '''259'''
 +
|}
 +
</div>
 +
 +
<ol start="2" style="list-style-type: 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-style-type: lower-alpha;">
 +
<li><p>First run '''orangepi-config'''. Ordinary users remember to add '''sudo''' permissions.</p>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''269'''
+
|  
| '''PI13'''
+
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p>
| '''PWM3/UART4_TX'''
+
|}
| '''7'''
+
</li>
|
+
<li><p>Then select '''System'''</p>
| '''8'''
+
<p>[[File:zero2w-img80.png]]</p></li>
| '''UART0_TX'''
+
<li><p>Then select '''Hardware'''</p>
| '''PH0'''
+
<p>[[File:zero2w-img81.png]]</p></li>
| '''224'''
+
<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 serial port you want to open.</p></li>
 +
 
 +
{| class="wikitable" style="width:800px;text-align: center;"
 
|-
 
|-
| style="text-align: left;"|
+
| '''Multiplexing function in 40pin'''
| style="text-align: left;"|
+
| '''Corresponding dtbo configuration'''
| '''GND'''
 
| '''9'''
 
|
 
| '''10'''
 
| '''UART0_RX'''
 
| '''PH1'''
 
| '''225'''
 
 
|-
 
|-
| '''226'''
+
| '''40pin - uart2'''
| '''PH2'''
+
| '''pi-uart2'''
| '''UART5_TX'''
+
|-
| '''11'''
+
| '''40pin - uart3'''
|
+
| '''pi-uart3'''
| '''12'''
 
| style="text-align: left;"|
 
| '''PI1'''
 
| '''257'''
 
 
|-
 
|-
| '''227'''
+
| '''40pin - uart4'''
| '''PH3'''
+
| '''pi-uart4'''
| '''UART5_RX'''
 
| '''13'''
 
|
 
| '''14'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
| '''261'''
+
| '''40pin - uart5'''
| '''PI5'''
+
| '''ph-uart5'''
| '''TWI0_SCL/UART2_TX'''
+
|}
| '''15'''
+
 
|
+
[[File:zero2w-img175.png]]
| '''16'''
+
</ol>
| '''PWM4/UART4_RX'''
+
<ol start="5" style="list-style-type: lower-alpha;">
| '''PI14'''
+
<li><p>Then select '''&lt;Save&gt;''' to save</p>
| '''270'''
+
<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 make the configuration take effect.</p>
 +
<p>[[File:zero2w-img85.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 a uart5 device node under '''/dev'''</p>
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
|-
 
|-
| style="text-align: left;"|
+
|  
| style="text-align: left;"|
+
<big><p>'''Note that the linux5.4 system is /dev/ttyASx.'''</p></big>
| '''3.3V'''
+
|}
| '''17'''
+
{| class="wikitable" style="width:800px;"  
|
 
| '''18'''
 
| style="text-align: left;"|
 
| '''PH4'''
 
| '''228'''
 
 
|-
 
|-
| '''231'''
+
|  
| '''PH7'''
+
<p>orangepi@orangepi:~$ '''ls /dev/ttyS*'''</p>
| '''SPI1_MOSI'''
+
<p>/dev/ttySx</p>
| '''19'''
+
|}
|
+
</li>
| '''20'''
+
<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>
| '''GND'''
+
<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.</p>
| style="text-align: left;"|
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
| style="text-align: left;"|
+
|-
 +
|  
 +
<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>
 +
|}
 +
{| class="wikitable" style="width:800px;"  
 
|-
 
|-
| '''232'''
+
|  
| '''PH8'''
+
<p>orangepi@orangepi:~$ '''gpio serial /dev/ttySx # linux-6.1 test command'''</p>
| '''SPI1_MISO'''
+
<p>orangepi@orangepi:~$ '''gpio serial /dev/ttyASx # linux-5.4 test command'''</p>
| '''21'''
+
 
|
+
 
| '''22'''
+
<p>Out: 0: -&gt; 0</p>
| '''TWI0_SDA/UART2_RX'''
+
<p>Out: 1: -&gt; 1</p>
| '''PI6'''
+
<p>Out: 2: -&gt; 2</p>
| '''262'''
+
<p>Out: 3: -&gt; 3^C</p>
 +
|}
 +
</li></ol>
 +
 
 +
<span id="pwm-test-method"></span>
 +
 
 +
=== PWM test method ===
 +
 
 +
# As can be seen from the following table, the available pwm are pwm1, pwm2, pwm3 and pwm4.
 +
 
 +
<div style="display: flex;">
 +
::{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
 
|-
 
|-
| '''230'''
+
| '''GPIO NO.'''
| '''PH6'''
+
| '''GPIO'''
| '''SPI1_CLK'''
+
| '''Function'''
| '''23'''
+
| '''Pin'''
|
 
| '''24'''
 
| '''SPI1_CS0'''
 
| '''PH5'''
 
| '''229'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''GND'''
+
| '''3.3V'''
| '''25'''
+
| '''1'''
|
+
|-
| '''26'''
+
| '''264'''
| '''SPI1_CS1'''
+
| '''PI8'''
| '''PH9'''
+
| '''TWI1-SDA'''
| '''233'''
+
| '''3'''
 +
|-
 +
| '''263'''
 +
| '''PI7'''
 +
| '''TWI1-SCL'''
 +
| '''5'''
 
|-
 
|-
| '''266'''
+
| '''<span style="color:#FF0000">269</span>'''
| '''PI10'''
+
| '''<span style="color:#FF0000">PI13</span>'''
| '''TWI2-SDA/UART3_RX'''
+
| '''<span style="color:#FF0000">PWM3</span>/UART4_TX'''
| '''27'''
+
| '''<span style="color:#FF0000">7</span>'''
|
 
| '''28'''
 
| '''TWI2-SCL/UART3_TX'''
 
| '''PI9'''
 
| '''265'''
 
 
|-
 
|-
| '''256'''
 
| '''PI0'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''29'''
+
| style="text-align: left;"|
|
 
| '''30'''
 
 
| '''GND'''
 
| '''GND'''
 +
| '''9'''
 +
|-
 +
| '''226'''
 +
| '''PH2'''
 +
| '''UART5_TX'''
 +
| '''11'''
 +
|-
 +
| '''227'''
 +
| '''PH3'''
 +
| '''UART5_RX'''
 +
| '''13'''
 +
|-
 +
| '''261'''
 +
| '''PI5'''
 +
| '''TWI0_SCL/UART2_TX'''
 +
| '''15'''
 +
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''3.3V'''
 +
| '''17'''
 +
|-
 +
| '''231'''
 +
| '''PH7'''
 +
| '''SPI1_MOSI'''
 +
| '''19'''
 
|-
 
|-
| '''271'''
+
| '''232'''
| '''PI15'''
+
| '''PH8'''
| style="text-align: left;"|
+
| '''SPI1_MISO'''
| '''31'''
+
| '''21'''
|
+
|-
| '''32'''
+
| '''230'''
| '''PWM1'''
+
| '''PH6'''
| '''PI11'''
+
| '''SPI1_CLK'''
| '''267'''
+
| '''23'''
 
|-
 
|-
| '''268'''
+
| style="text-align: left;"|
| '''PI12'''
+
| style="text-align: left;"|
| '''PWM2'''
 
| '''33'''
 
|
 
| '''34'''
 
 
| '''GND'''
 
| '''GND'''
 +
| '''25'''
 +
|-
 +
| '''266'''
 +
| '''PI10'''
 +
| '''TWI2-SDA/UART3_RX'''
 +
| '''27'''
 +
|-
 +
| '''256'''
 +
| '''PI0'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''29'''
 +
|-
 +
| '''271'''
 +
| '''PI15'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''31'''
 +
|-
 +
| '''<span style="color:#FF0000">268</span>'''
 +
| '''<span style="color:#FF0000">PI12</span>'''
 +
| '''<span style="color:#FF0000">PWM2</span>'''
 +
| '''<span style="color:#FF0000">33</span>'''
 
|-
 
|-
 
| '''258'''
 
| '''258'''
Line 4,457: Line 5,053:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''35'''
 
| '''35'''
|
 
| '''36'''
 
| style="text-align: left;"|
 
| '''PC12'''
 
| '''76'''
 
 
|-
 
|-
 
| '''272'''
 
| '''272'''
Line 4,467: Line 5,058:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''37'''
 
| '''37'''
|
 
| '''38'''
 
| style="text-align: left;"|
 
| '''PI4'''
 
| '''260'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
Line 4,477: Line 5,063:
 
| '''GND'''
 
| '''GND'''
 
| '''39'''
 
| '''39'''
|
 
| '''40'''
 
| style="text-align: left;"|
 
| '''PI3'''
 
| '''259'''
 
 
|}
 
|}
 
+
{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
<ol start="2" style="list-style-type: decimal;">
 
<li><p>In Linux systems, spi1 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-style-type: lower-alpha;">
 
<li><p>First run '''orangepi-config'''. Ordinary users remember to add &gt; '''sudo''' permissions.</p>
 
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
 
<li><p>Then select '''System'''</p>
 
<p>[[File:media/image80.png|389x192px]]</p></li>
 
<li><p>Then select '''Hardware'''</p>
 
<p>[[File:media/image81.png|393x202px]]</p></li>
 
<li><p>Then use the keyboard's arrow keys to locate the position shown &gt; in the figure below, and then use the '''space''' to select the &gt; dtbo configuration of the SPI you want to open.</p></li></ol>
 
</li></ol>
 
 
 
{| class="wikitable"
 
 
|-
 
|-
| '''dtbo configuration'''
+
| '''Pin'''
| '''illustrate'''
+
| '''Function'''
 +
| '''GPIO'''
 +
| '''GPIO NO.'''
 +
|-
 +
| '''2'''
 +
| '''5V'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''4'''
 +
| '''5V'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''6'''
 +
| '''GND'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''8'''
 +
| '''UART0_TX'''
 +
| '''PH0'''
 +
| '''224'''
 
|-
 
|-
| '''spi1-cs0-cs1-spidev'''
+
| '''10'''
| '''Open cs0 and cs1 of spi1 at the same time'''
+
| '''UART0_RX'''
 +
| '''PH1'''
 +
| '''225'''
 
|-
 
|-
| '''spi1-cs0-spidev'''
+
| '''12'''
| '''Only open cs0 of spi1'''
+
| style="text-align: left;"|
 +
| '''PI1'''
 +
| '''257'''
 
|-
 
|-
| '''spi1-cs1-spidev'''
+
| '''14'''
| '''Only open cs1 of spi1'''
+
| '''GND'''
|}
+
| style="text-align: left;"|
 
+
| style="text-align: left;"|
<ol start="5" style="list-style-type: lower-alpha;">
 
<li><p>Then select '''&lt;Save&gt;''' to save</p>
 
<p>[[File:media/image83.png|397x92px]]</p></li>
 
<li><p>Then select '''&lt;Back&gt;'''</p>
 
<p>[[File:media/image84.png|395x91px]]</p></li>
 
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system to make the &gt; configuration take effect.</p>
 
<p>[[File:media/image85.png|374x187px]]</p></li></ol>
 
 
 
<!-- -->
 
<ol start="3" style="list-style-type: decimal;">
 
<li><p>Then check whether there is a '''spidev1.x''' device node in the Linux system. If it exists, it means that the SPI1 configuration has taken effect.</p>
 
<p>orangepi@orangepi:~$ '''ls /dev/spidev1*'''</p>
 
<p>/dev/spidev1.0 /dev/spidev1.1</p>
 
<p>'''Note that only when you open spi1-cs0-cs1-spidev, you will see the device nodes of the two spi.'''</p></li>
 
<li><p>Then you can use the '''spidev_test.py''' program in examples to test the SPI loopback function. The '''spidev_test.py''' program needs to specify the following two parameters:</p>
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>'''--channel''': Specify the channel number of SPI</p></li>
 
<li><p>'''--port''': Specify the port number of the SPI</p></li></ol>
 
</li>
 
<li><p>Without shorting the mosi and miso pins of SPI1, the output result of running spidev_test.py is as follows. You can see that the data of TX and RX are inconsistent.</p>
 
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p></li></ol>
 
 
 
root@orangepi:~/wiringOP-Python/examples# '''python3 spidev_test.py \'''
 
 
 
'''--channel 1 --port 0'''
 
 
 
spi mode: 0x0
 
 
 
max speed: 500000 Hz (500 KHz)
 
 
 
Opening device /dev/spidev1.1
 
 
 
TX | FF FF FF FF FF FF '''40 00 00 00 00 95''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…|
 
 
 
RX | FF FF FF FF FF FF '''FF FF FF FF FF FF''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |.............….|
 
 
 
<ol start="6" style="list-style-type: decimal;">
 
<li><p>Then use Dupont wire to short-circuit the txd (pin 19 in the 40pin interface) and rxd (pin 21 in the 40pin interface) of SPI1 and then run spidev_test.py. The output is as follows, you can see If the data sent and received are the same, it means that the SPI1 loopback test is normal.</p>
 
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p></li></ol>
 
 
 
root@orangepi:~/wiringOP-Python/examples# '''python3 spidev_test.py \'''
 
 
 
'''--channel 1 --port 0'''
 
 
 
spi mode: 0x0
 
 
 
max speed: 500000 Hz (500 KHz)
 
 
 
Opening device /dev/spidev1.1
 
 
 
TX | FF FF FF FF FF FF '''40 00 00 00 00 95''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…|
 
 
 
RX | FF FF FF FF FF FF '''40 00 00 00 00 95''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…|
 
 
 
<span id="pin-i2c-test-1"></span>
 
=== 40pin I2C test ===
 
 
 
# As can be seen from the table below, the i2c available for the 40pin interface are i2c0, i2c1 and i2c2
 
 
 
{| class="wikitable"
 
 
|-
 
|-
| '''GPIO NO.'''
+
| '''<span style="color:#FF0000">16</span>'''
| '''GPIO'''
+
| '''<span style="color:#FF0000">PWM4</span>/UART4_RX'''
| '''Function'''
+
| '''<span style="color:#FF0000">PI14</span>'''
| '''Pin'''
+
| '''<span style="color:#FF0000">270</span>'''
|
 
| '''Pin'''
 
| '''Function'''
 
| '''GPIO'''
 
| '''GPIO NO.'''
 
 
|-
 
|-
 +
| '''18'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| style="text-align: left;"|
+
| '''PH4'''
| '''3.3V'''
+
| '''228'''
| '''1'''
+
|-
|
+
| '''20'''
| '''2'''
+
| '''GND'''
| '''5V'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
|-
 
|-
| '''264'''
+
| '''22'''
| '''PI8'''
+
| '''TWI0_SDA/UART2_RX'''
| '''TWI1-SDA'''
+
| '''PI6'''
| '''3'''
+
| '''262'''
|
+
|-
| '''4'''
+
| '''24'''
| '''5V'''
+
| '''SPI1_CS0'''
 +
| '''PH5'''
 +
| '''229'''
 +
|-
 +
| '''26'''
 +
| '''SPI1_CS1'''
 +
| '''PH9'''
 +
| '''233'''
 +
|-
 +
| '''28'''
 +
| '''TWI2-SCL/UART3_TX'''
 +
| '''PI9'''
 +
| '''265'''
 +
|-
 +
| '''30'''
 +
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
|-
 
|-
| '''263'''
+
| '''<span style="color:#FF0000">32</span>'''
| '''PI7'''
+
| '''<span style="color:#FF0000">PWM1</span>'''
| '''TWI1-SCL'''
+
| '''<span style="color:#FF0000">PI11</span>'''
| '''5'''
+
| '''<span style="color:#FF0000">267</span>'''
|
+
|-
| '''6'''
+
| '''34'''
 
| '''GND'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
|-
 
|-
| '''269'''
+
| '''36'''
| '''PI13'''
+
| style="text-align: left;"|
| '''PWM3/UART4_TX'''
+
| '''PC12'''
| '''7'''
+
| '''76'''
|
 
| '''8'''
 
| '''UART0_TX'''
 
| '''PH0'''
 
| '''224'''
 
 
|-
 
|-
 +
| '''38'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''PI4'''
 +
| '''260'''
 +
|-
 +
| '''40'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''GND'''
+
| '''PI3'''
| '''9'''
+
| '''259'''
|
+
|}
| '''10'''
+
</div>
| '''UART0_RX'''
+
 
| '''PH1'''
+
<ol start="2" style="list-style-type: decimal;">
| '''225'''
+
<li><p>pwm is turned off by default in Linux systems and needs to be turned on manually to use it. The opening steps are as follows:</p>
 +
<ol style="list-style-type: lower-alpha;">
 +
<li><p>First run '''orangepi-config'''. Ordinary users remember to add '''sudo''' permissions.</p>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''226'''
+
|  
| '''PH2'''
+
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p>
| '''UART5_TX'''
+
|}
| '''11'''
+
</li>
|
+
<li><p>Then select '''System'''</p>
| '''12'''
+
<p>[[File:zero2w-img80.png]]</p></li>
| style="text-align: left;"|
+
<li><p>Then select '''Hardware'''</p>
| '''PI1'''
+
<p>[[File:zero2w-img81.png]]</p></li>
| '''257'''
+
<li><p>Then use the keyboard's arrow keys to locate the position shown in the figure below, and then use the '''space''' to select the configuration corresponding to the pwm you want to open.</p>
 +
<p>[[File:zero2w-img176.png]]</p></li>
 +
<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 make the configuration take effect.</p>
 +
<p>[[File:zero2w-img85.png]]</p></li></ol>
 +
</li>
 +
<li><p>After restarting, you can start the PWM test</p>
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
|-
 
|-
| '''227'''
+
|  
| '''PH3'''
+
<big><p>'''Please execute the following commands under the root user.'''</p></big>
| '''UART5_RX'''
+
|}
| '''13'''
+
<ol style="list-style-type: lower-alpha;">
|
+
<li><p>Enter the following command on the command line to make pwm1 output a 50Hz square wave</p>
| '''14'''
+
{| class="wikitable" style="width:800px;"  
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
| '''261'''
+
|  
| '''PI5'''
+
<p>root@orangepi:~# '''echo 1 &gt; /sys/class/pwm/pwmchip0/export'''</p>
| '''TWI0_SCL/UART2_TX'''
+
<p>root@orangepi:~# '''echo 20000000 &gt; /sys/class/pwm/pwmchip0/pwm1/period'''</p>
| '''15'''
+
<p>root@orangepi:~# '''echo 1000000 &gt; /sys/class/pwm/pwmchip0/pwm1/duty_cycle'''</p>
|
+
<p>root@orangepi:~# '''echo 1 &gt; /sys/class/pwm/pwmchip0/pwm1/enable'''</p>
| '''16'''
+
|}
| '''PWM4/UART4_RX'''
+
</li>
| '''PI14'''
+
<li><p>Enter the following command on the command line to make pwm2 output a 50Hz square wave</p></li>
| '''270'''
+
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| style="text-align: left;"|
+
|  
| style="text-align: left;"|
+
root@orangepi:~# '''echo 2 &gt; /sys/class/pwm/pwmchip0/export'''
| '''3.3V'''
+
 
| '''17'''
+
root@orangepi:~# '''echo 20000000 &gt; /sys/class/pwm/pwmchip0/pwm2/period'''
|
+
 
| '''18'''
+
root@orangepi:~# '''echo 1000000 &gt; /sys/class/pwm/pwmchip0/pwm2/duty_cycle'''
| style="text-align: left;"|
+
 
| '''PH4'''
+
root@orangepi:~# '''echo 1 &gt; /sys/class/pwm/pwmchip0/pwm2/enable'''
| '''228'''
+
|}
 +
</ol>
 +
<ol start="3" style="list-style-type: lower-alpha;">
 +
<li>Enter the following command on the command line to make pwm3 output a 50Hz square wave</li>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''231'''
+
|  
| '''PH7'''
+
root@orangepi:~# '''echo 3 &gt; /sys/class/pwm/pwmchip0/export'''
| '''SPI1_MOSI'''
+
 
| '''19'''
+
root@orangepi:~# '''echo 20000000 &gt; /sys/class/pwm/pwmchip0/pwm3/period'''
|
+
 
| '''20'''
+
root@orangepi:~# '''echo 1000000 &gt; /sys/class/pwm/pwmchip0/pwm3/duty_cycle'''
| '''GND'''
+
 
| style="text-align: left;"|
+
root@orangepi:~# '''echo 1 &gt; /sys/class/pwm/pwmchip0/pwm3/enable'''
| style="text-align: left;"|
+
|}
 +
</ol>
 +
<ol start="4" style="list-style-type: lower-alpha;">
 +
<li>Enter the following command on the command line to make pwm4 output a 50Hz square wave</li>
 +
{| class="wikitable" style="width:800px;"  
 
|-
 
|-
| '''232'''
+
|  
| '''PH8'''
+
root@orangepi:~# '''echo 4 &gt; /sys/class/pwm/pwmchip0/export'''
| '''SPI1_MISO'''
+
 
| '''21'''
+
root@orangepi:~# '''echo 20000000 &gt; /sys/class/pwm/pwmchip0/pwm4/period'''
|
+
 
| '''22'''
+
root@orangepi:~# '''echo 1000000 &gt; /sys/class/pwm/pwmchip0/pwm4/duty_cycle'''
| '''TWI0_SDA/UART2_RX'''
+
 
| '''PI6'''
+
root@orangepi:~# '''echo 1 &gt; /sys/class/pwm/pwmchip0/pwm4/enable'''
| '''262'''
+
|}
|-
+
 
| '''230'''
+
<div class="figure">
| '''PH6'''
+
 
| '''SPI1_CLK'''
+
[[File:zero2w-img177.png]]
| '''23'''
+
 
|
+
</div></ol>
| '''24'''
+
</li></ol>
| '''SPI1_CS0'''
+
<span id="how-to-install-and-use-wiringop-python"></span>
| '''PH5'''
+
 
| '''229'''
+
== How to install and use wiringOP-Python ==
 +
 
 +
{| 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>
 +
|}
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
|-
 
|-
| style="text-align: left;"|
+
|  
| style="text-align: left;"|
+
<big>'''wiringOP-Python is the Python language version of wiringOP library, used to operate the development board's GPIO, I2C, SPI, UART and other hardware resources in the Python program'''
| '''GND'''
+
 
| '''25'''
+
'''Also please note that all the following commands are operated under the root user.'''</big>
|
+
|}
| '''26'''
+
 
| '''SPI1_CS1'''
+
<span id="how-to-install-wiringop-python"></span>
| '''PH9'''
+
=== How to install wiringOP-Python ===
| '''233'''
+
 
 +
<ol style="list-style-type: decimal;">
 +
<li><p>First install dependency packages</p>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''266'''
+
|  
| '''PI10'''
+
<p>root@orangepi:~# '''sudo apt-get update'''</p>
| '''TWI2-SDA/UART3_RX'''
+
<p>root@orangepi:~# '''sudo apt-get -y install git swig python3-dev python3-setuptools'''</p>
| '''27'''
+
|}
|
+
</li>
| '''28'''
+
<li><p>Then use the following command to download the source code of wiringOP-Python</p></li>
| '''TWI2-SCL/UART3_TX'''
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
| '''PI9'''
 
| '''265'''
 
 
|-
 
|-
| '''256'''
+
|  
| '''PI0'''
+
<big>'''Note that the following git clone--recursive command will automatically download the source code of wiringOP, because wiringOP-Python depends on wiringOP. Please make sure there are no errors during the download process due to network problems.'''
| style="text-align: left;"|
+
 
| '''29'''
+
'''If there is a problem downloading the code from GitHub, you can directly use the wiringOP-Python source code that comes with the Linux image. The storage location is: /usr/src/wiringOP-Python'''</big>
|
+
|}
| '''30'''
+
{| class="wikitable" style="width:800px;"  
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
| '''271'''
+
|  
| '''PI15'''
+
root@orangepi:~# '''git clone --recursive https://github.com/orangepi-xunlong/wiringOP-Python -b next'''
| style="text-align: left;"|
+
 
| '''31'''
+
root@orangepi:~# '''cd wiringOP-Python'''
|
+
 
| '''32'''
+
root@orangepi:~/wiringOP-Python# '''git submodule update --init --remote'''
| '''PWM1'''
+
|}
| '''PI11'''
+
</ol>
| '''267'''
+
<ol start="3" style="list-style-type: decimal;">
 +
<li><p>Then use the following command to compile wiringOP-Python and install it into the Linux system of the development board</p>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''268'''
+
|  
| '''PI12'''
+
<p>root@orangepi:~# '''cd wiringOP-Python'''</p>
| '''PWM2'''
+
<p>root@orangepi:~/wiringOP-Python# '''python3 generate-bindings.py &gt; bindings.i'''</p>
| '''33'''
+
<p>root@orangepi:~/wiringOP-Python# '''sudo python3 setup.py install'''</p>
|
+
|}
| '''34'''
+
</li>
| '''GND'''
+
<li><p>Then enter the following command. If helpful information is output, it means wiringOP-Python is successfully installed. Press the '''q''' key to exit the help information interface.</p></li>
| style="text-align: left;"|
+
{| class="wikitable" style="width:800px;"  
| style="text-align: left;"|
 
 
|-
 
|-
| '''258'''
+
|  
| '''PI2'''
+
root@orangepi:~/wiringOP-Python# '''python3 -c &quot;import wiringpi; help(wiringpi)&quot;'''
| style="text-align: left;"|
+
 
| '''35'''
+
Help on module wiringpi:
|
+
 
| '''36'''
+
 
| style="text-align: left;"|
+
NAME
| '''PC12'''
+
 
| '''76'''
+
:wiringpi
|-
+
 
| '''272'''
+
 
| '''PI16'''
+
DESCRIPTION
| style="text-align: left;"|
+
 
| '''37'''
+
: # This file was automatically generated by SWIG (http://www.swig.org).
|
+
 
| '''38'''
+
: # Version 4.0.2
| style="text-align: left;"|
+
 
| '''PI4'''
+
: #
| '''260'''
+
 
|-
+
: # Do not make changes to this file unless you know what you are doing--modify
| style="text-align: left;"|
+
 
| style="text-align: left;"|
+
: # the SWIG interface file instead.
| '''GND'''
 
| '''39'''
 
|
 
| '''40'''
 
| style="text-align: left;"|
 
| '''PI3'''
 
| '''259'''
 
 
|}
 
|}
 
+
</ol>
<ol start="2" style="list-style-type: decimal;">
+
<ol start="5" style="list-style-type: decimal;">
<li><p>i2c is turned off by default in Linux systems and needs to be turned on manually to use it. The opening steps are as follows:</p>
+
<li><p>The steps to test whether wiringOP-Python is installed successfully under the python command line are as follows:</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users remember to add &gt; '''sudo''' permissions.</p>
+
<li>First use the python3 command to enter the command line mode of &gt; python3</li>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
+
{| class="wikitable" style="width:800px;"  
<li><p>Then select '''System'''</p>
 
<p>[[File:media/image80.png|394x195px]]</p></li>
 
<li><p>Then select '''Hardware'''</p>
 
<p>[[File:media/image81.png|393x202px]]</p></li>
 
<li><p>Then use the keyboard’s arrow keys to locate the position shown &gt; in the picture below, and then use the '''space''' to select the &gt; corresponding i2c configuration in the picture below.</p></li></ol>
 
</li></ol>
 
 
 
{| class="wikitable"
 
 
|-
 
|-
| '''Multiplexing function in 40pin'''
+
|  
| '''Corresponding dtbo configuration'''
+
root@orangepi:~# '''python3'''
 +
|}
 +
</ol>
 +
<ol start="2" style="list-style-type: lower-alpha;">
 +
<li>Then import the python module of wiringpi</li>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''40pin - i2c0'''
+
|  
| '''pi-i2c0'''
+
&gt;&gt;&gt; '''import wiringpi;'''
 +
|}
 +
</ol>
 +
<ol start="3" style="list-style-type: lower-alpha;">
 +
<li>Finally, enter the following command to view the help information of &gt; wiringOP-Python. Press the q key to exit the help information &gt; interface.</li>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''40pin - i2c1'''
+
|  
| '''pi-i2c1'''
+
&gt;&gt;&gt; '''help(wiringpi)'''
|-
 
| '''40pin - i2c2'''
 
| '''pi-i2c2'''
 
|}
 
  
[[File:media/image173.png|393x60px]]
+
Help on module wiringpi:
  
<ol start="5" style="list-style-type: lower-alpha;">
 
<li><p>Then select <span class="mark">&lt;Save&gt;</span> to save</p>
 
<p>[[File:media/image83.png|395x91px]]</p></li>
 
<li><p>Then select <span class="mark">&lt;Back&gt;</span></p>
 
<p>[[File:media/image84.png|395x91px]]</p></li>
 
<li><p>Then select <span class="mark">&lt;Reboot&gt;</span> to restart the system to make the &gt; configuration take effect.</p>
 
<p>[[File:media/image85.png|374x187px]]</p></li></ol>
 
  
<!-- -->
+
NAME
<ol start="3" style="list-style-type: decimal;">
+
 
<li><p>After starting the Linux system, first confirm that there is an open i2c device node under <span class="mark">/dev</span></p>
+
:wiringpi
<p>orangepi@orangepi:~$ '''ls /dev/i2c-*'''</p>
+
 
<p>'''/dev/i2c-*'''</p>
+
 
<p>'''Sometimes the i2c device node and the i2c bus serial number do not correspond one to one. For example, the i2c device node of the i2c1 bus may be /dev/i2c-3.'''</p>
+
DESCRIPTION
<p>'''The method to accurately confirm the device node under /dev corresponding to the i2c bus is:'''</p></li></ol>
+
 
 +
: # This file was automatically generated by SWIG (http://www.swig.org).
 +
 
 +
: # Version 4.0.2
 +
 
 +
: #
 +
 
 +
: # Do not make changes to this file unless you know what you are doing--modify
 +
 
 +
: # the SWIG interface file instead.
 +
 
 +
 
 +
CLASSES
 +
 
 +
:builtins.object
 +
 
 +
::GPIO
 +
 
 +
::I2C
 +
 
 +
::Serial
 +
 
 +
::nes
  
<!-- -->
 
<ol start="3" style="list-style-type: lower-alpha;">
 
<li><p>'''First run the following command to check the corresponding relationship of i2c'''</p>
 
<p>orangepi@orangepizero2w:~$ '''ls /sys/devices/platform/soc*/*/i2c-* | grep &quot;i2c-[0-9]&quot;'''</p>
 
<p>/sys/devices/platform/soc/5002000.i2c/i2c-0:</p>
 
<p>/sys/devices/platform/soc/5002400.i2c/i2c-3:</p>
 
<p>/sys/devices/platform/soc/5002800.i2c/i2c-4:</p>
 
<p>/sys/devices/platform/soc/5002c00.i2c/i2c-5:</p>
 
<p>/sys/devices/platform/soc/6000000.hdmi/i2c-2:</p>
 
<p>/sys/devices/platform/soc/7081400.i2c/i2c-1:</p></li>
 
<li><p>'''In the above output'''</p></li></ol>
 
  
<!-- -->
+
:class GPIO(builtins.object)
<ol start="4" style="list-style-type: lower-alpha;">
 
<li><p>002000 is the register base address of the i2c0 bus, and i2c-0 shown behind it is its corresponding i2c device node</p></li>
 
<li><p>5002400 is the register base address of the i2c1 bus, and i2c-3 shown behind it is its corresponding i2c device node</p></li>
 
<li><p>5002800 is the register base address of the i2c2 bus, and i2c-4 shown behind it is its corresponding i2c device node</p></li></ol>
 
  
<!-- -->
+
:| GPIO(pinmode=0)
<ol start="4" style="list-style-type: decimal;">
 
<li><p>Then start testing i2c, first install i2c-tools</p>
 
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
 
<p>orangepi@orangepi:~$ '''sudo''' '''apt-get install -y i2c-tools'''</p></li>
 
<li><p>Then connect an i2c device to the i2c pin of the 40pin connector. Here we take the DS1307 RTC module as an example.</p>
 
<p>[[File:media/image178.png|180x153px]]</p></li>
 
<li><p>Then use the '''i2cdetect -y x'''command. If the address of the connected i2c device can be detected, it means that the i2c device is connected correctly.</p>
 
<p>'''Note that x in the i2cdetect -y x command needs to be replaced with the serial number of the device node corresponding to the i2c bus.'''</p></li></ol>
 
  
[[File:media/image179.png|388x203px]]
+
:|
  
<ol start="7" style="list-style-type: decimal;">
 
<li><p>Then you can run the '''ds1307.py''' test program in '''examples''' to read the RTC time</p>
 
<p>'''Note that the x in i2c-x in the following command needs to be replaced with the serial number of the device node corresponding to the i2c bus.'''</p>
 
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p>
 
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 ds1307.py --device \'''</p>
 
<p>'''&quot;/dev/i2c-x&quot;'''</p>
 
<p>Thu 2022-06-16 04:35:46</p>
 
<p>Thu 2022-06-16 04:35:47</p>
 
<p>Thu 2022-06-16 04:35:48</p>
 
<p>^C</p>
 
<p>exit</p></li></ol>
 
  
<span id="pin-uart-test-1"></span>
+
&gt;&gt;&gt;
=== 40pin UART test ===
+
|}
 +
</ol>
 +
</li></ol>
 +
<span id="pin-gpio-port-test-1"></span>
  
# 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.
+
=== 40pin GPIO port test ===
  
{| class="wikitable"
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"  
 
|-
 
|-
| '''GPIO NO.'''
+
|  
| '''GPIO'''
+
<big>'''Like wiringOP, wiringOP-Python can also determine which GPIO pin to operate by specifying the wPi number. Because there is no command to view the wPi number in wiringOP-Python, you can only view the board's wPi number and physics through the gpio command in wiringOP Correspondence of pins.'''</big>
| '''Function'''
+
 
| '''Pin'''
+
[[File:zero2w-img170.png|center]]
|
+
|}
| '''Pin'''
+
 
| '''Function'''
+
<ol style="list-style-type: decimal;">
| '''GPIO'''
+
<li><p>The following uses pin No. 7 - corresponding to GPIO PI13 - corresponding to wPi serial number 2 - as an example to demonstrate how to set the high and low levels of the GPIO port.</p>
| '''GPIO NO.'''
+
<p>[[File:zero2w-img171.png]]</p></li>
 +
<li><p>The steps for testing directly with commands are as follows:</p>
 +
<ol style="list-style-type: lower-alpha;">
 +
<li><p>First set the GPIO port to output mode, where the first parameter of the '''pinMode''' function is the serial number of the wPi corresponding to the pin, and the second parameter is the GPIO mode.</p>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| style="text-align: left;"|
+
|  
| style="text-align: left;"|
+
<p>root@orangepi:~/wiringOP-Python# '''python3 -c &quot;import wiringpi; \'''</p>
| '''3.3V'''
+
<p>'''from wiringpi import GPIO; wiringpi.wiringPiSetup() ; \'''</p>
| '''1'''
+
<p>'''wiringpi.pinMode(<span style="color:#FF0000">2, GPIO.OUTPUT</span>) ; &quot;'''</p>
|
+
|}
| '''2'''
+
</li>
| '''5V'''
+
<li><p>Then set the GPIO port to output a 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 is set successfully.</p>
| style="text-align: left;"|
+
{| class="wikitable" style="width:800px;"  
| style="text-align: left;"|
 
 
|-
 
|-
| '''264'''
+
|  
| '''PI8'''
+
<p>root@orangepi:~/wiringOP-Python# '''python3 -c &quot;import wiringpi; \'''</p>
| '''TWI1-SDA'''
+
<p>'''from wiringpi import GPIO; wiringpi.wiringPiSetup() ;\'''</p>
| '''3'''
+
<p>'''wiringpi.digitalWrite(2, <span style="color:#FF0000">GPIO.LOW</span>)&quot;'''</p>
|
+
|}
| '''4'''
+
</li>
| '''5V'''
+
<li><p>Then set the GPIO port to output a high level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 3.3v, it means the setting of the high level is successful.</p>
| style="text-align: left;"|
+
{| class="wikitable" style="width:800px;"  
| style="text-align: left;"|
 
 
|-
 
|-
| '''263'''
+
|  
| '''PI7'''
+
<p>root@orangepi:~/wiringOP-Python# '''python3 -c &quot;import wiringpi; \'''</p>
| '''TWI1-SCL'''
+
<p>'''from wiringpi import GPIO; wiringpi.wiringPiSetup() ;\'''</p>
| '''5'''
+
<p>'''wiringpi.digitalWrite(2, <span style="color:#FF0000">GPIO.HIGH</span>)&quot;'''</p>
|
+
|}
| '''6'''
+
</li></ol>
| '''GND'''
+
</li>
| style="text-align: left;"|
+
<li><p>The steps for testing in the command line of python3 are as follows:</p>
| style="text-align: left;"|
+
<ol style="list-style-type: lower-alpha;">
 +
<li><p>First use the python3 command to enter the command line mode of python3</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|  
 +
<p>root@orangepi:~# '''python3'''</p>
 +
|}
 +
</li>
 +
<li><p>Then import the python module of wiringpi</p>
 +
{| class="wikitable" style="width:800px;"  
 
|-
 
|-
| '''269'''
+
|  
| '''PI13'''
+
<p>&gt;&gt;&gt; '''import wiringpi'''</p>
| '''PWM3/UART4_TX'''
+
<p>&gt;&gt;&gt; '''from wiringpi import GPIO'''</p>
| '''7'''
+
|}
|
+
</li>
| '''8'''
+
<li><p>Then set the GPIO port to output mode, where the first parameter of the '''pinMode'''function is the serial number of the wPi corresponding to the pin, and the second parameter is the GPIO mode.</p>
| '''UART0_TX'''
+
{| class="wikitable" style="width:800px;"
| '''PH0'''
 
| '''224'''
 
 
|-
 
|-
| style="text-align: left;"|
+
|  
| style="text-align: left;"|
+
<p>&gt;&gt;&gt; '''wiringpi.wiringPiSetup()'''</p>
| '''GND'''
+
<p>0</p>
| '''9'''
+
<p>&gt;&gt;&gt; '''wiringpi.pinMode(<span style="color:#FF0000">2, GPIO.OUTPUT</span>)'''</p>
|
+
|}
| '''10'''
+
</li>
| '''UART0_RX'''
+
<li><p>Then set the GPIO port to output a 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 is set successfully.</p>
| '''PH1'''
+
{| class="wikitable" style="width:800px;"
| '''225'''
 
 
|-
 
|-
| '''226'''
+
|  
| '''PH2'''
+
<p>&gt;&gt;&gt; '''wiringpi.digitalWrite(2, <span style="color:#FF0000">GPIO.LOW</span>)'''</p>
| '''UART5_TX'''
+
|}
| '''11'''
+
</li>
|
+
<li><p>Then set the GPIO port to output a high level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 3.3v, it means the setting of the high level is successful.</p>
| '''12'''
+
{| class="wikitable" style="width:800px;"  
| style="text-align: left;"|
 
| '''PI1'''
 
| '''257'''
 
 
|-
 
|-
| '''227'''
+
|  
| '''PH3'''
+
<p>&gt;&gt;&gt; '''wiringpi.digitalWrite(2, <span style="color:#FF0000">GPIO.HIGH</span>)'''</p>
| '''UART5_RX'''
+
|}
| '''13'''
+
</li></ol>
|
+
</li>
| '''14'''
+
<li><p>For wiringOP-Python to set the GPIO high and low levels in the python code, you can refer to the '''blink.py''' test program in the examples. The '''blink.py''' test program will set the voltage of all GPIO ports in the 40 Pin of the development board to continuously change high and low.</p>
| '''GND'''
+
{| class="wikitable" style="width:800px;"
| style="text-align: left;"|
+
|-
| style="text-align: left;"|
+
|
 +
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p>
 +
<p>root@orangepi:~/wiringOP-Python/examples# '''ls blink.py'''</p>
 +
<p>'''blink.py'''</p>
 +
<p>root@orangepi:~/wiringOP-Python/examples'''# python3 blink.py'''</p>
 +
|}
 +
</li></ol>
 +
 
 +
<span id="pin-spi-test-1"></span>
 +
 
 +
=== 40pin SPI test ===
 +
 
 +
# 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
 +
 
 +
<div style="display: flex;">
 +
::{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
 
|-
 
|-
| '''261'''
+
| '''GPIO NO.'''
| '''PI5'''
+
| '''GPIO'''
| '''TWI0_SCL/UART2_TX'''
+
| '''Function'''
| '''15'''
+
| '''Pin'''
|
 
| '''16'''
 
| '''PWM4/UART4_RX'''
 
| '''PI14'''
 
| '''270'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''3.3V'''
 
| '''3.3V'''
| '''17'''
+
| '''1'''
|
 
| '''18'''
 
| style="text-align: left;"|
 
| '''PH4'''
 
| '''228'''
 
 
|-
 
|-
| '''231'''
+
| '''264'''
| '''PH7'''
+
| '''PI8'''
| '''SPI1_MOSI'''
+
| '''TWI1-SDA'''
| '''19'''
+
| '''3'''
|
 
| '''20'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
| '''232'''
+
| '''263'''
| '''PH8'''
+
| '''PI7'''
| '''SPI1_MISO'''
+
| '''TWI1-SCL'''
| '''21'''
+
| '''5'''
|
+
|-
| '''22'''
+
| '''269'''
| '''TWI0_SDA/UART2_RX'''
+
| '''PI13'''
| '''PI6'''
+
| '''PWM3/UART4_TX'''
| '''262'''
+
| '''7'''
 +
|-
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
| '''GND'''
 +
| '''9'''
 +
|-
 +
| '''226'''
 +
| '''PH2'''
 +
| '''UART5_TX'''
 +
| '''11'''
 +
|-
 +
| '''227'''
 +
| '''PH3'''
 +
| '''UART5_RX'''
 +
| '''13'''
 +
|-
 +
| '''261'''
 +
| '''PI5'''
 +
| '''TWI0_SCL/UART2_TX'''
 +
| '''15'''
 +
|-
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
| '''3.3V'''
 +
| '''17'''
 +
|-
 +
| '''<span style="color:#FF0000">231</span>'''
 +
| '''<span style="color:#FF0000">PH7</span>'''
 +
| '''<span style="color:#FF0000">SPI1_MOSI</span>'''
 +
| '''<span style="color:#FF0000">19</span>'''
 +
|-
 +
| '''<span style="color:#FF0000">232</span>'''
 +
| '''<span style="color:#FF0000">PH8</span>'''
 +
| '''<span style="color:#FF0000">SPI1_MISO</span>'''
 +
| '''<span style="color:#FF0000">21</span>'''
 
|-
 
|-
| '''230'''
+
| '''<span style="color:#FF0000">230</span>'''
| '''PH6'''
+
| '''<span style="color:#FF0000">PH6</span>'''
| '''SPI1_CLK'''
+
| '''<span style="color:#FF0000">SPI1_CLK</span>'''
| '''23'''
+
| '''<span style="color:#FF0000">23</span>'''
|
 
| '''24'''
 
| '''SPI1_CS0'''
 
| '''PH5'''
 
| '''229'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
Line 5,011: Line 5,589:
 
| '''GND'''
 
| '''GND'''
 
| '''25'''
 
| '''25'''
|
 
| '''26'''
 
| '''SPI1_CS1'''
 
| '''PH9'''
 
| '''233'''
 
 
|-
 
|-
 
| '''266'''
 
| '''266'''
Line 5,021: Line 5,594:
 
| '''TWI2-SDA/UART3_RX'''
 
| '''TWI2-SDA/UART3_RX'''
 
| '''27'''
 
| '''27'''
|
+
|-
| '''28'''
+
| '''256'''
| '''TWI2-SCL/UART3_TX'''
 
| '''PI9'''
 
| '''265'''
 
|-
 
| '''256'''
 
 
| '''PI0'''
 
| '''PI0'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''29'''
 
| '''29'''
|
 
| '''30'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''271'''
 
| '''271'''
Line 5,041: Line 5,604:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''31'''
 
| '''31'''
|
 
| '''32'''
 
| '''PWM1'''
 
| '''PI11'''
 
| '''267'''
 
 
|-
 
|-
 
| '''268'''
 
| '''268'''
Line 5,051: Line 5,609:
 
| '''PWM2'''
 
| '''PWM2'''
 
| '''33'''
 
| '''33'''
|
 
| '''34'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''258'''
 
| '''258'''
Line 5,061: Line 5,614:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''35'''
 
| '''35'''
|
 
| '''36'''
 
| style="text-align: left;"|
 
| '''PC12'''
 
| '''76'''
 
 
|-
 
|-
 
| '''272'''
 
| '''272'''
Line 5,071: Line 5,619:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''37'''
 
| '''37'''
|
 
| '''38'''
 
| style="text-align: left;"|
 
| '''PI4'''
 
| '''260'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
Line 5,081: Line 5,624:
 
| '''GND'''
 
| '''GND'''
 
| '''39'''
 
| '''39'''
|
 
| '''40'''
 
| style="text-align: left;"|
 
| '''PI3'''
 
| '''259'''
 
 
|}
 
|}
 
+
{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
<ol start="2" style="list-style-type: 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-style-type: lower-alpha;">
 
<li><p>First run '''orangepi-config'''. Ordinary users remember to add &gt; '''sudo''' permissions.</p>
 
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
 
<li><p>Then select '''System'''</p>
 
<p>[[File:media/image80.png|396x195px]]</p></li>
 
<li><p>Then select '''Hardware'''</p>
 
<p>[[File:media/image81.png|393x202px]]</p></li>
 
<li><p>Then use the keyboard’s arrow keys to locate the position shown &gt; 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 40pin'''
+
| '''Pin'''
| '''Corresponding dtbo configuration'''
+
| '''Function'''
 +
| '''GPIO'''
 +
| '''GPIO NO.'''
 
|-
 
|-
| '''40pin - uart2'''
+
| '''2'''
| '''pi-uart2'''
+
| '''5V'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 
|-
 
|-
| '''40pin - uart3'''
+
| '''4'''
| '''pi-uart3'''
+
| '''5V'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''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'''
 
|-
 
|-
| '''40pin - uart4'''
+
| '''14'''
| '''pi-uart4'''
+
| '''GND'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 
|-
 
|-
| '''40pin - uart5'''
+
| '''16'''
| '''ph-uart5'''
+
| '''PWM4/UART4_RX'''
|}
+
| '''PI14'''
 
+
| '''270'''
[[File:media/image175.png|395x216px]]
+
|-
 
+
| '''18'''
<ol start="5" style="list-style-type: lower-alpha;">
+
| style="text-align: left;"|
<li><p>Then select '''&lt;Save&gt;''' to save</p>
+
| '''PH4'''
<p>[[File:media/image83.png|397x92px]]</p></li>
+
| '''228'''
<li><p>Then select '''&lt;Back&gt;'''</p>
+
|-
<p>[[File:media/image84.png|395x91px]]</p></li>
+
| '''20'''
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system to make the &gt; configuration take effect.</p>
+
| '''GND'''
<p>[[File:media/image85.png|374x187px]]</p></li></ol>
+
| style="text-align: left;"|
 
+
| style="text-align: left;"|
<!-- -->
+
|-
<ol start="3" style="list-style-type: decimal;">
+
| '''22'''
<li><p>After entering the Linux system, first confirm whether there is a uart5 device node under '''<span class="mark">/dev</span>'''</p>
+
| '''TWI0_SDA/UART2_RX'''
<p>'''注意, linux5.4系统为/dev/ttyASx.'''</p>
+
| '''PI6'''
<p>orangepi@orangepi:~$ '''ls /dev/ttyS*'''</p>
+
| '''262'''
<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></li>
+
| '''<span style="color:#FF0000">24</span>'''
<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.</p>
+
| '''<span style="color:#FF0000">SPI1_CS0</span>'''
<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>
+
| '''<span style="color:#FF0000">PH5</span>'''
<p>orangepi@orangepi:~$ '''gpio serial /dev/ttySx # linux-6.1 test command'''</p>
+
| '''<span style="color:#FF0000">229</span>'''
<p>orangepi@orangepi:~$ '''gpio serial /dev/ttyASx # linux-5.4 test command'''</p>
+
|-
<p>Out: 0: -&gt; 0</p>
+
| '''<span style="color:#FF0000">26</span>'''
<p>Out: 1: -&gt; 1</p>
+
| '''<span style="color:#FF0000">SPI1_CS1</span>'''
<p>Out: 2: -&gt; 2</p>
+
| '''<span style="color:#FF0000">PH9</span>'''
<p>Out: 3: -&gt; 3^C</p></li>
+
| '''<span style="color:#FF0000">233</span>'''
<li><p>Finally, you can run the '''serialTest.py''' 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.'''</p>
+
| '''28'''
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p>
+
| '''TWI2-SCL/UART3_TX'''
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 serialTest.py --device &quot;/dev/ttySx&quot; # linux6.1 use'''</p>
+
| '''PI9'''
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 serialTest.py --device &quot;/dev/ttyASx&quot; # linux5.4 use'''</p>
+
| '''265'''
<p>Out: 0: -&gt; 0</p>
+
|-
<p>Out: 1: -&gt; 1</p>
+
| '''30'''
<p>Out: 2: -&gt; 2</p>
+
| '''GND'''
<p>Out: 3: -&gt; 3</p>
+
| style="text-align: left;"|
<p>Out: 4:^C</p>
+
| style="text-align: left;"|
<p>exit</p></li></ol>
+
|-
 
+
| '''32'''
<span id="hardware-watchdog-test"></span>
+
| '''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'''
 
+
| style="text-align: left;"|
<ol style="list-style-type: lower-alpha;">
+
| style="text-align: left;"|
<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>
+
|-
<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;keep alive&quot; to indicate that the dog feeding is successful.</p>
+
| '''36'''
<p>orangepi@orangepi:~$ '''sudo watchdog_test 10'''</p>
+
| style="text-align: left;"|
<p>open success</p>
+
| '''PC12'''
<p>options is 33152,identity is sunxi-wdt</p>
+
| '''76'''
<p>put_usr return,if 0,success:0</p>
+
|-
<p>The old reset time is: 16</p>
+
| '''38'''
<p>return ENOTTY,if -1,success:0</p>
+
| style="text-align: left;"|
<p>return ENOTTY,if -1,success:0</p>
+
| '''PI4'''
<p>put_user return,if 0,success:0</p>
+
| '''260'''
<p>put_usr return,if 0,success:0</p>
+
|-
<p>keep alive</p>
+
| '''40'''
<p>keep alive</p>
+
| style="text-align: left;"|
<p>keep alive</p></li></ol>
+
| '''PI3'''
 
+
| '''259'''
<span id="check-the-chipid-of-h618-chip"></span>
+
|}
== Check the chipid of H618 chip ==
+
</div>
  
The 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.
+
<ol start="2" style="list-style-type: decimal;">
 +
<li><p>In Linux systems, spi1 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-style-type: lower-alpha;">
 +
<li><p>First run '''orangepi-config'''. Ordinary users remember to add '''sudo''' permissions.</p>
 +
{| class="wikitable" style="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 figure below, and then use the '''space''' to select the dtbo configuration of the SPI you want to open.</p></li>
  
orangepi@orangepi:~$ '''cat /sys/class/sunxi_info/sys_info | grep &quot;chipid&quot;'''
+
{| class="wikitable" style="width:800px;text-align: center;"
 
+
|-
sunxi_chipid : 338020004c0048080147478824681ed1
+
| '''dtbo configuration'''
 
+
| '''illustrate'''
<span id="python-related-instructions"></span>
+
|-
== Python related instructions ==
+
| '''spi1-cs0-cs1-spidev'''
 
+
| '''Open cs0 and cs1 of spi1 at the same time'''
<span id="how-to-compile-and-install-python-source-code"></span>
+
|-
=== How to compile and install Python source code ===
+
| '''spi1-cs0-spidev'''
 
+
| '''Only open cs0 of spi1'''
'''If 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.'''
+
|-
 +
| '''spi1-cs1-spidev'''
 +
| '''Only open cs1 of spi1'''
 +
|}
 +
</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 make the configuration take effect.</p>
 +
<p>[[File:zero2w-img85.png]]</p></li></ol>
 +
</li></ol>
 +
<!-- -->
 +
<ol start="3" style="list-style-type: decimal;">
 +
<li><p>Then check whether there is a '''spidev1.x''' device node in the Linux system. If it exists, it means that the SPI1 configuration has taken effect.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''ls /dev/spidev1*'''</p>
 +
<p>/dev/spidev1.0 /dev/spidev1.1</p>
 +
|}
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''Note that only when you open spi1-cs0-cs1-spidev, you will see the device nodes of the two spi.'''</p></big>
 +
|}
 +
</li>
 +
<li><p>Then you can use the '''spidev_test.py''' program in examples to test the SPI loopback function. The '''spidev_test.py''' program needs to specify the following two parameters:</p>
 +
<ol style="list-style-type: lower-alpha;">
 +
<li><p>'''--channel''': Specify the channel number of SPI</p></li>
 +
<li><p>'''--port''': Specify the port number of the SPI</p></li></ol>
 +
</li>
 +
<li><p>Without shorting the mosi and miso pins of SPI1, the output result of running spidev_test.py is as follows. You can see that the data of TX and RX are inconsistent.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p>
 +
 
 +
root@orangepi:~/wiringOP-Python/examples# '''python3 spidev_test.py \'''
 +
 
 +
'''--channel 1 --port 0'''
  
'''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).'''
+
spi mode: 0x0
  
<ol style="list-style-type: decimal;">
+
max speed: 500000 Hz (500 KHz)
<li><p>First install the dependency packages needed to compile Python</p>
 
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
 
<p>orangepi@orangepi:~$ '''sudo apt-get install -y build-essential zlib1g-dev \'''</p>
 
<p>'''libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev \'''</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@orangepi:~$ '''wget \'''</p>
 
<p>[https://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''']</p>
 
<p>orangepi@orangepi:~$ '''tar xvf Python-3.9.10.tgz'''</p></li>
 
<li><p>Then run the configuration command</p>
 
<p>orangepi@orangepi:~$ '''cd Python-3.9.10'''</p>
 
<p>orangepi@orangepi:~$ '''./configure --enable-optimizations'''</p></li>
 
<li><p>Then compile and install Python3.9. The compilation time takes about half an hour.</p>
 
<p>orangepi@orangepi:~$ '''make -j4'''</p>
 
<p>orangepi@orangepi:~$ '''sudo make altinstall'''</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="how-to-replace-pip-source-in-python"></span>
+
Opening device /dev/spidev1.1
=== 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.'''
+
TX | FF FF FF FF FF FF '''<span style="color:#FF0000">40 00 00 00 00 95</span>''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…|
  
<ol style="list-style-type: decimal;">
+
RX | FF FF FF FF FF FF '''<span style="color:#FF0000">FF FF FF FF FF FF</span>''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |.............….|
<li><p>First install '''python3-pip'''</p>
+
|}
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
+
</li></ol>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y python3-pip'''</p></li>
+
<ol start="6" style="list-style-type: decimal;">
<li><p>How to permanently change the pip source under Linux</p>
+
<li><p>Then use Dupont wire to short-circuit the txd (pin 19 in the 40pin interface) and rxd (pin 21 in the 40pin interface) of SPI1 and then run spidev_test.py. The output is as follows, you can see If the data sent and received are the same, it means that the SPI1 loopback test is normal.</p>
<ol style="list-style-type: lower-alpha;">
+
{| class="wikitable" style="width:800px;"
<li><p>First create a new '''~/.pip''' directory, then add the &gt; '''pip.conf''' configuration file, 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>root@orangepi:~/wiringOP-Python# '''cd examples'''</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 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.edu.cn'''</p></li></ol>
 
  
<span id="how-to-install-docker"></span>
+
root@orangepi:~/wiringOP-Python/examples# '''python3 spidev_test.py \'''
== 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.
+
'''--channel 1 --port 0'''
  
orangepi@orangepi:~$ '''enable_docker.sh'''
+
spi mode: 0x0
  
You can use the following command to test docker. If '''hello-world''' can be run, docker can be used normally.
+
max speed: 500000 Hz (500 KHz)
  
orangepi@orangepi:~$ '''docker run hello-world'''
+
Opening device /dev/spidev1.1
  
Unable to find image 'hello-world:latest' locally
+
TX | FF FF FF FF FF FF '''<span style="color:#FF0000">40 00 00 00 00 95</span>''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…|
  
latest: Pulling from library/hello-world
+
RX | FF FF FF FF FF FF '''<span style="color:#FF0000">40 00 00 00 00 95</span>''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…|
 +
|}
 +
</li></ol>
 +
<span id="pin-i2c-test-1"></span>
  
256ab8fe8778: Pull complete
+
=== 40pin I2C test ===
  
Digest: sha256:7f0a9f93b4aa3022c3a4c147a449ef11e0941a1fd0bf4a8e6c9408b2600777c5
+
# As can be seen from the table below, the i2c available for the 40pin interface are i2c0, i2c1 and i2c2
  
Status: Downloaded newer image for hello-world:latest
+
<div style="display: flex;">
 
+
::{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
'''Hello from Docker!'''
+
|-
 
+
| '''GPIO NO.'''
'''This message shows that your installation appears to be working correctly.'''
+
| '''GPIO'''
 
+
| '''Function'''
'''.….'''
+
| '''Pin'''
 
+
|-
When using the docker command, if you are prompted for '''permission denied''', please add the current user to the docker user group so that you can run the docker command without sudo.
+
| style="text-align: left;"|
 
+
| style="text-align: left;"|
orangepi@orangepi:~$ '''sudo usermod -aG docker $USER'''
+
| '''3.3V'''
 
+
| '''1'''
'''Note: You need to log out and log in again to the system to take effect. You can also restart the system.'''
+
|-
 
+
| '''<span style="color:#FF0000">264</span>'''
<span id="how-to-install-home-assistant"></span>
+
| '''<span style="color:#FF0000">PI8</span>'''
== How to install Home Assistant ==
+
| '''<span style="color:#FF0000">TWI1-SDA</span>'''
 
+
| '''<span style="color:#FF0000">3</span>'''
'''Note that this article will only provide methods for installing Home Assistant in Ubuntu or Debian systems. For detailed usage of Home Assistant, please refer to the official documentation or corresponding books.'''
+
|-
 
+
| '''<span style="color:#FF0000">263</span>'''
<span id="installation-via-docker"></span>
+
| '''<span style="color:#FF0000">v</span>'''
=== Installation via docker ===
+
| '''<span style="color:#FF0000">TWI1-SCL</span>'''
 
+
| '''<span style="color:#FF0000">5</span>'''
<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 to Install Docker''']] section.</p></li>
+
| '''269'''
<li><p>Then you can search for the docker image of Home Assistant</p>
+
| '''PI13'''
<p>orangepi@orangepi:~$ '''docker search homeassistant'''</p></li>
+
| '''PWM3/UART4_TX'''
<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>
+
| '''7'''
<p>orangepi@orangepi:~$ '''docker pull homeassistant/home-assistant'''</p>
+
|-
<p>Using default tag: latest</p>
+
| style="text-align: left;"|
<p>latest: Pulling from homeassistant/home-assistant</p>
+
| style="text-align: left;"|
<p>be307f383ecc: Downloading</p>
+
| '''GND'''
<p>5fbc4c07ac88: Download complete</p>
+
| '''9'''
<p>'''...... (Omit some output)'''</p>
+
|-
<p>3cc6a1510c9f: Pull complete</p>
+
| '''226'''
<p>7a4e4d5b979f: Pull complete</p>
+
| '''PH2'''
<p>Digest: sha256:81d381f5008c082a37da97d8b08dd8b358dae7ecf49e62ce3ef1eeaefc4381bb</p>
+
| '''UART5_TX'''
<p>Status: Downloaded newer image for homeassistant/home-assistant:latest</p>
+
| '''11'''
<p>docker.io/homeassistant/home-assistant:latest</p></li>
+
|-
<li><p>Then you can use the following command to view the docker image of Home Assistant you just downloaded</p>
+
| '''227'''
<p>orangepi@orangepi:~$ '''docker images homeassistant/home-assistant'''</p>
+
| '''PH3'''
<p>REPOSITORY TAG IMAGE ID CREATED SIZE</p>
+
| '''UART5_RX'''
<p>homeassistant/home-assistant latest bfa0ab9e1cf5 2 months ago '''1.17GB'''</p></li>
+
| '''13'''
<li><p>At this point you can run the Home Assistant docker container</p>
+
|-
<p>orangepi@orangepi:~$ '''docker run -d \'''</p>
+
| '''<span style="color:#FF0000">261</span>'''
<p>'''--name homeassistant \'''</p>
+
| '''<span style="color:#FF0000">PI5</span>'''
<p>'''--privileged \'''</p>
+
| '''<span style="color:#FF0000">TWI0_SCL</span>/UART2_TX'''
<p>'''--restart=unless-stopped \'''</p>
+
| '''<span style="color:#FF0000">15</span>'''
<p>'''-e TZ=Asia/Shanghai \'''</p>
+
|-
<p>'''-v /home/orangepi/home-assistant:/config \'''</p>
+
| style="text-align: left;"|
<p>'''--network=host \'''</p>
+
| style="text-align: left;"|
<p>'''homeassistant/home-assistant:latest'''</p></li>
+
| '''3.3V'''
<li><p>Then enter【the IP address of the development board: 8123】in the browser to see the Home Assistant interface</p>
+
| '''17'''
<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 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.'''</p>
+
|-
<div class="figure">
+
| '''231'''
 
+
| '''PH7'''
[[File:media/image180.png|576x210px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-18.jpg未标题-18]]
+
| '''SPI1_MOSI'''
 
+
| '''19'''
</div></li>
+
|-
<li><p>Then enter your '''name, username''' and '''password''' and click '''Create Account'''</p>
+
| '''232'''
<div class="figure">
+
| '''PH8'''
 
+
| '''SPI1_MISO'''
[[File:media/image181.png|251x330px|IMG_256]]
+
| '''21'''
 
+
|-
</div></li>
+
| '''230'''
<li><p>Then follow the interface prompts to set according to your own preferences, and then click Next</p>
+
| '''PH6'''
<div class="figure">
+
| '''SPI1_CLK'''
 
+
| '''23'''
[[File:media/image182.png|575x297px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-19.png未标题-19]]
+
|-
 
+
| style="text-align: left;"|
</div></li>
+
| style="text-align: left;"|
<li><p>Then click Next</p>
+
| '''GND'''
<div class="figure">
+
| '''25'''
 
+
|-
[[File:media/image183.png|576x185px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-24.jpg未标题-24]]
+
| '''<span style="color:#FF0000">266</span>'''
 
+
| '''<span style="color:#FF0000">PI10</span>'''
</div></li>
+
| '''<span style="color:#FF0000">TWI2-SDA</span>/UART3_RX'''
<li><p>Then click Finish</p>
+
| '''<span style="color:#FF0000">27</span>'''
<div class="figure">
+
|-
 
+
| '''256'''
[[File:media/image184.png|577x157px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-20.jpg未标题-20]]
+
| '''PI0'''
 
+
| style="text-align: left;"|
</div></li>
+
| '''29'''
<li><p>The main interface finally displayed by Home Assistant is as shown below</p>
+
|-
<p>[[File:media/image185.png|576x264px]]</p></li>
+
| '''271'''
<li><p>Method to stop Home Assistant container</p>
+
| '''PI15'''
<ol style="list-style-type: lower-alpha;">
+
| style="text-align: left;"|
<li><p>The command to view the docker container is as follows</p>
+
| '''31'''
<p>orangepi@orangepi:~$ '''docker ps -a'''</p></li>
+
|-
<li><p>The command to stop the Home Assistant container is as follows</p>
+
| '''268'''
<p>orangepi@orangepi:~$ '''docker stop homeassistant'''</p></li>
+
| '''PI12'''
<li><p>The command to delete the Home Assistant container is as follows</p>
+
| '''PWM2'''
<p>orangepi@orangepi:~$ '''docker rm homeassistant'''</p></li></ol>
+
| '''33'''
</li></ol>
+
|-
 
+
| '''258'''
<span id="installation-via-python"></span>
+
| '''PI2'''
=== Installation via python ===
+
| style="text-align: left;"|
 
+
| '''35'''
'''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;'''
+
|-
 
+
| '''272'''
<ol style="list-style-type: decimal;">
+
| '''PI16'''
<li><p>First install dependency packages</p>
+
| style="text-align: left;"|
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
+
| '''37'''
<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>
+
| style="text-align: left;"|
<p>'''libopenjp2-7 libtiff5 libturbojpeg0-dev tzdata'''</p>
+
| style="text-align: left;"|
<p>'''If it is debian12, please use the following command:'''</p>
+
| '''GND'''
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
+
| '''39'''
<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>
+
{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
<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>
+
| '''Pin'''
<p>'''The default Python version of Debian Bullseye is Python3.9, so there is no need to compile and install it.'''</p>
+
| '''Function'''
<p>'''The default Python version of Ubuntu Jammy is Python3.10, so there is no need to compile and install it.'''</p>
+
| '''GPIO'''
<p>'''The default Python version of Debian Bookworm is Python3.11, so there is no need to compile and install it.'''</p></li>
+
| '''GPIO NO.'''
<li><p>Then create a Python virtual environment</p>
+
|-
<p>'''Debian Bookworm is python3.11, please remember to replace the corresponding command.'''</p>
+
| '''2'''
<p>orangepi@orangepi:~$ '''sudo mkdir /srv/homeassistant'''</p>
+
| '''5V'''
<p>orangepi@orangepi:~$ '''sudo chown orangepi:orangepi /srv/homeassistant'''</p>
+
| style="text-align: left;"|
<p>orangepi@orangepi:~$ '''cd /srv/homeassistant'''</p>
+
| style="text-align: left;"|
<p>orangepi@orangepi:~$ '''python3.9 -m venv .'''</p>
+
|-
<p>orangepi@orangepi:~$ '''source bin/activate'''</p>
+
| '''4'''
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$</p></li>
+
| '''5V'''
<li><p>Then install the required Python packages</p>
+
| style="text-align: left;"|
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''python3 -m pip install wheel'''</p></li>
+
| style="text-align: left;"|
<li><p>Then you can install Home Assistant Core</p>
+
|-
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''pip3 install homeassistant'''</p></li>
+
| '''6'''
<li><p>Then enter the following command to run Home Assistant Core</p>
+
| '''GND'''
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''hass'''</p></li>
+
| style="text-align: left;"|
<li><p>Then enter【'''development board IP address: 8123'''】 in the browser to see the Home Assistant interface</p>
+
| style="text-align: left;"|
<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">
+
| '''8'''
 
+
| '''UART0_TX'''
[[File:media/image180.png|571x208px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-18.jpg未标题-18]]
+
| '''PH0'''
 
+
| '''224'''
</div></li></ol>
+
|-
 
+
| '''10'''
<span id="opencv-installation-method"></span>
+
| '''UART0_RX'''
== OpenCV installation method ==
+
| '''PH1'''
 
+
| '''225'''
<span id="use-apt-to-install-opencv"></span>
+
|-
=== Use apt to install OpenCV ===
+
| '''12'''
 
+
| style="text-align: left;"|
<ol style="list-style-type: decimal;">
+
| '''PI1'''
<li><p>The installation command is as follows</p>
+
| '''257'''
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
+
|-
<p>orangepi@orangepi:~$ '''sudo apt-get install -y libopencv-dev python3-opencv'''</p></li>
+
| '''14'''
<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>
+
| '''GND'''
<ol style="list-style-type: lower-alpha;">
+
| style="text-align: left;"|
<li><p>The version of OpenCV in Ubuntu22.04 is as follows:</p>
+
| style="text-align: left;"|
<p>orangepi@orangepi:~$ '''python3 -c &quot;import cv2; print(cv2.__version__)&quot;'''</p>
+
|-
<p>'''4.5.4'''</p></li>
+
| '''16'''
<li><p>The version of OpenCV in Ubuntu20.04 is as follows:</p>
+
| '''PWM4/UART4_RX'''
<p>orangepi@orangepi:~$ '''python3 -c &quot;import cv2; print(cv2.__version__)&quot;'''</p>
+
| '''PI14'''
<p>'''4.2.0'''</p></li>
+
| '''270'''
<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>
+
| '''18'''
<p>'''4.5.1'''</p></li>
+
| style="text-align: left;"|
<li><p>The version of OpenCV in Debian12 is as follows:</p>
+
| '''PH4'''
<p>orangepi@orangepi:~$ '''python3 -c &quot;import cv2; print(cv2.__version__)&quot;'''</p>
+
| '''228'''
<p>'''4.6.0'''</p></li></ol>
+
|-
</li></ol>
+
| '''20'''
 
+
| '''GND'''
<span id="set-up-the-chinese-environment-and-install-the-chinese-input-method"></span>
+
| style="text-align: left;"|
== Set up the Chinese environment and install the Chinese input method ==
+
| style="text-align: left;"|
 
+
|-
'''Note, before installing the Chinese input method, please make sure that the Linux system used by the development board is a desktop version.'''
+
| '''<span style="color:#FF0000">22</span>'''
 
+
| '''<span style="color:#FF0000">TWI0_SDA</span>/UART2_RX'''
<span id="debian-system-installation-method"></span>
+
| '''<span style="color:#FF0000">PI6</span>'''
=== Debian system installation method ===
+
| '''<span style="color:#FF0000">262</span>'''
 
+
|-
<ol style="list-style-type: decimal;">
+
| '''24'''
<li><p>First set the default '''locale''' to Chinese</p>
+
| '''SPI1_CS0'''
<ol style="list-style-type: lower-alpha;">
+
| '''PH5'''
<li><p>Enter the following command to start configuring '''locale'''</p>
+
| '''229'''
<p>orangepi@orangepi:~$ '''sudo dpkg-reconfigure locales'''</p></li>
+
|-
<li><p>Then select '''zh_CN.UTF-8 UTF-8''' in the pop-up interface (use &gt; 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>
+
| '''26'''
<p>[[File:media/image186.png|575x296px]]</p></li>
+
| '''SPI1_CS1'''
<li><p>Then set the default '''locale''' to '''zh_CN.UTF-8'''</p>
+
| '''PH9'''
<p>[[File:media/image187.png|575x160px]]</p></li>
+
| '''233'''
<li><p>After exiting the interface, the '''locale''' setting will begin. &gt; The output displayed on the command line is as follows:</p>
+
|-
<p>orangepi@orangepi:~$ '''sudo dpkg-reconfigure locales'''</p>
+
| '''<span style="color:#FF0000">28</span>'''
<p>Generating locales (this might take a while)...</p>
+
| '''<span style="color:#FF0000">TWI2-SCL</span>/UART3_TX'''
<p>en_US.UTF-8... done</p>
+
| '''<span style="color:#FF0000">PI9</span>'''
<p>zh_CN.UTF-8... done</p>
+
| '''<span style="color:#FF0000">265</span>'''
<p>Generation complete.</p></li></ol>
+
|-
</li>
+
| '''30'''
<li><p>Then open '''Input Method'''</p>
+
| '''GND'''
<p>[[File:media/image188.png|575x361px]]</p></li>
+
| style="text-align: left;"|
<li><p>Then select '''OK'''</p>
+
| style="text-align: left;"|
<p>[[File:media/image189.png|295x212px]]</p></li>
+
|-
<li><p>Then select '''Yes'''</p>
+
| '''32'''
<p>[[File:media/image190.png|303x192px]]</p></li>
+
| '''PWM1'''
<li><p>Then select '''fcitx'''</p>
+
| '''PI11'''
<p>[[File:media/image191.png|307x220px]]</p></li>
+
| '''267'''
<li><p>Then select '''OK'''</p>
+
|-
<p>[[File:media/image192.png|305x216px]]</p></li>
+
| '''34'''
<li><p>'''Then restart the Linux system to make the configuration take effect.'''</p></li>
+
| '''GND'''
<li><p>Then open '''Fcitx configuration'''</p>
+
| style="text-align: left;"|
<p>[[File:media/image193.png|575x376px]]</p></li>
+
| style="text-align: left;"|
<li><p>Then click the + sign as shown in the picture below</p>
+
|-
<p>[[File:media/image194.png|280x187px]]</p></li>
+
| '''36'''
<li><p>Then search '''Google Pinyin''' and click '''OK'''</p>
+
| style="text-align: left;"|
<div class="figure">
+
| '''PC12'''
 
+
| '''76'''
[[File:media/image195.png|291x196px|C:\Users\orangepi\Desktop\用户手册插图\Pi5 Plus\未标题-10.jpg未标题-10]]
+
|-
 
+
| '''38'''
</div></li>
+
| style="text-align: left;"|
<li><p>Then put '''Google Pinyin''' on top</p>
+
| '''PI4'''
<p>[[File:media/image196.png|299x202px]]</p>
+
| '''260'''
<p>[[File:media/image197.png|300x202px]]</p></li>
+
|-
<li><p>Then open the '''Geany''' editor to test the Chinese input method</p>
+
| '''40'''
<p>[[File:media/image198.png|349x212px]]</p></li>
+
| style="text-align: left;"|
<li><p>The Chinese input method test is as follows</p>
+
| '''PI3'''
<p>[[File:media/image199.png|575x325px]]</p></li>
+
| '''259'''
<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>
+
</div>
<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:media/image200.png|576x356px]]</p></li></ol>
 
 
 
<span id="installation-method-of-ubuntu-20.04-system"></span>
 
=== Installation method of Ubuntu 20.04 system ===
 
 
 
<ol style="list-style-type: decimal;">
 
<li><p>First open '''Language Support'''</p>
 
<p>[[File:media/image201.png|575x351px]]</p></li>
 
<li><p>Then find the '''Chinese (China)''' option</p>
 
<p>[[File:media/image202.png|318x311px]]</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:media/image203.png|324x320px]]</p></li></ol>
 
  
'''Note that this step is not easy to drag, please be patient and try it a few times.'''
+
<ol start="2" style="list-style-type: decimal;">
 +
<li><p>i2c is turned off by default in Linux systems and needs to be turned on manually to use it. The opening steps are as follows:</p>
 +
<ol style="list-style-type: lower-alpha;">
 +
<li><p>First run '''orangepi-config'''. Ordinary users remember to add '''sudo''' permissions.</p>
 +
{| class="wikitable" style="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 corresponding i2c configuration in the picture below.</p></li>
  
<ol start="4" style="list-style-type: decimal;">
+
{| class="wikitable" style="width:800px;text-align: center;"
<li><p>Then select '''Apply System-Wide''' to apply the Chinese settings to the entire system</p>
+
|-
<p>[[File:media/image204.png|321x316px]]</p></li>
+
| '''Multiplexing function in 40pin'''
<li><p>Then set the '''Keyboard input method system''' system to '''fcitx'''</p>
+
| '''Corresponding dtbo configuration'''
<p>[[File:media/image205.png|327x320px]]</p></li>
+
|-
<li><p>'''Then restart the Linux system to make the configuration take effect'''</p></li>
+
| '''40pin - i2c0'''
<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>
+
| '''pi-i2c0'''
<p>[[File:media/image206.png|303x247px]]</p></li>
+
|-
<li><p>Then you can see that the desktop is displayed in Chinese</p>
+
| '''40pin - i2c1'''
<p>[[File:media/image207.png|575x383px]]</p></li>
+
| '''pi-i2c1'''
<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:media/image208.png|576x292px]]</p></li>
+
| '''40pin - i2c2'''
<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>
+
| '''pi-i2c2'''
<p>[[File:media/image209.png|575x308px]]</p></li></ol>
+
|}
 +
 
 +
[[File:zero2w-img173.png]]
 +
</ol>
 +
<ol start="5" style="list-style-type: lower-alpha;">
 +
<li><p>Then select <span class="mark">&lt;Save&gt;</span> to save</p>
 +
<p>[[File:zero2w-img83.png]]</p></li>
 +
<li><p>Then select <span class="mark">&lt;Back&gt;</span></p>
 +
<p>[[File:zero2w-img84.png]]</p></li>
 +
<li><p>Then select <span class="mark">&lt;Reboot&gt;</span> to restart the system to make the configuration take effect.</p>
 +
<p>[[File:zero2w-img85.png]]</p></li></ol>
 +
</li></ol>
 +
<!-- -->
 +
<ol start="3" style="list-style-type: decimal;">
 +
<li><p>After starting the Linux system, first confirm that there is an open i2c device node under <span class="mark">/dev</span></p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''ls /dev/i2c-*'''</p>
 +
<p>'''/dev/i2c-*'''</p>
 +
|}
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|  
 +
<big>'''注意,这里说的Linux镜像具体指的是从Orange Pi资料下载页面下载的Debian或者Ubuntu这样的Linux发行版镜像。'''</big>
 +
|}
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''Sometimes the i2c device node and the i2c bus serial number do not correspond one to one. For example, the i2c device node of the i2c1 bus may be /dev/i2c-3.'''</p>
 +
<p>'''The method to accurately confirm the device node under /dev corresponding to the i2c bus is: '''</p></big>
  
<span id="installation-method-of-ubuntu-22.04-system"></span>
 
=== Installation method of Ubuntu 22.04 system ===
 
  
<ol style="list-style-type: decimal;">
+
<ol style="list-style-type: lower-alpha;">
<li><p>First open '''Language Support'''</p>
+
<li><p>'''First run the following command to check the corresponding relationship of i2c'''</p>
<p>[[File:media/image201.png|575x351px]]</p></li>
+
<p>orangepi@orangepizero2w:~$ '''ls /sys/devices/platform/soc*/*/i2c-* | grep &quot;i2c-[0-9]&quot;'''</p>
<li><p>Then find the '''Chinese (China)''' option</p>
+
<p>/sys/devices/platform/soc/5002000.i2c/i2c-0:</p>
<p>[[File:media/image210.png|249x242px]]</p></li>
+
<p>/sys/devices/platform/soc/5002400.i2c/i2c-3:</p>
<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>/sys/devices/platform/soc/5002800.i2c/i2c-4:</p>
<p>[[File:media/image211.png|267x262px]]</p></li></ol>
+
<p>/sys/devices/platform/soc/5002c00.i2c/i2c-5:</p>
 +
<p>/sys/devices/platform/soc/6000000.hdmi/i2c-2:</p>
 +
<p>/sys/devices/platform/soc/7081400.i2c/i2c-1:</p></li>
  
'''Note that this step is not easy to drag, please be patient and try it a few times.'''
 
  
 +
<li><p>'''In the above output'''</p>
 +
<ol style="list-style-type: none;">
 +
<li><p>a) 5002000 is the register base address of the i2c0 bus, and i2c-0 shown behind it is its corresponding i2c device node</p></li>
 +
<li><p>b) 5002400 is the register base address of the i2c1 bus, and i2c-3 shown behind it is its corresponding i2c device node</p></li>
 +
<li><p>c) 5002800 is the register base address of the i2c2 bus, and i2c-4 shown behind it is its corresponding i2c device node</p></li></ol>
 +
</li></ol>
 +
|}
 +
</li></ol>
 
<ol start="4" style="list-style-type: decimal;">
 
<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>
+
<li><p>Then start testing i2c, first install i2c-tools</p>
<p>[[File:media/image212.png|287x282px]]</p></li>
+
{| class="wikitable" style="width:800px;"
<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:media/image206.png|303x247px]]</p></li>
+
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<li><p>Then you can see that the desktop is displayed in Chinese</p>
+
<p>orangepi@orangepi:~$ '''sudo''' '''apt-get install -y i2c-tools'''</p>
<p>[[File:media/image207.png|575x383px]]</p></li>
+
|}
<li><p>Then open the Fcitx5 configuration program</p>
+
</li>
<p>[[File:media/image213.png|575x349px]]</p></li>
+
<li><p>Then connect an i2c device to the i2c pin of the 40pin connector. Here we take the DS1307 RTC module as an example.</p>
<li><p>Then choose to use Pinyin input method</p>
+
<p>[[File:zero2w-img178.png]]</p></li>
<div class="figure">
+
<li><p>Then use the '''i2cdetect -y x'''command. If the address of the connected i2c device can be detected, it means that the i2c device is connected correctly.</p>
 
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"  
[[File:media/image214.png|338x267px|C:\Users\orangepi\Desktop\用户手册插图\Pi5 Plus\未标题-11.jpg未标题-11]]
+
|-
 
+
|  
</div></li>
+
<big>'''<p>'''Note that x in the i2cdetect -y x command needs to be replaced with the serial number of the device node corresponding to the i2c bus.'''</p>'''</big>
<li><p>The interface after selection is as shown below, then click OK</p>
+
|}
<p>[[File:media/image215.png|366x290px]]</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:media/image208.png|576x292px]]</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:media/image216.png|434x308px]]</p></li></ol>
 
  
<span id="how-to-remotely-log-in-to-the-linux-system-desktop"></span>
+
[[File:zero2w-img179.png]]
== How to remotely log in to the Linux system desktop ==
+
</li></ol>
 
+
<ol start="7" style="list-style-type: decimal;">
<span id="remote-login-using-nomachine"></span>
+
<li><p>Then you can run the '''ds1307.py''' test program in '''examples''' to read the RTC time</p>
=== Remote login using NoMachine ===
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
+
|-
'''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. The document link is as follows:'''
+
|
 
+
<big><p>'''Note that the x in i2c-x in the following command needs to be replaced with the serial number of the device node corresponding to the i2c bus.'''</p></big>
'''https://knowledgebase.nomachine.com/DT10R00166'''
+
|}
 
+
{| class="wikitable" style="width:800px;"  
'''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>root@orangepi:~/wiringOP-Python# '''cd examples'''</p>
 
+
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 ds1307.py --device \'''</p>
<ol style="list-style-type: decimal;">
+
<p>'''&quot;/dev/i2c-x&quot;'''</p>
<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 board</p>
+
<p>Thu 2022-06-16 04:35:46</p>
<ol style="list-style-type: lower-alpha;">
+
<p>Thu 2022-06-16 04:35:47</p>
<li>Since H618 is an ARMv8 architecture SOC and the system we use is &gt; Ubuntu or Debian, we need to download the '''NoMachine for ARM &gt; ARMv8 DEB''' installation package. The download link is as &gt; follows:</li></ol>
+
<p>Thu 2022-06-16 04:35:48</p>
 +
<p>^C</p>
 +
<p>exit</p>
 +
|}
 
</li></ol>
 
</li></ol>
  
'''Note that this download link may change, please look for the Armv8/Arm64 version of the deb package.'''
+
<span id="pin-uart-test-1"></span>
  
[https://www.nomachine.com/download/download&id=112&s=ARM '''https://downloads.nomachine.com/download/?id=118&amp;distro=ARM''']
+
=== 40pin UART test ===
  
[[File:media/image217.png|575x227px]]
+
# 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.
 
 
<ol start="2" style="list-style-type: lower-alpha;">
 
<li><p>In addition, you can also download the '''NoMachine''' installation &gt; package from the official tool.</p>
 
<p>[[File:media/image218.png|66x102px]]</p>
 
<p>First enter the '''remote login software-NoMachine''' folder</p>
 
<p>[[File:media/image219.png|271x43px]]</p>
 
<p>Then download the arm64 version of the deb installation package</p>
 
<p>[[File:media/image220.png|180x109px]]</p></li>
 
<li><p>Then upload the downloaded '''nomachine_x.x.x_x_arm64.deb''' to the &gt; Linux system of the development board</p></li>
 
<li><p>Then use the following command to install '''NoMachine''' in the Linux &gt; system of the development board</p>
 
<p>orangepi@orangepi:~$ '''sudo dpkg -i nomachine_x.x.x_x_arm64_arm64.deb'''</p></li></ol>
 
 
 
<!-- -->
 
<ol start="2" style="list-style-type: decimal;">
 
<li>Then download the installation package of the Windows version of the NoMachine software. The download address is as follows</li></ol>
 
 
 
'''Note that this download link may change.'''
 
 
 
'''https://downloads.nomachine.com/download/?id=9'''
 
 
 
[[File:media/image221.png|575x163px]]
 
 
 
<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</p>
 
<p>[[File:media/image222.png|76x66px]]</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:media/image223.png|321x92px]]</p></li>
 
<li><p>Then click '''OK'''</p>
 
<p>[[File:media/image224.png|318x217px]]</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:media/image225.png|303x204px]]</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:media/image226.png|411x246px]]</p></li></ol>
 
 
 
<span id="remote-login-using-vnc"></span>
 
=== Remote login using VNC ===
 
 
 
'''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'''s</p>
 
<p>orangepi@orangepi:~$ '''sudo set_vnc.sh'''</p>
 
<p>You will require a password to access your desktops.</p>
 
<p>Password: '''#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 view-only password (y/n)? '''n'''</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 use MobaXterm software to connect to the development board Linux system desktop are as follows:</p>
 
<ol style="list-style-type: lower-alpha;">
 
<li>First click Session, then select VNC, then fill in the IP &gt; address and port of the development board, and finally click &gt; OK to confirm.</li></ol>
 
</li></ol>
 
 
 
<div class="figure">
 
 
 
[[File:media/image227.png|490x349px|图片1208]]
 
 
 
</div>
 
<ol start="2" style="list-style-type: lower-alpha;">
 
<li><p>Then enter the VNC password set earlier</p>
 
<p>[[File:media/image228.png|221x105px]]</p></li>
 
<li><p>After successful login, the interface is displayed as shown below, &gt; and then you can remotely operate the desktop of the development &gt; board Linux system.</p></li></ol>
 
 
 
[[File:media/image229.png|405x293px]]
 
 
 
<span id="qt-installation-method"></span>
 
== QT installation method ==
 
 
 
<ol style="list-style-type: decimal;">
 
<li><p>Use the following script to install QT5 and QT Creator</p>
 
<p>orangepi@orangepi:~$ '''install_qt.sh'''</p></li>
 
<li><p>After installation, the QT version number will be automatically printed.</p>
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>The qt version that comes with Ubuntu20.04 is '''5.12.8'''</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:~$ '''install_qt.sh'''</p>
 
<p>......</p>
 
<p>QMake version 3.1</p>
 
<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-linux-gnu</p></li>
 
<li><p>The QT version that comes with Debian12 is '''5.15.8'''</p>
 
<p>orangepi@orangepi:~$ '''install_qt.sh'''</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 '''Applications'''</p>
 
<p>[[File:media/image230.png|576x270px]]</p>
 
<p>You can also use the following command to open QT Creator</p>
 
<p>orangepi@orangepi:~$ '''qtcreator'''</p></li>
 
<li><p>The interface after QT Creator is opened is as follows</p>
 
<p>[[File:media/image231.png|576x342px]]</p></li>
 
<li><p>The version of QT Creator is as follows</p>
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>The default version of QT Creator in '''Ubuntu20.04''' is as &gt; follows</p>
 
<p>[[File:media/image232.png|419x224px]]</p></li>
 
<li><p>The default version of QT Creator in '''Ubuntu22.04''' is as &gt; follows</p>
 
<p>[[File:media/image233.png|443x237px]]</p></li>
 
<li><p>The default version of QT Creator in '''Debian11''' is as follows</p>
 
<p>[[File:media/image234.png|444x238px]]</p></li>
 
<li><p>The default version of QT Creator in '''Debian12''' is as follows</p>
 
<p>[[File:media/image235.png|449x277px]]</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...'''.</p>
 
<p>[[File:media/image236.png|573x164px]]</p></li>
 
<li><p>Then remove the check mark of '''ClangCodeModel'''</p>
 
<p>[[File:media/image237.png|408x254px]]</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>'''Debian12 please skip this step.'''</p>
 
<p>[[File:media/image238.png|576x315px]]</p>
 
<p>[[File:media/image239.png|575x307px]]</p></li></ol>
 
</li>
 
<li><p>Then you can open a sample code</p>
 
<p>[[File:media/image240.png|575x312px]]</p></li>
 
<li><p>After clicking on the sample code, the corresponding instruction document will automatically open. You can read the instructions carefully.</p>
 
<p>[[File:media/image241.png|576x218px]]</p></li>
 
<li><p>Then click '''Configure Project'''</p>
 
<p>[[File:media/image242.png|575x304px]]</p></li>
 
<li><p>Then click the green triangle in the lower left corner to compile and run the sample code</p>
 
<p>[[File:media/image243.png|575x312px]]</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>[[File:media/image244.png|576x308px]]</p></li>
 
<li><p>References</p>
 
<p>[https://wiki.qt.io/Install_Qt_5_on_Ubuntu '''https://wiki.qt.io/Install_Qt_5_on_Ubuntu''']</p>
 
<p>[https://download.qt.io/archive/qtcreator '''https://download.qt.io/archive/qtcreator''']</p>
 
<p>[https://download.qt.io/archive/qt '''https://download.qt.io/archive/qt''']</p></li></ol>
 
 
 
<span id="ros-installation-method"></span>
 
== ROS installation method ==
 
 
 
<span id="how-to-install-ros-1-noetic-on-ubuntu20.04"></span>
 
=== 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:media/image245.png|345x235px]]
 
 
 
[[File:media/image246.png|576x210px]]
 
 
 
[http://docs.ros.org/ '''http://docs.ros.org''']
 
 
 
'''https://wiki.ros.org/Distributions'''
 
 
 
<ol start="2" style="list-style-type: decimal;">
 
<li><p>The link to the official installation documentation of ROS 1 '''Noetic Ninjemys''' is as follows:</p>
 
<p>[http://wiki.ros.org/noetic/Installation/Ubuntu '''http://wiki.ros.org/noetic/Installation/Ubuntu''']</p></li>
 
<li><p>In the official installation documentation of ROS '''Noetic Ninjemys''', Ubuntu recommends using Ubuntu20.04, so please ensure that the system used by the development board is '''Ubuntu20.04 desktop system'''.</p>
 
<p>[http://wiki.ros.org/noetic/Installation '''http://wiki.ros.org/noetic/Installation''']</p>
 
<p>[[File:media/image247.png|312x176px]]</p></li>
 
<li><p>Then use the script below to install ros1</p>
 
<p>orangepi@orangepi:~$ '''install_ros.sh ros1'''</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 in ROS.</p></li></ol>
 
 
 
'''Note that when running 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 /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.'''
 
 
 
'''https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml'''
 
 
 
'''Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml'''
 
 
 
'''ERROR: error loading sources list:'''
 
 
 
'''The read operation timed out'''
 
 
 
orangepi@orangepi:~$ '''source /opt/ros/noetic/setup.bash'''
 
 
 
orangepi@orangepi:~$ '''sudo rosdep init'''
 
 
 
Wrote /etc/ros/rosdep/sources.list.d/20-default.list
 
 
 
Recommended: please run
 
 
 
rosdep update
 
 
 
orangepi@orangepi:~$ '''rosdep update'''
 
 
 
reading in sources list data from /etc/ros/rosdep/sources.list.d
 
 
 
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
 
 
 
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
 
 
 
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
 
 
 
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
 
 
 
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
 
 
 
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
 
 
 
Skip end-of-life distro &quot;ardent&quot;
 
 
 
Skip end-of-life distro &quot;bouncy&quot;
 
 
 
Skip end-of-life distro &quot;crystal&quot;
 
 
 
Skip end-of-life distro &quot;dashing&quot;
 
 
 
Skip end-of-life distro &quot;eloquent&quot;
 
 
 
Add distro &quot;foxy&quot;
 
 
 
Add distro &quot;galactic&quot;
 
 
 
Skip end-of-life distro &quot;groovy&quot;
 
 
 
Add distro &quot;humble&quot;
 
 
 
Skip end-of-life distro &quot;hydro&quot;
 
 
 
Skip end-of-life distro &quot;indigo&quot;
 
 
 
Skip end-of-life distro &quot;jade&quot;
 
 
 
Skip end-of-life distro &quot;kinetic&quot;
 
 
 
Skip end-of-life distro &quot;lunar&quot;
 
 
 
Add distro &quot;melodic&quot;
 
 
 
Add distro &quot;noetic&quot;
 
 
 
Add distro &quot;rolling&quot;
 
 
 
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:media/image248.png|575x291px]]</p></li>
 
<li><p>Then please keep the terminal window you just opened at the top</p></li></ol>
 
 
 
<div class="figure">
 
 
 
[[File:media/image249.png|575x269px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-5.jpg未标题-5]]
 
  
 +
<div style="display: flex;">
 +
::{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
 +
|-
 +
| '''GPIO NO.'''
 +
| '''GPIO'''
 +
| '''Function'''
 +
| '''Pin'''
 +
|-
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
| '''3.3V'''
 +
| '''1'''
 +
|-
 +
| '''264'''
 +
| '''PI8'''
 +
| '''TWI1-SDA'''
 +
| '''3'''
 +
|-
 +
| '''263'''
 +
| '''PI7'''
 +
| '''TWI1-SCL'''
 +
| '''5'''
 +
|-
 +
| '''269'''
 +
| '''PI13'''
 +
| '''PWM3/UART4_TX'''
 +
| '''7'''
 +
|-
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
| '''GND'''
 +
| '''9'''
 +
|-
 +
| '''226'''
 +
| '''PH2'''
 +
| '''UART5_TX'''
 +
| '''11'''
 +
|-
 +
| '''227'''
 +
| '''PH3'''
 +
| '''UART5_RX'''
 +
| '''13'''
 +
|-
 +
| '''261'''
 +
| '''PI5'''
 +
| '''TWI0_SCL/UART2_TX'''
 +
| '''15'''
 +
|-
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
| '''3.3V'''
 +
| '''17'''
 +
|-
 +
| '''231'''
 +
| '''PH7'''
 +
| '''SPI1_MOSI'''
 +
| '''19'''
 +
|-
 +
| '''232'''
 +
| '''PH8'''
 +
| '''SPI1_MISO'''
 +
| '''21'''
 +
|-
 +
| '''230'''
 +
| '''PH6'''
 +
| '''SPI1_CLK'''
 +
| '''23'''
 +
|-
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
| '''GND'''
 +
| '''25'''
 +
|-
 +
| '''266'''
 +
| '''PI10'''
 +
| '''TWI2-SDA/UART3_RX'''
 +
| '''27'''
 +
|-
 +
| '''256'''
 +
| '''PI0'''
 +
| style="text-align: left;"|
 +
| '''29'''
 +
|-
 +
| '''271'''
 +
| '''PI15'''
 +
| style="text-align: left;"|
 +
| '''31'''
 +
|-
 +
| '''268'''
 +
| '''PI12'''
 +
| '''PWM2'''
 +
| '''33'''
 +
|-
 +
| '''258'''
 +
| '''PI2'''
 +
| style="text-align: left;"|
 +
| '''35'''
 +
|-
 +
| '''272'''
 +
| '''PI16'''
 +
| style="text-align: left;"|
 +
| '''37'''
 +
|-
 +
| style="text-align: left;"|
 +
| 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'''
 +
| '''5V'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''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'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''16'''
 +
| '''PWM4/UART4_RX'''
 +
| '''PI14'''
 +
| '''270'''
 +
|-
 +
| '''18'''
 +
| style="text-align: left;"|
 +
| '''PH4'''
 +
| '''228'''
 +
|-
 +
| '''20'''
 +
| '''GND'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''22'''
 +
| '''TWI0_SDA/UART2_RX'''
 +
| '''PI6'''
 +
| '''262'''
 +
|-
 +
| '''24'''
 +
| '''SPI1_CS0'''
 +
| '''PH5'''
 +
| '''229'''
 +
|-
 +
| '''26'''
 +
| '''SPI1_CS1'''
 +
| '''PH9'''
 +
| '''233'''
 +
|-
 +
| '''28'''
 +
| '''TWI2-SCL/UART3_TX'''
 +
| '''PI9'''
 +
| '''265'''
 +
|-
 +
| '''30'''
 +
| '''GND'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''32'''
 +
| '''PWM1'''
 +
| '''PI11'''
 +
| '''267'''
 +
|-
 +
| '''34'''
 +
| '''GND'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''36'''
 +
| style="text-align: left;"|
 +
| '''PC12'''
 +
| '''76'''
 +
|-
 +
| '''38'''
 +
| style="text-align: left;"|
 +
| '''PI4'''
 +
| '''260'''
 +
|-
 +
| '''40'''
 +
| style="text-align: left;"|
 +
| '''PI3'''
 +
| '''259'''
 +
|}
 
</div>
 
</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:media/image250.png|575x250px]]</p></li></ol>
 
  
<span id="how-to-install-ros-2-galactic-on-ubuntu20.04"></span>
+
<ol start="2" style="list-style-type: decimal;">
=== How to install ROS 2 Galactic on Ubuntu20.04 ===
+
<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-style-type: lower-alpha;">
 +
<li><p>First run '''orangepi-config'''. Ordinary users remember to add '''sudo''' permissions.</p>
 +
{| class="wikitable" style="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 serial port you want to open.</p></li>
  
<ol style="list-style-type: decimal;">
+
{| class="wikitable" style="width:800px;text-align: center;"
<li><p>The currently active version of ROS 2 is as follows, the recommended version is '''Galactic Geochelone'''</p>
+
|-
<p>[[File:media/image251.png|576x271px]]</p>
+
| '''Multiplexing function in 40pin'''
<p>[[File:media/image252.png|575x265px]]</p>
+
| '''Corresponding dtbo configuration'''
<p>[http://docs.ros.org/ '''http://docs.ros.org''']</p>
+
|-
<p>'''http://docs.ros.org/en/galactic/Releases.html'''</p></li>
+
| '''40pin - uart2'''
<li><p>The link to the official installation documentation of ROS 2 '''Galactic Geochelone''' is as follows:</p>
+
| '''pi-uart2'''
<p>'''docs.ros.org/en/galactic/Installation.html'''</p>
+
|-
<p>'''http://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html'''</p></li>
+
| '''40pin - uart3'''
<li><p>In the official installation documentation of ROS 2 '''Galactic Geochelone''', Ubuntu Linux recommends using Ubuntu20.04, so please ensure that the system used by the development board is the '''Ubuntu20.04 desktop system'''. There are several ways to install ROS 2. The following demonstrates how to install ROS 2 '''Galactic Geochelone''' through '''Debian packages'''.</p></li>
+
| '''pi-uart3'''
<li><p>Use the '''install_ros.sh''' script to install ros2</p>
+
|-
<p>orangepi@orangepi:~$ '''install_ros.sh ros2'''</p></li>
+
| '''40pin - uart4'''
<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>
+
| '''pi-uart4'''
<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>
+
| '''40pin - uart5'''
<p>optional arguments:</p>
+
| '''ph-uart5'''
<p>-h, --help show this help message and exit</p>
+
|}
<p>Commands:</p>
+
 
<p>action Various action related sub-commands</p>
+
[[File:zero2w-img175.png]]
<p>bag Various rosbag related sub-commands</p>
+
</ol>
<p>component Various component related sub-commands</p>
+
<ol start="5" style="list-style-type: lower-alpha;">
<p>daemon Various daemon related sub-commands</p>
+
<li><p>Then select '''&lt;Save&gt;''' to save</p>
<p>doctor Check ROS setup and other potential issues</p>
+
<p>[[File:zero2w-img83.png]]</p></li>
<p>interface Show information about ROS interfaces</p>
+
<li><p>Then select '''&lt;Back&gt;'''</p>
<p>launch Run a launch file</p>
+
<p>[[File:zero2w-img84.png]]</p></li>
<p>lifecycle Various lifecycle related sub-commands</p>
+
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system to make the configuration take effect.</p>
<p>multicast Various multicast related sub-commands</p>
+
<p>[[File:zero2w-img85.png]]</p></li></ol>
<p>node Various node related sub-commands</p>
+
</li></ol>
<p>param Various param related sub-commands</p>
+
<!-- -->
<p>pkg Various package related sub-commands</p>
+
<ol start="3" style="list-style-type: decimal;">
<p>run Run a package specific executable</p>
+
<li><p>After entering the Linux system, first confirm whether there is a uart5 device node under '''<span class="mark">/dev</span>'''</p>
<p>security Various security related sub-commands</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
<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>
+
<big><p>'''注意, linux5.4系统为/dev/ttyASx.'''</p></big>
<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 installed successfully. 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>orangepi@orangepi:~$ '''ls /dev/ttyS*'''</p>
<p>[INFO] [1671174102.199572327] [talker]: Publishing: 'Hello World: 2'</p>
+
<p>/dev/ttySx</p>
<p>[INFO] [1671174102.204196299] [listener]: I heard: [Hello World: 2]</p>
+
|}
<p>[INFO] [1671174103.199580322] [talker]: Publishing: 'Hello World: 3'</p>
+
</li>
<p>[INFO] [1671174103.204019965] [listener]: I heard: [Hello World: 3]</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></li>
<li><p>Run the following command to open rviz2</p>
+
<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.</p>
<p>orangepi@orangepi:~$ '''source /opt/ros/galactic/setup.bash'''</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
<p>orangepi@orangepi:~$ '''ros2 run rviz2 rviz2'''</p>
+
|-
<p>[[File:media/image253.png|576x324px]]</p></li>
+
|
<li><p>For how to use ROS, please refer to the documentation of ROS 2.</p>
+
<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>
<p>[http://docs.ros.org/en/galactic/Tutorials.html '''http://docs.ros.org/en/galactic/Tutorials.html''']</p></li></ol>
+
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''gpio serial /dev/ttySx &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # linux-6.1 test command'''</p>
 +
<p>orangepi@orangepi:~$ '''gpio serial /dev/ttyASx &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # linux-5.4 test command'''</p>
  
<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;">
+
<p>Out: 0: -&gt; 0</p>
<li><p>Use the install_ros.sh script to '''install_ros.sh'''</p>
+
<p>Out: 1: -&gt; 1</p>
<p>orangepi@orangepi:~$ '''install_ros.sh ros2'''</p></li>
+
<p>Out: 2: -&gt; 2</p>
<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>Out: 3: -&gt; 3^C</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>
+
</li>
<p>optional arguments:</p>
+
<li><p>Finally, you can run the '''serialTest.py''' 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>-h, --help show this help message and exit</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
<p>Commands:</p>
+
|-
<p>action Various action related sub-commands</p>
+
|
<p>bag Various rosbag related sub-commands</p>
+
<big><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.'''</p></big>
<p>component Various component related sub-commands</p>
+
|}
<p>daemon Various daemon related sub-commands</p>
+
{| class="wikitable" style="width:800px;"
<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>root@orangepi:~/wiringOP-Python# '''cd examples'''</p>
<p>lifecycle Various lifecycle related sub-commands</p>
+
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 serialTest.py --device &quot;/dev/ttySx&quot; # linux6.1 use'''</p>
<p>multicast Various multicast related sub-commands</p>
+
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 serialTest.py --device &quot;/dev/ttyASx&quot; # linux5.4 use'''</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>Out: 0: -&gt; 0</p>
<p>run Run a package specific executable</p>
+
<p>Out: 1: -&gt; 1</p>
<p>security Various security related sub-commands</p>
+
<p>Out: 2: -&gt; 2</p>
<p>service Various service related sub-commands</p>
+
<p>Out: 3: -&gt; 3</p>
<p>topic Various topic related sub-commands</p>
+
<p>Out: 4:^C</p>
<p>wtf Use `wtf` as alias to `doctor`</p>
+
<p>exit</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>
+
</li></ol>
<p>orangepi@orangepi:~$ '''test_ros.sh'''</p>
+
 
<p>[INFO] [1671174101.200091527] [talker]: Publishing: 'Hello World: 1'</p>
+
<span id="hardware-watchdog-test"></span>
<p>[INFO] [1671174101.235661048] [listener]: I heard: [Hello World: 1]</p>
+
 
<p>[INFO] [1671174102.199572327] [talker]: Publishing: 'Hello World: 2'</p>
+
== Hardware watchdog test ==
<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:media/image254.png|575x323px]]</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>
+
The watchdog_test program is pre-installed in the Linux system released by Orange Pi and can be tested directly.
== 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.'''
+
The method to run the watchdog_test program is as follows:
  
<ol style="list-style-type: decimal;">
+
<ol style="list-style-type: lower-alpha;">
<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>
+
<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>
<p>orangepi@orangepi:~$ '''ls /opt/linux-headers*'''</p>
+
<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;keep alive&quot; to indicate that the dog feeding is successful.</p>
<p>/opt/linux-headers-xxx-sun50iw9_x.x.x_arm64.deb</p></li>
+
{| class="wikitable" style="width:800px;"
<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:~$ '''sudo watchdog_test 10'''</p>
<p>orangepi@orangepi:~$ '''ls /usr/src'''</p>
+
<p>open success</p>
<p>linux-headers-x.x.x</p></li>
+
<p>options is 33152,identity is sunxi-wdt</p>
<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>put_usr return,if 0,success:0</p>
<p>orangepi@orangepi:~$ '''cd /usr/src/hello/'''</p>
+
<p>The old reset time is: 16</p>
<p>orangepi@orangepi:/usr/src/hello$ '''sudo make'''</p>
+
<p>return ENOTTY,if -1,success:0</p>
<p>make -C /lib/modules/5.4.125/build M=/usr/src/hello modules</p>
+
<p>return ENOTTY,if -1,success:0</p>
<p>make[1]: Entering directory '/usr/src/linux-headers-5.4.125'</p>
+
<p>put_user return,if 0,success:0</p>
<p>CC [M] /usr/src/hello/hello.o</p>
+
<p>put_usr return,if 0,success:0</p>
<p>Building modules, stage 2.</p>
+
<p>keep alive</p>
<p>MODPOST 1 modules</p>
+
<p>keep alive</p>
<p>CC [M] /usr/src/hello/hello.mod.o</p>
+
<p>keep alive</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></ol>
<li><p>After compilation, the '''hello.ko''' kernel module will be generated</p>
+
 
<p>orangepi@orangepi:/usr/src/hello$ '''ls *.ko'''</p>
+
<span id="check-the-chipid-of-h618-chip"></span>
<p>hello.ko</p></li>
+
 
<li><p>Use the '''insmod''' command to insert the '''hello.ko''' kernel module into the kernel</p>
+
== Check the chipid of H618 chip ==
<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>
+
The 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.
<p>orangepi@orangepi:/usr/src/hello$ '''dmesg | grep &quot;Hello&quot;'''</p>
+
 
<p>[ 2871.893988] '''Hello Orange Pi -- init'''</p></li>
+
{| class="wikitable" style="width:800px;"
<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>
+
orangepi@orangepi:~$ '''cat /sys/class/sunxi_info/sys_info | grep &quot;chipid&quot;'''
<p>[ 2871.893988] Hello Orange Pi -- init</p>
+
 
<p>[ 3173.800892] '''Hello Orange Pi -- exit'''</p></li></ol>
+
sunxi_chipid : 338020004c0048080147478824681ed1
 +
|}
 +
 
 +
<span id="python-related-instructions"></span>
 +
 
 +
== Python related instructions ==
 +
 
 +
<span id="how-to-compile-and-install-python-source-code"></span>
 +
=== How to compile and install Python source code ===
  
<span id="testing-of-some-programming-languages-supported-by-linux-system"></span>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
== Testing of some programming languages supported by Linux system ==
+
|-
 +
|
 +
<big>'''If 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.'''
  
<span id="debian-bullseye-system"></span>
+
'''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).'''</big>
=== Debian Bullseye system ===
+
|}
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: 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.</p>
+
<li><p>First install the dependency packages needed to compile Python</p>
<ol style="list-style-type: lower-alpha;">
+
{| class="wikitable" style="width:800px;"  
<li><p>The version of a.gcc is as follows</p>
+
|-
<p>orangepi@orangepi:~$ '''gcc --version'''</p>
+
|
<p>gcc (Debian 10.2.1-6) 10.2.1 20210110</p>
+
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>Copyright (C) 2020 Free Software Foundation, Inc.</p>
+
<p>orangepi@orangepi:~$ '''sudo apt-get install -y build-essential zlib1g-dev \'''</p>
<p>This is free software; see the source for copying conditions. There is NO</p>
+
<p>'''libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev \'''</p>
<p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p></li>
+
<p>'''libreadline-dev libffi-dev curl libbz2-dev'''</p>
<li><p>Write the '''hello_world.c''' program in C language</p>
+
|}
<p>orangepi@orangepi:~$ '''vim hello_world.c'''</p>
+
</li>
<p>#include &lt;stdio.h&gt;</p>
+
<li><p>Then download the latest version of Python3.9 source code and unzip it</p>
<p>int main(void)</p>
+
{| class="wikitable" style="width:800px;"
<p>{</p>
+
|-
<p>printf(&quot;Hello World!\n&quot;);</p>
+
|
<p>return 0;</p>
+
<p>orangepi@orangepi:~$ '''wget \'''</p>
<p>}</p></li>
+
<p>'''https://www.python.org/ftp/python/3.9.10/Python-3.9.10.tgz'''</p>
<li><p>Then compile and run '''hello_world.c'''</p>
+
<p>orangepi@orangepi:~$ '''tar xvf Python-3.9.10.tgz'''</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>
<li><p>Debian Bullseye has Python3 installed by default</p>
+
<li><p>Then run the configuration command</p>
<ol style="list-style-type: lower-alpha;">
+
{| class="wikitable" style="width:800px;"  
<li><p>The specific version of Python is as follows</p>
+
|-
<p>orangepi@orangepi:~$ '''python3'''</p>
+
|
<p>'''Python 3.9.2''' (default, Feb 28 2021, 17:03:44)</p>
+
<p>orangepi@orangepi:~$ '''cd Python-3.9.10'''</p>
<p>[GCC 10.2.1 20210110] on linux</p>
+
<p>orangepi@orangepi:~$ '''./configure --enable-optimizations'''</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>
<li><p>Debian Bullseye does not install Java compilation tools and operating environment by default.</p>
+
<li><p>Then compile and install Python3.9. The compilation time takes about half an hour.</p>
<ol style="list-style-type: lower-alpha;">
+
{| class="wikitable" style="width:800px;"  
<li><p>You can use the following command to install openjdk. The latest &gt; version in Debian Bullseye 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:~$ '''make -j4'''</p>
<p>orangepi@orangepi:~$ '''java --version'''</p></li>
+
<p>orangepi@orangepi:~$ '''sudo make altinstall'''</p>
<li><p>Write the Java version of '''hello_world.java'''</p>
+
|}
<p>orangepi@orangepi:~$ '''vim hello_world.java'''</p>
+
</li>
<p>public class hello_world</p>
+
<li><p>After installation, you can use the following command to check the version number of the Python you just installed.</p>
<p>{</p>
+
{| class="wikitable" style="width:800px;"
<p>public static void main(String[] args)</p>
+
|-
<p>{</p>
+
|
<p>System.out.println(&quot;Hello World!&quot;);</p>
+
<p>orangepi@orangepi:~$ '''python3.9 --version'''</p>
<p>}</p>
+
<p>'''Python 3.9.10'''</p>
<p>}</p></li>
+
|}
<li><p>Then compile and run '''hello_world.java'''</p>
+
</li>
<p>orangepi@orangepi:~$ '''javac hello_world.java'''</p>
+
<li><p>Then update pip</p>
<p>orangepi@orangepi:~$ '''java hello_world'''</p>
+
{| class="wikitable" style="width:800px;"
<p>Hello World!</p></li></ol>
+
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''/usr/local/bin/python3.9 -m pip install --upgrade pip'''</p>
 +
|}
 
</li></ol>
 
</li></ol>
  
<span id="debian-bookworm-system"></span>
+
<span id="how-to-replace-pip-source-in-python"></span>
=== Debian Bookworm system ===
+
 
 +
=== How to replace pip source in Python ===
 +
 
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<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.'''</big>
 +
|}
  
 
<ol style="list-style-type: decimal;">
 
<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>
+
<li><p>First install '''python3-pip'''</p>
<ol style="list-style-type: lower-alpha;">
+
{| class="wikitable" style="width:800px;"
<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>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>Copyright (C) 2022 Free Software Foundation, Inc.</p>
+
<p>orangepi@orangepi:~$ '''sudo apt-get install -y python3-pip'''</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>
<li><p>Debian Bookworm has Python3 installed by default</p>
+
<li><p>How to permanently change the pip source under Linux</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>The specific version of Python is as follows</p>
+
<li><p>First create a new '''~/.pip''' directory, then add the '''pip.conf''' configuration file, and set the pip source in it to Tsinghua source.</p>
<p>orangepi@orangepi:~$ '''python3'''</p>
+
{| class="wikitable" style="width:800px;"
<p>Python 3.11.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>
+
<p>orangepi@orangepi:~$ '''mkdir -p ~/.pip'''</p>
<p>'''Use the Ctrl+D shortcut key to exit python's interactive mode.'''</p></li>
+
<p>orangepi@orangepi:~$ '''cat &lt;&lt;EOF &gt; ~/.pip/pip.conf'''</p>
<li><p>Write the '''hello_world.py''' program in Python language</p>
+
<p>'''[global]'''</p>
<p>orangepi@orangepi:~$ '''vim hello_world.py'''</p>
+
<p>'''timeout = 6000'''</p>
<p>print('Hello World!')</p></li>
+
<p>'''index-url = https://pypi.tuna.tsinghua.edu.cn/simple'''</p>
<li><p>The result of running '''hello_world.py''' is as follows</p>
+
<p>'''trusted-host = pypi.tuna.tsinghua.edu.cn'''</p>
<p>orangepi@orangepi:~$ '''python3 hello_world.py'''</p>
+
<p>'''EOF'''</p>
<p>Hello World!</p></li></ol>
+
|}
 +
</li>
 +
<li><p>Then use pip3 to install the Python library very quickly</p></li></ol>
 
</li>
 
</li>
<li><p>Debian Bookworm does not install Java compilation tools and operating environment by default.</p>
+
<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>
<ol style="list-style-type: lower-alpha;">
+
{| class="wikitable" style="width:800px;"  
<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:~$ '''pip3 install &lt;packagename&gt; -i \'''</p>
<p>orangepi@orangepi:~$ '''java --version'''</p></li>
+
<p>'''https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn'''</p>
<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>
 
</li></ol>
  
<span id="ubuntu-focal-system"></span>
+
<span id="how-to-install-docker"></span>
=== Ubuntu Focal system ===
+
 
 +
== 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.
 +
 
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
orangepi@orangepi:~$ '''enable_docker.sh'''
 +
|}
 +
 
 +
You can use the following command to test docker. If '''hello-world''' can be run, docker can be used normally.
 +
 
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
orangepi@orangepi:~$ '''docker run hello-world'''
  
<ol style="list-style-type: decimal;">
+
Unable to find image 'hello-world:latest' locally
<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;">
+
latest: Pulling from library/hello-world
<li><p>The version of a.gcc is as follows</p>
+
 
<p>orangepi@orangepi:~$ '''gcc --version'''</p>
+
256ab8fe8778: Pull complete
<p>gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0</p>
+
 
<p>Copyright (C) 2019 Free Software Foundation, Inc.</p>
+
Digest: sha256:7f0a9f93b4aa3022c3a4c147a449ef11e0941a1fd0bf4a8e6c9408b2600777c5
<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>
+
Status: Downloaded newer image for hello-world:latest
<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>
+
'''<span style="color:#FF0000">Hello from Docker!</span>'''
<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 Focal 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.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_world.py'''</p>
 
<p>Hello World!</p></li></ol>
 
</li>
 
<li><p>Ubuntu Focal does not have Java compilation tools and running environment installed by default.</p>
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>You can use the following command to install 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>
 
<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.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="ubuntu-jammy-system"></span>
+
'''<span style="color:#FF0000">This message shows that your installation appears to be working correctly.</span>'''
=== Ubuntu Jammy system ===
 
  
<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-system"></span>
+
When using the docker command, if you are prompted for '''permission denied''', please add the current user to the docker user group so that you can run the docker command without sudo.
== Method of uploading files to the development board Linux system ==
 
  
<span id="method-to-upload-files-to-the-development-board-linux-system-in-ubuntu-pc"></span>
+
{| class="wikitable" style="width:800px;"
=== Method to upload files to the development board Linux system in Ubuntu PC ===
+
|-
 +
|
 +
orangepi@orangepi:~$ '''sudo usermod -aG docker $USER'''
 +
|}
  
<span id="how-to-upload-files-using-scp-command"></span>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
==== How to upload files using scp command ====
+
|-
 +
|
 +
<big>'''Note: You need to log out and log in again to the system to take effect. You can also restart the system.'''</big>
 +
|}
  
<ol style="list-style-type: decimal;">
+
<span id="how-to-install-home-assistant"></span>
<li><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</p>
 
<ol style="list-style-type: lower-alpha;">
 
<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@test:~$ '''scp file_path orangepi@192.168.xx.xx:/home/orangepi/'''</p></li></ol>
 
</li>
 
<li><p>If you want to upload a folder, you need to add the -r parameter</p>
 
<p>test@test:~$ '''scp -r 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></ol>
 
  
test@test:~$ '''man scp'''
+
== How to install Home Assistant ==
  
<span id="how-to-upload-files-using-filezilla"></span>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
==== How to upload files using filezilla ====
+
|-
 +
|
 +
<big>'''Note that this article will only provide methods for installing Home Assistant in Ubuntu or Debian systems. For detailed usage of Home Assistant, please refer to the official documentation or corresponding books.'''</big>
 +
|}
 +
 
 +
<span id="installation-via-docker"></span>
 +
=== Installation via docker ===
  
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
<li><p>First install filezilla in Ubuntu PC</p>
+
<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 [[Orange Pi Zero 2W#How to install Docker|'''How to Install Docker''']] section.</p></li>
<p>test@test:~$ '''sudo apt install -y filezilla'''</p></li>
+
<li><p>Then you can search for the docker image of Home Assistant</p>
<li><p>Then use the following command to open filezilla</p>
+
{| class="wikitable" style="width:800px;"
<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>
+
|
 +
<p>orangepi@orangepi:~$ '''docker search homeassistant'''</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>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''docker pull homeassistant/home-assistant'''</p>
 +
<p>Using default tag: latest</p>
 +
<p>latest: Pulling from homeassistant/home-assistant</p>
 +
<p>be307f383ecc: Downloading</p>
 +
<p>5fbc4c07ac88: Download complete</p>
 +
<p>'''...... (Omit some output)'''</p>
 +
<p>3cc6a1510c9f: Pull complete</p>
 +
<p>7a4e4d5b979f: Pull complete</p>
 +
<p>Digest: sha256:81d381f5008c082a37da97d8b08dd8b358dae7ecf49e62ce3ef1eeaefc4381bb</p>
 +
<p>Status: Downloaded newer image for homeassistant/home-assistant:latest</p>
 +
<p>docker.io/homeassistant/home-assistant:latest</p>
 +
|}
 +
</li>
 +
<li><p>Then you can use the following command to view the docker image of Home Assistant you just downloaded</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''docker images homeassistant/home-assistant'''</p>
 +
<p>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>
 +
<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; '''<span style="color:#FF0000">1.17GB</span>'''</p>
 +
|}
 +
</li>
 +
<li><p>At this point you can run the Home Assistant docker container</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''docker run -d \'''</p>
 +
:<p>'''--name homeassistant \'''</p>
 +
:<p>'''--privileged \'''</p>
 +
:<p>'''--restart=unless-stopped \'''</p>
 +
:<p>'''-e TZ=Asia/Shanghai \'''</p>
 +
:<p>'''-v /home/orangepi/home-assistant:/config \'''</p>
 +
:<p>'''--network=host \'''</p>
 +
:<p>'''homeassistant/home-assistant:latest'''</p>
 +
|}
 +
</li>
 +
<li><p>Then 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 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.'''</p></big>
 +
|}
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image255.png|576x453px|截图 2022-12-03 19-04-40]]
+
[[File:zero2w-img180.png]]
  
 
</div></li>
 
</div></li>
<li><p>The method of connecting the development board is as shown in the figure below</p></li></ol>
+
<li><p>Then enter your '''name, username''' and '''password''' and click '''Create Account'''</p>
 +
<div class="figure">
  
 +
[[File:zero2w-img181.png]]
 +
 +
</div></li>
 +
<li><p>Then follow the interface prompts to set according to your own preferences, and then click Next</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image256.png|575x128px|图片565]]
+
[[File:zero2w-img182.png]]
 
 
</div>
 
<ol start="5" style="list-style-type: decimal;">
 
<li><p>Then choose to '''save the password''' and click '''OK'''</p>
 
<p>[[File:media/image257.png|249x181px]]</p></li>
 
<li><p>Then select '''Always trust this host''' and click '''OK'''</p></li></ol>
 
  
 +
</div></li>
 +
<li><p>Then click Next</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image258.png|278x150px|IMG_256]]
+
[[File:zero2w-img183.png]]
 
 
</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 software.</li></ol>
 
  
 +
</div></li>
 +
<li><p>Then click Finish</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image259.png|533x330px|IMG_256]]
+
[[File:zero2w-img184.png]]
  
</div>
+
</div></li>
<ol start="8" style="list-style-type: decimal;">
+
<li><p>The main interface finally displayed by Home Assistant is as shown below</p>
<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>
+
<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 to view the docker container is as follows</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''docker ps -a'''</p>
 +
|}
 +
</li>
 +
<li><p>The command to stop the Home Assistant container is as follows</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''docker stop homeassistant'''</p>
 +
|}
 +
</li>
 +
<li><p>The command to delete the Home Assistant container is as follows</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''docker rm homeassistant'''</p>
 +
|}
 +
</li></ol>
 +
</li></ol>
  
<div class="figure">
+
<span id="installation-via-python"></span>
  
[[File:media/image260.png|529x414px|IMG_256]]
+
=== Installation via python ===
  
</div>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"  
<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>
+
<big>'''Before installation, please change the source of pip to a domestic source to speed up the installation of Python packages. For the configuration method, see the instructions in the section &quot;[[Orange Pi Zero 2W#How to replace pip source in Python|How to Change the Pip Source of Python]]&quot;'''</big>
 
+
|}
<span id="method-to-upload-files-from-windows-pc-to-development-board-linux-system"></span>
 
=== Method to upload files from Windows PC to development board Linux system ===
 
 
 
<span id="how-to-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
 
 
 
[https://filezilla-project.org/download.php?type=client '''https://filezilla-project.org/download.php?type=client'''][[File:media/image261.png|472x171px|C:\Users\orangepi\Desktop\用户手册插图\Pi5 Plus\未标题-15.jpg未标题-15]]
 
 
 
<div class="figure">
 
 
 
[[File:media/image262.png|384x276px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-21.jpg未标题-21]]
 
 
 
</div>
 
<ol start="2" style="list-style-type: decimal;">
 
<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 '''Next&gt;'''
 
  
 +
<ol style="list-style-type: decimal;">
 +
<li><p>First install dependency packages</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
 +
<p>orangepi@orangepi:~$ '''sudo apt-get install -y python3 python3-dev python3-venv \'''</p>
 +
<p>'''python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \'''</p>
 +
<p>'''libopenjp2-7 libtiff5 libturbojpeg0-dev tzdata'''</p>
 +
|}
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''If it is debian12, please use the following command:'''</p></big>
 +
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
 +
<p>orangepi@orangepi:~$ '''sudo apt-get install -y python3 python3-dev python3-venv \'''</p>
 +
<p>'''python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \'''</p>
 +
<p>'''libopenjp2-7 libturbojpeg0-dev tzdata'''</p>
 +
|}
 +
</li>
 +
<li><p>Then you need to compile and install Python3.9. For the method, please refer to the [[Orange Pi Zero 2W#Python related instructions|'''Python source code compilation and installation method''']] section.</p>
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''The default Python version of Debian Bullseye is Python3.9, so there is no need to compile and install it.'''</p>
 +
<p>'''The default Python version of Ubuntu Jammy is Python3.10, so there is no need to compile and install it.'''</p>
 +
<p>'''The default Python version of Debian Bookworm is Python3.11, so there is no need to compile and install it.'''</p></big>
 +
|}
 +
</li>
 +
<li><p>Then create a Python virtual environment</p>
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''Debian Bookworm is python3.11, please remember to replace the corresponding command.'''</p></big>
 +
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo mkdir /srv/homeassistant'''</p>
 +
<p>orangepi@orangepi:~$ '''sudo chown orangepi:orangepi /srv/homeassistant'''</p>
 +
<p>orangepi@orangepi:~$ '''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>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''python3 -m pip install wheel'''</p>
 +
|}
 +
</li>
 +
<li><p>Then you can install Home Assistant Core</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''pip3 install homeassistant'''</p>
 +
|}
 +
</li>
 +
<li><p>Then enter the following command to run Home Assistant Core</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''hass'''</p>
 +
|}
 +
</li>
 +
<li><p>Then enter【'''development board IP address: 8123'''】 in the browser to see the Home Assistant interface</p>
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''When you run the hass command for the first time, some libraries and dependency packages necessary for operation will be downloaded, installed and cached. This process may take several minutes. Note that you cannot see the Home Assistant interface in the browser at this time. Please wait for a while and then refresh it.'''</p></big>
 +
|}
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image263.png|355x279px|IMG_256]]
+
[[File:zero2w-img180.png]]
  
</div>
+
</div></li></ol>
<ol start="3" style="list-style-type: decimal;">
 
<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">
+
<span id="opencv-installation-method"></span>
  
[[File:media/image264.png|451x357px|IMG_256]]
+
== OpenCV installation method ==
  
</div>
+
<span id="use-apt-to-install-opencv"></span>
<ol start="4" style="list-style-type: decimal;">
+
=== Use apt to install OpenCV ===
<li>The method of connecting the development board is as shown in the figure below:</li></ol>
 
  
<div class="figure">
+
<ol style="list-style-type: decimal;">
 +
<li><p>The installation command is as follows</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<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-type: lower-alpha;">
 +
<li><p>The version of OpenCV in Ubuntu22.04 is as follows:</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<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>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''python3 -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>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<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>
 +
{| class="wikitable" style="width:800px;"  
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''python3 -c &quot;import cv2; print(cv2.__version__)&quot;'''</p>
 +
<p>'''4.6.0'''</p>
 +
|}
 +
</li></ol>
 +
</li></ol>
  
[[File:media/image256.png|575x128px|图片565]]
+
<span id="set-up-the-chinese-environment-and-install-the-chinese-input-method"></span>
  
</div>
+
== Set up the Chinese environment and install the Chinese input method ==
<ol start="5" style="list-style-type: decimal;">
 
<li>Then choose to '''save the password''' and click '''OK'''</li></ol>
 
  
<div class="figure">
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"  
 +
|-
 +
|
 +
<big>'''Note, before installing the Chinese input method, please make sure that the Linux system used by the development board is a desktop version.'''</big>
 +
|}
  
[[File:media/image265.png|207x146px|IMG_256]]
+
<span id="debian-system-installation-method"></span>
 
+
=== Debian system installation method ===
</div>
 
<ol start="6" style="list-style-type: decimal;">
 
<li>Then select '''Always trust this host''' and click '''OK'''</li></ol>
 
 
 
<div class="figure">
 
 
 
[[File:media/image266.png|221x109px|IMG_256]]
 
 
 
</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 software.</li></ol>
 
  
 +
<ol style="list-style-type: decimal;">
 +
<li><p>First set the default '''locale''' to Chinese</p>
 +
<ol style="list-style-type: lower-alpha;">
 +
<li><p>Enter the following command to start configuring '''locale'''</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo dpkg-reconfigure locales'''</p>
 +
|}
 +
</li>
 +
<li><p>Then select '''zh_CN.UTF-8 UTF-8''' in the pop-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 Tab key to move 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>
 +
<li><p>After exiting the interface, the '''locale''' setting will begin. The output displayed on the command line is as follows:</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<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>'''<span style="color:#FF0000">Then restart the Linux system to make the configuration take effect.</span>'''</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-img194.png]]</p></li>
 +
<li><p>Then search '''Google Pinyin''' and click '''OK'''</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image267.png|446x329px|图片3]]
+
[[File:zero2w-img195.png]]
  
</div>
+
</div></li>
<ol start="8" style="list-style-type: decimal;">
+
<li><p>Then put '''Google Pinyin''' on top</p>
<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 on the Windows 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>
+
<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>
 +
{| class="wikitable" style="width:800px;"  
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''sudo vim /etc/default/locale'''</p>
 +
<p># File generated by update-locale</p>
 +
<p>LC_MESSAGES='''<span style="color:#FF0000">zh_CN.UTF-8</span>'''</p>
 +
<p>LANG='''<span style="color:#FF0000">zh_CN.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>
  
<div class="figure">
+
<span id="installation-method-of-ubuntu-20.04-system"></span>
  
[[File:media/image268.png|461x340px|IMG_256]]
+
=== Installation method of Ubuntu 20.04 system ===
  
</div>
+
<ol style="list-style-type: decimal;">
<ol start="9" style="list-style-type: decimal;">
+
<li><p>First open '''Language Support'''</p>
<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>
+
<p>[[File:zero2w-img201.png]]</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>
+
<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-img209.png]]</p></li></ol>
  
<span id="instructions-for-using-the-logo-on-and-off-the-machine"></span>
+
<span id="installation-method-of-ubuntu-22.04-system"></span>
== Instructions for using the logo on and off the machine ==
+
 
 +
=== Installation method of Ubuntu 22.04 system ===
  
 
<ol style="list-style-type: decimal;">
 
<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>First open '''Language Support'''</p>
<li><p>Set the '''bootlogo''' variable to '''false''' in '''/boot/orangepiEnv.txt''' to turn off the switch logo.</p>
+
<p>[[File:zero2w-img201.png]]</p></li>
<p>orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''</p>
+
<li><p>Then find the '''Chinese (China)''' option</p>
<p>verbosity=1</p>
+
<p>[[File:zero2w-img210.png]]</p></li>
<p>'''bootlogo=false'''</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>
<li><p>Set the '''bootlogo''' variable to '''true''' in '''/boot/orangepiEnv.txt''' to enable the power on/off logo.</p>
+
<p>[[File:zero2w-img211.png]]</p></li>
<p>orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''</p>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
<p>verbosity=1</p>
+
|-
<p>'''bootlogo=true'''</p></li>
+
|
<li><p>The location of the boot logo picture in the Linux system is</p>
+
<big>'''Note that this step is not easy to drag, please be patient and try it a few times.'''</big>
<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>
+
</ol>
<p>orangepi@orangepi:~$ '''sudo update-initramfs -u'''</p></li></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-img212.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 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-img207.png]]</p></li>
 +
<li><p>Then open the Fcitx5 configuration program</p>
 +
<p>[[File:zero2w-img213.png]]</p></li>
 +
<li><p>Then choose to use Pinyin input method</p>
 +
<div class="figure">
 +
 
 +
[[File:zero2w-img214.png]]
  
<span id="how-to-turn-on-the-power-button-in-linux5.4"></span>
+
</div></li>
== How to turn on the power button in Linux5.4 ==
+
<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''' 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 enter Chinese.</p>
 +
<p>[[File:zero2w-img216.png]]</p></li></ol>
  
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:
+
<span id="how-to-remotely-log-in-to-the-linux-system-desktop"></span>
  
[[File:media/image269.png|190x98px]]
+
== How to remotely log in to the Linux system desktop ==
  
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:
+
<span id="remote-login-using-nomachine"></span>
 +
=== Remote login using NoMachine ===
  
<ol style="list-style-type: decimal;">
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"  
<li><p>First run '''orangepi-config'''. Ordinary users remember to add '''sudo''' permissions.</p>
+
|-
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
+
|  
<li><p>Then select '''System'''</p>
+
<big>'''Please ensure that the Ubuntu or Debian system installed on the development board is a <span style="color:#FF0000">desktop version</span> 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. The document link is as follows:'''
<p>[[File:media/image80.png|402x199px]]</p></li>
 
<li><p>Then select '''Hardware'''</p>
 
<p>[[File:media/image81.png|393x202px]]</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 dtbo configuration of the SPI you want to open.</p>
 
<p>[[File:media/image270.png|399x76px]]</p></li>
 
<li><p>Then select '''&lt;Save&gt;''' to save</p>
 
<p>[[File:media/image83.png|397x92px]]</p></li>
 
<li><p>Then select '''&lt;Back&gt;'''</p>
 
<p>[[File:media/image84.png|395x91px]]</p></li>
 
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system to make the configuration take effect.</p>
 
<p>[[File:media/image85.png|298x149px]]</p></li></ol>
 
  
<span id="how-to-shut-down-and-restart-the-development-board"></span>
+
'''https://knowledgebase.nomachine.com/DT10R00166'''</big>
== How to shut down and restart the development board ==
+
|}
 +
{| 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 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.'''</big>
 +
|}
  
 
<ol style="list-style-type: decimal;">
 
<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.</p>
+
<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>
<p>orangepi@orangepi:~$ '''sudo poweroff'''</p>
+
<ol style="list-style-type: lower-alpha;">
<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>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>
<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>
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
<p>[[File:media/image269.png|190x98px]]</p>
+
|-
<p>'''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.4.'''</p></li>
+
|  
<li><p>Use the '''reboot''' command to restart the Linux system in the development board</p>
+
<big>'''Note that this download link may change, please look for the Armv8/Arm64 version of the deb package.'''</big>
<p>orangepi@orangepi:~$ '''sudo''' '''reboot'''</p></li></ol>
+
|}
 +
{| 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''']
 +
|}
  
<span id="linux-sdkorangepi-build-usage-instructions"></span>
+
[[File:zero2w-img217.png]]
= Linux SDK——orangepi-build usage instructions =
+
</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:~$ '''sudo dpkg -i nomachine_x.x.x_x_arm64_arm64.deb'''</p>
 +
|}
 +
</li></ol>
 +
</li></ol>
 +
<ol start="2" style="list-style-type: decimal;">
 +
<li>Then download the installation package of the Windows version of the NoMachine software. The download address is as follows</li>
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''Note that this download link may change.'''</big>
 +
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
'''https://downloads.nomachine.com/download/?id=9'''
 +
|}
  
<span id="compilation-system-requirements"></span>
+
[[File:zero2w-img221.png]]
== Compilation system requirements ==
+
</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</p>
 +
<p>[[File:zero2w-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: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>
  
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.
+
<span id="remote-login-using-vnc"></span>
  
test@test:~$ '''lsb_release -a'''
+
=== Remote login using VNC ===
  
No LSB modules are available.
+
{| class="wikitable" style="background-color:#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.'''
  
Distributor ID: Ubuntu
+
'''<span style="color:#FF0000">There are many problems with VNC testing in Ubuntu20.04, please do not use this method.</span>'''</big>
 +
|}
  
Description: Ubuntu 22.04 LTS
+
<ol style="list-style-type: decimal;">
 +
<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>
  
Release: '''22.04'''
 
  
Codename: '''jammy'''
+
<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;&nbsp;&nbsp; '''<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>
  
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''' 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 orangepi-build can be used normally in WSL. In addition, please do not compile the Linux system on the development board. Use orangepi-build. The installation image download address of Ubuntu 22.04 amd64 version is:
 
  
[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''']
+
<p>New 'X' desktop is orangepi:1</p>
  
After 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:
 
  
<ol style="list-style-type: lower-alpha;">
+
<p>Creating default startup script /root/.vnc/xstartup</p>
<li>For the method of replacing Tsinghua Source, please refer to the instructions on this page.</li></ol>
+
<p>Starting applications specified in /root/.vnc/xstartup</p>
 +
<p>Log file is /root/.vnc/orangepi:1.log</p>
  
[https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/ '''https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/''']
 
  
<ol start="2" style="list-style-type: lower-alpha;">
+
<p>Killing Xtightvnc process ID 3047</p>
<li>Note that the Ubuntu version needs to be switched to 22.04.</li></ol>
 
  
[[File:media/image271.png|576x241px]]
 
  
<ol start="3" style="list-style-type: lower-alpha;">
+
<p>New 'X' desktop is orangepi:1</p>
<li>The contents of the '''/etc/apt/sources.list''' file that need to be replaced are:</li></ol>
 
  
test@test:~$ '''sudo mv /etc/apt/sources.list cat /etc/apt/sources.list.bak'''
 
  
test@test:~$ '''sudo vim /etc/apt/sources.list'''
+
<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-style-type: lower-alpha;">
 +
<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>
  
# The source code image is commented by default to improve apt update speed. You can uncomment it yourself if necessary.
+
<div class="figure">
  
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
+
[[File:zero2w-img227.png]]
  
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
+
</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>
  
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
+
[[File:zero2w-img229.png]]
 +
</ol>
 +
</li></ol>
 +
<span id="qt-installation-method"></span>
  
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
+
== QT installation method ==
  
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
+
<ol style="list-style-type: decimal;">
 
+
<li><p>Use the following script to install QT5 and QT Creator</p>
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
+
{| class="wikitable" style="width:800px;"
 
+
|-
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
+
|
 
+
<p>orangepi@orangepi:~$ '''install_qt.sh'''</p>
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
+
|}
 
+
</li>
# Pre-release software source, not recommended to be enabled
+
<li><p>After installation, the QT version number will be automatically printed.</p>
 
+
<ol style="list-style-type: lower-alpha;">
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
+
<li><p>The qt version that comes with Ubuntu20.04 is '''5.12.8'''</p>
 
+
{| class="wikitable" style="width:800px;"  
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
+
|-
 
+
|
<ol start="4" style="list-style-type: lower-alpha;">
+
<p>orangepi@orangepi:~$ '''install_qt.sh'''</p>
<li>After the replacement, you need to update the package information and ensure that no errors are reported.</li></ol>
+
<p>......</p>
 
+
<p>QMake version 3.1</p>
test@test:~$ '''sudo apt-get update'''
+
<p>Using Qt version '''<span style="color:#FF0000">5.12.8</span>''' in /usr/lib/aarch64-linux-gnu</p>
 
+
|}
<ol start="5" style="list-style-type: lower-alpha;">
+
</li>
<li>'''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></ol>
+
<li><p>The QT version that comes with Ubuntu22.04 is '''5.15.3'''</p>
 
+
{| class="wikitable" style="width:800px;"  
<span id="obtain-the-source-code-of-linux-sdk"></span>
 
== Obtain the source code of linux sdk ==
 
 
 
<span id="download-orangepi-build-from-github"></span>
 
=== 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'''
 
 
 
'''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 next.'''
 
 
 
<div class="figure">
 
 
 
[[File:media/image272.png|576x298px|图片6]]
 
 
 
</div>
 
'''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"
 
 
|-
 
|-
| '''branch'''
+
|  
| '''u-boot Version'''
+
<p>orangepi@orangepi:~$ '''install_qt.sh'''</p>
| '''linux Kernel version'''
+
<p>......</p>
 +
<p>QMake version 3.1</p>
 +
<p>Using Qt version '''<span style="color:#FF0000">5.15.3</span>''' in /usr/lib/aarch64-linux-gnu</p>
 +
|}
 +
</li>
 +
<li><p>The QT version that comes with Debian11 is '''5.15.2'''</p>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''current'''
+
|  
| '''u-boot v2018.05'''
+
<p>orangepi@orangepi:~$ '''install_qt.sh'''</p>
| '''linux5.4'''
+
<p>......</p>
 +
<p>QMake version 3.1</p>
 +
<p>Using Qt version '''<span style="color:#FF0000">5.15.2</span>''' in /usr/lib/aarch64-linux-gnu</p>
 +
|}
 +
</li>
 +
<li><p>The QT version that comes with Debian12 is '''5.15.8'''</p>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''next'''
+
|  
| '''u-boot v2021.07'''
+
<p>orangepi@orangepi:~$ '''install_qt.sh'''</p>
| '''linux6.1'''
+
<p>......</p>
 +
<p>QMake version 3.1</p>
 +
<p>Using Qt version '''<span style="color:#FF0000">5.15.8</span>''' in /usr/lib/aarch64-linux-gnu</p>
 
|}
 
|}
 
+
</li></ol>
'''The branch mentioned here is not the same thing as the branch of orangepi-build source code, please don't get confused. This branch is mainly used to distinguish different kernel source code versions.'''
+
</li>
 
+
<li><p>Then you can see the QT Creator startup icon in '''Applications'''</p>
'''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.'''
+
<p>[[File:zero2w-img230.png]]</p>
 
+
<p>You can also use the following command to open QT Creator</p>
After downloading, the following files and folders will be included:
+
{| class="wikitable" style="width:800px;"
 
+
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''qtcreator'''</p>
 +
|}
 +
</li>
 +
<li><p>The interface after QT Creator is opened is as follows</p>
 +
<p>[[File:zero2w-img231.png]]</p></li>
 +
<li><p>The version of QT Creator is as follows</p>
 +
<ol style="list-style-type: lower-alpha;">
 +
<li><p>The default version of QT Creator in '''Ubuntu20.04''' is as follows</p>
 +
<p>[[File:zero2w-img232.png]]</p></li>
 +
<li><p>The default version of QT Creator in '''Ubuntu22.04''' is as follows</p>
 +
<p>[[File:zero2w-img233.png]]</p></li>
 +
<li><p>The default version of QT Creator in '''Debian11''' is as follows</p>
 +
<p>[[File:zero2w-img234.png]]</p></li>
 +
<li><p>The default version of QT Creator in '''Debian12''' is as follows</p>
 +
<p>[[File:zero2w-img235.png]]</p></li></ol>
 +
</li>
 +
<li><p>Then set up QT</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>'''build.sh''': Compile startup script</p></li>
+
<li><p>First open '''Help'''-&gt;'''About Plugins...'''.</p>
<li><p>'''external''': Contains configuration files needed to compile the image, specific scripts, and source code of some programs, etc.</p></li>
+
<p>[[File:zero2w-img236.png]]</p></li>
<li><p>'''LICENSE''': GPL 2 license file</p></li>
+
<li><p>Then remove the check mark of '''ClangCodeModel'''</p>
<li><p>'''README.md''': orangepi-build documentation</p></li>
+
<p>[[File:zero2w-img237.png]]</p></li>
<li><p>'''scripts''': Common script for compiling linux images</p></li></ol>
+
<li><p>'''<span style="color:#FF0000">After setting up, you need to restart QT Creator</span>'''</p></li>
 +
<li><p>Then make sure the GCC compiler used by QT Creator. If the default is Clang, please change it to GCC.</p>
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big><p>'''Debian12 please skip this step.'''</p></big>
 +
|}
 +
<p>[[File:zero2w-img238.png]]</p>
 +
<p>[[File:zero2w-img239.png]]</p></li></ol>
 +
</li>
 +
<li><p>Then you can open a sample code</p>
 +
<p>[[File:zero2w-img240.png]]</p></li>
 +
<li><p>After clicking on the sample code, the corresponding instruction document will automatically open. You can read the instructions carefully.</p>
 +
<p>[[File:zero2w-img241.png]]</p></li>
 +
<li><p>Then click '''Configure Project'''</p>
 +
<p>[[File:zero2w-img242.png]]</p></li>
 +
<li><p>Then click the green triangle in the lower left corner to compile and run the sample code</p>
 +
<p>[[File:zero2w-img243.png]]</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>[[File:zero2w-img244.png]]</p></li>
 +
<li><p>References</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>[https://wiki.qt.io/Install_Qt_5_on_Ubuntu '''https://wiki.qt.io/Install_Qt_5_on_Ubuntu''']</p>
 +
<p>[https://download.qt.io/archive/qtcreator '''https://download.qt.io/archive/qtcreator''']</p>
 +
<p>[https://download.qt.io/archive/qt '''https://download.qt.io/archive/qt''']</p>
 +
|}
 +
</li></ol>
  
test@test:~/orangepi-build$ '''ls'''
+
<span id="ros-installation-method"></span>
  
'''build.sh external LICENSE README.md scripts'''
+
== ROS installation method ==
  
'''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="how-to-install-ros-1-noetic-on-ubuntu20.04"></span>
 +
=== How to install ROS 1 Noetic on Ubuntu20.04 ===
  
<span id="download-the-cross-compilation-tool-chain"></span>
+
# The currently active version of ROS 1 is as follows, the recommended version is '''Noetic Ninjemys'''
=== 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.
+
::[[File:zero2w-img245.png]]
  
<div class="figure">
+
::[[File:zero2w-img246.png]]
  
[[File:media/image273.png|575x278px|选区_396]]
+
::{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
[http://docs.ros.org/ '''http://docs.ros.org''']
  
</div>
+
'''https://wiki.ros.org/Distributions'''
The mirror URL of the cross-compilation tool chain in China is the open source software mirror site of Tsinghua University:
+
|}
 +
 
 +
<ol start="2" style="list-style-type: decimal;">
 +
<li><p>The link to the official installation documentation of ROS 1 '''Noetic Ninjemys''' is as follows:</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>[http://wiki.ros.org/noetic/Installation/Ubuntu '''http://wiki.ros.org/noetic/Installation/Ubuntu''']</p>
 +
|}
 +
</li>
 +
<li><p>In the official installation documentation of ROS '''Noetic Ninjemys''', Ubuntu recommends using Ubuntu20.04, so please ensure that the system used by the development board is '''<span style="color:#FF0000">Ubuntu20.04 desktop system</span>'''.</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>[http://wiki.ros.org/noetic/Installation '''http://wiki.ros.org/noetic/Installation''']</p>
 +
<p>[[File:zero2w-img247.png]]</p>
 +
|}
 +
</li>
 +
<li><p>Then use the script below to install ros1</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''install_ros.sh ros1'''</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 in ROS.</p></li>
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''<span style="color:#FF0000">Note that when running 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.</span>'''
  
[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
+
'''The install_ros.sh script will try to modify /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.'''
  
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
+
'''https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml'''
  
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
+
'''Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml'''
  
The cross-compilation tool chain used to compile the H618 Linux kernel source code is:
+
'''<span style="color:#FF0000">ERROR: error loading sources list:</span>'''
  
<ol style="list-style-type: lower-alpha;">
+
::'''<span style="color:#FF0000">The read operation timed out</span>'''</big>
<li>linux5.4</li></ol>
+
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
orangepi@orangepi:~$ '''source /opt/ros/noetic/setup.bash'''
  
'''gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu'''
+
orangepi@orangepi:~$ '''sudo rosdep init'''
  
<ol start="2" style="list-style-type: lower-alpha;">
+
Wrote /etc/ros/rosdep/sources.list.d/20-default.list
<li>linux6.1</li></ol>
 
  
'''gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu'''
+
Recommended: please run
  
The cross-compilation tool chain used to compile the H618 u-boot source code is:
 
  
<ol style="list-style-type: lower-alpha;">
+
::rosdep update
<li>v2018.05</li></ol>
 
  
'''gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi'''
+
orangepi@orangepi:~$ '''rosdep update'''
  
<ol start="2" style="list-style-type: lower-alpha;">
+
reading in sources list data from /etc/ros/rosdep/sources.list.d
<li>v2021.07</li></ol>
 
  
'''gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu'''
+
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
  
<span id="orangepi-build-complete-directory-structure-description"></span>
+
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
=== orangepi-build complete directory structure description ===
 
  
<ol style="list-style-type: decimal;">
+
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
<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: lower-alpha;">
 
<li>Linux5.4</li></ol>
 
</li></ol>
 
</li></ol>
 
  
https://github.com/orangepi-xunlong/linux-orangepi/tree/'''orange-pi-5.4-sun50iw9'''
+
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
  
<ol start="2" style="list-style-type: lower-alpha;">
+
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
<li>Linux6.1</li></ol>
 
  
https://github.com/orangepi-xunlong/linux-orangepi/tree/'''orange-pi-6.1-sun50iw9'''
+
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
  
<ol start="2" style="list-style-type: lower-alpha;">
+
Skip end-of-life distro &quot;ardent&quot;
<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>v2018.05</li></ol>
 
</li></ol>
 
  
https://github.com/orangepi-xunlong/u-boot-orangepi/tree/'''v2018.05-h618'''
+
Skip end-of-life distro &quot;bouncy&quot;
  
<ol start="2" style="list-style-type: lower-alpha;">
+
Skip end-of-life distro &quot;crystal&quot;
<li>v2021.07</li></ol>
 
  
https://github.com/orangepi-xunlong/u-boot-orangepi/tree/'''v2021.07-sunxi'''
+
Skip end-of-life distro &quot;dashing&quot;
  
<ol start="2" style="list-style-type: decimal;">
+
Skip end-of-life distro &quot;eloquent&quot;
<li><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 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 compilation process is also stored in external.</p></li>
 
<li><p>'''kernel''': Store the source code of the linux kernel</p></li>
 
<li><p>'''LICENSE''': GPL 2 license file</p></li>
 
<li><p>'''README.md''': orangepi-build documentation</p></li>
 
<li><p>'''output''': Store compiled u-boot, linux and other deb packages, compilation logs, 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</p></li></ol>
 
</li></ol>
 
  
test@test:~/orangepi-build$ '''ls'''
+
Add distro &quot;foxy&quot;
  
'''build.sh external kernel LICENSE output README.md scripts toolchains u-boot userpatches'''
+
Add distro &quot;galactic&quot;
  
<span id="compile-u-boot"></span>
+
Skip end-of-life distro &quot;groovy&quot;
== Compile u-boot ==
 
  
# Run the build.sh script, remember to add sudo permissions
+
Add distro &quot;humble&quot;
  
test@test:~/orangepi-build$ '''sudo ./build.sh'''
+
Skip end-of-life distro &quot;hydro&quot;
  
<ol start="2" style="list-style-type: decimal;">
+
Skip end-of-life distro &quot;indigo&quot;
<li>Select '''U-boot package''' and press Enter</li></ol>
 
  
<div class="figure">
+
Skip end-of-life distro &quot;jade&quot;
  
[[File:media/image274.png|576x132px|选区_238]]
+
Skip end-of-life distro &quot;kinetic&quot;
  
</div>
+
Skip end-of-life distro &quot;lunar&quot;
<ol start="3" style="list-style-type: decimal;">
 
<li>Then select the model of the development board</li></ol>
 
  
[[File:media/image275.png|576x266px]]
+
Add distro &quot;melodic&quot;
  
<ol start="4" style="list-style-type: decimal;">
+
Add distro &quot;noetic&quot;
<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 image.</p></li>
 
<li><p>The next branch will compile the u-boot v2021.07 version code that needs to be used by the linux6.1 image.</p>
 
<p>[[File:media/image276.png|576x77px]]</p></li></ol>
 
</li>
 
<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 branch.</p></li></ol>
 
  
<blockquote>a. If the development board you purchased has a memory size of 1.5GB, please select the first option.
+
Add distro &quot;rolling&quot;
 
 
b. If the development board you purchased has 1GB or 2GB or 4GB memory size, please choose the second option.
 
</blockquote>
 
[[File:media/image277.png|575x72px]]
 
  
 +
updated cache in /home/orangepi/.ros/rosdep/sources.cache
 +
|}
 +
</ol>
 
<ol start="6" style="list-style-type: decimal;">
 
<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>
+
<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>
<ol style="list-style-type: lower-alpha;">
+
{| class="wikitable" style="width:800px;"  
<li>Version of u-boot source code</li></ol>
+
|-
</li></ol>
+
|
 +
<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>
  
[ o.k. ] Compiling u-boot [ '''v2021.07''' ]
+
<div class="figure">
  
<ol start="2" style="list-style-type: lower-alpha;">
+
[[File:zero2w-img249.png]]
<li>Version of the cross-compilation tool chain</li></ol>
 
  
[ o.k. ] Compiler version [ '''aarch64-linux-gnu-gcc 11''' ]
+
</div></ol>
 +
<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>
  
<ol start="3" style="list-style-type: lower-alpha;">
+
<span id="how-to-install-ros-2-galactic-on-ubuntu20.04"></span>
<li>Path to the compiled u-boot deb package</li></ol>
 
  
[ o.k. ] Target directory [ '''orangepi-build/output/debs/u-boot''' ]
+
=== How to install ROS 2 Galactic on Ubuntu20.04 ===
  
<ol start="4" style="list-style-type: lower-alpha;">
+
<ol style="list-style-type: decimal;">
<li>The package name of the compiled u-boot deb package</li></ol>
+
<li><p>The currently active version of ROS 2 is as follows, the 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 the 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 official installation documentation of ROS 2 '''Galactic Geochelone''', Ubuntu Linux recommends using Ubuntu20.04, so please ensure that the system used by the development board is 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'''</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>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>usage: ros2 [-h] Call `ros2 &lt;command&gt; -h` for more detailed usage. ...</p>
  
[ o.k. ] File name [ '''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb''' ]
 
  
<ol start="5" style="list-style-type: lower-alpha;">
+
<p>ros2 is an extensible command-line tool for ROS 2.</p>
<li>Compilation time</li></ol>
 
  
[ o.k. ] Runtime [ '''1 min''' ]
 
  
<ol start="6" style="list-style-type: lower-alpha;">
+
<p>optional arguments:</p>
<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></ol>
+
:<p>-h, --help show this help message and exit</p>
  
[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=u-boot''' ]
 
  
<ol start="7" style="list-style-type: decimal;">
+
<p>Commands:</p>
<li>View the compiled u-boot deb package</li></ol>
+
:<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>
  
test@test:~/orangepi-build$ '''ls output/debs/u-boot/'''
 
  
'''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb'''
+
:<p>Call `ros2 &lt;command&gt; -h` for more detailed usage.</p>
 
+
|}
<ol start="8" style="list-style-type: decimal;">
+
</li>
<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></ol>
+
<li><p>Then you can use the '''test_ros.sh''' script to test whether ROS 2 is installed successfully. If you can see the following print, it means ROS 2 can run normally.</p>
 
+
{| class="wikitable" style="width:800px;"  
<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'''
+
<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>
IGNORE_UPDATES=&quot;'''yes'''&quot;
+
<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>
 
+
|}
<ol start="9" style="list-style-type: decimal;">
+
</li>
<li><p>When debugging u-boot code, you can use the following method to update u-boot in the linux image for testing</p>
+
<li><p>Run the following command to open rviz2</p>
<ol style="list-style-type: lower-alpha;">
+
{| class="wikitable" style="width:800px;"
<li>First upload the compiled deb package of u-boot to the Linux system of the development board.</li></ol>
+
|-
 +
|
 +
<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>
 +
{| class="wikitable" style="width:800px;"  
 +
|-
 +
|
 +
<p>[http://docs.ros.org/en/galactic/Tutorials.html '''http://docs.ros.org/en/galactic/Tutorials.html''']</p>
 +
|}
 
</li></ol>
 
</li></ol>
  
test@test:~/orangepi-build$ '''cd output/debs/u-boot'''
+
<span id="how-to-install-ros-2-humble-on-ubuntu22.04"></span>
  
test@test:~/orangepi_build/output/debs/u-boot$ '''scp \'''
+
=== How to install ROS 2 Humble on Ubuntu22.04 ===
  
'''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb [mailto:root@192.168.1.xxx:/root root@192.168.1.xxx:/root]'''
+
<ol style="list-style-type: decimal;">
 +
<li><p>Use the install_ros.sh script to '''install_ros.sh'''</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<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>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>usage: ros2 [-h] Call `ros2 &lt;command&gt; -h` for more detailed usage. ...</p>
  
<ol start="2" style="list-style-type: lower-alpha;">
 
<li>Install the new u-boot deb package just uploaded</li></ol>
 
  
orangepi@orangepi:~$ '''sudo dpkg -i''' '''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb'''
+
<p>ros2 is an extensible command-line tool for ROS 2.</p>
  
<ol start="3" style="list-style-type: lower-alpha;">
 
<li>Then run the nand-sata-install script</li></ol>
 
  
orangepi@orangepi:~$ '''sudo nand-sata-install'''
+
<p>optional arguments:</p>
 +
:<p>-h, --help show this help message and exit</p>
  
<ol start="4" style="list-style-type: lower-alpha;">
 
<li>Then select '''5 Install/Update the bootloader on SD/eMMC'''</li></ol>
 
  
[[File:media/image278.png|320x174px]]
+
<p>Commands:</p>
 
+
:<p>action Various action related sub-commands</p>
<ol start="5" style="list-style-type: lower-alpha;">
+
:<p>bag Various rosbag related sub-commands</p>
<li>After pressing the Enter key, a Warning will pop up first.</li></ol>
+
:<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>
  
[[File:media/image279.png|314x170px]]
 
  
<ol start="6" style="list-style-type: lower-alpha;">
+
:<p>Call `ros2 &lt;command&gt; -h` for more detailed usage.</p>
<li>Press the Enter key again to start updating u-boot. After the update is completed, the following information will be displayed.</li></ol>
+
|}
 
+
</li>
[[File:media/image280.png|292x164px]]
+
<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>
 +
{| 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>
  
<ol start="7" style="list-style-type: lower-alpha;">
+
<span id="how-to-install-kernel-header-files"></span>
<li>Then you can restart the development board to test whether the u-boot modification has taken effect.</li></ol>
 
  
<span id="compile-the-linux-kernel"></span>
+
== How to install kernel header files ==
== Compile the linux kernel ==
 
  
# Run the '''build.sh''' script, remember to add sudo permissions
+
{| 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. So if you want to compile the kernel module, please use Debian12 or Ubuntu22.04.'''</big>
 +
|}
  
test@test:~/orangepi-build$ '''sudo ./build.sh'''
+
<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>
<ol start="2" style="list-style-type: decimal;">
+
{| class="wikitable" style="width:800px;"
<li>Select '''Kernel package''' and press Enter</li></ol>
+
|-
 
+
|
<div class="figure">
+
<p>orangepi@orangepi:~$ '''ls /opt/linux-headers*'''</p>
 
+
<p>/opt/linux-headers-xxx-sun50iw9_x.x.x_arm64.deb</p>
[[File:media/image281.png|575x116px|选区_240]]
+
|}
 
+
</li>
</div>
+
<li><p>Use the following command to install the deb package of the kernel header file</p>
<ol start="3" style="list-style-type: decimal;">
+
{| class="wikitable" style="width:800px;"
<li>Then you will be prompted whether you need to display the kernel configuration interface. If you do not need to modify the kernel configuration, select the first one. If you need to modify the kernel configuration, select the second one.</li></ol>
+
|-
 
+
|
[[File:media/image282.png|576x87px]]
+
<p>orangepi@orangepi:~$ '''sudo dpkg -i /opt/linux-headers*.deb'''</p>
 
+
|}
<ol start="4" style="list-style-type: decimal;">
+
</li>
<li>Then select the model of the development board</li></ol>
+
<li><p>After installation, you can see the folder where the kernel header file is located under '''/usr/src'''.</p>
 
+
{| class="wikitable" style="width:800px;"  
[[File:media/image275.png|576x266px]]
+
|-
 +
|
 +
<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>
 +
{| class="wikitable" style="width:800px;"  
 +
|-
 +
|
 +
<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>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<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>
 +
{| class="wikitable" style="width:800px;"  
 +
|-
 +
|
 +
<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>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<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>
 +
{| class="wikitable" style="width:800px;"  
 +
|-
 +
|
 +
<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>
  
<ol start="5" style="list-style-type: decimal;">
+
<span id="testing-of-some-programming-languages-supported-by-linux-system"></span>
<li>Then select the branch type of the kernel source code</li></ol>
 
  
<blockquote>a. The current branch will compile the linux5.4 kernel source code
+
== Testing of some programming languages supported by Linux system ==
  
b. The next branch will compile the linux6.1 kernel source code
+
<span id="debian-bullseye-system"></span>
</blockquote>
+
=== Debian Bullseye system ===
[[File:media/image276.png|576x77px]]
 
 
 
<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></ol>
 
 
 
[[File:media/image283.png|575x357px]]
 
  
 +
<ol style="list-style-type: 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.</p>
 
<ol style="list-style-type: lower-alpha;">
 
<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></ol>
+
<li><p>The version of a.gcc is as follows</p>
 
+
{| class="wikitable" style="width:800px;"
test@test:~/orangepi-build$ '''sudo ./build.sh KERNEL_CONFIGURE=no'''
+
|-
 
+
|
<ol start="2" style="list-style-type: lower-alpha;">
+
<p>orangepi@orangepi:~$ '''gcc --version'''</p>
<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>
+
<p>gcc (Debian 10.2.1-6) 10.2.1 20210110</p>
<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>
+
<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 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;</p>
  
[[File:media/image284.png|574x234px]]
 
  
<ol start="7" style="list-style-type: decimal;">
+
<p>int main(void)</p>
<li><p>Part of the information prompted when compiling the next branch kernel source code is explained as follows:</p>
+
<p>{</p>
<ol style="list-style-type: lower-alpha;">
+
:<p>printf(&quot;Hello World!\n&quot;);</p>
<li>Version of the linux kernel source code</li></ol>
 
</li></ol>
 
  
[ o.k. ] Compiling current kernel [ '''6.1.31''' ]
 
  
<ol start="2" style="list-style-type: lower-alpha;">
+
:<p>return 0;</p>
<li>The version of the cross-compilation tool chain used</li></ol>
+
<p>}</p>
 
+
|}
[ o.k. ] Compiler version [ '''aarch64-linux-gnu-gcc 11''' ]
+
</li>
 
+
<li><p>Then compile and run '''hello_world.c'''</p>
<ol start="3" style="list-style-type: lower-alpha;">
+
{| class="wikitable" style="width:800px;"  
<li>The default configuration file used by the kernel and the path where it is stored are as follows</li></ol>
+
|-
 
+
|
[ o.k. ] Using kernel config file [ '''orangepi-build/external/config/kernel/linux-6.1-sun50iw9-next.config''' ]
+
<p>orangepi@orangepi:~$ '''gcc -o hello_world hello_world.c'''</p>
 
+
<p>orangepi@orangepi:~$ '''./hello_world'''</p>
<ol start="4" style="list-style-type: lower-alpha;">
+
<p>Hello World!</p>
<li>The path to the kernel-related deb package generated by compilation</li></ol>
+
|}
 
+
</li></ol>
[ o.k. ] Target directory [ '''output/debs/''' ]
+
</li>
 
+
<li><p>Debian Bullseye has Python3 installed by default</p>
<ol start="5" style="list-style-type: lower-alpha;">
 
<li>The package name of the kernel image deb package generated by compilation</li></ol>
 
 
 
[ o.k. ] File name [ '''linux-image-next-sun50iw9_x.x.x_arm64.deb''' ]
 
 
 
<ol start="6" style="list-style-type: lower-alpha;">
 
<li>Compilation time</li></ol>
 
 
 
[ o.k. ] Runtime [ '''10 min''' ]
 
 
 
<ol start="7" style="list-style-type: lower-alpha;">
 
<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.</li></ol>
 
 
 
[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=kernel KERNEL_CONFIGURE=no''' ]
 
 
 
<ol start="8" style="list-style-type: decimal;">
 
<li><p>View the kernel-related deb package generated by compilation</p>
 
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>'''linux-dtb-next-sun50iw9_x.x.x_arm64.deb''' Contains dtb files used by the kernel</p></li>
+
<li><p>The specific version of Python is as follows</p>
<li><p>'''linux-headers-next-sun50iw9_x.x.x_arm64.deb''' Contains kernel header files</p></li>
+
{| class="wikitable" style="width:800px;"
<li><p>'''linux-image-next-sun50iw9_x.x.x_arm64.deb''' Contains kernel images and kernel modules</p></li></ol>
+
|-
</li></ol>
+
|
 +
<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:~$ '''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>
  
test@test:~/orangepi-build$ '''ls output/debs/linux-*'''
+
<span id="debian-bookworm-system"></span>
  
output/debs/linux-dtb-next-sun50iw9_x.x.x_arm64.deb
+
=== Debian Bookworm system ===
  
output/debs/linux-headers-next-sun50iw9_x.x.x_arm64.deb
+
<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:~$ '''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>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''vim hello_world.c'''</p>
 +
<p>#include &lt;stdio.h&gt;</p>
  
output/debs/linux-image-next-sun50iw9_x.x.x_arm64.deb
 
  
<ol start="9" style="list-style-type: decimal;">
+
<p>int main(void)</p>
<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 found'''), otherwise the modifications will be restored. The method is as follows:</li></ol>
+
<p>{</p>
 +
:<p>printf(&quot;Hello World!\n&quot;);</p>
  
<blockquote>Set the IGNORE_UPDATES variable in '''userpatches/config-default.conf''' to &quot;yes&quot;
 
</blockquote>
 
test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''
 
  
IGNORE_UPDATES=&quot;'''yes'''&quot;
+
:<p>return 0;</p>
 
+
<p>}</p>
<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</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;">
 
<ol style="list-style-type: lower-alpha;">
<li>Upload the compiled deb package of the Linux kernel to the Linux system of the development board</li></ol>
+
<li><p>The specific version of Python is as follows</p>
</li></ol>
+
{| class="wikitable" style="width:800px;"
 
+
|-
test@test:~/orangepi-build$ '''cd output/debs'''
+
|
 
+
<p>orangepi@orangepi:~$ '''python3'''</p>
test@test:~/orangepi-build/output/debs$ '''scp \'''
+
<p>Python 3.11.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>
'''linux-image-next-sun50iw9_x.x.x_arm64.deb root@192.168.1.xxx:/root'''
+
<p>&gt;&gt;&gt;</p>
 
+
|}
<ol start="2" style="list-style-type: lower-alpha;">
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
<li>Install the deb package of the new linux kernel just uploaded.</li></ol>
+
|-
 
+
|
orangepi@orangepi:~$ '''sudo dpkg -i linux-image-next-sun50iw9_x.x.x_arm64.deb'''
+
<big><p>'''Use the Ctrl+D shortcut key to exit python's interactive mode.'''</p></big>
 
+
|}
<ol start="3" style="list-style-type: lower-alpha;">
+
</li>
<li>Then restart the development board and check whether the kernel-related modifications have taken effect.</li></ol>
+
<li><p>Write the '''hello_world.py''' program in Python language</p>
 
+
{| class="wikitable" style="width:800px;"
orangepi@orangepi:~$ '''sudo''' '''reboot'''
+
|-
 
+
|
<span id="compile-rootfs"></span>
+
<p>orangepi@orangepi:~$ '''vim hello_world.py'''</p>
== Compile rootfs ==
+
<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>
  
# Run the build.sh script, remember to add sudo permissions
+
<span id="ubuntu-focal-system"></span>
  
test@test:~/orangepi-build$ '''sudo ./build.sh'''
+
=== Ubuntu Focal system ===
  
<ol start="2" style="list-style-type: decimal;">
+
<ol style="list-style-type: decimal;">
<li>Select '''Rootfs and all deb packages''' and press Enter</li></ol>
+
<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><p>The version of a.gcc 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;</p>
  
<div class="figure">
 
  
[[File:media/image285.png|576x119px|选区_241]]
+
<p>int main(void)</p>
 +
<p>{</p>
 +
:<p>printf(&quot;Hello World!\n&quot;);</p>
  
</div>
 
<ol start="3" style="list-style-type: decimal;">
 
<li>Then select the model of the development board</li></ol>
 
  
[[File:media/image275.png|576x266px]]
+
:<p>return 0;</p>
 
+
<p>}</p>
<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>
+
</li>
<ol style="list-style-type: lower-alpha;">
+
<li><p>Then compile and run '''hello_world.c'''</p>
<li><p>In the current branch, you can see three options: debian11, ubuntu20.04, and ubuntu22.04.</p></li>
+
{| class="wikitable" style="width:800px;"  
<li><p>In the next branch, you can see three options: debian11, debian12, and ubuntu22.04.</p></li></ol>
+
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''gcc -o hello_world hello_world.c'''</p>
 +
<p>orangepi@orangepi:~$ '''./hello_world'''</p>
 +
<p>Hello World!</p>
 +
|}
 
</li></ol>
 
</li></ol>
 
+
</li>
[[File:media/image276.png|576x77px]]
+
<li><p>Ubuntu Focal has Python3 installed by default</p>
 
 
<ol start="5" style="list-style-type: decimal;">
 
<li>Then select the type of rootfs</li></ol>
 
 
 
[[File:media/image286.png|576x79px]]
 
 
 
<ol start="6" style="list-style-type: decimal;">
 
<li><p>Then select the type of image</p>
 
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li><p>'''Image with console interface (server)''' Represents the image of the server version, which is relatively small in size.</p></li>
+
<li><p>The specific version of Python3 is as follows</p>
<li><p>'''Image with desktop environment''' Represents an image with a desktop, which is relatively large in size.</p></li></ol>
+
{| class="wikitable" style="width:800px;"
</li></ol>
+
|-
 
+
|
<div class="figure">
+
<p>orangepi@orangepi:~$ '''python3'''</p>
 
+
<p>Python 3.8.10 (default, Nov 14 2022, 12:59:47)</p>
[[File:media/image287.png|576x75px|选区_245]]
+
<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>
</div>
+
<p>&gt;&gt;&gt;</p>
<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></ol>
+
{| 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 Focal does not have Java compilation tools and running environment installed by default.</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:~$ '''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>
 +
<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.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>
  
<div class="figure">
+
<span id="ubuntu-jammy-system"></span>
  
[[File:media/image288.png|576x78px|选区_397]]
+
=== Ubuntu Jammy system ===
  
</div>
+
<ol style="list-style-type: decimal;">
<ol start="8" 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>
<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>
+
<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:~$ '''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>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>orangepi@orangepi:~$ '''vim hello_world.c'''</p>
 +
<p>#include &lt;stdio.h&gt;</p>
  
[[File:media/image289.png|576x76px]]
 
  
[[File:media/image290.png|576x74px]]
+
<p>int main(void)</p>
 +
<p>{</p>
 +
:<p>printf(&quot;Hello World!\n&quot;);</p>
  
You can then select additional packages that need to be installed. Please press the Enter key here to skip directly.
 
  
[[File:media/image291.png|575x264px]]
+
:<p>return 0;</p>
 
+
<p>}</p>
<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>
+
</li>
<ol style="list-style-type: lower-alpha;">
+
<li><p>Then compile and run '''hello_world.c'''</p>
<li>Type of rootfs</li></ol>
+
{| 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></ol>
 
+
</li>
[ o.k. ] local not found [ Creating new rootfs cache for '''bullseye''' ]
+
<li><p>Ubuntu Jammy has Python3 installed by default</p>
 
 
<ol start="2" style="list-style-type: lower-alpha;">
 
<li>The storage path of the compiled rootfs compressed package</li></ol>
 
 
 
[ o.k. ] Target directory [ '''orangepi-build/external/cache/rootfs''' ]
 
 
 
<ol start="3" style="list-style-type: lower-alpha;">
 
<li>The name of the rootfs compressed package generated by compilation</li></ol>
 
 
 
[ o.k. ] File name [ '''bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4''' ]
 
 
 
<ol start="10" style="list-style-type: decimal;">
 
<li><p>View the compiled rootfs compressed package</p>
 
 
<ol style="list-style-type: lower-alpha;">
 
<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></ol>
+
<li><p>The specific version of Python3 is as follows</p>
</li></ol>
+
{| class="wikitable" style="width:800px;"
 
+
|-
<blockquote>a) '''bullseye''' represents the type of Linux distribution of rootfs
+
|
 
+
<p>orangepi@orangepi:~$ '''python3'''</p>
b) '''xfce''' indicates that the rootfs is the desktop version, and if it is cli, it indicates the server version.
+
<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>
c) '''arm64''' represents the architecture type of rootfs
+
<p>&gt;&gt;&gt;</p>
 
+
|}
d) '''25250ec7002de9e81a41de169f1f89721''' 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
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
</blockquote>
+
|-
<ol start="2" style="list-style-type: lower-alpha;">
+
|
<li>'''bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.list''' Lists the package names of all packages installed by rootfs</li></ol>
+
<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>
  
test@test:~/orangepi-build$ '''ls external/cache/rootfs/'''
+
<span id="method-of-uploading-files-to-the-development-board-linux-system"></span>
  
bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4
+
== Method of uploading files to the development board Linux system ==
  
bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.current
+
<span id="method-to-upload-files-to-the-development-board-linux-system-in-ubuntu-pc"></span>
 +
=== Method to upload files to the development board Linux system in Ubuntu PC ===
  
bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.list
+
<span id="how-to-upload-files-using-scp-command"></span>
 +
==== How to upload files using scp command ====
  
<ol start="11" style="list-style-type: decimal;">
+
<ol 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>
+
<li><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</p>
 +
<ol style="list-style-type: lower-alpha;">
 +
<li><p>'''file_path: '''Needs to be replaced with the path of 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/'''</p>
 +
|}
 +
</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>
  
<span id="compile-linux-image"></span>
+
==== How to upload files using filezilla ====
== Compile linux image ==
 
  
# Run the '''build.sh''' script, remember to add sudo permissions
+
<ol style="list-style-type: decimal;">
 +
<li><p>First install filezilla in Ubuntu PC</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>test@test:~$ '''sudo apt install -y filezilla'''</p>
 +
|}
 +
</li>
 +
<li><p>Then use the following command to open filezilla</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<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">
  
test@test:~/orangepi-build$ '''sudo ./build.sh'''
+
[[File:zero2w-img255.png]]
  
<ol start="2" style="list-style-type: decimal;">
+
</div></li>
<li>Select '''Full OS image for flashing''' and press Enter</li></ol>
+
<li><p>The method of connecting the development board is as shown in the figure below</p></li>
  
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image292.png|576x128px|选区_242]]
+
[[File:zero2w-img256.png]]
  
</div>
+
</div></ol>
<ol start="3" style="list-style-type: decimal;">
+
<ol start="5" style="list-style-type: decimal;">
<li>Then select the model of the development board</li></ol>
+
<li><p>Then choose to '''save the password''' and click '''OK'''</p>
 +
<p>[[File:zero2w-img257.png]]</p></li>
 +
<li><p>Then select '''Always trust this host''' and click '''OK'''</p></li>
  
[[File:media/image275.png|576x266px]]
+
<div class="figure">
  
<ol start="4" style="list-style-type: decimal;">
+
[[File:zero2w-img258.png]]
<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></ol>
 
</li></ol>
 
  
[[File:media/image276.png|576x77px]]
+
</div></ol>
 +
<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 software.</li>
  
<ol start="5" style="list-style-type: decimal;">
+
<div class="figure">
<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 branch.</p>
 
<ol style="list-style-type: lower-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:media/image277.png|575x72px]]</p></li></ol>
 
</li>
 
<li><p>Then select the type of rootfs</p></li></ol>
 
  
[[File:media/image286.png|576x79px]]
+
[[File:zero2w-img259.png]]
  
<ol start="7" style="list-style-type: decimal;">
+
</div></ol>
<li><p>Then select the type of image</p>
 
<ol style="list-style-type: lower-alpha;">
 
<li><p>'''Image 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></ol>
 
</li></ol>
 
 
 
<div class="figure">
 
 
 
[[File:media/image287.png|576x75px|选区_245]]
 
 
 
</div>
 
 
<ol start="8" style="list-style-type: decimal;">
 
<ol start="8" 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></ol>
+
<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>
  
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image288.png|576x78px|选区_397]]
+
[[File:zero2w-img260.png]]
  
</div>
+
</div></ol>
 
<ol start="9" style="list-style-type: decimal;">
 
<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></ol>
+
<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>
  
[[File:media/image289.png|576x76px]]
+
<span id="method-to-upload-files-from-windows-pc-to-development-board-linux-system"></span>
  
[[File:media/image290.png|576x74px]]
+
=== Method to upload files from Windows PC to development board Linux system ===
  
You can then select additional packages that need to be installed. Please press the Enter key here to skip directly.
+
<span id="how-to-upload-files-using-filezilla-1"></span>
 +
==== How to upload files using filezilla ====
  
[[File:media/image291.png|575x264px]]
+
# First download the installation file of the Windows version of the filezilla software. The download link is as follows
  
<ol start="10" style="list-style-type: decimal;">
+
::{| class="wikitable" style="width:800px;"  
<li>Then the compilation of the linux image will begin. The general process of compilation is as follows</li></ol>
+
|-
 +
|
 +
[https://filezilla-project.org/download.php?type=client '''https://filezilla-project.org/download.php?type=client''']
 +
|}
  
a. Initialize the compilation environment of Ubuntu PC and install the software packages required for the compilation process.
+
::[[File:zero2w-img261.png]]
  
b. Download the source code of u-boot and linux kernel (if already cached, only update the code)
+
<div class="figure">
  
c. Compile u-boot source code and generate u-boot deb package
+
::[[File:zero2w-img262.png]]
  
d. Compile linux source code and generate linux-related deb packages
+
</div>
 +
<ol start="2" style="list-style-type: decimal;">
 +
<li><p>The downloaded installation package is as shown below, then double-click to install it directly</p>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
<p>'''FileZilla_Server_1.5.1_win64-setup.exe'''</p>
 +
|}
 +
During the installation process, please select '''Decline''' on the following installation interface, and then select '''Next&gt;'''
  
e. Make the deb package of linux firmware
+
<div class="figure">
  
f. Make the deb package of orangepi-config tool
+
[[File:zero2w-img263.png]]
  
g. Create a deb package with board-level support
+
</div>
 +
</li></ol>
 +
<ol start="3" style="list-style-type: decimal;">
 +
<li>The interface after opening filezilla is as shown below. At this time, the remote site on the right is empty.</li>
  
h. If you compile the desktop version image, you will also create a desktop-related deb package.
+
<div class="figure">
  
i. Check whether rootfs has been cached. If not, re-create rootfs. If it has been cached, decompress it directly and use it.
+
[[File:zero2w-img264.png]]
  
j. Install the deb package generated previously into rootfs
+
</div></ol>
 +
<ol start="4" style="list-style-type: decimal;">
 +
<li>The method of connecting the development board is as shown in the figure below:</li>
  
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.
+
<div class="figure">
  
l. Then create the image file and format the partition. The default type is ext4.
+
[[File:zero2w-img256.png]]
  
m. Then copy the configured rootfs to the mirror partition.
+
</div></ol>
 +
<ol start="5" style="list-style-type: decimal;">
 +
<li>Then choose to '''save the password''' and click '''OK'''</li>
  
n. Then update initramfs
+
<div class="figure">
  
o. Finally, write the bin file of u-boot into the image through the dd command.
+
[[File:zero2w-img265.png]]
  
<ol start="11" style="list-style-type: decimal;">
+
</div></ol>
<li><p>After compiling the image, the following message will be displayed</p>
+
<ol start="6" style="list-style-type: decimal;">
<ol style="list-style-type: lower-alpha;">
+
<li>Then select '''Always trust this host''' and click '''OK'''</li>
<li>The storage path of the compiled image</li></ol>
 
</li></ol>
 
  
[ o.k. ] Done building [ '''output/images/orangepizero2w_x.x.x_debian_bullseye_linux6.1.xx_xfce_desktop/orangepizero2w_x.x.x_debian_bullseye_linux6.1.xx_xfce_desktop.img''' ]
+
<div class="figure">
  
<ol start="2" style="list-style-type: lower-alpha;">
+
[[File:zero2w-img266.png]]
<li>Compilation time</li></ol>
 
  
'''[ o.k. ] Runtime [ 19 min ]'''
+
</div></ol>
 +
<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 software.</li>
  
<ol start="3" style="list-style-type: lower-alpha;">
+
<div class="figure">
<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></ol>
 
  
[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=image RELEASE=bullseye BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=yes''' ]
+
[[File:zero2w-img267.png]]
  
<span id="instructions-for-using-the-orange-pi-os-arch-system"></span>
+
</div></ol>
= Instructions for using the Orange Pi OS Arch system =
+
<ol start="8" style="list-style-type: decimal;">
 +
<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 on the Windows 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>
 +
 
 +
<div class="figure">
 +
 
 +
[[File:zero2w-img268.png]]
 +
 
 +
</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="instructions-for-using-the-logo-on-and-off-the-machine"></span>
  
<span id="orange-pi-os-arch-system-function-adaptation-status"></span>
+
== Instructions for using the logo on and off the machine ==
== Orange Pi OS Arch system function adaptation status ==
 
  
{| class="wikitable"
+
<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>
 +
{| class="wikitable" style="width:800px;"  
 
|-
 
|-
| '''Motherboard functions'''
+
|  
| '''OPi OS Arch'''
+
<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;"
 
|-
 
|-
| '''HDMI video'''
+
|  
| '''OK'''
+
<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 location of the boot logo picture in the Linux system is</p>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''HDMI Audio'''
+
|  
| '''OK'''
+
<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>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''Type-C USB2.0 x 2'''
+
|  
| '''OK'''
+
<p>orangepi@orangepi:~$ '''sudo update-initramfs -u'''</p>
 +
|}
 +
</li></ol>
 +
 
 +
<span id="how-to-turn-on-the-power-button-in-linux5.4"></span>
 +
 
 +
== 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:zero2w-img269.png]]
 +
 
 +
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="list-style-type: decimal;">
 +
<li><p>First run '''orangepi-config'''. Ordinary users remember to add '''sudo''' permissions.</p>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''TF Card Startup'''
+
|  
| '''OK'''
+
<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 dtbo configuration of the SPI you want to open.</p>
 +
<p>[[File:zero2w-img270.png]]</p></li>
 +
<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 make the configuration take effect.</p>
 +
<p>[[File:zero2w-img85.png]]</p></li></ol>
 +
 
 +
<span id="how-to-shut-down-and-restart-the-development-board"></span>
 +
 
 +
== How to shut down and restart the development board ==
 +
 
 +
<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.</p>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''WIFI'''
+
|  
| '''OK'''
+
<p>orangepi@orangepi:~$ '''sudo poweroff'''</p>
 +
|}
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
|-
 
|-
| '''Bluetooth'''
+
|  
| '''OK'''
+
<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-img269.png]]</p>
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
|-
 
|-
| '''LED Light'''
+
|  
| '''OK'''
+
<big><p>'''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 [[Orange Pi Zero 2W#How to turn on the power button in Linux5.4|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;"
 
|-
 
|-
| '''40pin GPIO'''
+
|  
| '''OK'''
+
<p>orangepi@orangepi:~$ '''sudo''' '''reboot'''</p>
|-
 
| '''40pin I2C'''
 
| '''OK'''
 
|-
 
| '''40pin SPI'''
 
| '''OK'''
 
|-
 
| '''40pin UART'''
 
| '''OK'''
 
|-
 
| '''40pin PWM'''
 
| '''OK'''
 
|-
 
| '''Temperature Sensor'''
 
| '''OK'''
 
|-
 
| '''Hardware watchdog'''
 
| '''OK'''
 
|-
 
| '''Mali GPU'''
 
| '''NO'''
 
|-
 
| '''Video codec'''
 
| '''NO'''
 
 
|}
 
|}
 +
</li></ol>
  
{| class="wikitable"
+
<span id="linux-sdkorangepi-build-usage-instructions"></span>
|-
 
| '''24pin expansion board function'''
 
| '''OPi OS Arch'''
 
|-
 
| '''100M network port'''
 
| '''OK'''
 
|-
 
| '''100M Ethernet port light'''
 
| '''OK'''
 
|-
 
| '''USB2.0 HOST x 2'''
 
| '''OK'''
 
|-
 
| '''Infrared reception'''
 
| '''OK'''
 
|-
 
| '''Headphone audio playback'''
 
| '''OK'''
 
|-
 
| '''On/off button'''
 
| '''OK'''
 
|-
 
| '''LRADC''' '''Custom buttons x 2'''
 
| '''OK'''
 
|-
 
| '''TV-OUT'''
 
| '''NO'''
 
|}
 
  
<span id="orange-pi-os-arch-system-user-guide-instructions"></span>
+
= '''Linux SDK——orangepi-build usage instructions''' =
== 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.
+
<span id="compilation-system-requirements"></span>
 +
== Compilation system requirements ==
  
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). The setup steps of the user wizard are as follows:
+
The Linux SDK, '''orangepi-build''', only supports running on X64 computers with '''<span style="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 '''<span style="color:#FF0000">22.04</span>''', it means that the Ubuntu version currently used does not meet the requirements. Please change the system before performing the following operations.
  
<ol style="list-style-type: lower-alpha;">
+
{| class="wikitable" style="width:800px;"  
<li><p>After burning the system, when you start it for the first time and enter the desktop, you will see the user wizard program shown in the figure below.</p>
+
|-
<div class="figure">
+
|
 +
test@test:~$ '''lsb_release -a'''
  
[[File:media/image293.png|576x324px|1]]
+
No LSB modules are available.
  
</div></li>
+
Distributor ID: Ubuntu
<li><p>First you need to select the language you want</p>
 
<div class="figure">
 
  
[[File:media/image294.png|576x324px|2]]
+
Description: Ubuntu 22.04 LTS
  
</div></li>
+
Release: '''<span style="color:#FF0000">22.04</span>'''
<li><p>After selecting the language, the user wizard will immediately switch to the corresponding language interface, as shown below in Chinese</p>
 
<div class="figure">
 
  
[[File:media/image295.png|576x324px|3]]
+
Codename: '''jammy'''
 +
|}
  
</div></li>
+
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''' 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 orangepi-build can be used normally in WSL. In addition, please do not compile the Linux system on the development board. Use orangepi-build. The installation image download address of Ubuntu 22.04 amd64 version is:
<li><p>Then select the area</p>
 
<div class="figure">
 
  
[[File:media/image296.png|576x324px|4]]
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
[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''']
 +
|}
  
</div></li>
+
After 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:
<li><p>Then select the keyboard model</p>
 
<div class="figure">
 
  
[[File:media/image297.png|576x324px|5]]
+
<ol style="list-style-type: lower-alpha;">
 +
<li>For the method of replacing Tsinghua Source, please refer to the instructions on this page.</li>
  
</div></li>
+
{| class="wikitable" style="width:800px;"
<li><p>Then create a new username and set a password</p>
+
|-
<div class="figure">
+
|
 +
[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>Note that the Ubuntu version needs to be switched to 22.04.</li>
  
[[File:media/image298.png|576x324px|6]]
+
[[File:zero2w-img271.png]]
 +
</ol>
 +
<ol start="3" style="list-style-type: lower-alpha;">
 +
<li>The contents of the '''/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/sources.list.bak'''
  
</div></li>
+
test@test:~$ '''sudo vim /etc/apt/sources.list'''
<li><p>Then make sure there is no problem with the selection, and then click the install '''button'''</p>
 
<div class="figure">
 
  
[[File:media/image299.png|576x324px|7]]
+
'''#''' The source code image is commented by default to improve apt update speed. You can uncomment it yourself if necessary.
  
</div></li>
+
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
<li><p>Then wait for the installation to complete</p>
 
<div class="figure">
 
  
[[File:media/image300.png|576x324px|8]]
+
'''#''' deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
  
</div></li>
+
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
<li><p>After the installation is complete, you need to click the '''Finish''' button to restart the system.</p>
 
<div class="figure">
 
  
[[File:media/image301.png|576x324px|9]]
+
'''#''' deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
  
</div></li>
+
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
<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 manually close the Orange Pi Hello program every time you start it.</p>
 
<div class="figure">
 
  
[[File:media/image302.png|576x324px|1]]
+
'''#''' deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
  
</div>
+
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
<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>
 
  
<span id="how-to-set-dt-overlays"></span>
+
'''#''' deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
== How to set DT overlays ==
 
  
The multiplexing functions such as I2C/SPI/UART/PWM in the 40-pin development board are turned off by default in the kernel's dts, and the corresponding DT overlays need to be manually turned on before they can be used.
 
  
The method to open DT overlays in OPi OS Arch system is as follows:
+
'''#''' Pre-release software source, not recommended to be enabled
  
# First open the '''/boot/extlinux/extlinux.conf''' configuration file
+
'''#''' deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
  
[orangepi@orangepi-pc ~]$ '''sudo vim /boot/extlinux/extlinux.conf'''
+
'''#''' deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
 +
|}
 +
</ol>
 +
<ol start="4" style="list-style-type: lower-alpha;">
 +
<li>After the replacement, you need to update the package information and ensure that no errors are reported.</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
test@test:~$ '''sudo apt-get update'''
 +
|}
 +
</ol>
 +
<ol start="5" style="list-style-type: lower-alpha;">
 +
<li>'''<span style="color:#FF0000">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.</span>'''</li></ol>
  
<ol start="2" style="list-style-type: decimal;">
+
<span id="obtain-the-source-code-of-linux-sdk"></span>
<li>Then open the corresponding configuration by adding '''FDTOVERLAYS''' '''/dtbs/allwinner/overlay/xxx.dtbo''' in '''/boot/extlinux/extlinux.conf'''</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.'''
+
== Obtain the source code of linux sdk ==
  
[orangepi@orangepi-pc ~]$ '''sudo vim /boot/extlinux/extlinux.conf'''
+
<span id="download-orangepi-build-from-github"></span>
 +
=== Download orangepi-build from github ===
  
LABEL Orange Pi
+
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:
  
KERNEL /Image
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
test@test:~$ '''sudo apt-get update'''
 +
 
 +
test@test:~$ '''sudo apt-get install -y git'''
  
FDT /dtbs/allwinner/sun50i-h616-orangepi-zero2w.dtb
+
test@test:~$ '''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-build source code as next.'''</big>
  
'''FDTOVERLAYS /dtbs/allwinner/overlay/xxx.dtbo''' #Configuration that needs to be added
+
<div class="figure">
  
<ol start="3" style="list-style-type: decimal;">
+
[[File:zero2w-img272.png|center|800px]]
<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>
 
  
{| class="wikitable"
+
</div>
 +
|}
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"  
 
|-
 
|-
| '''Functions on the development board'''
+
|  
| '''Corresponding DT overlays configuration'''
+
<big>'''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.'''</big>
 +
|}
 +
 
 +
The u-boot and linux kernel versions currently used by the H618 series development boards are as follows:
 +
 
 +
{| class="wikitable" style="width:800px;text-align: center;"
 
|-
 
|-
| '''40pin - i2c0'''
+
| '''branch'''
| '''sun50i-h616-pi-i2c0.dtbo'''
+
| '''u-boot Version'''
 +
| '''linux Kernel version'''
 
|-
 
|-
| '''40pin - i2c1'''
+
| '''current'''
| '''sun50i-h616-pi-i2c1.dtbo'''
+
| '''u-boot v2018.05'''
 +
| '''linux5.4'''
 
|-
 
|-
| '''40pin - i2c2'''
+
| '''next'''
| '''sun50i-h616-pi-i2c2.dtbo'''
+
| '''u-boot v2021.07'''
 +
| '''linux6.1'''
 +
|}
 +
 
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
|-
 
|-
| '''40pin - uart2'''
+
|  
| '''sun50i-h616-pi-uart2.dtbo'''
+
<big>'''The branch mentioned here is not the same thing as the branch of orangepi-build source code, please don't get confused. This branch is mainly used to distinguish different kernel source code versions.'''
 +
 
 +
'''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.'''</big>
 +
|}
 +
 
 +
After downloading, the following files and folders will be included:
 +
 
 +
<ol style="list-style-type: lower-alpha;">
 +
<li><p>'''build.sh''': Compile startup script</p></li>
 +
<li><p>'''external''': Contains configuration files needed to compile the image, specific scripts, and source code of some programs, etc.</p></li>
 +
<li><p>'''LICENSE''': GPL 2 license file</p></li>
 +
<li><p>'''README.md''': orangepi-build documentation</p></li>
 +
<li><p>'''scripts''': Common script for compiling linux images</p></li></ol>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''40pin - uart3'''
+
|  
| '''sun50i-h616-pi-uart3.dtbo'''
+
test@test:~/orangepi-build$ '''ls'''
 +
 
 +
'''build.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;"
 
|-
 
|-
| '''40pin - uart4'''
+
|  
| '''sun50i-h616-pi-uart4.dtbo'''
+
<big>'''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.'''</big>
|-
 
| '''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 - spi1 cs0 cs1'''
 
| '''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="list-style-type: decimal;">
+
<span id="download-the-cross-compilation-tool-chain"></span>
<li>If you need to open multiple configurations at the same time, just add the paths of multiple configurations directly after '''FDTOVERLAYS.''' For example, the configuration of opening i2c1 and uart5 at the same time is as follows</li></ol>
 
  
[orangepi@orangepi-pc ~]$ '''sudo vim /boot/extlinux/extlinux.conf'''
+
=== Download the cross-compilation tool chain ===
  
LABEL Orange Pi
+
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.
  
KERNEL /Image
+
<div class="figure">
  
FDT /dtbs/allwinner/sun50i-h616-orangepi-zero2w.dtb
+
[[File:zero2w-img273.png]]
  
'''FDTOVERLAYS /dtbs/allwinner/overlay/sun50i-h616-pi-i2c1.dtbo /dtbs/allwinner/overlay/sun50i-h616-ph-uart5.dtbo'''
+
</div>
 +
The mirror URL of the cross-compilation tool chain in China is the open source software mirror site of Tsinghua University:
  
<ol start="6" style="list-style-type: decimal;">
+
{| class="wikitable" style="width:800px;"  
<li>After setting, you need to restart the system for the configuration to take effect.</li></ol>
+
|-
 +
|
 +
[https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/ '''https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/''']
 +
|}
  
[orangepi@orangepi-pc ~]$ '''sudo reboot'''
+
After toolchains is downloaded, it will contain multiple versions of cross-compilation '''toolchain''':
  
<span id="how-to-install-software"></span>
+
{| class="wikitable" style="width:800px;"
== How to install software ==
+
|-
 +
|
 +
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
  
You can use the pacman package management tool to install software that is not available in OPi OS. For 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.
+
gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu
 +
 
 +
gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf
  
[orangepi@orangepi-pc ~]$ '''sudo pacman -Syy vim'''
+
gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux
  
<span id="android-12-tv-system-usage-instructions"></span>
+
gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf
= Android 12 TV system usage instructions =
 
  
<span id="supported-android-versions"></span>
+
gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu
== Supported Android versions ==
 
  
{| class="wikitable"
+
gcc-linaro-arm-none-eabi-4.8-2014.04_linux
|-
 
| Android Version
 
| Kernel version
 
|-
 
| '''Android 12 TV Version'''
 
| '''linux5.4'''
 
 
|}
 
|}
  
<span id="android-12-tv-function-adaptation-status"></span>
+
The cross-compilation tool chain used to compile the H618 Linux kernel source code is:
== Android 12 TV function adaptation status ==
 
  
{| class="wikitable"
+
<ol style="list-style-type: lower-alpha;">
 +
<li>linux5.4</li>
 +
{| class="wikitable" style="width:800px;"  
 
|-
 
|-
| '''Motherboard functions'''
+
|  
| '''Android12 TV'''
+
'''gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu'''
 +
|}
 +
</ol>
 +
<ol start="2" style="list-style-type: lower-alpha;">
 +
<li>linux6.1</li>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''HDMI video'''
+
|  
| '''OK'''
+
'''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;"
 
|-
 
|-
| '''HDMI Audio'''
+
|  
| '''OK'''
+
'''gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi'''
 +
|}
 +
</ol>
 +
<ol start="2" style="list-style-type: lower-alpha;">
 +
<li>v2021.07</li>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''Type-C USB2.0 x 2'''
+
|  
| '''OK'''
+
'''gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu'''
 +
|}
 +
</ol>
 +
<span id="orangepi-build-complete-directory-structure-description"></span>
 +
 
 +
=== orangepi-build complete directory structure description ===
 +
 
 +
<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:800px;"
 
|-
 
|-
| '''TF card startup'''
+
|  
| '''OK'''
+
https://github.com/orangepi-xunlong/linux-orangepi/tree/'''orange-pi-5.4-sun50iw9'''
 +
|}
 +
</ol>
 +
<ol start="2" style="list-style-type: lower-alpha;">
 +
<li>b) Linux6.1</li>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''WIFI'''
+
|  
| '''OK'''
+
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;"
 
|-
 
|-
| '''Bluetooth'''
+
|  
| '''OK'''
+
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;"
 
|-
 
|-
| '''USB Camera'''
+
|  
| '''OK'''
+
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><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 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 compilation process is also stored in external.</p></li>
 +
<li><p>'''kernel''': Store the source code of the linux kernel</p></li>
 +
<li><p>'''LICENSE''': GPL 2 license file</p></li>
 +
<li><p>'''README.md''': orangepi-build documentation</p></li>
 +
<li><p>'''output''': Store compiled u-boot, linux and other deb packages, compilation logs, 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</p></li>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''LED Light'''
+
|  
| '''OK'''
+
test@test:~/orangepi-build$ '''ls'''
 +
 
 +
'''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-boot &nbsp;&nbsp;&nbsp;&nbsp; userpatches'''
 +
|}
 +
</ol>
 +
</li></ol>
 +
 
 +
<span id="compile-u-boot"></span>
 +
 
 +
== Compile u-boot ==
 +
 
 +
# Run the build.sh script, remember to add sudo permissions
 +
 
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''40pin GPIO'''
+
|  
| '''OK'''
+
test@test:~/orangepi-build$ '''sudo ./build.sh'''
|-
+
|}
| '''40pin I2C'''
+
 
| '''OK'''
+
<ol start="2" style="list-style-type: decimal;">
 +
<li>Select '''U-boot package''' and press Enter</li>
 +
 
 +
<div class="figure">
 +
 
 +
[[File:zero2w-img274.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>
 +
<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 image.</p></li>
 +
<li><p>The next branch will compile the u-boot v2021.07 version code that needs to be used by the linux6.1 image.</p>
 +
<p>[[File:zero2w-img276.png]]</p></li></ol>
 +
</li>
 +
<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 branch.</p>
 +
<ol style="list-style-type: lower-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: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;"
 
|-
 
|-
| '''40pin SPI1'''
+
|  
| '''OK'''
+
[ o.k. ] Compiling u-boot [ '''v2021.07''' ]
 +
|}
 +
</ol>
 +
<ol start="2" style="list-style-type: lower-alpha;">
 +
<li>Version of the cross-compilation tool chain</li>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''40pin UART'''
+
|  
| '''OK'''
+
[ o.k. ] Compiler version [ '''aarch64-linux-gnu-gcc 11''' ]
 +
|}
 +
</ol>
 +
<ol start="3" style="list-style-type: lower-alpha;">
 +
<li>Path to the compiled u-boot deb package</li>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''40pin PWM'''
+
|  
| '''OK'''
+
[ o.k. ] Target directory [ '''orangepi-build/output/debs/u-boot''' ]
 +
|}
 +
</ol>
 +
<ol start="4" style="list-style-type: lower-alpha;">
 +
<li>The package name of the compiled u-boot deb package</li>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''Temperature Sensor'''
+
|  
| '''OK'''
+
[ o.k. ] File name [ '''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb''' ]
 +
|}
 +
</ol>
 +
<ol start="5" style="list-style-type: lower-alpha;">
 +
<li>Compilation time</li>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''Hardware watchdog'''
+
|  
| '''OK'''
+
[ o.k. ] Runtime [ '''1 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>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''Mali GPU'''
+
|  
| '''OK'''
+
[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=u-boot''' ]
|-
 
| '''Video codec'''
 
| '''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/'''
  
{| class="wikitable"
+
'''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb'''
|-
 
| '''24pin Expansion board function'''
 
| '''Android12 TV'''
 
|-
 
| '''100M network port'''
 
| '''OK'''
 
|-
 
| '''100M Ethernet port light'''
 
| '''OK'''
 
|-
 
| '''USB2.0 HOST x 2'''
 
| '''OK'''
 
|-
 
| '''Infrared reception'''
 
| '''OK'''
 
|-
 
| '''Headphone audio playback'''
 
| '''OK'''
 
|-
 
| '''On/off button'''
 
| '''OK'''
 
|-
 
| '''LRADC''' '''Custom buttons x 2'''
 
| '''OK, The default setting is the volume up and down keys.'''
 
|-
 
| '''TV-OUT'''
 
| '''OK'''
 
 
|}
 
|}
 +
</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>
  
<span id="onboard-led-light-display-instructions"></span>
+
Set the IGNORE_UPDATES variable in u'''userpatches/config-default.conf''' to &quot;yes&quot;
== Onboard LED light display instructions ==
 
  
{| class="wikitable"
+
{| class="wikitable" style="width:800px;"  
 
|-
 
|-
|
+
|  
| '''green light'''
+
test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''
| '''red light'''
 
|-
 
| '''u-boot startup phase'''
 
| '''Off'''
 
| '''on'''
 
|-
 
| '''Kernel boot to enter the system'''
 
| '''on'''
 
| '''on'''
 
|}
 
  
<span id="how-to-return-to-the-previous-interface-in-android"></span>
+
......
== How to return to the previous interface in Android ==
 
  
We 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-clicking the mouse, and the keyboard cannot return.
+
IGNORE_UPDATES=&quot;'''<span style="color:#FF0000">yes</span>'''&quot;
  
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 the return key on the remote control to return to the previous menu. The location of the return key is as shown below. Shown:
+
......
 +
|}
 +
</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'''
  
[[File:media/image303.png|231x185px]]
+
test@test:~/orangepi_build/output/debs/u-boot$ '''scp \'''
  
<span id="how-to-use-adb"></span>
+
'''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb [mailto:root@192.168.1.xxx:/root root@192.168.1.xxx:/root]'''
== How to use ADB ==
+
|}
 +
</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:~$ '''sudo dpkg -i''' '''linux-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;"
 +
|-
 +
|
 +
orangepi@orangepi:~$ '''sudo nand-sata-install'''
 +
|}
 +
</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>
  
<span id="use-network-connection-adb-debugging"></span>
+
[[File:zero2w-img279.png]]
=== Use network connection adb debugging ===
+
</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>
  
'''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.'''
+
[[File:zero2w-img280.png]]
 +
</ol>
 +
<ol start="7" style="list-style-type: lower-alpha;">
 +
<li>Then you can restart the development board to test whether the u-boot modification has taken effect.</li></ol>
 +
</li></ol>
 +
<span id="compile-the-linux-kernel"></span>
  
# Make sure the '''service.adb.tcp.port''' of the Android system is set to 5555 port number
+
== Compile the linux kernel ==
  
apollo-p2:/ # '''getprop | grep &quot;adb.tcp&quot;'''
+
# Run the '''build.sh''' script, remember to add sudo permissions
  
[service.adb.tcp.port]: [5555]
+
::{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
test@test:~/orangepi-build$ '''sudo ./build.sh'''
 +
|}
  
 
<ol start="2" style="list-style-type: decimal;">
 
<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></ol>
+
<li>Select '''Kernel package''' and press Enter</li>
  
apollo-p2:/ # '''setprop service.adb.tcp.port 5555'''<br />
+
<div class="figure">
apollo-p2:/ # '''stop adbd'''
 
  
apollo-p2:/ # '''start adbd'''
+
[[File:zero2w-img281.png]]
  
 +
</div></ol>
 
<ol start="3" style="list-style-type: decimal;">
 
<ol start="3" style="list-style-type: decimal;">
<li>Install adb tool on Ubuntu PC</li></ol>
+
<li>Then you will be prompted whether you need to display the kernel configuration interface. If you do not need to modify the kernel configuration, select the first one. If you need to modify the kernel configuration, select the second one.</li>
 
 
test@test:~$ '''sudo apt-get update'''
 
 
 
test@test:~$ '''sudo apt-get install -y adb'''
 
  
 +
[[File:zero2w-img282.png]]
 +
</ol>
 
<ol start="4" style="list-style-type: decimal;">
 
<ol start="4" style="list-style-type: decimal;">
<li>Then connect network adb on Ubuntu PC</li></ol>
+
<li>Then select the model of the development board</li>
  
test@test:~$ '''adb connect 192.168.1.xxx:5555''' '''(Need to be modified to the IP address of the development board)'''
+
[[File:zero2w-img275.png]]
 +
</ol>
 +
<ol start="5" style="list-style-type: decimal;">
 +
<li>Then select the branch type of the kernel source code</li>
  
* daemon not running; starting now at tcp:5037
+
::a. The current branch will compile the linux5.4 kernel source code
  
* daemon started successfully
+
::b. The next branch will compile the linux6.1 kernel source code
  
connected to 192.168.1.xxx:5555
+
::[[File:zero2w-img276.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>
  
test@test:~$ '''adb devices'''
+
[[File:zero2w-img283.png]]
  
List of devices attached
+
<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>
192.168.1.xxx:5555 device
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
test@test:~/orangepi-build$ '''sudo ./build.sh KERNEL_CONFIGURE=no'''
 +
|}
 +
</ol>
 +
<ol start="2" 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 start="5" style="list-style-type: decimal;">
+
[[File:zero2w-img284.png]]
<li>Then you can log in to the android system through adb shell on Ubuntu PC</li></ol>
+
</ol>
 +
</ol>
 +
<ol start="7" style="list-style-type: decimal;">
 +
<li><p>Part of the information prompted when compiling the next branch kernel source code is explained as follows:</p>
 +
<ol style="list-style-type: lower-alpha;">
 +
<li>Version of the linux kernel source code</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
[ o.k. ] Compiling current kernel [ '''6.1.31''' ]
 +
|}
 +
</ol>
 +
<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>
 +
<ol start="3" style="list-style-type: lower-alpha;">
 +
<li>The default configuration file used by the kernel and the path where it is stored are as follows</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
[ o.k. ] Using kernel config file [ '''orangepi-build/external/config/kernel/linux-6.1-sun50iw9-next.config''' ]
 +
|}
 +
</ol>
 +
<ol start="4" style="list-style-type: lower-alpha;">
 +
<li>The path to the kernel-related deb package generated by compilation</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
[ o.k. ] Target directory [ '''output/debs/''' ]
 +
|}
 +
</ol>
 +
<ol start="5" style="list-style-type: lower-alpha;">
 +
<li>The package name of the kernel image deb package generated by compilation</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
[ o.k. ] File name [ '''linux-image-next-sun50iw9_x.x.x_arm64.deb''' ]
 +
|}
 +
</ol>
 +
<ol start="6" style="list-style-type: lower-alpha;">
 +
<li>Compilation time</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
[ o.k. ] Runtime [ '''10 min''' ]
 +
|}
 +
</ol>
 +
<ol start="7" style="list-style-type: lower-alpha;">
 +
<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.</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=kernel KERNEL_CONFIGURE=no''' ]
 +
|}
 +
</ol>
 +
</li></ol>
 +
<ol start="8" style="list-style-type: decimal;">
 +
<li><p>View the kernel-related deb package generated by compilation</p>
 +
<ol style="list-style-type: lower-alpha;">
 +
<li><p>'''linux-dtb-next-sun50iw9_x.x.x_arm64.deb''' Contains dtb files used by the kernel</p></li>
 +
<li><p>'''linux-headers-next-sun50iw9_x.x.x_arm64.deb''' Contains kernel header files</p></li>
 +
<li><p>'''linux-image-next-sun50iw9_x.x.x_arm64.deb''' Contains kernel images and kernel modules</p></li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
test@test:~/orangepi-build$ '''ls output/debs/linux-*'''
  
test@test:~$ '''adb shell'''
+
output/debs/linux-dtb-next-sun50iw9_x.x.x_arm64.deb
  
apollo-p2:/ #
+
output/debs/linux-headers-next-sun50iw9_x.x.x_arm64.deb
  
<span id="use-data-cable-to-connect-adb-debugging"></span>
+
output/debs/linux-image-next-sun50iw9_x.x.x_arm64.deb
=== Use data cable to connect adb debugging ===
+
|}
 +
</ol>
 +
</li></ol>
 +
<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 found'''), otherwise the modifications will be restored. The method is as follows:</li>
  
# 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.
+
Set the IGNORE_UPDATES variable in '''userpatches/config-default.conf''' to &quot;yes&quot;
  
[[File:media/image304.png|178x178px]] [[File:media/image305.png|276x147px|001]]
+
{| class="wikitable" style="width:800px;"
 +
|-
 +
|  
 +
test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''
  
<ol start="2" style="list-style-type: decimal;">
+
IGNORE_UPDATES=&quot;'''<span style="color:#FF0000">yes</span>'''&quot;
<li>Install adb tool on Ubuntu PC</li></ol>
+
|}
 +
</ol>
 +
<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</p>
 +
<ol style="list-style-type: lower-alpha;">
 +
<li>Upload the compiled deb package of the Linux kernel to the Linux system of the development board</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
test@test:~/orangepi-build$ '''cd output/debs'''
  
test@test:~$ '''sudo apt-get update'''
+
test@test:~/orangepi-build/output/debs$ '''scp \'''
  
test@test:~$ '''sudo apt-get install -y adb'''
+
'''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 kernel just uploaded.</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
orangepi@orangepi:~$ '''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 kernel-related modifications have taken effect.</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
orangepi@orangepi:~$ '''sudo''' '''reboot'''
 +
|}
 +
</ol>
 +
</li></ol>
 +
<span id="compile-rootfs"></span>
  
<ol start="3" style="list-style-type: decimal;">
+
== Compile rootfs ==
<li>Check whether the ADB device is recognized</li></ol>
 
  
test@test:~$ '''adb devices'''
+
# Run the build.sh script, remember to add sudo permissions
  
List of devices attached
+
::{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
test@test:~/orangepi-build$ '''sudo ./build.sh'''
 +
|}
  
4c00146473c28651dd0 device
+
<ol start="2" style="list-style-type: decimal;">
 +
<li>Select '''Rootfs and all deb packages''' and press Enter</li>
  
<ol start="4" style="list-style-type: decimal;">
+
<div class="figure">
<li>Then you can log in to the android system through adb shell on Ubuntu PC</li></ol>
 
  
test@test:~$ '''adb shell'''
+
[[File:zero2w-img285.png]]
  
apollo-p2:/ $
+
</div></ol>
 +
<ol start="3" style="list-style-type: decimal;">
 +
<li>Then select the model of the development board</li>
  
<span id="view-how-to-set-hdmi-display-resolution"></span>
+
[[File:zero2w-img275.png]]
== View how to set HDMI display resolution ==
+
</ol>
 +
<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>
  
<ol style="list-style-type: decimal;">
+
[[File:zero2w-img276.png]]
<li><p>Enter first '''Settings'''</p>
+
</ol>
<p>[[File:media/image306.png|234x83px]]</p></li>
+
</li></ol>
<li><p>Then select '''Device Preferences'''</p>
+
<ol start="5" style="list-style-type: decimal;">
<p>[[File:media/image307.png|415x170px]]</p></li>
+
<li>Then select the type of rootfs</li>
<li><p>Then select '''Display &amp; Sound'''</p>
 
<p>[[File:media/image308.png|420x133px]]</p></li>
 
<li><p>Then select '''Advanced display settings'''</p>
 
<p>[[File:media/image309.png|423x96px]]</p></li>
 
<li><p>Then select '''HDMI output mode'''</p>
 
<p>[[File:media/image310.png|423x101px]]</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:media/image311.png|429x136px]]</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:media/image312.png|429x242px]]</p></li></ol>
 
  
<span id="hdmi-to-vga-display-test-1"></span>
+
[[File:zero2w-img286.png]]
=== HDMI to VGA display test ===
+
</ol>
 
+
<ol start="6" style="list-style-type: decimal;">
<ol style="list-style-type: decimal;">
+
<li><p>Then select the type of image</p>
<li><p>First you need to prepare the following accessories</p>
 
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li>HDMI to VGA converter</li></ol>
+
<li><p>'''Image with console interface (server)''' Represents the image of the server version, which is relatively small in size.</p></li>
</li></ol>
+
<li><p>'''Image with desktop environment''' Represents an image with a desktop, which is relatively large in size.</p></li>
  
[[File:media/image144.png|155x104px]]
+
<div class="figure">
  
<ol start="2" style="list-style-type: lower-alpha;">
+
[[File:zero2w-img287.png]]
<li>A VGA cable and a Mini HDMI male to HDMI female adapter</li></ol>
 
  
[[File:media/image145.png|145x131px]] [[File:media/image146.png|219x124px]]
+
</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>
  
<ol start="3" style="list-style-type: lower-alpha;">
+
<div class="figure">
<li>A monitor or TV that supports VGA interface</li></ol>
 
  
<!-- -->
+
[[File:zero2w-img288.png]]
<ol start="2" style="list-style-type: decimal;">
 
<li>HDMI to VGA display test is as follows</li></ol>
 
  
[[File:media/image313.png|575x327px]]
+
</div>
 
+
</ol>
'''When using HDMI to VGA display, the development board and the 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.'''
+
<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>
  
<span id="wi-fi-connection-method"></span>
+
[[File:zero2w-img289.png]]
== WI-FI connection method ==
 
  
# Choose first '''Settings'''
+
[[File:zero2w-img290.png]]
  
[[File:media/image306.png|234x83px]]
+
You can then select additional packages that need to be installed. Please press the Enter key here to skip directly.
  
<ol start="2" style="list-style-type: decimal;">
+
[[File:zero2w-img291.png]]
<li>Then select '''Network &amp; Internet'''</li></ol>
+
</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 '''bullseye''' ]
 +
|}
 +
</ol>
 +
<ol start="2" style="list-style-type: lower-alpha;">
 +
<li>The storage path of the compiled rootfs compressed package</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
[ o.k. ] Target directory [ '''orangepi-build/external/cache/rootfs''' ]
 +
|}
 +
</ol>
 +
<ol start="3" style="list-style-type: lower-alpha;">
 +
<li>The name of the rootfs compressed package generated by compilation</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
[ o.k. ] File name [ '''bullseye-xfce-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>
  
[[File:media/image314.png|373x103px]]
+
:a) '''bullseye''' represents the type of Linux distribution of rootfs
  
<ol start="3" style="list-style-type: decimal;">
+
:b) '''xfce''' indicates that the rootfs is the desktop version, and if it is cli, it indicates the server version.
<li>Then turn on WI-FI</li></ol>
 
  
[[File:media/image315.png|381x50px]]
+
:c) '''arm64''' represents the architecture type of rootfs
  
<ol start="4" style="list-style-type: decimal;">
+
:d) '''25250ec7002de9e81a41de169f1f89721''' 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
<li>After turning on WI-FI, you can see the searched signals under '''Available networks'''.</li></ol>
+
</ol>
 +
<ol start="2" style="list-style-type: lower-alpha;">
 +
<li>'''bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.list''' Lists the package names of all packages installed by rootfs</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
test@test:~/orangepi-build$ '''ls external/cache/rootfs/'''
  
[[File:media/image316.png|381x187px]]
+
bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4
  
<ol start="5" style="list-style-type: decimal;">
+
bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.current
<li>After selecting the WI-FI you want to connect to, the password input interface shown below will pop up.</li></ol>
 
  
<div class="figure">
+
bullseye-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>
  
[[File:media/image317.png|386x180px|Screenshot_20220104-164114]]
+
<span id="compile-linux-image"></span>
  
</div>
+
== Compile linux image ==
<ol start="6" style="list-style-type: decimal;">
 
<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.</li></ol>
 
  
<div class="figure">
+
# Run the '''build.sh''' script, remember to add sudo permissions
  
[[File:media/image318.png|401x165px|图片1]]
+
::{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
test@test:~/orangepi-build$ '''sudo ./build.sh'''
 +
|}
  
</div>
+
<ol start="2" style="list-style-type: decimal;">
<ol start="7" style="list-style-type: decimal;">
+
<li>Select '''Full OS image for flashing''' and press Enter</li>
<li>The display after successful WI-FI connection is as shown below</li></ol>
 
  
[[File:media/image319.png|402x141px]]
+
<div class="figure">
 
 
<span id="how-to-use-wi-fi-hotspot"></span>
 
== How to use WI-FI hotspot ==
 
 
 
# First, please make sure that the Ethernet port is connected to the network cable and can access the Internet normally.
 
# Then select '''Settings'''
 
  
[[File:media/image306.png|234x83px]]
+
[[File:zero2w-img292.png]]
  
 +
</div></ol>
 
<ol start="3" style="list-style-type: decimal;">
 
<ol start="3" style="list-style-type: decimal;">
<li>Then select '''Network &amp; Internet'''</li></ol>
+
<li>Then select the model of the development board</li>
 
 
[[File:media/image314.png|373x103px]]
 
  
 +
[[File:zero2w-img275.png]]
 +
</ol>
 
<ol start="4" style="list-style-type: decimal;">
 
<ol start="4" style="list-style-type: decimal;">
<li>Then select '''WIFI hotspot'''</li></ol>
+
<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>
  
[[File:media/image320.png|378x104px]]
+
[[File:zero2w-img276.png]]
 +
</ol>
 +
</li></ol>
 +
<ol start="5" style="list-style-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 branch.</p>
 +
<ol style="list-style-type: lower-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:zero2w-img277.png]]</p></li></ol>
 +
</li>
 +
<li><p>Then select the type of rootfs</p></li>
  
<ol start="5" style="list-style-type: decimal;">
+
[[File:zero2w-img286.png]]
<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)</li></ol>
+
</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>'''Image 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>
  
[[File:media/image321.png|402x174px]]
+
<div class="figure">
  
<ol start="6" style="list-style-type: decimal;">
+
[[File:zero2w-img287.png]]
<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_7132''') 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>
 
  
[[File:media/image322.png|269x191px]]
+
</div></ol>
 +
</li></ol>
 +
<ol start="8" 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>
  
<ol start="7" style="list-style-type: decimal;">
+
<div class="figure">
<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 '''WI-FI Hotspot''' of the development board can be used normally.</li></ol>
 
  
[[File:media/image323.png|269x125px]]
+
[[File:zero2w-img288.png]]
  
<span id="how-to-check-the-ip-address-of-the-ethernet-port"></span>
+
</div></ol>
== How to check the IP address of the Ethernet port ==
+
<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>
  
# 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-img289.png]]
  
[[File:media/image107.png|338x229px]]
+
[[File:zero2w-img290.png]]
  
<ol start="2" style="list-style-type: decimal;">
+
You can then select additional packages that need to be installed. Please press the Enter key here to skip directly.
<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:media/image324.png|431x161px]]</p></li>
 
<li><p>Then select '''Network &amp; Internet'''</p>
 
<p>[[File:media/image325.png|576x186px]]</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:media/image326.png|576x200px]]</p></li></ol>
 
  
<span id="bluetooth-connection-method"></span>
+
[[File:zero2w-img291.png]]
== Bluetooth connection method ==
+
</ol>
 +
<ol start="10" style="list-style-type: decimal;">
 +
<li>Then the compilation of the linux image will begin. The general process of compilation is as follows</li>
  
# Choose first '''Settings'''
+
::a. Initialize the compilation environment of Ubuntu PC and install the software packages required for the compilation process.
  
[[File:media/image306.png|234x83px]]
+
::b. Download the source code of u-boot and linux kernel (if already cached, only update the code)
  
<ol start="2" style="list-style-type: decimal;">
+
::c. Compile u-boot source code and generate u-boot deb package
<li>Then select '''Bluetooth'''</li></ol>
 
  
[[File:media/image327.png|377x111px]]
+
::d. Compile linux source code and generate linux-related deb packages
  
<ol start="3" style="list-style-type: decimal;">
+
::e. Make the deb package of linux firmware
<li>Then Open '''Bluetooth Enable'''</li></ol>
 
  
[[File:media/image328.png|384x180px]]
+
::f. Make the deb package of orangepi-config tool
  
<ol start="4" style="list-style-type: decimal;">
+
::g. Create a deb package with board-level support
<li>Then click '''Pair new device'''to start scanning for surrounding Bluetooth devices</li></ol>
 
  
[[File:media/image329.png|389x129px]]
+
::h. If you compile the desktop version image, you will also create a desktop-related deb package.
  
<ol start="5" style="list-style-type: decimal;">
+
::i. Check whether rootfs has been cached. If not, re-create rootfs. If it has been cached, decompress it directly and use it.
<li>The searched Bluetooth devices will be displayed under '''Available devices'''</li></ol>
 
  
[[File:media/image330.png|407x181px]]
+
::j. Install the deb package generated previously into rootfs
  
<ol start="6" style="list-style-type: decimal;">
+
::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.
<li>Then click on the Bluetooth device you want to connect to start pairing. When the following interface pops up, please use the mouse to select the '''Pair'''option</li></ol>
 
  
[[File:media/image331.png|420x115px]]
+
::l. Then create the image file and format the partition. The default type is ext4.
  
<ol start="7" style="list-style-type: decimal;">
+
::m. Then copy the configured rootfs to the mirror partition.
<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></ol>
 
  
[[File:media/image332.png|178x200px]]
+
::n. Then update initramfs
 
 
<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></ol>
 
 
 
[[File:media/image333.png|430x136px]]
 
 
 
<ol start="9" 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></ol>
 
 
 
[[File:media/image334.png|433x113px]]
 
 
 
<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></ol>
 
 
 
[[File:media/image335.png|432x209px]]
 
 
 
<span id="how-to-set-usb0-to-host-mode-1"></span>
 
== How to set USB0 to HOST mode ==
 
 
 
As shown in the figure below, there are two Type-C interfaces 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.
 
 
 
[[File:media/image160.png|346x171px]]
 
 
 
USB0 of the 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 power supply, so that USB1 can be directly used to connect USB devices .
 
 
 
If you want to use USB0 to connect USB devices, you need to set USB0 to HOST mode. The method is as follows:
 
  
 +
::o. Finally, write the bin file of u-boot into the image through the dd command.
 +
</ol>
 +
<ol start="11" style="list-style-type: decimal;">
 +
<li><p>After compiling the image, the following message will be displayed</p>
 
<ol style="list-style-type: lower-alpha;">
 
<ol style="list-style-type: lower-alpha;">
<li>Run the following command to set USB0 to HOST mode:</li></ol>
+
<li>The storage path of the compiled image</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
[ o.k. ] Done building [ '''output/images/orangepizero2w_x.x.x_debian_bullseye_linux6.1.xx_xfce_desktop/orangepizero2w_x.x.x_debian_bullseye_linux6.1.xx_xfce_desktop.img''' ]
 +
|}
 +
</ol>
 +
<ol start="2" style="list-style-type: lower-alpha;">
 +
<li>Compilation time</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
'''[ o.k. ] Runtime [ 19 min ]'''
 +
|}
 +
</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 [ '''sudo ./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>
  
apollo-p2:/ # '''cat /sys/devices/platform/soc@3000000/soc@3000000\:usbc0@0/usb_host'''
+
= '''Instructions for using the Orange Pi OS Arch system''' =
  
host_chose finished!
+
<span id="orange-pi-os-arch-system-function-adaptation-status"></span>
 +
== Orange Pi OS Arch system function adaptation status ==
  
apollo-p2:/ #
+
{| class="wikitable" style="width:800px;text-align: center;"
 +
|-
 +
| '''Motherboard functions'''
 +
| '''OPi OS Arch'''
 +
|-
 +
| '''HDMI video'''
 +
| '''OK'''
 +
|-
 +
| '''HDMI Audio'''
 +
| '''OK'''
 +
|-
 +
| '''Type-C USB2.0 x 2'''
 +
| '''OK'''
 +
|-
 +
| '''TF Card Startup'''
 +
| '''OK'''
 +
|-
 +
| '''WIFI'''
 +
| '''OK'''
 +
|-
 +
| '''Bluetooth'''
 +
| '''OK'''
 +
|-
 +
| '''LED Light'''
 +
| '''OK'''
 +
|-
 +
| '''40pin GPIO'''
 +
| '''OK'''
 +
|-
 +
| '''40pin I2C'''
 +
| '''OK'''
 +
|-
 +
| '''40pin SPI'''
 +
| '''OK'''
 +
|-
 +
| '''40pin UART'''
 +
| '''OK'''
 +
|-
 +
| '''40pin PWM'''
 +
| '''OK'''
 +
|-
 +
| '''Temperature Sensor'''
 +
| '''OK'''
 +
|-
 +
| '''Hardware watchdog'''
 +
| '''OK'''
 +
|-
 +
| '''Mali GPU'''
 +
| '''<span style="color:#FF0000">NO</span>'''
 +
|-
 +
| '''Video codec'''
 +
| '''<span style="color:#FF0000">NO</span>'''
 +
|}
  
<ol start="2" style="list-style-type: lower-alpha;">
+
{| class="wikitable" style="width:800px;text-align: center;"
<li>Run the following command to switch back to Device mode</li></ol>
+
|-
 
+
| '''24pin expansion board function'''
apollo-p2:/ # '''cat /sys/devices/platform/soc@3000000/soc@3000000\:usbc0@0/usb_device'''
+
| '''OPi OS Arch'''
 
+
|-
device_chose finished!
+
| '''100M network port'''
 +
| '''OK'''
 +
|-
 +
| '''100M Ethernet port light'''
 +
| '''OK'''
 +
|-
 +
| '''USB2.0 HOST x 2'''
 +
| '''OK'''
 +
|-
 +
| '''Infrared reception'''
 +
| '''OK'''
 +
|-
 +
| '''Headphone audio playback'''
 +
| '''OK'''
 +
|-
 +
| '''On/off button'''
 +
| '''OK'''
 +
|-
 +
| '''LRADC''' '''Custom buttons x 2'''
 +
| '''OK'''
 +
|-
 +
| '''TV-OUT'''
 +
| '''<span style="color:#FF0000">NO</span>'''
 +
|}
  
apollo-p2:/ #
+
<span id="orange-pi-os-arch-system-user-guide-instructions"></span>
  
<ol start="3" style="list-style-type: lower-alpha;">
+
== Orange Pi OS Arch System User Guide Instructions ==
<li>The command to view the current mode of USB0 is</li></ol>
 
  
apollo-p2:/ # '''cat /sys/devices/platform/soc@3000000/soc@3000000\:usbc0@0/otg_role'''
+
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.
  
usb_host
+
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). The setup steps of the user wizard are as follows:
  
<span id="how-to-use-usb-camera"></span>
+
<ol style="list-style-type: lower-alpha;">
== How to use USB camera ==
+
<li><p>After burning the system, when you start it for the first time and enter the desktop, you will see the user wizard program shown in the figure below.</p>
 +
<div class="figure">
  
# First insert the USB (UVC protocol) camera into the USB interface of the development board
+
[[File:zero2w-img293.png]]
# If the USB camera is recognized normally, the corresponding video device node will be generated under /dev
 
  
console:/ # '''ls /dev/video0'''
+
</div></li>
 +
<li><p>First you need to select the language you want</p>
 +
<div class="figure">
  
/dev/video0
+
[[File:zero2w-img294.png]]
 
 
<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 the USB camera test APP from the '''official tool''' on the development board information download page</p></li></ol>
 
  
 +
</div></li>
 +
<li><p>After selecting the language, the user wizard will immediately switch to the corresponding language interface, as shown below in Chinese</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image336.png|340x184px|1695368427270]]
+
[[File:zero2w-img295.png]]
  
</div>
+
</div></li>
 +
<li><p>Then select the area</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image337.png|575x138px|1695368570150]]
+
[[File:zero2w-img296.png]]
  
</div>
+
</div></li>
<ol start="5" style="list-style-type: decimal;">
+
<li><p>Then select the keyboard model</p>
<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>
+
<div class="figure">
  
test@test:~$ '''adb install usbcamera.apk'''
+
[[File:zero2w-img297.png]]
  
<ol start="6" style="list-style-type: decimal;">
+
</div></li>
<li>After installation, you can see the startup icon of the USB camera on the Android desktop.</li></ol>
+
<li><p>Then create a new username and set a password</p>
 +
<div class="figure">
  
[[File:media/image338.png|576x132px]]
+
[[File:zero2w-img298.png]]
  
<ol start="7" style="list-style-type: decimal;">
+
</div></li>
<li>Then double-click to open the USB camera APP and you can see the output video of the USB camera.</li></ol>
+
<li><p>Then make sure there is no problem with the selection, and then click the install '''button'''</p>
 +
<div class="figure">
  
<span id="android-system-root-description"></span>
+
[[File:zero2w-img299.png]]
== Android system ROOT description ==
 
  
'''The Android system released by Orange Pi has been ROOT and can be tested using the following method.'''
+
</div></li>
 +
<li><p>Then wait for the installation to complete</p>
 +
<div class="figure">
  
# Download from the '''official tool''' on the development board data download page '''rootcheck.apk'''
+
[[File:zero2w-img300.png]]
  
 +
</div></li>
 +
<li><p>After the installation is complete, you need to click the '''Finish''' button to restart the system.</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image336.png|340x184px|1695368427270]]
+
[[File:zero2w-img301.png]]
  
</div>
+
</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 manually close the Orange Pi Hello program every time you start it.</p>
 
<div class="figure">
 
<div class="figure">
  
[[File:media/image339.png|576x159px|1695368626097]]
+
[[File:zero2w-img302.png]]
  
 
</div>
 
</div>
<ol start="2" style="list-style-type: decimal;">
+
<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>
<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></ol>
 
  
test@test:~$ '''adb install rootcheck.apk'''
+
<span id="how-to-set-dt-overlays"></span>
 +
== How to set DT overlays ==
  
<ol start="4" style="list-style-type: decimal;">
+
The multiplexing functions such as I2C/SPI/UART/PWM in the 40-pin development board are turned off by default in the kernel's dts, and the corresponding DT overlays need to be manually turned on before they can be used.
<li>After installation, you can see the startup icon of the ROOT test tool on the Android desktop.</li></ol>
 
  
[[File:media/image340.png|575x119px]]
+
The method to open DT overlays in OPi OS Arch system is as follows:
  
<ol start="5" style="list-style-type: decimal;">
+
# First open the '''/boot/extlinux/extlinux.conf''' configuration file
<li>The display interface after opening the '''ROOT test tool''' for the first time is as shown below</li></ol>
 
  
[[File:media/image341.png|575x162px]]
+
::{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
[orangepi@orangepi-pc ~]$ '''sudo vim /boot/extlinux/extlinux.conf'''
 +
|}
  
<ol start="6" style="list-style-type: decimal;">
+
<ol start="2" 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></ol>
+
<li>Then open the corresponding configuration by adding '''FDTOVERLAYS''' '''/dtbs/allwinner/overlay/xxx.dtbo''' in '''/boot/extlinux/extlinux.conf'''</li>
  
[[File:media/image342.png|575x161px]]
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<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.'''</big>
 +
|}
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
[orangepi@orangepi-pc ~]$ '''sudo vim /boot/extlinux/extlinux.conf'''
  
<span id="how-to-use-miracastreceiver-to-cast-the-mobile-phone-screen-to-the-development-board"></span>
+
LABEL Orange Pi
== How to use MiracastReceiver to cast the mobile phone screen to the development board ==
 
  
<ol style="list-style-type: decimal;">
+
KERNEL /Image
<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:media/image343.png|416x89px]]</p></li>
 
<li><p>The interface after '''MiracastReceiver''' is opened is as follows</p>
 
<div class="figure">
 
  
[[File:media/image344.png|576x324px|Screenshot_20230901-095945]]
+
FDT /dtbs/allwinner/sun50i-h616-orangepi-zero2w.dtb
  
</div></li>
+
'''FDTOVERLAYS /dtbs/allwinner/overlay/<span style="color:#FF0000">xxx.dtbo</span>''' #Configuration that needs to be added
<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.</p>
+
|}
<p>[[File:media/image345.png|138x266px]]</p></li>
+
</ol>
<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>
+
<ol start="3" style="list-style-type: decimal;">
<p>[[File:media/image346.png|144x302px]]</p></li>
+
<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>
<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>
+
{| class="wikitable" style="width:800px;"
<p>[[File:media/image347.png|468x265px]]</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:media/image348.png|559x453px]]</p></li></ol>
+
<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>
  
<span id="method-of-turning-on-and-off-the-machine-through-buttons-or-infrared-remote-control"></span>
+
{| class="wikitable" style="width:800px;text-align: center;"
== Method of turning on and off the machine through buttons or infrared remote control ==
+
|-
 
+
| '''Functions on the development board'''
We 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.
+
| '''Corresponding DT overlays configuration'''
 
+
|-
[[File:media/image107.png|338x229px]]
+
| '''40pin - i2c0'''
 
+
| '''sun50i-h616-pi-i2c0.dtbo'''
The location of the power button on the 24pin expansion board is as shown in the figure below:
+
|-
 
+
| '''40pin - i2c1'''
[[File:media/image269.png|190x98px]]
+
| '''sun50i-h616-pi-i2c1.dtbo'''
 
+
|-
The location of the infrared remote control power button is as follows:
+
| '''40pin - i2c2'''
 
+
| '''sun50i-h616-pi-i2c2.dtbo'''
[[File:media/image349.png|191x179px]]
+
|-
 
+
| '''40pin - uart2'''
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 figure below, and then select '''OK''' to shut down the Android system.
+
| '''sun50i-h616-pi-uart2.dtbo'''
 
+
|-
[[File:media/image350.png|547x108px]]
+
| '''40pin - uart3'''
 
+
| '''sun50i-h616-pi-uart3.dtbo'''
After shutting down, press and hold the power button or the power button on the infrared remote control again to turn it on.
+
|-
 
+
| '''40pin - uart4'''
<span id="pin-interface-gpio-uart-spi-test"></span>
+
| '''sun50i-h616-pi-uart4.dtbo'''
== 40pin interface GPIO, UART, SPI test ==
+
|-
 
+
| '''40pin - uart5'''
'''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.'''
+
| '''sun50i-h616-ph-uart5.dtbo'''
 
+
|-
<span id="pin-gpio-port-test-method"></span>
+
| '''40pin - pwm1'''
=== 40pin GPIO port test method ===
+
| '''sun50i-h616-pi-pwm1.dtbo'''
 
+
|-
# First open wiringOP APP on the desktop
+
| '''40pin - pwm2'''
 
+
| '''sun50i-h616-pi-pwm2.dtbo'''
[[File:media/image351.png|571x132px]]
+
|-
 
+
| '''40pin - pwm3'''
<ol start="2" style="list-style-type: decimal;">
+
| '''sun50i-h616-pi-pwm3.dtbo'''
<li>Then click the '''GPIO_TEST''' button to open the GPIO test interface</li></ol>
+
|-
 +
| '''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 - spi1 cs0 cs1'''
 +
| '''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>
 +
<ol start="5" style="list-style-type: decimal;">
 +
<li>If you need to open multiple configurations at the same time, just add the paths of multiple configurations directly after '''FDTOVERLAYS.''' For example, the configuration of opening i2c1 and uart5 at the same time is as follows</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
[orangepi@orangepi-pc ~]$ '''sudo vim /boot/extlinux/extlinux.conf'''
  
[[File:media/image352.png|575x136px]]
+
LABEL Orange Pi
  
<ol start="3" style="list-style-type: decimal;">
+
KERNEL /Image
<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></ol>
 
  
[[File:media/image353.png|575x331px]]
+
FDT /dtbs/allwinner/sun50i-h616-orangepi-zero2w.dtb
  
<ol start="4" style="list-style-type: decimal;">
+
'''FDTOVERLAYS <span style="color:#FF0000">/dtbs/allwinner/overlay/sun50i-h616-pi-i2c1.dtbo /dtbs/allwinner/overlay/sun50i-h616-ph-uart5.dtbo</span>'''
<li>Then click the '''GPIO READALL''' button, and the output information is as shown below:</li></ol>
+
|}
 +
</ol>
 +
<ol start="6" style="list-style-type: decimal;">
 +
<li>After setting, you need to restart the system for the configuration to take effect.</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
[orangepi@orangepi-pc ~]$ '''sudo reboot'''
 +
|}
 +
</ol>
 +
<span id="how-to-install-software"></span>
  
<div class="figure">
+
== How to install software ==
  
[[File:media/image354.png|576x324px|Screenshot_20230901-103250]]
+
You can use the pacman package management tool to install software that is not available in OPi OS. For 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.
  
</div>
+
{| class="wikitable" style="width:800px;"  
<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></ol>
+
|
 +
[orangepi@orangepi-pc ~]$ '''sudo pacman -Syy vim'''
 +
|}
  
[[File:media/image355.png|486x304px]]
+
<span id="android-12-tv-system-usage-instructions"></span>
  
<ol start="6" style="list-style-type: decimal;">
+
= '''Android 12 TV system usage instructions''' =
<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></ol>
 
  
[[File:media/image356.png|453x289px]]
+
<span id="supported-android-versions"></span>
 +
== Supported Android versions ==
  
<ol start="7" style="list-style-type: decimal;">
+
{| class="wikitable" style="width:800px;text-align: center;"
<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></ol>
+
|-
 +
| Android Version
 +
| Kernel version
 +
|-
 +
| '''Android 12 TV Version'''
 +
| '''linux5.4'''
 +
|}
  
[[File:media/image357.png|452x280px]]
+
<span id="android-12-tv-function-adaptation-status"></span>
 
+
== Android 12 TV function adaptation status ==
<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></ol>
 
  
[[File:media/image358.png|417x264px]]
+
{| class="wikitable" style="width:800px;text-align: center;"
 
 
<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.
 
 
 
{| class="wikitable"
 
 
|-
 
|-
| '''GPIO序号'''
+
| '''Motherboard functions'''
| '''GPIO'''
+
| '''Android12 TV'''
| '''功能'''
 
| '''引脚'''
 
|
 
| '''引脚'''
 
| '''功能'''
 
| '''GPIO'''
 
| '''GPIO序号'''
 
 
|-
 
|-
| style="text-align: left;"|
+
| '''HDMI video'''
| style="text-align: left;"|
+
| '''OK'''
| '''3.3V'''
 
| '''1'''
 
|
 
| '''2'''
 
| '''5V'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
| '''264'''
+
| '''HDMI Audio'''
| '''PI8'''
+
| '''OK'''
| '''TWI1-SDA'''
 
| '''3'''
 
|
 
| '''4'''
 
| '''5V'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
| '''263'''
+
| '''Type-C USB2.0 x 2'''
| '''PI7'''
+
| '''OK'''
| '''TWI1-SCL'''
 
| '''5'''
 
|
 
| '''6'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
| '''269'''
+
| '''TF card startup'''
| '''PI13'''
+
| '''OK'''
| '''PWM3'''
+
|-
| '''7'''
+
| '''WIFI'''
|
+
| '''OK'''
| '''8'''
 
| '''UART0_TX'''
 
| '''PH0'''
 
| '''224'''
 
 
|-
 
|-
| style="text-align: left;"|
+
| '''Bluetooth'''
| style="text-align: left;"|
+
| '''OK'''
| '''GND'''
 
| '''9'''
 
|
 
| '''10'''
 
| '''UART0_RX'''
 
| '''PH1'''
 
| '''225'''
 
 
|-
 
|-
| '''226'''
+
| '''USB Camera'''
| '''PH2'''
+
| '''OK'''
| '''UART5_TX'''
 
| '''11'''
 
|
 
| '''12'''
 
| style="text-align: left;"|
 
| '''PI1'''
 
| '''257'''
 
 
|-
 
|-
| '''227'''
+
| '''LED Light'''
| '''PH3'''
+
| '''OK'''
| '''UART5_RX'''
 
| '''13'''
 
|
 
| '''14'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
| '''261'''
+
| '''40pin GPIO'''
| '''PI5'''
+
| '''OK'''
| '''UART2_TX'''
 
| '''15'''
 
|
 
| '''16'''
 
| '''PWM4'''
 
| '''PI14'''
 
| '''270'''
 
 
|-
 
|-
| style="text-align: left;"|
+
| '''40pin I2C'''
| style="text-align: left;"|
+
| '''OK'''
| '''3.3V'''
+
|-
| '''17'''
+
| '''40pin SPI1'''
|
+
| '''OK'''
| '''18'''
 
| style="text-align: left;"|
 
| '''PH4'''
 
| '''228'''
 
 
|-
 
|-
| '''231'''
+
| '''40pin UART'''
| '''PH7'''
+
| '''OK'''
| '''SPI1_MOSI'''
 
| '''19'''
 
|
 
| '''20'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
| '''232'''
+
| '''40pin PWM'''
| '''PH8'''
+
| '''OK'''
| '''SPI1_MISO'''
 
| '''21'''
 
|
 
| '''22'''
 
| '''UART2_RX'''
 
| '''PI6'''
 
| '''262'''
 
 
|-
 
|-
| '''230'''
+
| '''Temperature Sensor'''
| '''PH6'''
+
| '''OK'''
| '''SPI1_CLK'''
 
| '''23'''
 
|
 
| '''24'''
 
| '''SPI1_CS0'''
 
| '''PH5'''
 
| '''229'''
 
 
|-
 
|-
| style="text-align: left;"|
+
| '''Hardware watchdog'''
| style="text-align: left;"|
+
| '''OK'''
| '''GND'''
 
| '''25'''
 
|
 
| '''26'''
 
| '''SPI1_CS1'''
 
| '''PH9'''
 
| '''233'''
 
 
|-
 
|-
| '''266'''
+
| '''Mali GPU'''
| '''PI10'''
+
| '''OK'''
| '''TWI2-SDA'''
 
| '''27'''
 
|
 
| '''28'''
 
| '''TWI2-SCL'''
 
| '''PI9'''
 
| '''265'''
 
 
|-
 
|-
| '''256'''
+
| '''Video codec'''
| '''PI0'''
+
| '''OK'''
| style="text-align: left;"|
+
|}
| '''29'''
+
 
|
+
{| class="wikitable" style="width:800px;text-align: center;"
| '''30'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
| '''271'''
+
| '''24pin Expansion board function'''
| '''PI15'''
+
| '''Android12 TV'''
| style="text-align: left;"|
 
| '''31'''
 
|
 
| '''32'''
 
| '''PWM1'''
 
| '''PI11'''
 
| '''267'''
 
 
|-
 
|-
| '''268'''
+
| '''100M network port'''
| '''PI12'''
+
| '''OK'''
| '''PWM2'''
 
| '''33'''
 
|
 
| '''34'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
| '''258'''
+
| '''100M Ethernet port light'''
| '''PI2'''
+
| '''OK'''
| style="text-align: left;"|
 
| '''35'''
 
|
 
| '''36'''
 
| style="text-align: left;"|
 
| '''PC12'''
 
| '''76'''
 
 
|-
 
|-
| '''272'''
+
| '''USB2.0 HOST x 2'''
| '''PI16'''
+
| '''OK'''
| style="text-align: left;"|
+
|-
| '''37'''
+
| '''Infrared reception'''
|
+
| '''OK'''
| '''38'''
+
|-
| style="text-align: left;"|
+
| '''Headphone audio playback'''
| '''PI4'''
+
| '''OK'''
| '''260'''
+
|-
 +
| '''On/off button'''
 +
| '''OK'''
 +
|-
 +
| '''LRADC''' '''Custom buttons x 2'''
 +
| '''OK, The default setting is the volume up and down keys.'''
 
|-
 
|-
| style="text-align: left;"|
+
| '''TV-OUT'''
| style="text-align: left;"|
+
| '''OK'''
| '''GND'''
 
| '''39'''
 
|
 
| '''40'''
 
| style="text-align: left;"|
 
| '''PI3'''
 
| '''259'''
 
 
|}
 
|}
  
<ol start="2" style="list-style-type: decimal;">
+
<span id="onboard-led-light-display-instructions"></span>
<li>The device node corresponding to uart2 is '''/dev/ttyAS2''', and the device node corresponding to uart5 is'''/dev/ttyAS5'''</li></ol>
+
== Onboard LED light display instructions ==
  
apollo-p2:/ # ls /dev/ttyAS*
+
{| class="wikitable" style="width:800px;text-align: center;"
 +
|-
 +
|
 +
| '''green light'''
 +
| '''red light'''
 +
|-
 +
| '''u-boot startup phase'''
 +
| '''Off'''
 +
| '''on'''
 +
|-
 +
| '''Kernel boot to enter the system'''
 +
| '''on'''
 +
| '''on'''
 +
|}
  
/dev/ttyAS0 /dev/ttyAS1 '''/dev/ttyAS2 /dev/ttyAS5'''
+
<span id="how-to-return-to-the-previous-interface-in-android"></span>
 +
== How to return to the previous interface in Android ==
  
<ol start="3" style="list-style-type: decimal;">
+
We 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-clicking the mouse, and the keyboard cannot return.
<li>First open wiringOP APP on the desktop</li></ol>
 
  
[[File:media/image351.png|576x133px]]
+
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 the return key on the remote control to return to the previous menu. The location of the return key is as shown below. Shown:
  
<ol start="4" style="list-style-type: decimal;">
+
[[File:zero2w-img303.png]]
<li>Then click the '''UART_TEST'''button to open the UART test interface</li></ol>
 
  
[[File:media/image359.png|576x130px]]
+
<span id="how-to-use-adb"></span>
 +
== How to use ADB ==
  
<ol start="5" style="list-style-type: decimal;">
+
<span id="use-network-connection-adb-debugging"></span>
<li>The serial port test interface of wiringOP is as shown in the figure below</li></ol>
+
=== Use network connection adb debugging ===
  
[[File:media/image360.png|576x150px]]
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<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.'''</big>
 +
|}
 +
 
 +
# Make sure the '''service.adb.tcp.port''' of the Android system is set to 5555 port number
 +
 
 +
::{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
apollo-p2:/ # '''getprop | grep &quot;adb.tcp&quot;'''
  
<ol start="6" style="list-style-type: decimal;">
+
[service.adb.tcp.port]: [5555]
<li><p>Then select the '''/dev/ttyAS2''' or'''/dev/ttyAS5''' node in the selection box</p>
+
|}
<p>[[File:media/image361.png|352x186px]]</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>
+
<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:800px;"
 +
|-
 +
|  
 +
apollo-p2:/ # '''setprop service.adb.tcp.port 5555'''
 +
 
 +
apollo-p2:/ # '''stop adbd'''
 +
 
 +
apollo-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:~$ '''sudo apt-get update'''
  
[[File:media/image362.png|334x107px]]
+
test@test:~$ '''sudo apt-get install -y adb'''
 +
|}
 +
</ol>
 +
<ol start="4" style="list-style-type: decimal;">
 +
<li>Then connect network adb on Ubuntu PC</li>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
test@test:~$ '''adb connect 192.168.1.xxx:5555''' '''(Need to be modified to the IP address of the development board)'''
  
<ol start="8" style="list-style-type: decimal;">
+
<p>* daemon not running; starting now at tcp:5037</p>
<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:media/image363.png|376x189px]]
+
<p>* daemon started successfully</p>
  
<ol start="10" style="list-style-type: decimal;">
+
connected to 192.168.1.xxx:5555
<li>If everything is normal, the received string will be displayed in the receiving box</li></ol>
 
  
[[File:media/image364.png|382x196px]]
 
  
<span id="pin-spi-test-method"></span>
+
test@test:~$ '''adb devices'''
=== 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
+
List of devices attached
  
{| class="wikitable"
+
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;"  
 
|-
 
|-
| '''GPIO serial number'''
+
|  
| '''GPIO'''
+
test@test:~$ '''adb shell'''
| '''Function'''
+
 
| '''pin'''
+
apollo-p2:/ #
|
+
|}
| '''pin'''
+
</ol>
| '''Function'''
+
<span id="use-data-cable-to-connect-adb-debugging"></span>
| '''GPIO'''
+
 
| '''GPIO serial number'''
+
=== 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-img305.png]]
 +
 
 +
<ol start="2" style="list-style-type: decimal;">
 +
<li>Install adb tool on Ubuntu PC</li>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| style="text-align: left;"|
+
|  
| style="text-align: left;"|
+
test@test:~$ '''sudo apt-get update'''
| '''3.3V'''
+
 
| '''1'''
+
test@test:~$ '''sudo apt-get install -y adb'''
|
+
|}
| '''2'''
+
</ol>
| '''5V'''
+
<ol start="3" style="list-style-type: decimal;">
| style="text-align: left;"|
+
<li>Check whether the ADB device is recognized</li>
| style="text-align: left;"|
+
{| class="wikitable" style="width:800px;"  
 
|-
 
|-
| '''264'''
+
|  
| '''PI8'''
+
test@test:~$ '''adb devices'''
| '''TWI1-SDA'''
+
 
| '''3'''
+
List of devices attached
|
+
 
| '''4'''
+
4c00146473c28651dd0 device
| '''5V'''
+
|}
| style="text-align: left;"|
+
</ol>
| style="text-align: left;"|
+
<ol start="4" 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;"  
 
|-
 
|-
| '''263'''
+
|  
| '''PI7'''
+
test@test:~$ '''adb shell'''
| '''TWI1-SCL'''
+
 
| '''5'''
+
apollo-p2:/ $
|
+
|}
| '''6'''
+
</ol>
| '''GND'''
+
<span id="view-how-to-set-hdmi-display-resolution"></span>
| style="text-align: left;"|
+
 
| style="text-align: left;"|
+
== View how to set HDMI display resolution ==
|-
+
 
| '''269'''
+
<ol style="list-style-type: decimal;">
| '''PI13'''
+
<li><p>Enter first '''Settings'''</p>
| '''PWM3'''
+
<p>[[File:zero2w-img306.png]]</p></li>
| '''7'''
+
<li><p>Then select '''Device Preferences'''</p>
|
+
<p>[[File:zero2w-img307.png]]</p></li>
| '''8'''
+
<li><p>Then select '''Display &amp; Sound'''</p>
| '''UART0_TX'''
+
<p>[[File:zero2w-img308.png]]</p></li>
| '''PH0'''
+
<li><p>Then select '''Advanced display settings'''</p>
| '''224'''
+
<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-img312.png]]</p></li></ol>
 +
 
 +
<span id="hdmi-to-vga-display-test-1"></span>
 +
=== HDMI to VGA display test ===
 +
 
 +
<ol style="list-style-type: decimal;">
 +
<li><p>First you need to prepare the following accessories</p>
 +
<ol style="list-style-type: lower-alpha;">
 +
<li>HDMI to VGA converter</li>
 +
 
 +
[[File:zero2w-img144.png]]
 +
</ol>
 +
<ol start="2" style="list-style-type: lower-alpha;">
 +
<li>A VGA cable and a Mini HDMI male to HDMI female adapter</li>
 +
 
 +
[[File:zero2w-img145.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="2" style="list-style-type: decimal;">
 +
<li>HDMI to VGA display test is as follows</li>
 +
 
 +
[[File:zero2w-img313.png]]
 +
 
 +
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 
|-
 
|-
| style="text-align: left;"|
+
|  
| style="text-align: left;"|
+
<big>'''When using HDMI to VGA display, the development board and the 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.'''</big>
| '''GND'''
+
|}
| '''9'''
+
</ol>
|
+
<span id="wi-fi-connection-method"></span>
| '''10'''
+
 
| '''UART0_RX'''
+
== WI-FI connection method ==
| '''PH1'''
+
 
| '''225'''
+
# Choose first '''Settings'''
|-
+
 
| '''226'''
+
::[[File:zero2w-img306.png]]
| '''PH2'''
+
 
| '''UART5_TX'''
+
<ol start="2" style="list-style-type: decimal;">
| '''11'''
+
<li>Then select '''Network &amp; Internet'''</li>
|
+
 
| '''12'''
+
[[File:zero2w-img314.png]]
| style="text-align: left;"|
+
</ol>
| '''PI1'''
+
<ol start="3" style="list-style-type: decimal;">
| '''257'''
+
<li>Then turn on WI-FI</li>
|-
+
 
| '''227'''
+
[[File:zero2w-img315.png]]
| '''PH3'''
+
</ol>
| '''UART5_RX'''
+
<ol start="4" style="list-style-type: decimal;">
| '''13'''
+
<li>After turning on WI-FI, you can see the searched signals under '''Available networks'''.</li>
|
+
 
| '''14'''
+
[[File:zero2w-img316.png]]
| '''GND'''
+
</ol>
| style="text-align: left;"|
+
<ol start="5" style="list-style-type: decimal;">
| style="text-align: left;"|
+
<li>After selecting the WI-FI you want to connect to, the password input interface shown below will pop up.</li>
|-
+
 
| '''261'''
+
<div class="figure">
| '''PI5'''
+
 
| '''UART2_TX'''
+
[[File:zero2w-img317.png]]
| '''15'''
+
 
|
+
</div></ol>
| '''16'''
+
<ol start="6" style="list-style-type: decimal;">
| '''PWM4'''
+
<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.</li>
| '''PI14'''
+
 
| '''270'''
+
<div class="figure">
|-
+
 
| style="text-align: left;"|
+
[[File:zero2w-img318.png]]
| style="text-align: left;"|
+
 
| '''3.3V'''
+
</div></ol>
| '''17'''
+
<ol start="7" style="list-style-type: decimal;">
|
+
<li>The display after successful WI-FI connection is as shown below</li>
| '''18'''
+
 
| style="text-align: left;"|
+
[[File:zero2w-img319.png]]
| '''PH4'''
+
</ol>
| '''228'''
+
<span id="how-to-use-wi-fi-hotspot"></span>
|-
+
 
| '''231'''
+
== How to use WI-FI hotspot ==
| '''PH7'''
+
 
| '''SPI1_MOSI'''
+
# First, please make sure that the Ethernet port is connected to the network cable and can access the Internet normally.
| '''19'''
+
# Then select '''Settings'''
|
+
 
| '''20'''
+
::[[File:zero2w-img306.png]]
| '''GND'''
+
 
| style="text-align: left;"|
+
<ol start="3" style="list-style-type: decimal;">
| style="text-align: left;"|
+
<li>Then select '''Network &amp; Internet'''</li>
|-
+
 
| '''232'''
+
[[File:zero2w-img314.png]]
| '''PH8'''
+
</ol>
| '''SPI1_MISO'''
+
<ol start="4" style="list-style-type: decimal;">
| '''21'''
+
<li>Then select '''WIFI hotspot'''</li>
|
+
 
| '''22'''
+
[[File:zero2w-img320.png]]
| '''UART2_RX'''
+
</ol>
| '''PI6'''
+
<ol start="5" style="list-style-type: decimal;">
| '''262'''
+
<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)</li>
|-
+
 
| '''230'''
+
[[File:zero2w-img321.png]]
| '''PH6'''
+
</ol>
| '''SPI1_CLK'''
+
<ol start="6" style="list-style-type: decimal;">
| '''23'''
+
<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_7132''') 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>
|
+
 
| '''24'''
+
[[File:zero2w-img322.png]]
| '''SPI1_CS0'''
+
</ol>
| '''PH5'''
+
<ol start="7" style="list-style-type: decimal;">
| '''229'''
+
<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 '''WI-FI Hotspot''' of the development board can be used normally.</li>
 +
 
 +
[[File:zero2w-img323.png]]
 +
</ol>
 +
<span id="how-to-check-the-ip-address-of-the-ethernet-port"></span>
 +
 
 +
== How to check the IP address of the Ethernet port ==
 +
 
 +
# 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-img107.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]]</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 ==
 +
 
 +
# Choose first '''Settings'''
 +
 
 +
::[[File:zero2w-img306.png]]
 +
 
 +
<ol start="2" style="list-style-type: decimal;">
 +
<li>Then select '''Bluetooth'''</li>
 +
 
 +
[[File:zero2w-img327.png]]
 +
</ol>
 +
<ol start="3" style="list-style-type: decimal;">
 +
<li>Then Open '''Bluetooth Enable'''</li>
 +
 
 +
[[File:zero2w-img328.png]]
 +
</ol>
 +
<ol start="4" style="list-style-type: decimal;">
 +
<li>Then click '''Pair new device'''to start scanning for surrounding Bluetooth devices</li>
 +
 
 +
[[File:zero2w-img329.png]]
 +
</ol>
 +
<ol start="5" style="list-style-type: decimal;">
 +
<li>The searched Bluetooth devices will be displayed under '''Available devices'''</li>
 +
 
 +
[[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 following interface pops up, please use the mouse to select the '''Pair'''option</li>
 +
 
 +
[[File:zero2w-img331.png]]
 +
</ol>
 +
<ol start="7" style="list-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-img332.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]]
 +
</ol>
 +
<ol start="9" 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-img334.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]]
 +
</ol>
 +
<span id="how-to-set-usb0-to-host-mode-1"></span>
 +
 
 +
== How to set USB0 to HOST mode ==
 +
 
 +
As shown in the figure below, there are two Type-C interfaces 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.
 +
 
 +
[[File:zero2w-img160.png]]
 +
 
 +
USB0 of the 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 power supply, so that USB1 can be directly used to connect USB devices .
 +
 
 +
If you want to use USB0 to connect USB devices, you need to set USB0 to HOST mode. The method is as follows:
 +
 
 +
<ol style="list-style-type: lower-alpha;">
 +
<li>Run the following command to set USB0 to HOST mode:</li>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| style="text-align: left;"|
+
|  
| style="text-align: left;"|
+
apollo-p2:/ # '''cat /sys/devices/platform/soc@3000000/soc@3000000\:usbc0@0/usb_host'''
| '''GND'''
+
 
| '''25'''
+
host_chose finished!
|
+
 
| '''26'''
+
apollo-p2:/ #
| '''SPI1_CS1'''
+
|}
| '''PH9'''
+
</ol>
| '''233'''
+
<ol start="2" style="list-style-type: lower-alpha;">
 +
<li>Run the following command to switch back to Device mode</li>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''266'''
+
|  
| '''PI10'''
+
apollo-p2:/ # '''cat /sys/devices/platform/soc@3000000/soc@3000000\:usbc0@0/usb_device'''
| '''TWI2-SDA'''
+
 
| '''27'''
+
device_chose finished!
|
+
 
| '''28'''
+
apollo-p2:/ #
| '''TWI2-SCL'''
+
|}
| '''PI9'''
+
</ol>
| '''265'''
+
<ol start="3" style="list-style-type: lower-alpha;">
 +
<li>The command to view the current mode of USB0 is</li>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''256'''
+
|  
| '''PI0'''
+
apollo-p2:/ # '''cat /sys/devices/platform/soc@3000000/soc@3000000\:usbc0@0/otg_role'''
| style="text-align: left;"|
+
 
| '''29'''
+
usb_host
|
 
| '''30'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| 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;"|
 
| style="text-align: left;"|
 
|-
 
| '''258'''
 
| '''PI2'''
 
| style="text-align: left;"|
 
| '''35'''
 
|
 
| '''36'''
 
| style="text-align: left;"|
 
| '''PC12'''
 
| '''76'''
 
 
|}
 
|}
 +
</ol>
 +
<span id="how-to-use-usb-camera"></span>
  
<ol start="2" style="list-style-type: decimal;">
+
== How to use USB camera ==
<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></ol>
 
  
apollo-p2:/ # '''ls /dev/spidev1.*'''
+
# First insert the USB (UVC protocol) camera into the USB interface of the development board
 
+
# If the USB camera is recognized normally, the corresponding video device node will be generated under /dev
'''/dev/spidev1.0 /dev/spidev1.1'''
+
 
 +
::{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
console:/ # '''ls /dev/video0'''
 +
 
 +
/dev/video0
 +
|}
  
 
<ol start="3" style="list-style-type: decimal;">
 
<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></ol>
+
<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>Download the USB camera test APP from the '''official tool''' on the development board information download page</p></li>
 +
 
 +
<div class="figure">
  
'''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-img336.png]]
  
<ol start="4" style="list-style-type: decimal;">
+
</div>
<li>Then open wiringOP APP on the desktop</li></ol>
+
<div class="figure">
  
[[File:media/image351.png|576x133px]]
+
[[File:zero2w-img337.png]]
  
 +
</div></ol>
 
<ol start="5" style="list-style-type: decimal;">
 
<ol start="5" style="list-style-type: decimal;">
<li>Then click the '''SPI_TEST''' button to open the SPI test interface</li></ol>
+
<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 installation, you can see the startup icon of the USB camera on the Android desktop.</li>
 +
 
 +
[[File:zero2w-img338.png]]
 +
</ol>
 +
<ol start="7" 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.</li></ol>
 +
 
 +
<span id="android-system-root-description"></span>
 +
 
 +
== Android system ROOT description ==
  
[[File:media/image365.png|575x131px]]
+
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
 +
|-
 +
|
 +
<big>'''The Android system released by Orange Pi has been ROOT and can be tested using the following method.'''</big>
 +
|}
 +
 
 +
# Download from the '''official tool''' on the development board data download page '''rootcheck.apk'''
  
<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">
 
<div class="figure">
  
[[File:media/image366.png|296x135px|C:\Users\orangepi\Desktop\用户手册插图\Zero3\未标题-7.jpg未标题-7]]
+
::[[File:zero2w-img336.png]]
  
</div></li>
+
</div>
<li><p>Then click the '''OPEN''' button to initialize the SPI</p></li></ol>
+
<div class="figure">
  
[[File:media/image367.png|295x168px]]
+
::[[File:zero2w-img339.png]]
  
<ol start="8" style="list-style-type: decimal;">
+
</div>
<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>
+
<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>After installation, you can see the startup icon of the ROOT test tool on the Android desktop.</li>
  
[[File:media/image368.png|294x169px]]
+
[[File:zero2w-img340.png]]
 +
</ol>
 +
<ol start="5" style="list-style-type: decimal;">
 +
<li>The display interface after opening the '''ROOT test tool''' for the first time is as shown below</li>
  
<ol start="9" style="list-style-type: decimal;">
+
[[File:zero2w-img341.png]]
<li>Finally, the APP will display the read ID information of the onboard SPI Flash.</li></ol>
+
</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:media/image369.png|296x223px]]
+
[[File:zero2w-img342.png]]
 +
</ol>
 +
<span id="how-to-use-miracastreceiver-to-cast-the-mobile-phone-screen-to-the-development-board"></span>
  
<ol start="10" style="list-style-type: decimal;">
+
== How to use MiracastReceiver to cast the mobile phone screen to the development board ==
<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>
+
<ol style="list-style-type: decimal;">
=== 40pin I2C test method ===
+
<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">
  
# As can be seen from the table below, the Android12 TV system has i2c1 and i2c2 turned on by default.
+
[[File:zero2w-img344.png]]
  
{| class="wikitable"
+
</div></li>
|-
+
<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.</p>
| '''GPIO serial number'''
+
<p>[[File:zero2w-img345.png]]</p></li>
| '''GPIO'''
+
<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>
| '''Function'''
+
<p>[[File:zero2w-img346.png]]</p></li>
| '''pin'''
+
<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:zero2w-img347.png]]</p></li>
| '''pin'''
+
<li><p>Then you can see the content of the mobile phone screen on the HDMI screen connected to the development board</p>
| '''Function'''
+
<p>[[File:zero2w-img348.png]]</p></li></ol>
| '''GPIO'''
+
 
| '''GPIO serial number'''
+
<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 ==
 +
 
 +
We 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.
 +
 
 +
[[File:zero2w-img107.png]]
 +
 
 +
The location of the power button on the 24pin expansion board is as shown in the figure below:
 +
 
 +
[[File:zero2w-img269.png]]
 +
 
 +
The location of the infrared remote control power button is as follows:
 +
 
 +
[[File:zero2w-img349.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 figure below, and then select '''OK''' to shut down the Android system.
 +
 
 +
[[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 NO.'''
 +
| '''GPIO'''
 +
| '''Function'''
 +
| '''Pin'''
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''3.3V'''
+
| '''3.3V'''
| '''1'''
+
| '''1'''
|
+
|-
| '''2'''
+
| '''264'''
| '''5V'''
+
| '''PI8'''
| style="text-align: left;"|
+
| '''TWI1-SDA'''
| style="text-align: left;"|
+
| '''3'''
|-
 
| '''264'''
 
| '''PI8'''
 
| '''TWI1-SDA'''
 
| '''3'''
 
|
 
| '''4'''
 
| '''5V'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''263'''
 
| '''263'''
Line 8,600: Line 10,540:
 
| '''TWI1-SCL'''
 
| '''TWI1-SCL'''
 
| '''5'''
 
| '''5'''
|
 
| '''6'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''269'''
 
| '''269'''
Line 8,610: Line 10,545:
 
| '''PWM3'''
 
| '''PWM3'''
 
| '''7'''
 
| '''7'''
|
 
| '''8'''
 
| '''UART0_TX'''
 
| '''PH0'''
 
| '''224'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
Line 8,620: Line 10,550:
 
| '''GND'''
 
| '''GND'''
 
| '''9'''
 
| '''9'''
|
 
| '''10'''
 
| '''UART0_RX'''
 
| '''PH1'''
 
| '''225'''
 
 
|-
 
|-
| '''226'''
+
| '''<span style="color:#FF0000">226</span>'''
| '''PH2'''
+
| '''<span style="color:#FF0000">PH2</span>'''
| '''UART5_TX'''
+
| '''<span style="color:#FF0000">UART5_TX</span>'''
| '''11'''
+
| '''<span style="color:#FF0000">11</span>'''
|
+
|-
| '''12'''
+
| '''<span style="color:#FF0000">227</span>'''
| style="text-align: left;"|
+
| '''<span style="color:#FF0000">PH3</span>'''
| '''PI1'''
+
| '''<span style="color:#FF0000">UART5_RX</span>'''
| '''257'''
+
| '''<span style="color:#FF0000">13</span>'''
|-
+
|-
| '''227'''
+
| '''<span style="color:#FF0000">261</span>'''
| '''PH3'''
+
| '''<span style="color:#FF0000">PI5</span>'''
| '''UART5_RX'''
+
| '''<span style="color:#FF0000">UART2_TX</span>'''
| '''13'''
+
| '''<span style="color:#FF0000">15</span>'''
|
+
|-
| '''14'''
+
| style="text-align: left;"|
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
|-
 
| '''261'''
 
| '''PI5'''
 
| '''UART2_TX'''
 
| '''15'''
 
|
 
| '''16'''
 
| '''PWM4'''
 
| '''PI14'''
 
| '''270'''
 
|-
 
| style="text-align: left;"|
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''3.3V'''
 
| '''3.3V'''
 
| '''17'''
 
| '''17'''
|
 
| '''18'''
 
| style="text-align: left;"|
 
| '''PH4'''
 
| '''228'''
 
 
|-
 
|-
 
| '''231'''
 
| '''231'''
Line 8,670: Line 10,575:
 
| '''SPI1_MOSI'''
 
| '''SPI1_MOSI'''
 
| '''19'''
 
| '''19'''
|
 
| '''20'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''232'''
 
| '''232'''
Line 8,680: Line 10,580:
 
| '''SPI1_MISO'''
 
| '''SPI1_MISO'''
 
| '''21'''
 
| '''21'''
|
 
| '''22'''
 
| '''UART2_RX'''
 
| '''PI6'''
 
| '''262'''
 
 
|-
 
|-
 
| '''230'''
 
| '''230'''
Line 8,690: Line 10,585:
 
| '''SPI1_CLK'''
 
| '''SPI1_CLK'''
 
| '''23'''
 
| '''23'''
|
 
| '''24'''
 
| '''SPI1_CS0'''
 
| '''PH5'''
 
| '''229'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
Line 8,700: Line 10,590:
 
| '''GND'''
 
| '''GND'''
 
| '''25'''
 
| '''25'''
|
 
| '''26'''
 
| '''SPI1_CS1'''
 
| '''PH9'''
 
| '''233'''
 
 
|-
 
|-
 
| '''266'''
 
| '''266'''
Line 8,710: Line 10,595:
 
| '''TWI2-SDA'''
 
| '''TWI2-SDA'''
 
| '''27'''
 
| '''27'''
|
 
| '''28'''
 
| '''TWI2-SCL'''
 
| '''PI9'''
 
| '''265'''
 
 
|-
 
|-
 
| '''256'''
 
| '''256'''
Line 8,720: Line 10,600:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''29'''
 
| '''29'''
|
 
| '''30'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''271'''
 
| '''271'''
Line 8,730: Line 10,605:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''31'''
 
| '''31'''
|
 
| '''32'''
 
| '''PWM1'''
 
| '''PI11'''
 
| '''267'''
 
 
|-
 
|-
 
| '''268'''
 
| '''268'''
Line 8,740: Line 10,610:
 
| '''PWM2'''
 
| '''PWM2'''
 
| '''33'''
 
| '''33'''
|
 
| '''34'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''258'''
 
| '''258'''
Line 8,750: Line 10,615:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''35'''
 
| '''35'''
|
 
| '''36'''
 
| style="text-align: left;"|
 
| '''PC12'''
 
| '''76'''
 
 
|-
 
|-
 
| '''272'''
 
| '''272'''
Line 8,760: Line 10,620:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''37'''
 
| '''37'''
|
 
| '''38'''
 
| style="text-align: left;"|
 
| '''PI4'''
 
| '''260'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
Line 8,770: Line 10,625:
 
| '''GND'''
 
| '''GND'''
 
| '''39'''
 
| '''39'''
|
+
|}
| '''40'''
+
{| 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'''
 +
| '''5V'''
 +
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| 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:media/image351.png|576x133px]]
 
 
<ol start="4" style="list-style-type: decimal;">
 
<li>Then click the '''I2C_TEST''' button to open the i2c test interface</li></ol>
 
 
[[File:media/image370.png|576x133px]]
 
 
<ol start="5" style="list-style-type: decimal;">
 
<li>The i2c test interface of wiringOP is shown in the figure below</li></ol>
 
 
[[File:media/image371.png|231x164px]]
 
 
<ol start="6" style="list-style-type: 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:media/image372.png|239x186px]]
 
 
<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:media/image178.png|121x103px]]
 
 
<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:media/image373.png|361x166px]]</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:media/image374.png|256x159px]]</p></li>
 
<li><p>After clicking the '''OPEN''' button to open i2c, the display is as follows</p>
 
<p>[[File:media/image375.png|320x191px]]</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:media/image376.png|321x194px]]</p></li>
 
<li><p>Then set the value to be written to 0x55</p>
 
<p>[[File:media/image377.png|309x182px]]</p></li>
 
<li><p>Then click the '''WRITE BYTE''' button to perform the writing action</p>
 
<p>[[File:media/image378.png|304x185px]]</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:media/image379.png|290x181px]]</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'''
+
| '''6'''
| '''GPIO'''
+
| '''GND'''
| '''Function'''
+
| style="text-align: left;"|
| '''pin'''
+
| style="text-align: left;"|
|
+
|-
| '''pin'''
+
| '''8'''
| '''Function'''
+
| '''UART0_TX'''
| '''GPIO'''
+
| '''PH0'''
| '''GPIO serial number'''
+
| '''224'''
 +
|-
 +
| '''10'''
 +
| '''UART0_RX'''
 +
| '''PH1'''
 +
| '''225'''
 +
|-
 +
| '''12'''
 +
| style="text-align: left;"|
 +
| '''PI1'''
 +
| '''257'''
 
|-
 
|-
 +
| '''14'''
 +
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''3.3V'''
+
|-
| '''1'''
+
| '''16'''
|
+
| '''PWM4'''
| '''2'''
+
| '''PI14'''
| '''5V'''
+
| '''270'''
 +
|-
 +
| '''18'''
 +
| style="text-align: left;"|
 +
| '''PH4'''
 +
| '''228'''
 +
|-
 +
| '''20'''
 +
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
|-
 
|-
| '''264'''
+
| '''<span style="color:#FF0000">22</span>'''
| '''PI8'''
+
| '''<span style="color:#FF0000">UART2_RX</span>'''
| '''TWI1-SDA'''
+
| '''<span style="color:#FF0000">PI6</span>'''
| '''3'''
+
| '''<span style="color:#FF0000">262</span>'''
|
+
|-
| '''4'''
+
| '''24'''
| '''5V'''
+
| '''SPI1_CS0'''
 +
| '''PH5'''
 +
| '''229'''
 +
|-
 +
| '''26'''
 +
| '''SPI1_CS1'''
 +
| '''PH9'''
 +
| '''233'''
 +
|-
 +
| '''28'''
 +
| '''TWI2-SCL'''
 +
| '''PI9'''
 +
| '''265'''
 +
|-
 +
| '''30'''
 +
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
|-
 
|-
| '''263'''
+
| '''32'''
| '''PI7'''
+
| '''PWM1'''
| '''TWI1-SCL'''
+
| '''PI11'''
| '''5'''
+
| '''267'''
|
+
|-
| '''6'''
+
| '''34'''
 
| '''GND'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
|-
 
|-
| '''269'''
+
| '''36'''
| '''PI13'''
 
| '''PWM3'''
 
| '''7'''
 
|
 
| '''8'''
 
| '''UART0_TX'''
 
| '''PH0'''
 
| '''224'''
 
|-
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| style="text-align: left;"|
+
| '''PC12'''
| '''GND'''
+
| '''76'''
| '''9'''
 
|
 
| '''10'''
 
| '''UART0_RX'''
 
| '''PH1'''
 
| '''225'''
 
 
|-
 
|-
| '''226'''
+
| '''38'''
| '''PH2'''
 
| '''UART5_TX'''
 
| '''11'''
 
|
 
| '''12'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''PI1'''
+
| '''PI4'''
| '''257'''
+
| '''260'''
 
|-
 
|-
| '''227'''
+
| '''40'''
| '''PH3'''
 
| '''UART5_RX'''
 
| '''13'''
 
|
 
| '''14'''
 
| '''GND'''
 
| style="text-align: left;"|
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''PI3'''
 +
| '''259'''
 +
|}
 +
</div>
 +
 +
<ol start="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>
 +
{| class="wikitable" style="width:800px;"
 
|-
 
|-
| '''261'''
+
|  
| '''PI5'''
+
<p>apollo-p2:/ # ls /dev/ttyAS*</p>
| '''UART2_TX'''
+
<p>/dev/ttyAS0 &nbsp;&nbsp;&nbsp;&nbsp; /dev/ttyAS1 &nbsp;&nbsp;&nbsp;&nbsp; '''<span style="color:#FF0000">/dev/ttyAS2 &nbsp;&nbsp;&nbsp;&nbsp; /dev/ttyAS5</span>'''</p>
| '''15'''
+
|}
|
+
</ol>
| '''16'''
+
<ol start="3" style="list-style-type: decimal;">
| '''PWM4'''
+
<li>First open wiringOP APP on the desktop</li>
| '''PI14'''
+
 
| '''270'''
+
[[File:zero2w-img351.png]]
 +
</ol>
 +
<ol start="4" style="list-style-type: decimal;">
 +
<li>Then click the '''UART_TEST'''button to open the UART test interface</li>
 +
 
 +
[[File:zero2w-img359.png]]
 +
</ol>
 +
<ol start="5" style="list-style-type: decimal;">
 +
<li>The serial port test interface of wiringOP is as shown in the figure below</li>
 +
 
 +
[[File:zero2w-img360.png]]
 +
</ol>
 +
<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>
 +
 
 +
[[File:zero2w-img362.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]]
 +
</ol>
 +
<ol start="10" style="list-style-type: decimal;">
 +
<li>If everything is normal, the received string will be displayed in the receiving box</li>
 +
 
 +
[[File:zero2w-img364.png]]
 +
</ol>
 +
<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
 +
 
 +
<div style="display: flex;">
 +
::{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
 +
|-
 +
| '''GPIO NO.'''
 +
| '''GPIO'''
 +
| '''Function'''
 +
| '''Pin'''
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''3.3V'''
 
| '''3.3V'''
| '''17'''
+
| '''1'''
|
+
|-
| '''18'''
+
| '''264'''
| style="text-align: left;"|
+
| '''PI8'''
| '''PH4'''
+
| '''TWI1-SDA'''
| '''228'''
+
| '''3'''
 +
|-
 +
| '''263'''
 +
| '''PI7'''
 +
| '''TWI1-SCL'''
 +
| '''5'''
 +
|-
 +
| '''269'''
 +
| '''PI13'''
 +
| '''PWM3'''
 +
| '''7'''
 
|-
 
|-
| '''231'''
 
| '''PH7'''
 
| '''SPI1_MOSI'''
 
| '''19'''
 
|
 
| '''20'''
 
| '''GND'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''GND'''
 +
| '''9'''
 
|-
 
|-
| '''232'''
+
| '''226'''
| '''PH8'''
+
| '''PH2'''
| '''SPI1_MISO'''
+
| '''UART5_TX'''
 +
| '''11'''
 +
|-
 +
| '''227'''
 +
| '''PH3'''
 +
| '''UART5_RX'''
 +
| '''13'''
 +
|-
 +
| '''261'''
 +
| '''PI5'''
 +
| '''UART2_TX'''
 +
| '''15'''
 +
|-
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
| '''3.3V'''
 +
| '''17'''
 +
|-
 +
| '''231'''
 +
| '''PH7'''
 +
| '''SPI1_MOSI'''
 +
| '''19'''
 +
|-
 +
| '''232'''
 +
| '''PH8'''
 +
| '''SPI1_MISO'''
 
| '''21'''
 
| '''21'''
|
 
| '''22'''
 
| '''UART2_RX'''
 
| '''PI6'''
 
| '''262'''
 
 
|-
 
|-
 
| '''230'''
 
| '''230'''
Line 8,962: Line 10,850:
 
| '''SPI1_CLK'''
 
| '''SPI1_CLK'''
 
| '''23'''
 
| '''23'''
|
 
| '''24'''
 
| '''SPI1_CS0'''
 
| '''PH5'''
 
| '''229'''
 
 
|-
 
|-
 
| style="text-align: left;"|
 
| style="text-align: left;"|
Line 8,972: Line 10,855:
 
| '''GND'''
 
| '''GND'''
 
| '''25'''
 
| '''25'''
|
 
| '''26'''
 
| '''SPI1_CS1'''
 
| '''PH9'''
 
| '''233'''
 
 
|-
 
|-
 
| '''266'''
 
| '''266'''
Line 8,982: Line 10,860:
 
| '''TWI2-SDA'''
 
| '''TWI2-SDA'''
 
| '''27'''
 
| '''27'''
|
 
| '''28'''
 
| '''TWI2-SCL'''
 
| '''PI9'''
 
| '''265'''
 
 
|-
 
|-
 
| '''256'''
 
| '''256'''
Line 8,992: Line 10,865:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''29'''
 
| '''29'''
|
 
| '''30'''
 
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
 
|-
 
|-
 
| '''271'''
 
| '''271'''
Line 9,002: Line 10,870:
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
| '''31'''
 
| '''31'''
|
 
| '''32'''
 
| '''PWM1'''
 
| '''PI11'''
 
| '''267'''
 
 
|-
 
|-
 
| '''268'''
 
| '''268'''
Line 9,012: Line 10,875:
 
| '''PWM2'''
 
| '''PWM2'''
 
| '''33'''
 
| '''33'''
|
+
|-
| '''34'''
+
| '''258'''
| '''GND'''
+
| '''PI2'''
 +
| style="text-align: left;"|
 +
| '''35'''
 +
|}
 +
{| 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;"|
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 
|-
 
|-
| '''258'''
+
| '''4'''
| '''PI2'''
+
| '''5V'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''35'''
 
|
 
| '''36'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''PC12'''
 
| '''76'''
 
 
|-
 
|-
| '''272'''
+
| '''6'''
| '''PI16'''
+
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''37'''
 
|
 
| '''38'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''PI4'''
 
| '''260'''
 
 
|-
 
|-
 +
| '''8'''
 +
| '''UART0_TX'''
 +
| '''PH0'''
 +
| '''224'''
 +
|-
 +
| '''10'''
 +
| '''UART0_RX'''
 +
| '''PH1'''
 +
| '''225'''
 +
|-
 +
| '''12'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
 +
| '''PI1'''
 +
| '''257'''
 +
|-
 +
| '''14'''
 +
| '''GND'''
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''GND'''
 
| '''39'''
 
|
 
| '''40'''
 
 
| style="text-align: left;"|
 
| style="text-align: left;"|
| '''PI3'''
+
|-
| '''259'''
+
| '''16'''
|}
+
| '''PWM4'''
 
+
| '''PI14'''
 +
| '''270'''
 +
|-
 +
| '''18'''
 +
| style="text-align: left;"|
 +
| '''PH4'''
 +
| '''228'''
 +
|-
 +
| '''20'''
 +
| '''GND'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''22'''
 +
| '''UART2_RX'''
 +
| '''PI6'''
 +
| '''262'''
 +
|-
 +
| '''24'''
 +
| '''SPI1_CS0'''
 +
| '''PH5'''
 +
| '''229'''
 +
|-
 +
| '''26'''
 +
| '''SPI1_CS1'''
 +
| '''PH9'''
 +
| '''233'''
 +
|-
 +
| '''28'''
 +
| '''TWI2-SCL'''
 +
| '''PI9'''
 +
| '''265'''
 +
|-
 +
| '''30'''
 +
| '''GND'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''32'''
 +
| '''PWM1'''
 +
| '''PI11'''
 +
| '''267'''
 +
|-
 +
| '''34'''
 +
| '''GND'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''36'''
 +
| style="text-align: left;"|
 +
| '''PC12'''
 +
| '''76'''
 +
|}
 +
</div>
 +
 
 
<ol start="2" style="list-style-type: decimal;">
 
<ol start="2" style="list-style-type: decimal;">
<li>First click the wiringOP icon to open wiringOP APP</li></ol>
+
<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;"
[[File:media/image351.png|576x133px]]
+
|-
 +
|
 +
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;">
 
<ol start="3" style="list-style-type: decimal;">
<li>Then click the '''PWM_TEST''' button on the main interface of wiringOP to enter the PWM test interface</li></ol>
+
<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;"
[[File:media/image380.png|575x129px]]
+
|-
 
+
|
 +
<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;">
 
<ol start="4" style="list-style-type: decimal;">
<li>The PWM test interface is as follows</li></ol>
+
<li>Then open wiringOP APP on the desktop</li>
  
<div class="figure">
+
[[File:zero2w-img351.png]]
 
+
</ol>
[[File:media/image381.png|576x159px|Screenshot_20230901-115927]]
 
 
 
</div>
 
 
<ol start="5" style="list-style-type: decimal;">
 
<ol start="5" style="list-style-type: 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></ol>
+
<li>Then click the '''SPI_TEST''' button to open the SPI test interface</li>
 
 
[[File:media/image382.png|575x177px]]
 
  
 +
[[File:zero2w-img365.png]]
 +
</ol>
 
<ol start="6" style="list-style-type: decimal;">
 
<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></ol>
+
<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:media/image383.png|337x155px]]
+
[[File:zero2w-img366.png]]
  
<ol start="7" style="list-style-type: decimal;">
+
</div></li>
<li>Then click the '''EXPORT'''button to export PWM</li></ol>
+
<li><p>Then click the '''OPEN''' button to initialize the SPI</p></li>
 
 
[[File:media/image384.png|336x144px]]
 
  
 +
[[File:zero2w-img367.png]]
 +
</ol>
 
<ol start="8" style="list-style-type: decimal;">
 
<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></ol>
+
<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:media/image385.png|575x152px]]
 
  
 +
[[File:zero2w-img368.png]]
 +
</ol>
 
<ol start="9" style="list-style-type: decimal;">
 
<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></ol>
+
<li>Finally, the APP will display the read ID information of the onboard SPI Flash.</li>
  
[[File:media/image386.png|460x276px]]
+
[[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="how-to-compile-android-12-source-code"></span>
+
<span id="pin-i2c-test-method"></span>
= How to compile Android 12 source code =
 
  
<span id="download-the-source-code-of-android-12"></span>
+
=== 40pin I2C test method ===
== Download the source code of Android 12 ==
 
  
<ol style="list-style-type: decimal;">
+
# As can be seen from the table below, the Android12 TV system has i2c1 and i2c2 turned on by default.
<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></ol>
 
</li></ol>
 
  
[[File:media/image387.png|575x261px]]
+
<div style="display: flex;">
 
+
::{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
<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></ol>
+
| '''GPIO NO.'''
 
+
| '''GPIO'''
test@test:~$ '''md5sum -c H618-Android12-Src.tar.gz.md5sum'''
+
| '''Function'''
 
+
| '''Pin'''
H618-Android12-Src.tar.gzaa: '''OK'''
+
|-
 
+
| style="text-align: left;"|
H618-Android12-Src.tar.gzab: '''OK'''
+
| style="text-align: left;"|
 
+
| '''3.3V'''
......
+
| '''1'''
 
+
|-
<ol start="3" style="list-style-type: decimal;">
+
| '''<span style="color:#FF0000">264</span>'''
<li>Then you need to merge multiple compressed files into one, and then extract the Android source code. The command looks like this:</li></ol>
+
| '''<span style="color:#FF0000">PI8</span>'''
 
+
| '''<span style="color:#FF0000">TWI1-SDA</span>'''
test@test:~$ '''cat H618-Android12-Src.tar.gza* &gt; H618-Android12-Src.tar.gz'''
+
| '''<span style="color:#FF0000">3</span>'''
 
+
|-
test@test:~$ '''tar -xvf H618-Android12-Src.tar.gz'''
+
| '''<span style="color:#FF0000">263</span>'''
 
+
| '''<span style="color:#FF0000">PI7</span>'''
<ol start="4" style="list-style-type: decimal;">
+
| '''<span style="color:#FF0000">TWI1-SCL</span>'''
<li>Then unzip the compressed package of the files modified by Orange Pi Zero2w</li></ol>
+
| '''<span style="color:#FF0000">5</span>'''
 
+
|-
test@test:~$ '''tar zxf opizero2w_android12_patches.tar.gz'''
+
| '''269'''
 
+
| '''PI13'''
test@test:~$ '''ls'''
+
| '''PWM3'''
 
+
| '''7'''
'''opizero2w_android12_patches''' opizero2w_android12_patches.tar.gz
+
|-
 
+
| style="text-align: left;"|
<ol start="5" style="list-style-type: decimal;">
+
| style="text-align: left;"|
<li>Then copy the files modified by Orange Pi Zero2w to the Android source code</li></ol>
+
| '''GND'''
 
+
| '''9'''
test@test:~$ '''cp -rf opizero2w_android12_patches/* H618-Android12-Src/'''
+
|-
 
+
| '''226'''
<span id="compile-the-source-code-of-android-12"></span>
+
| '''PH2'''
== Compile the source code of Android 12 ==
+
| '''UART5_TX'''
 
+
| '''11'''
'''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:'''
+
|-
 
+
| '''227'''
[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''']
+
| '''PH3'''
 
+
| '''UART5_RX'''
'''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.'''
+
| '''13'''
 
+
|-
# First install the software packages needed to compile Android12 source code
+
| '''261'''
 
+
| '''PI5'''
test@test:~$ '''sudo apt-get update'''
+
| '''UART2_TX'''
 
+
| '''15'''
test@test:~$ '''sudo apt-get install -y git gnupg flex bison gperf build-essential \'''
+
|-
 
+
| style="text-align: left;"|
'''zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \'''
+
| style="text-align: left;"|
 
+
| '''3.3V'''
'''lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev ccache \'''
+
| '''17'''
 
+
|-
'''libgl1-mesa-dev libxml2-utils xsltproc unzip u-boot-tools python-is-python3 \'''
+
| '''231'''
 
+
| '''PH7'''
'''libssl-dev libncurses5 clang gawk'''
+
| '''SPI1_MOSI'''
 
+
| '''19'''
<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>
+
| '''232'''
<ol style="list-style-type: lower-alpha;">
+
| '''PH8'''
<li>First run '''./build.sh config''' to set compilation options</li></ol>
+
| '''SPI1_MISO'''
</li></ol>
+
| '''21'''
 
+
|-
test@test:~$ '''cd H618-Android12-Src/longan'''
+
| '''230'''
 
+
| '''PH6'''
test@test:~/H618-Android12-Src/longan$ '''./build.sh config'''
+
| '''SPI1_CLK'''
 
+
| '''23'''
Welcome to mkscript setup progress
+
|-
 
+
| style="text-align: left;"|
All available platform:
+
| style="text-align: left;"|
 
+
| '''GND'''
0. android
+
| '''25'''
 
+
|-
1. linux
+
| '''<span style="color:#FF0000">266</span>'''
 
+
| '''<span style="color:#FF0000">PI10</span>'''
Choice [android]: '''0'''
+
| '''<span style="color:#FF0000">TWI2-SDA</span>'''
 
+
| '''<span style="color:#FF0000">27</span>'''
All available ic:
+
|-
 
+
| '''256'''
0. h618
+
| '''PI0'''
 
+
| style="text-align: left;"|
Choice [h618]: '''0'''
+
| '''29'''
 
+
|-
All available board:
+
| '''271'''
 
+
| '''PI15'''
0. ft
+
| style="text-align: left;"|
 
+
| '''31'''
1. p1
+
|-
 
+
| '''268'''
2. p2
+
| '''PI12'''
 
+
| '''PWM2'''
3. p7
+
| '''33'''
 
+
|-
4. p7l
+
| '''258'''
 
+
| '''PI2'''
5. perf1
+
| style="text-align: left;"|
 
+
| '''35'''
6. perf2
+
|-
 
+
| '''272'''
7. perf3
+
| '''PI16'''
 
+
| style="text-align: left;"|
8. qa
+
| '''37'''
 
+
|-
Choice [p2]: '''2'''
+
| style="text-align: left;"|
 
+
| style="text-align: left;"|
All available flash:
+
| '''GND'''
 
+
| '''39'''
0. default
+
|}
 
+
{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
1. nor
+
|-
 
+
| '''Pin'''
Choice [default]: '''0'''
+
| '''Function'''
 
+
| '''GPIO'''
All available kern_ver:
+
| '''GPIO NO.'''
 
+
|-
0. linux-5.4
+
| '''2'''
 
+
| '''5V'''
Choice [linux-5.4]: '''0'''
+
| style="text-align: left;"|
 
+
| style="text-align: left;"|
All available arch:
+
|-
 
+
| '''4'''
0. arm
+
| '''5V'''
 
+
| style="text-align: left;"|
1. arm64
+
| style="text-align: left;"|
 
+
|-
Choice [arm64]: '''1'''
+
| '''6'''
 
+
| '''GND'''
'''......'''
+
| style="text-align: left;"|
 
+
| style="text-align: left;"|
*** Default configuration is based on 'sun50iw9p1smp_h618_android_defconfig'
+
|-
 
+
| '''8'''
#
+
| '''UART0_TX'''
 
+
| '''PH0'''
# configuration written to .config
+
| '''224'''
 
+
|-
#
+
| '''10'''
 
+
| '''UART0_RX'''
make[1]: Leaving directory '/home/test/H618-Android12-Src/longan/out/kernel/build'
+
| '''PH1'''
 
+
| '''225'''
make: Leaving directory '/home/test/H618-Android12-Src/longan/kernel/linux-5.4'
+
|-
 
+
| '''12'''
INFO: clean buildserver
+
| style="text-align: left;"|
 
+
| '''PI1'''
INFO: prepare_buildserver
+
| '''257'''
 
+
|-
<ol start="2" style="list-style-type: lower-alpha;">
+
| '''14'''
<li>Then run the '''./build.sh''' script to start compilation.</li></ol>
+
| '''GND'''
 
+
| style="text-align: left;"|
test@test:~/H618-Android12-Src/longan$ '''./build.sh'''
+
| style="text-align: left;"|
 
+
|-
<ol start="3" style="list-style-type: lower-alpha;">
+
| '''16'''
<li>After compilation is completed, you will see the following output</li></ol>
+
| '''PWM4'''
 
+
| '''PI14'''
sun50iw9p1 compile Kernel successful
+
| '''270'''
 
+
|-
INFO: Prepare toolchain ...
+
| '''18'''
 
+
| style="text-align: left;"|
'''......'''
+
| '''PH4'''
 
+
| '''228'''
INFO: build kernel OK.
+
|-
 +
| '''20'''
 +
| '''GND'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''22'''
 +
| '''UART2_RX'''
 +
| '''PI6'''
 +
| '''262'''
 +
|-
 +
| '''24'''
 +
| '''SPI1_CS0'''
 +
| '''PH5'''
 +
| '''229'''
 +
|-
 +
| '''26'''
 +
| '''SPI1_CS1'''
 +
| '''PH9'''
 +
| '''233'''
 +
|-
 +
| '''<span style="color:#FF0000">28</span>'''
 +
| '''<span style="color:#FF0000">TWI2-SCL</span>'''
 +
| '''<span style="color:#FF0000">PI9</span>'''
 +
| '''<span style="color:#FF0000">265</span>'''
 +
|-
 +
| '''30'''
 +
| '''GND'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''32'''
 +
| '''PWM1'''
 +
| '''PI11'''
 +
| '''267'''
 +
|-
 +
| '''34'''
 +
| '''GND'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''36'''
 +
| style="text-align: left;"|
 +
| '''PC12'''
 +
| '''76'''
 +
|-
 +
| '''38'''
 +
| style="text-align: left;"|
 +
| '''PI4'''
 +
| '''260'''
 +
|-
 +
| '''40'''
 +
| style="text-align: left;"|
 +
| '''PI3'''
 +
| '''259'''
 +
|}
 +
</div>
  
INFO: build rootfs ...
+
<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>
 +
{| class="wikitable" style="width:800px;"
 +
|-
 +
|
 +
apollo-p2:/ # '''ls /dev/i2c-*'''
  
INFO: skip make rootfs for android
+
'''<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>First open wiringOP APP on the desktop</li>
  
INFO: ----------------------------------------
+
[[File:zero2w-img351.png]]
 +
</ol>
 +
<ol start="4" style="list-style-type: decimal;">
 +
<li>Then click the '''I2C_TEST''' button to open the i2c test interface</li>
  
INFO: build lichee OK.
+
[[File:zero2w-img370.png]]
 +
</ol>
 +
<ol start="5" style="list-style-type: decimal;">
 +
<li>The i2c test interface of wiringOP is shown in the figure below</li>
  
INFO: ----------------------------------------
+
[[File:zero2w-img371.png]]
 +
</ol>
 +
<ol start="6" style="list-style-type: decimal;">
 +
<li>Then click the device node selection box in the upper left corner to select the i2c you want to test</li>
  
 +
[[File:zero2w-img372.png]]
 +
</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.</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 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.
 +
 +
<div style="display: flex;">
 +
::{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
 +
|-
 +
| '''GPIO NO.'''
 +
| '''GPIO'''
 +
| '''Function'''
 +
| '''Pin'''
 +
|-
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
| '''3.3V'''
 +
| '''1'''
 +
|-
 +
| '''264'''
 +
| '''PI8'''
 +
| '''TWI1-SDA'''
 +
| '''3'''
 +
|-
 +
| '''263'''
 +
| '''PI7'''
 +
| '''TWI1-SCL'''
 +
| '''5'''
 +
|-
 +
| '''<span style="color:#FF0000">269</span>'''
 +
| '''<span style="color:#FF0000">PI13</span>'''
 +
| '''<span style="color:#FF0000">PWM3</span>'''
 +
| '''<span style="color:#FF0000">7</span>'''
 +
|-
 +
| 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'''
 +
|-
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
| '''3.3V'''
 +
| '''17'''
 +
|-
 +
| '''231'''
 +
| '''PH7'''
 +
| '''SPI1_MOSI'''
 +
| '''19'''
 +
|-
 +
| '''232'''
 +
| '''PH8'''
 +
| '''SPI1_MISO'''
 +
| '''21'''
 +
|-
 +
| '''230'''
 +
| '''PH6'''
 +
| '''SPI1_CLK'''
 +
| '''23'''
 +
|-
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
| '''GND'''
 +
| '''25'''
 +
|-
 +
| '''266'''
 +
| '''PI10'''
 +
| '''TWI2-SDA'''
 +
| '''27'''
 +
|-
 +
| '''256'''
 +
| '''PI0'''
 +
| style="text-align: left;"|
 +
| '''29'''
 +
|-
 +
| '''271'''
 +
| '''PI15'''
 +
| style="text-align: left;"|
 +
| '''31'''
 +
|-
 +
| '''<span style="color:#FF0000">268</span>'''
 +
| '''<span style="color:#FF0000">PI12</span>'''
 +
| '''<span style="color:#FF0000">PWM2</span>'''
 +
| '''<span style="color:#FF0000">33</span>'''
 +
|-
 +
| '''258'''
 +
| '''PI2'''
 +
| style="text-align: left;"|
 +
| '''35'''
 +
|-
 +
| '''272'''
 +
| '''PI16'''
 +
| style="text-align: left;"|
 +
| '''37'''
 +
|-
 +
| style="text-align: left;"|
 +
| 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'''
 +
| '''5V'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''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'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''<span style="color:#FF0000">16</span>'''
 +
| '''<span style="color:#FF0000">PWM4</span>'''
 +
| '''<span style="color:#FF0000">PI14</span>'''
 +
| '''<span style="color:#FF0000">270</span>'''
 +
|-
 +
| '''18'''
 +
| style="text-align: left;"|
 +
| '''PH4'''
 +
| '''228'''
 +
|-
 +
| '''20'''
 +
| '''GND'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''22'''
 +
| '''UART2_RX'''
 +
| '''PI6'''
 +
| '''262'''
 +
|-
 +
| '''24'''
 +
| '''SPI1_CS0'''
 +
| '''PH5'''
 +
| '''229'''
 +
|-
 +
| '''26'''
 +
| '''SPI1_CS1'''
 +
| '''PH9'''
 +
| '''233'''
 +
|-
 +
| '''28'''
 +
| '''TWI2-SCL'''
 +
| '''PI9'''
 +
| '''265'''
 +
|-
 +
| '''30'''
 +
| '''GND'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''<span style="color:#FF0000">32</span>'''
 +
| '''<span style="color:#FF0000">PWM1</span>'''
 +
| '''<span style="color:#FF0000">PI11</span>'''
 +
| '''<span style="color:#FF0000">267</span>'''
 +
|-
 +
| '''34'''
 +
| '''GND'''
 +
| style="text-align: left;"|
 +
| style="text-align: left;"|
 +
|-
 +
| '''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>First click the wiringOP icon to open wiringOP APP</li>
 +
 +
[[File:zero2w-img351.png]]
 +
</ol>
 
<ol start="3" style="list-style-type: decimal;">
 
<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>
+
<li>Then click the '''PWM_TEST''' button on the main interface of wiringOP to enter the PWM test interface</li>
 
+
 
test@test:~$ '''cd H618-Android12-Src'''
+
[[File:zero2w-img380.png]]
 
+
</ol>
test@test:~/H618-Android12-Src$ '''source build/envsetup.sh'''
+
<ol start="4" style="list-style-type: decimal;">
 
+
<li>The PWM test interface is as follows</li>
test@test:~/H618-Android12-Src$ '''lunch apollo_p2-userdebug'''
+
 
 
+
<div class="figure">
test@test:~/H618-Android12-Src$ '''make -j8'''
+
 
 
+
[[File:zero2w-img381.png]]
test@test:~/H618-Android12-Src$ '''pack'''
+
 
 
+
</div></ol>
<ol start="4" style="list-style-type: decimal;">
+
<ol start="5" style="list-style-type: decimal;">
<li><p>The storage path of the Android image generated by compilation is:</p>
+
<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>
<p>'''longan/out/h618_android12_p2_uart0.img'''</p></li></ol>
+
 
 
+
[[File:zero2w-img382.png]]
<span id="appendix"></span>
+
</ol>
= '''Appendix''' =
+
<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>
<span id="user-manual-update-history"></span>
+
 
== User manual update history ==
+
[[File:zero2w-img383.png]]
 
+
</ol>
{| class="wikitable"
+
<ol start="7" style="list-style-type: decimal;">
|-
+
<li>Then click the '''EXPORT'''button to export PWM</li>
| '''Version'''
+
 
| '''Date'''
+
[[File:zero2w-img384.png]]
| '''Release Notes'''
+
</ol>
|-
+
<ol start="8" style="list-style-type: decimal;">
| v1.0
+
<li>Then drag the progress bar below to change the PWM duty cycle, and then check '''Enable''' to output the PWM waveform.</li>
| 2023-09-14
+
 
| initial version
+
[[File:zero2w-img385.png]]
|}
+
</ol>
 
+
<ol start="9" style="list-style-type: decimal;">
<span id="image-update-history"></span>
+
<li>Then use an oscilloscope to measure the corresponding pins in the 40pin development board and you can see the following waveform.</li>
== Image update history ==
+
 
 
+
[[File:zero2w-img386.png]]
{| class="wikitable"
+
</ol>
|-
+
<span id="how-to-compile-android-12-source-code"></span>
| * *Date**
+
 
 +
= '''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>
 +
{| 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'''
 +
|-
 +
| style="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
  
| '''Release Notes'''
 
|-
 
| 202 3-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
 
Opios-arch-aarch64-xfce-opizero2w-23.09-linux6.1.31.img.xz

Latest revision as of 20:33, 27 September 2023

Contents

Basic features of Orange Pi Zero 2w

What is Orange Pi Zero 2w

Orange Pi is an open source single-board card computer, a new generation of arm64 development board, which can run operating systems such as Android TV 12, Ubuntu and Debian. The Orange Pi Zero 2w development board uses the Allwinner H618 system-on-chip, and can optionally have 1GB or 1.5GB or 2GB or 4GB LPDDR4 memory.

Usage of Orange Pi Zero 2w

We can use it to achieve:

  • A small Linux desktop computer
  • A small Linux network server
  • Install the Klipper host computer to control the 3D printer
  • Android TV TV box

Of course, there are more functions. Relying on a powerful ecosystem and a variety of expansion accessories, Orange Pi can help users easily achieve delivery from ideas to prototypes to mass production. It is an ideal choice for makers, dreamers, and hobbyists. An ideal creative platform for readers.

Who is Orange Pi Zero 2w designed for?

The Orange Pi development board is not only a consumer product, but also designed for anyone who wants to use technology to create and innovate. It's a simple, fun, and practical tool you can use to shape the world around you.

Hardware features of Orange Pi Zero 2w

Introduction to hardware features
CPU

Allwinner H618 quad-core 64-bit 1.5GHz high-performance Cortex-A53 processor

GPU

Mali G31 MP2

Supports OpenGL ES 1.0/2.0/3.2、OpenCL 2.0

Memory

1GB/1.5GB/2GB/4GB LPDDR4 (shared with GPU)

Onboard storage

TF card slot, 16MB SPI Flash

WIFI+BT

• 20U5622 chip, supports IEEE 802.11 a/b/g/n/ac, BT5.0

Video Output

• Mini HDMI 2.0 interface

Audio Output

• Mini HDMI output

Power Supply

Type-C 5V/2A

USB 2.0 port

Type-C USB2.0 x 2

40pinexpansion interface

Used to expand GPIO, UART, I2C, SPI, PWM

24pinexpansion interface

Used to expand USB2.0 x 2, 100M Ethernet, infrared reception, audio output, TV-OUT output, power on/off button, LRADC button x 2

LED Light

Power light and status light

Supported OS

Android 12 TV, Debi an11, Debian12, Ubuntu22.04, Ubuntu20.04, Orange Pi OS(Arch)etc.

Appearance specifications introduction
PCB Size

30mm x 65mm x 1.2mm

Weight

12.5g

Top view and bottom view of Orange Pi Zero 2w

Top view:

Zero2w-img3.png

Bottom view:

Zero2w-img4.png

Orange Pi Zero 2w interface details

Zero2w-img5.png

Orange Pi Zero 2w 24pin expansion board interface details

Zero2w-img6.png

Zero2w-img7.png

The diameters of the four positioning holes are all 3.0mm.

Introduction to the use of development boards

Prepare necessary accessories

  1. TF card, high-speed SanDisk card with minimum capacity of 8GB, class 10 or above

    Zero2w-img8.png

    When using other brands of TF cards (non-SanDisk TF cards), as shown in the picture below (including but not limited to these cards), some friends have reported that problems will occur during system startup, such as the system getting stuck halfway through startup. Or the reboot command cannot be used normally, and it was finally solved after replacing the SanDisk TF card. Therefore, if you are using a non-SanDisk TF card and find problems with system startup or use, please replace it with a SanDisk TF card and then test again.

    Zero2w-img9.pngZero2w-img10.pngZero2w-img11.pngZero2w-img12.png

    There are currently reports that some TF cards have problems booting on Orange Pi Zero 2w.

    In addition, TF cards that can be used normally on other types of development boards are not guaranteed to be able to start normally on Orange Pi Zero 2w. Please pay special attention to this point.

  2. TF card reader, used to read and write TF cards

    Zero2w-img13.png

  3. Mini HDMI to HDMI cable, used to connect the development board to an HDMI monitor or TV for display

  4. Zero2w-img14.png

  1. Power supply. If you have a 5V/2A or 5V/3A power supply, you only need to prepare a USB to Type C interface data cable as shown in the picture on the left below. You can also use a cable similar to the picture on the right below. 5V/2A or 5V/3A high-quality USB Type C interface power adapter integrated with the power head.

    Zero2w-img15.png Zero2w-img16.png

    Both Type-C interfaces on the development board can be used for power supply.

    Zero2w-img17.png

  2. 24pin expansion board

    Zero2w-img18.png

  3. USB interface mouse and keyboard, as long as it is a standard USB interface mouse and keyboard, the mouse and keyboard can be used to control the Orange Pi development board

  4. Infrared remote control, mainly used to control Android TV system

    Zero2w-img19.png

    Note that the remote control of the air conditioner or the TV cannot control the Orange Pi development board. By default, only the remote control provided by Orange Pi can.

  5. Network cable to connect the development board to the Internet

  6. AV video cable. If you want to display video through the TV-OUT interface instead of the HDMI interface, you need to connect the development board to the TV through the AV video cable.

    Zero2w-img20.png

  7. Heat sink. If you are worried that the temperature of the development board is too high, you can add some heat sinks and stick the heat sinks on the H618 chip and memory chip.

    Zero2w-img21.png Zero2w-img22.png

  8. 5V cooling fan, as shown in the figure below. There are 5V and GND pins on the 40pin interface of the development board that can be connected to the cooling fan. The spacing of the 40pin pins is 2.54mm. The power interface of the cooling fan can be purchased according to this specification.

    Zero2w-img23.png

    Note that the 5V pin can be used directly after the development board is plugged in and no other settings are required. In addition, the voltage output by the 5V pin cannot be adjusted or turned off through software.

    The pin headers on the 40pin interface are not soldered by default, and you need to solder them yourself before you can use them.

  9. Type-C to USB cable for connecting USB devices

    Zero2w-img24.png

  10. USB to TTL module and Dupont cable. When using the serial port debugging function, a USB to TTL module and Dupont cable are needed to connect the development board and the computer.

    Zero2w-img25.png Zero2w-img26.png

    Note that the TTL level used by the development board is 3.3v. In addition to the USB to TTL module shown in the picture above, other similar 3.3v USB to TTL modules are generally available.

  11. X64 computer with Ubuntu and Windows operating systems installed

  12. 1 Ubuntu22.04 PC Optional, used to compile Android and Linux source code
    2 Windows PC For burning Android and Linux images

Download the development board image and related information

  1. The download URL for the Chinese version of the information is

http://www.orangepi.cn/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero-2W.html

  1. The download URL for the English version of the information is

    http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero-2W.html

  2. The information mainly includes

    a. Android source code: saved on Google Cloud Drive

    b. Linux source code: saved on Github

    c. Android image: saved on Google Cloud Drive

    d. Ubuntu image: saved on Google Cloud Drive

    e. Debian image: saved on Google Cloud Drive

    f. Orange Pi OS (Arch) image: saved on Google Cloud Drive

    g. User manual and schematic diagram: chip-related data manuals will also be placed here

    h. Official tools: mainly include software needed when using the development board

Method of burning Linux image to TF card based on Windows PC

Note that the Linux image mentioned here specifically refers to the Linux distribution image such as Debian or Ubuntu downloaded from the Orange Pi information download page.

How to burn Linux image using balenaEtcher

  1. First prepare a TF card with 8GB or larger capacity. The transmission speed of the TF card must be class10 or above. It is recommended to use TF cards from SanDisk and other brands.
  2. Then use the card reader to insert the TF card into the computer
  3. Download the compressed package of the Linux operating system image file you want to burn from the Orange Pi information download page, and then use the decompression software to decompress it. In the decompressed file, the file ending with ".img" is the image file of the operating system. The size is generally above 1GB
  4. Then download the Linux image burning software-balenaEtcher, the download address is

https://www.balena.io/etcher/

  1. After entering the balenaEtcher download page, click the green download button to jump to the software download location.

    Zero2w-img27.png

  2. Then you can choose to download the Portable version of balenaEtcher software. The Portable version does not need to be installed. You can use it by double-clicking to open it.

    Zero2w-img28.png

  3. If you downloaded the version of balenaEtcher that needs to be installed, please install it first and then use it. If you downloaded the Portable version of balenaEtcher, just double-click to open it. The balenaEtcher interface after opening is as shown below.

    Zero2w-img29.png

  4. If the following error is prompted when opening balenaEtcher:

    Zero2w-img30.png

    Please select balenaEtcher, right-click, and select Run as administrator.

    Zero2w-img31.png
  1. The specific steps to use balenaEtcher to burn a Linux image are as follows

    a. First select the path of the Linux image file to be burned.

    b. Then select the drive letter of the TF card

    c. Finally click Flash and it will start burning the Linux image to the TF card.

    Zero2w-img32.png
  2. The interface displayed during the process of burning the Linux image by balenaEtcher is as shown in the figure below. In addition, the progress bar displays purple to indicate that the Linux image is being burned into the TF card.

    Zero2w-img33.png

  3. After the Linux image is burned, balenaEtcher will also verify the image burned into the TF card by default to ensure that there are no problems during the burning process. As shown in the figure below, a green progress bar indicates that the image has been burned, and balenaEtcher is verifying the burned image.

    Zero2w-img34.png

  4. After successful burning, the display interface of balenaEtcher is as shown below. If the green indicator icon is displayed, it means that the image burning is successful. At this time, you can exit balenaEtcher, then pull out the TF card and insert it into the TF card slot of the development board for use.

    Zero2w-img35.png

How to burn Linux image using Win32Diskimager

  1. First prepare a TF card with 8GB or larger capacity. The transmission speed of the TF card must be class10 or above. It is recommended to use TF cards from SanDisk and other brands.

  2. Then use the card reader to insert the TF card into the computer

  3. Then format the TF card

    1. You can use the SD Card Formatter software to format the TF card. Its download address is:
    2. https://www.sdcard.org/downloads/formatter/eula_windows/SDCardFormatterv5_WinEN.zip

    1. After downloading, just unzip and install it, and then open the software.

    2. If only the TF card is inserted into the computer, the drive letter of the TF card will be displayed in the "Select card" column. If multiple USB storage devices are inserted into the computer, you can select the drive letter corresponding to the TF card through the drop-down box.

      Zero2w-img36.png

    3. Then click "Format". A warning box will pop up before formatting. After selecting "Yes (Y)", formatting will begin.

    4. Zero2w-img37.png

    1. After formatting the TF card, the information shown in the picture below will pop up, click OK.

      Zero2w-img38.png

  1. Download the compressed package of the Linux operating system image file you want to burn from the Orange Pi information download page, and then use the decompression software to decompress it. In the decompressed file, the file ending with ".img" is the image file of the operating system. The size is generally above 1GB

  2. Use Win32Diskimager to burn the Linux image to the TF card

    1. The download page of Win32Diskimager is
    2. http://sourceforge.net/projects/win32diskimager/files/Archive/

    1. After downloading, you can install it directly. The Win32Diskimager interface is as follows

      a) First select the path to the image file

      b) Then confirm that the drive letter of the TF card is consistent with what is displayed in the "Device" column

      c) Finally click "Write" to start burning

      Zero2w-img39.png

    2. After the image writing is completed, click the "Exit" button to exit. Then you can pull out the TF card and insert it into the development board to start.

Method to burn Linux image to TF card based on Ubuntu PC

Note that the Linux image mentioned here specifically refers to the Linux distribution image such as Debian or Ubuntu downloaded from the Orange Pi information download page. Ubuntu PC refers to the personal computer with the Ubuntu system installed.

  1. First prepare a TF card with 8GB or larger capacity. The transmission speed of the TF card must be class10 or above. It is recommended to use TF cards from SanDisk and other brands.
  2. Then use the card reader to insert the TF card into the computer
  3. Download the balenaEtcher software, the download address is

https://www.balena.io/etcher/

  1. After entering the balenaEtcher download page, click the green download button to jump to the software download place.

    Zero2w-img27.png

  2. Then choose to download the Linux version of the software

    Zero2w-img40.png

  3. Download the compressed package of the Linux operating system image file you want to burn from the Orange Pi information download page, and then use the decompression software to decompress it. In the decompressed file, the file ending with ".img" is the image file of the operating system. The size is generally above 1GB. The decompression command for the compressed package ending in 7z is as follows:

    test@test:~$ 7z x orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.7z

    test@test:~$ ls orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.*

    orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.7z

    orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.sha #Checksum file

    orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.img #Image file

  4. After decompressing the image, you can first use the sha256sum -c *.sha command to calculate whether the checksum is correct. If it prompts that it is successful, it means that the downloaded image is correct, and you can burn it to the TF card with confidence. If it prompts that the checksum does not match, it means There is a problem with the downloaded image, please try downloading again

    test@test:~$ sha256sum -c *.sha

    orangepizero2w_1.0.0_ubuntu_focal_desktop_linux6.1.31.img: successful

  5. Then double-click balenaEtcher-1.14.3-x64.AppImage on the graphical interface of Ubuntu PC to open balenaEtcher (no installation required). The interface after balenaEtcher is opened is as shown below

    Zero2w-img41.png

  6. The specific steps to use balenaEtcher to burn a Linux image are as follows

    a. First select the path of the Linux image file to be burned.

    b. Then select the drive letter of the TF card

    c. Finally click Flash and it will start burning the Linux image to the TF card.

    Zero2w-img32.png

  7. The interface displayed during the process of burning the Linux image by balenaEtcher is as shown in the figure below. In addition, the progress bar displays purple to indicate that the Linux image is being burned into the TF card.

    Zero2w-img42.png

  8. After the Linux image is burned, balenaEtcher will also verify the image burned into the TF card by default to ensure that there are no problems during the burning process. As shown in the figure below, a green progress bar indicates that the image has been burned, and balenaEtcher is verifying the burned image.

    Zero2w-img43.png

  9. After successful burning, the display interface of balenaEtcher is as shown below. If a green indicator icon is displayed, it means that the image burning is successful. At this time, you can exit balenaEtcher, then pull out the TF card and insert it into the TF card slot of the development board for use.

    Zero2w-img44.png

Method of burning Android image to TF card

The Android image of the development board can only be burned to the TF card using the PhoenixCard software under the Windows platform. The version of the PhoenixCard software must be PhonixCard-4.2.8.

Please do not use software to burn Linux images, such as Win32Diskimager or balenaEtcher to burn Android images.

In addition, PhoenixCard software does not have versions for Linux and Mac platforms, so it is impossible to burn Android images to TF cards under Linux and Mac platforms.

  1. First, please make sure that Microsoft Visual C++ 2008 Redistrbutable - x86

    is installed on your Windows system.

    Zero2w-img45.png

  2. If Microsoft Visual C++ 2008 Redistrbutable - x86 is not installed, using PhoenixCard to format the TF card or burn the Android image will prompt the following error

    Zero2w-img46.png

  3. Microsoft Visual C++ 2008 Redistrbutable - x86 installation package can be downloaded from the official tool of Orange Pi Zero 2w, or you can download it from Microsoft's official website

    Zero2w-img47.png Zero2w-img48.png

  4. Then prepare a TF card with 8GB or larger capacity. The transmission speed of the TF card must be class10 or above. It is recommended to use TF cards from SanDisk and other brands.

  5. Then use the card reader to insert the TF card into the computer

  6. Download the Android image and PhoenixCard burning tool from the Orange Pi download page. Please ensure that the version of the PhonenixCrad tool is PhonixCard-4.2.8. Please do not use PhonixCard software with a version lower than 4.2.8 to burn the Android image. Low There may be problems with the Android image programmed with this version of PhonixCard tool.

    Zero2w-img49.png

  7. Then use decompression software to decompress the compressed package of the downloaded Android image. In the decompressed file, the file ending with ".img" is the Android image file, with a size of more than 1GB. If you don't know how to decompress the Android image compressed package, you can install a 360 compression software to decompress the image.

    Zero2w-img50.png

  8. Then use decompression software to decompress PhonixCard4.2.8.zip. This software does not need to be installed. Just find PhoenixCard in the decompressed folder and open it.

    Zero2w-img51.png

  9. After opening PhoenixCard, if the TF card is recognized normally, the drive letter and capacity of the TF card will be displayed in the middle list. Please make sure that the displayed drive letter is consistent with the drive letter of the TF card you want to burn. If If there is no display, you can try to remove the TF card, or click the "Refresh Drive Letter" button in PhoenixCard.

  10. Zero2w-img52.png

  1. After confirming the drive letter, format the TF card first and click the "Restore Card" button in PhoenixCard (if the "Restore Card" button is gray and cannot be pressed, you can click the "Refresh Drive Letter" button first)

    Zero2w-img53.png

    If there is a problem with formatting, please try to remove the TF card and then test again. If there is still a problem after re-inserting the TF card, you can restart the Windows computer or try another computer.

  2. Then start writing the Android image to the TF card

    a. First select the path to the Android image in the "Firmware" column

    b. Select "Start Card" in "Card Type"

    c. Then click the "Burn Card" button to start burning.

    Zero2w-img54.png

  3. After burning, the display of PhoenixCard is as shown below. At this time, click the "Close" button to exit PhoenixCard, and then you can pull out the TF card from the computer and insert it into the development board to start.

    Zero2w-img55.png

    After burning the Android system, you can only see a 128 MB partition on the TF card in Windows. The displayed partition is as shown below (some computers may pop up more than twenty disk partitions, but they can only open the 128 MB one. partition), please note that this is normal, please do not think that the TF card is burned out. The reason for this is that there are more than twenty partitions in the Android system, but most of them cannot be recognized normally in the Windows system. At this time, please feel free to unplug the TF card and insert it into the development board to start.

    Zero2w-img56.png

    After the Android system starts, you can use the following command to see the twenty partitions in the TF card:

    Zero2w-img57.png

    Using the df -h command, you can see that after burning the Android system on the 16GB TF card, there is about 11 GB of space available (not all of the more than twenty partitions will be mounted to the Android system, focus on these to see to the partition you want to reach).

    Zero2w-img58.png

Instructions for using micro-linux system in onboard SPI Flash

There is a 16MB SPI Flash on the development board, and its location is shown in the figure below:

Zero2w-img59.png

A micro Linux system is programmed into SPI Flash by default. This system is mainly used to prove that the development board can start normally. After getting the development board, there is no need to burn the system into the TF card. You only need to connect the Type-C power supply to the development board to start the micro Linux system in the SPI Flash. The main functions of this system are:

  1. After booting into the kernel, the green LED light will flash;

  2. If the development board is connected to an HDMI screen, after the system startup is completed, the command line interface of the micro Linux system can be seen on the HDMI screen.

I would like to emphasize again that the micro Linux system in SPI Flash is only used to prove that the development board can start normally (you can light up the development board without burning the system). If you find that there are other problems with the system in SPI Flash (such as serial port Unable to log in), please ignore it.

If you want to use the development board normally, please burn Ubuntu, Debian and other Linux images or Android images to the TF card, and then use it.

Start the Orange Pie development board

  1. Insert the TF card with the burned image into the TF card slot of the Orange Pi development board.
  2. The development board has a Mini HDMI interface. You can connect the development board to a TV or HDMI monitor through a Mini HDMI to HDMI cable.
  3. If you purchase a 24-pin expansion board, you can connect the 24-pin expansion board to the 24-pin interface of the development board through a cable.
  4. Connect a USB mouse and keyboard to control the Orange Pi development board.
  5. Connect a high-quality power adapter with a 5V/2A (5V/3A is also available) USB Type C interface

Remember not to plug in a power adapter with a voltage output greater than 5V, as it will burn out the development board.

Many unstable phenomena during system power-on and startup are basically caused by power supply problems, so a reliable power adapter is very important. If you find that you are constantly restarting during the startup process, please replace the power supply or Type C data cable and try again.

Both Type-C interfaces on the development board can be used for power supply.

Zero2w-img17.png
  1. Then turn on the power adapter. If everything is normal, the system startup screen will be visible on the HDMI monitor.

  2. If you want to view the output information of the system through the debugging serial port, please use the serial port cable to connect the development board to the computer. For the serial port connection method, please refer to the section on how to use the debugging serial port.

How to use the debugging serial port

Debug serial port connection instructions

  1. First, you need to prepare a 3.3v USB to TTL module, and then insert one end of the USB interface of the USB to TTL module into the USB interface of the computer.

    Zero2w-img60.png

  2. The corresponding relationship between the GND, TX and RX pins of the debugging serial port of the development board is shown in the figure below

    Zero2w-img61.png

    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.

  3. The GND, TX and RX pins of the USB to TTL module need to be connected to the debugging serial port of the development board through Dupont lines.

    1. Connect the GND of the USB to TTL module to the GND of the development board

    2. Connect the RX of the USB to TTL module to the TX of the development board

    3. Connect the TX of the USB to TTL module to the RX of the development board

  4. The schematic diagram of connecting the USB to TTL module to the computer and Orange Pi development board is as shown below

    Zero2w-img62.png

    The TX and RX of the serial port need to be cross-connected. If you don't want to carefully distinguish the order of TX and RX, you can casually connect the TX and RX of the serial port first. If there is no output from the test serial port, then exchange the order of TX and RX, so that the There is a right order.

How to use the debugging serial port on Ubuntu platform

There are many serial port debugging software that can be used under Linux, such as putty, minicom, etc. The following demonstrates how to use putty.

  1. First insert the USB to TTL module into the USB interface of the Ubuntu computer. If the USB to TTL module is connected and recognized normally, you can see the corresponding device node name under /dev of the Ubuntu PC. Remember this node name and set the serial port later. software will be used

    test@test:~$ ls /dev/ttyUSB*

    /dev/ttyUSB0

  2. Then use the following command to install putty on Ubuntu PC

    test@test:~$ sudo apt update

    test@test:~$ sudo apt install -y putty

  3. Then run putty, remember to add sudo permissions

    test@test:~$ sudo putty

  4. After executing the putty command, the following interface will pop up

    Zero2w-img63.png

  5. First select the serial port setting interface

    Zero2w-img64.png

  6. Then set the parameters of the serial port

    1. Set the Serial line to connect to to /dev/ttyUSB0 (modify to the corresponding node name, usually /dev/ttyUSB0)

    2. Set Speed(baud) to 115200 (baud rate of the serial port)

    3. Set Flow control to None

      Zero2w-img65.png

  7. After setting up the serial port setting interface, return to the Session interface.

    1. First select Connection type as Serial

    2. Then click the Open button to connect to the serial port

      Zero2w-img66.png

  8. Then start the development board, and you can see the Log information output by the system from the open serial terminal.

    Zero2w-img67.png

How to use the debugging serial port on Windows platform

There are many serial port debugging software that can be used under Windows, such as SecureCRT, MobaXterm, etc. The following demonstrates how to use MobaXterm. This software has a free version and can be used without purchasing a serial number.

  1. Download MobaXterm

    1. Download MobaXterm URL as follows

      https://mobaxterm.mobatek.net/

    2. Enter the MobaXterm download webpage and click GET XOBATERM > NOW!

      Zero2w-img68.png

    3. Then choose to download the Home version

      Zero2w-img69.png

    4. Then select the Portable version. There is no need to install it after downloading. You can open it directly and use it.

      Zero2w-img70.png

  2. After downloading, use decompression software to decompress the downloaded compressed package to get the executable software of MobaXterm, and then double-click to open it.

    Zero2w-img71.png

  3. After opening the software, the steps to set up the serial port connection are as follows:

    a. Open the session settings interface

    b. Select the serial port type

    c. Select the port number of the serial port (select the corresponding port number according to the actual situation). If you cannot see the port number, please use 360 Driver Master to scan and install the driver for the USB to TTL serial port chip.

    d. Select the baud rate of the serial port to 115200

    e. Finally click the "OK" button to complete the settings

  4. Zero2w-img72.png
  1. After clicking the "OK" button, you will enter the following interface. At this time, start the development board and you can see the output information of the serial port.

    Zero2w-img73.png

Instructions for using the 5v pin in the 40pin interface of the development board for power supply

The power supply method we recommend for the development board is to use a 5V/2A or 5V/3A Type C interface power cord and plug it into the development board's Type C power interface. If you need to use the 5V pin in the 40-pin interface to power the development board, please ensure that the power cable used can meet the power supply requirements of the development board. If the use is unstable, please switch to Type C power supply.

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.

  1. First you need to prepare a power cord as shown in the picture below

    Zero2w-img74.png

    The power cord shown in the picture above can be purchased on Taobao, please search and buy it yourself.

  2. Use the 5V pin in the 40pin interface to power the development board. The power cord connection is as follows:

    a. The USB-A port of the power cord shown in the picture above needs to be plugged into the 5V/2A or 5V/3A power adapter connector.

    b. The red DuPont wire needs to be plugged into the 5V pin of the 40pin interface of the development board

    c. The black DuPont wire needs to be plugged into the GND pin of the 40pin interface

    d. The positions of the 5V pin and GND pin of the 40pin interface in the development board are as shown in the figure below. Remember not to connect them reversely.

    Zero2w-img23.png

Debian/Ubuntu Server and Xfce desktop system usage instructions

Supported linux image types and kernel versions

Linux image type Kernel version Server version desktop version
Ubuntu 20.04 - Focal Linux5.4 Support Support
Debian 11 - Bullseye Linux5.4 Support Support
Ubuntu 22.04 - Jammy Linux6.1 Support Support
Debian 11 - Bullseye Linux6.1 Support Support
Debian 12 - Bookworm Linux6.1 Support Support

After entering the download page of the corresponding development board on the Orange Pi data download page, you can see the following download options. In the description below, Ubuntu images and Debian images are generally referred to as Linux images.

Zero2w-img75.png

The naming rules for Linux images are:

Development board model_version number_Linux distribution type_distribution code_server or desktop_kernel version

a. Development board models: all are orangepizero2w. The model names of different development boards are generally different. Before burning the image, please make sure that the model name of the selected image matches the development board.

b. Version number: such as 1.x.x, this version number will increase with the update of the mirror function. In addition, the last number of the version number of the development board Linux mirror is an even number.

c. Type of Linux distribution: Ubuntu and Debian are currently supported. Since Ubuntu is derived from Debian, there is not much difference in usage between the two systems. However, there are still slight differences in the default configuration of some software and the use of commands. In addition, Ubuntu and Debian each maintain their own supported software repositories, and there are also slight differences in the supported installable software packages. These need to be used and experienced in person to have a deeper understanding. For more details, please refer to the official documentation provided by Ubuntu and Debian.

d. Release codename: Used to distinguish different versions of specific Linux distributions such as Ubuntu or Debian. Among them, focal and jammy are both Ubuntu distributions. focal means Ubuntu20.04 and jammy means Ubuntu22.04. The biggest difference between different versions is that the software in the software warehouse maintained by the new version of Ubuntu system is much better than that of the old version of Ubuntu system. The ones in it should be new, such as Python and GCC compilation tool chains. bullseye is the specific version code name of Debian, bullseye means Debian11, and bookworm means Debian12.

e. Server or desktop: Used to indicate whether the system has a desktop environment. If it is server, it means that the system does not have a desktop environment installed. The storage space and resources occupied by the image are relatively small. The command line is mainly used to operate the control system. If it is desktop_xfce, it means that the system has the XFCE desktop environment installed by default. The image takes up a lot of storage space and resources. You can connect a monitor, mouse and keyboard to operate the operating system through the interface. Of course, the desktop version of the system can also be operated through the command line like the server version of the system.

f. Kernel version: used to indicate the version number of the linux kernel. Currently, linux5.4 and linux6.1 are supported.

Linux kernel driver adaptation situation

Board functions Linux5.4 Linux6.1
HDMI video OK OK
HDMI audio OK OK
Type-C USB2.0 x 2 OK OK
TF card startup OK OK
WIFI OK OK
Bluetooth OK OK
USB Camera OK OK
LED Light OK OK
40pin GPIO OK OK
40pin I2C OK OK
40pin SPI OK OK
40pin UART OK OK
40pin PWM OK OK
Temperature Sensor OK OK
Hardware watchdog OK OK
Mali GPU NO NO
Video codec NO NO
24pin expansion board function Linux5.4 Linux6.1
100M network port OK OK
100M Ethernet port light OK OK
USB2.0 HOST x 2 OK OK
Infrared reception OK OK
Headphone audio playback OK OK
On/off button OK OK
LRADC custom buttons x 2 OK OK
TV-OUT NO NO

Linux command format description in this manual

  1. All commands that need to be entered in the Linux system in this manual will be enclosed in the following boxes

    As shown below, the content in the yellow box indicates content that requires special attention, except for the commands inside.

  2. Description of the prompt type before the command

    1. The prompt in front of the command refers to the red part in the box below. This part is not part of the Linux command. Therefore, when entering commands in the Linux system, please do not also enter the content in the red font.

      orangepi@orangepi:~$ sudo apt update

      root@orangepi:~# vim /boot/boot.cmd

      test@test:~$ ssh root@192.168.1.xxx

      root@test:~# ls

    2. root@orangepi:~$ prompt indicates that this command is entered in the Linux system of the development board. The $ at the end of the prompt indicates that the current user of the system is an ordinary user. When executing a privileged command, sudo needs to be added.

    3. root@orangepi:~# The prompt indicates that this command is entered in the Linux system of the development board. The # at the end of the prompt indicates that the current user of the system is the root user and can execute any command you want to execute.

    4. test@test:~$ prompt indicates that this command was entered in the Ubuntu PC or Ubuntu virtual machine, not the Linux system of the development board. The $ at the end of the prompt indicates that the current user of the system is an ordinary user. When executing privileged commands, sudo needs to be added.

    5. root@test:~# prompt indicates that this command is entered in the Ubuntu PC or Ubuntu virtual machine, not the Linux system of the development board. The # at the end of the prompt indicates that the current user of the system is the root user and can execute any command you want to execute.

  3. What are the commands that need to be entered?

    1. As shown below, the bold black part is the command that needs to be input. The content below the command is the output content (some commands have output, and some may not output). This part of the content does not need to be input.

      root@orangepi:~# cat /boot/orangepiEnv.txt

      verbosity=7

      bootlogo=false

      console=serial

    2. As shown below, some commands that cannot be written in one line will be placed on the next line. As long as the black and bold parts are the commands that need to be entered. When these commands are entered into one line, the "\" at the end of each line needs to be removed. This is not part of the command. In addition, different parts of the command have spaces, please don't miss them.

      orangepi@orangepi:~$ echo \

      "deb [arch=$(dpkg --print-architecture) \

      signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \

      https://download.docker.com/linux/debian \

      $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Linux system login instructions

Linux system default login account and password

Account Password
root orangepi
orangepi orangepi

Note that when entering a password, the specific content of the entered password will not be displayed on the screen. Please do not think that there is any malfunction. Just press Enter after entering the password.

When you are prompted for an incorrect password or there is a problem with the ssh connection, please note that as long as you are using the Linux image provided by Orange Pi, please do not suspect that the above password is incorrect, but look for other reasons.

How to set up automatic login of Linux system terminal

  1. The Linux system automatically logs in to the terminal by default. The default login user name is orangepi

    Zero2w-img76.png

  2. Use the following command to set the root user to automatically log in to the terminal

    orangepi@orangepi:~$ sudo auto_login_cli.sh root

  3. Use the following command to disable automatic login to the terminal

    orangepi@orangepi:~$ sudo auto_login_cli.sh -d

  4. Use the following command to set the orangepi user to automatically log in to the terminal again

    orangepi@orangepi:~$ sudo auto_login_cli.sh orangepi

Instructions for automatic login of Linux desktop version system

  1. The desktop version system will automatically log in to the desktop after startup without entering a password.

    Zero2w-img77.png

  2. Run the following command to prevent the desktop system from automatically logging into the desktop.

    orangepi@orangepi:~$ sudo disable_desktop_autologin.sh

  3. Then restart the system and a login dialog box will appear. At this time, you need to enter a password to enter the system.

  4. Zero2w-img78.png

Setting method for automatic login of root user in Linux desktop system

  1. Execute the following command to set the desktop version of the system to automatically log in using the root user

    orangepi@orangepi:~$ sudo desktop_login.sh root

  2. Then restart the system and you will automatically log in to the desktop as the root user.

    Zero2w-img79.png

    Note that if you use the root user to log in to the desktop system, you cannot use pulseaudio in the upper right corner to manage audio devices.

    Also please note that this is not a bug, because pulseaudio is not allowed to run under the root user.

  3. Execute the following command to set up the desktop version of the system again to use the orangepi user to automatically log in

    orangepi@orangepi:~$ sudo desktop_login.sh orangepi

How to disable the desktop in Linux desktop system

  1. First enter the following command on the command line, please remember to add sudo permissions

    orangepi@orangepi:~$ sudo systemctl disable lightdm.service

  2. Then restart the Linux system and you will find that the desktop will not be displayed.

    orangepi@orangepi:~$ sudo reboot

  3. The command to reopen the desktop is as follows, please remember to add sudo permissions

    orangepi@orangepi:~$ sudo systemctl start lightdm.service

    orangepi@orangepi:~$ sudo systemctl enable lightdm.service

Onboard LED light test instructions

  1. There are two LED lights on the development board, one green light and one red light. The default display of the LED lights when the system is started is as follows:
Green light Red Light
u-boot startup phase Turn off Bright
Kernel boot to enter the system Flashing Bright

The green light on the development board can be controlled through software. The red light will be on continuously after power is turned on and cannot be controlled through software.

When you get the development board, you may find that even if the TF card with the system burned is not inserted into the development board, the green light will flash after connecting the power supply to the development board. This is because the 16MB SPI Flash on the development board is factory default. A miniature Linux system will be burned. This system will set the green light to flash after entering the kernel.

If the Linux system in the SPI Flash is cleared, then without inserting the TF card with the system programmed in it, you will only see a steady red light on the development board after turning on the power.

  1. The method of setting the green light to turn on and off and flash is as follows:

    Note that the following operations should be performed under the root user.

    1. First enter the setting directory of the green light

      root@orangepi:~# cd /sys/class/leds/green_led

    2. The command to set the green light to stop flashing is as follows:

      root@orangepi:/sys/class/leds/green_led# echo none > trigger

    3. The command to set the green light to be always on is as > follows:

      root@orangepi:/sys/class/leds/green_led# echo default-on > trigger

    4. The command to set the green light flashing is as follows:

      root@orangepi:/sys/class/leds/green_led# echo heartbeat > trigger

  2. If you do not need the LED light to flash after powering on, you can use the following method to turn off the green light flashing

    1. First run orangepi-config. Ordinary users remember to add sudo permissions.

      orangepi@orangepi:~$ sudo orangepi-config

    2. Then select System

      Zero2w-img80.png

    3. Then select Hardware

      Zero2w-img81.png

    4. Then use the keyboard's arrow keys to locate the position shown in the picture below, and then use the space to select disable-leds

      Zero2w-img82.png

    5. Then select <Save> to save

      Zero2w-img83.png

    6. Then select <Back>

      Zero2w-img84.png

    7. Then select <Reboot> to restart the system to make the configuration take effect.

      Zero2w-img85.png

    8. After restarting and entering the system, you can see that the green LED light on the development board will no longer light up.

Operation instructions for rootfs partition capacity of Linux system in TF card

The first startup will automatically expand the capacity of the rootfs partition in the TF card.

  1. After burning the Linux image of the development board into the TF card, you can check the usage of the TF card capacity on the Ubuntu computer. The steps are as follows:

    Note that failure to perform this step will not affect the automatic expansion of the Linux system of the development board. Here I just want to explain how to check the capacity of the TF card after burning the Linux image on the TF card.

    1. First install the gparted software on your Ubuntu computer

      test@test:~$ sudo apt install -y gparted

    2. Then open gparted

      test@test:~$ sudo gparted

    3. After opening gparted, you can select the TF card in the upper right corner, and then you can see the usage of the TF card capacity.

      Zero2w-img86.png

    4. The picture above shows the situation of the TF card after burning the Linux desktop system. It can be seen that although the total capacity of the TF card is 16GB (displayed as 14.84GiB in GParted), the rootfs partition (/dev/ sdc1) Only 4.05GiB is actually allocated, leaving 10.79GiB unallocated

  2. Then you can insert the TF card with the Linux system burned into the development board to start. When the TF card starts the Linux system for the first time, it will automatically call the orangepi-resize-filesystem script through the orangepi-resize-filesystem.service systemd service. Expansion of rootfs partition, so there is no need to manually expand it

  3. After logging in to the system, you can use the df -h command to check the size of rootfs. If it is consistent with the actual capacity of the TF card, it means that the automatic expansion is running correctly.

  4. orangepi@orangepi:~$ df -h

    Filesystem Size Used AvailUse% Mounted on
    udev430M0430M 0% /dev
    tmpfs 100M 5.6M 95M 6% /run
    /dev/mmcblk0p115G915M14G7% /
    tmpfs 500M 0500M 0% /dev/shm

  1. After starting the Linux system for the first time, we can also remove the TF card from the development board and reinsert it into the Ubuntu computer, and then use gparted again to check the status of the TF card, as shown in the figure below, rootfs partition (/dev/ The capacity of sdc1) has been expanded to 14.69GiB

    Zero2w-img87.png

    It should be noted that the Linux system has only one ext4 format partition and does not use a separate BOOT partition to store files such as kernel images, so there is no problem of BOOT partition expansion.

Method to prohibit automatic expansion of rootfs partition capacity in TF card

  1. First, burn the Linux image of the development board into the TF card on the Ubuntu computer (Windows is not available), and then unplug and insert the TF card again.

  2. Then the Ubuntu computer will usually automatically mount the partition of the TF card. If the automatic mounting is normal, use the ls command to see the following output.

    test@test:~$ ls /media/test/opi_root/

    bin    boot    dev    etc    home    lib    lost+found    media    mnt    opt    proc    root    run
    sbin    selinux    srv    sys    tmp    usr    var

  3. Then switch the current user to the root user on the Ubuntu computer

    test@test:~$ sudo -i

    [sudo] test 的密码:

    root@test:~#

  4. Then enter the root directory of the Linux system in the TF card and create a new file named .no_rootfs_resize

    root@test:~# cd /media/test/opi_root/

    root@test:/media/test/opi_root/# cd root

    root@test:/media/test/opi_root/root# touch .no_rootfs_resize

    root@test:/media/test/opi_root/root# ls .no_rootfs*

    .no_rootfs_resize

  5. Then you can uninstall the TF card, then pull out the TF card and insert it into the development board to start. When the Linux system starts, when the .no_rootfs_resize file is detected in the /root directory, rootfs will not be automatically expanded.

  6. After disabling the automatic expansion of rootfs, you can enter the Linux system and you can see that the total capacity of the rootfs partition is only 4GB (the image tested here is the desktop version), which is much smaller than the actual capacity of the TF card, indicating that the automatic expansion of rootfs has been successfully disabled.

    orangepi@orangepi:~$ df -h

    Filesystem Size Used AvailUse% Mounted on
    udev925M 0925M 0% /dev
    tmpfs 199M 3.2M 196M 2% /run
    /dev/mmcblk0p14.0G 3.2G 686M 83% /

  7. If you need to re-expand the capacity of the rootfs partition in the TF card, just execute the following command and then restart the Linux system of the development board.

    Note, please execute the following command under the root user.

    root@orangepi:~# rm /root/.no_rootfs_resize

    root@orangepi:~# systemctl enable orangepi-resize-filesystem.service

    root@orangepi:~# sudo reboot

    After restarting, enter the Linux system of the development board again and you will see that the rootfs partition has been expanded to the actual capacity of the TF card.

    root@orangepi:~$ df -h

    Filesystem Size Used AvailUse% Mounted on
    udev925M 0925M 0% /dev
    tmpfs 199M 3.2M 196M 2% /run
    /dev/mmcblk0p115G3.2G 12G 23% /

Method to manually expand the capacity of rootfs partition in TF card

If the total capacity of the TF card is large, such as 128GB, and you do not want the rootfs partition of the Linux system to use all the capacity of the TF card, you only want to allocate a part of the capacity, such as 16GB, to the Linux system, and then the remaining capacity of the TF card can be used for other purposes. use. Then you can use the content introduced in this section to manually expand the capacity of the rootfs partition in TF.

  1. First, burn the Linux image of the development board into the TF card on the Ubuntu computer (Windows is not available), and then unplug and insert the TF card again.

  2. Then the Ubuntu computer will usually automatically mount the partition of the TF card. If the automatic mounting is normal, use the ls command to see the following output.

    test@test:~$ ls /media/test/opi_root/

    bin    boot    dev    etc    home    lib    lost+found    media    mnt    opt    proc    root    run
    sbin    selinux    srv    sys    tmp    usr    var

  3. Then switch the current user to the root user on the Ubuntu computer

    test@test:~$ sudo -i

    [sudo] test 的密码:

    root@test:~#

  4. Then enter the root directory of the Linux system in the TF card and create a new file named .no_rootfs_resize

    root@test:~# cd /media/test/opi_root/

    root@test:/media/test/opi_root/# cd root

    root@test:/media/test/opi_root/root# touch .no_rootfs_resize

    root@test:/media/test/opi_root/root# ls .no_rootfs*

    .no_rootfs_resize

  1. Then install the gparted software on your Ubuntu computer

    test@test:~$ sudo apt install -y gparted

  2. Then open gparted

    test@test:~$ sudo gparted

  3. After opening gparted, you can select the TF card in the upper right corner, and then you can see the usage of the TF card capacity. The picture below shows the situation of the TF card after burning the Linux desktop system. It can be seen that although the total capacity of the TF card is 16GB (displayed as 14.84GiB in GParted), the rootfs partition (/dev/sdc1) Only 4.05GiB is actually allocated, leaving 10.79GiB unallocated

    Zero2w-img86.png

  4. Then select the rootfs partition (/dev/sdc1)

    Zero2w-img88.png

  5. Right-click the mouse again to see the operation options shown in the picture below. If the TF card has been mounted, you first need to Umount the rootfs partition of the TF card.

    Zero2w-img89.png

  6. Then select the rootfs partition again, right-click, and select Resize/Move to start expanding the size of the rootfs partition.

    Zero2w-img90.png

  7. After the Resize/Move option is turned on, the following setting interface will pop up.

    Zero2w-img91.png

  8. Then you can directly drag the position shown in the figure below to set the size of the capacity, or you can set the size of the rootfs partition by setting the number in New size(MiB)

    Zero2w-img92.png

  9. After setting the capacity, click Resize/Move in the lower right corner.

    Zero2w-img93.png

  10. After final confirmation, click the green shown in the picture below.

    Zero2w-img94.png

  11. Then select Apply, and the capacity expansion of the rootfs partition will officially begin.

    Zero2w-img95.png

  12. After the expansion is completed, click Close to close it.

    Zero2w-img96.png

  13. Then you can unplug the TF card and insert it into the development board to start. After entering the Linux system of the development board, if you use the df -h command to see that the size of the rootfs partition is consistent with the size set previously, it means manual Expansion successful

    root@orangepi:~# df -h

    Filesystem Size Used AvailUse% Mounted on
    udev925M 0925M 0% /dev
    tmpfs 199M 3.2M 196M 2% /run
    /dev/mmcblk0p17.7G 3.2G 4.4G 42% /

Method to reduce the capacity of rootfs partition in TF card

After configuring the application or other development environment in the Linux system of the TF card, if you want to back up the Linux system in the TF card, you can use the method in this section to reduce the size of the rootfs partition first, and then start the backup.

  1. First, insert the TF card you want to operate on your Ubuntu computer (not Windows)

  2. Then install the gparted software on your Ubuntu computer

    test@test:~$ sudo apt install -y gparted

  3. Then open gparted

    test@test:~$ sudo gparted

  4. After opening gparted, you can select the TF card in the upper right corner, and then you can see the usage of the TF card capacity.

    Zero2w-img97.png

  5. Then select the rootfs partition (/dev/sdc1)

    Zero2w-img98.png

  6. Right-click the mouse again to see the operation options shown in the picture below. If the TF card is already mounted, you first need to Umount the rootfs partition of the TF card.

    Zero2w-img99.png

  7. Then select the rootfs partition again, right-click the mouse, and select Resize/Move to start setting the size of the rootfs partition.

    Zero2w-img100.png

  8. After the Resize/Move option is turned on, the following setting interface will pop up.

    Zero2w-img101.png

  9. Then you can directly drag the position shown in the figure below to set the size of the capacity, or you can set the size of the rootfs partition by setting the number in New sieze(MiB)

    Zero2w-img92.png

  10. After setting the capacity, click Resize/Move in the lower right corner.

    Zero2w-img93.png

  11. After final confirmation, click the green as shown in the picture below.

    Zero2w-img94.png

  12. Then select Apply, and the capacity expansion of the rootfs partition will officially begin.

    Zero2w-img95.png

  13. After the expansion is completed, click Close to close it.

    Zero2w-img96.png

  14. Then you can unplug the TF card and insert it into the development board to start. After entering the Linux system of the development board, if you use the df -h command, you can see that the size of the rootfs partition is consistent with the size set previously, which means it has been reduced capacity success

    root@orangepi:~# df -h

    Filesystem Size Used AvailUse% Mounted on
    udev925M 0925M 0% /dev
    tmpfs 199M 3.2M 196M 2% /run
    /dev/mmcblk0p17.7G 3.2G 4.4G 42% /

24Pin expansion board interface pin description

  1. Please refer to the figure below for the order of the interface pins of the 24-pin expansion board of the development board.

    Zero2w-img102.png

  2. The schematic diagram of the 24pin expansion board interface of the development board is as follows

    Zero2w-img103.png

  3. The way to connect the expansion board to the development board is as follows. Please pay attention to the forward and reverse directions of the cable and do not plug it in backwards.

    Zero2w-img104.png

  4. The functions that the expansion board can expand include:

    Zero2w-img105.png

  5. 1 100M network port Used to connect to a wired network to access the Internet
    2 Analog audio and video output interface In Linux system, it can be used to connect headphones to play music, but the TV-OUT function cannot be used.
    3 USB 2.0 Host x 2 For connecting USB keyboard, mouse and USB storage devices
    4 Infrared receiving function Currently it is mainly used in Android systems, and Linux systems are mainly adapted to kernel drivers.
    5 On/off button Used to turn off or turn on the development board
    6 LRADC custom buttons x 2 The default settings of the Linux system are KEY_1 (Number 1 key) and KEY_ENTER (Enter key), which can be customized as other function keys by modifying the dts configuration.
  1. The adaptation of Linux5.4 and Linux6.1 systems to expansion boards is shown in the following table
  2. 24pin expansion board function Linux5.4 Linux6.1
    100M network port OK OK
    100M Ethernet port light OK OK
    USB2.0 HOST x 2 OK OK
    Infrared reception OK OK
    Headphone audio playback OK OK
    On/off button OK OK
    LRADC custom buttons x 2 OK OK
    TV-OUT NO NO

How to use the two LRADC buttons on the 24pin expansion board

  1. There are two LRADC buttons on the 24pin expansion board, and their locations are as shown in the figure below:

    Zero2w-img106.png

  2. In the Linux system, the default key values of KEY1 and KEY2 are

  3. Linux kernel KEY1 KEY2
    Linux5.4 KEY_1, the number 1 on the keyboard KEY_ENTER, the enter key
    Linux6.1 KEY_1, the number 1 on the keyboard KEY_ENTER, the enter key
  1. Through the evtest command, we can check the key values reported after KEY1 and KEY2 are pressed.

    1. linux5.4

      orangepi@orangepizero2w:~$ evtest

      No device specified, trying to scan all of /dev/input/event*

      Not running as root, no devices may be available.

      Available devices:

      /dev/input/event0: sunxi-keyboard

      /dev/input/event1: sunxi-ir

      /dev/input/event2: axp2101-pek

      /dev/input/event3: SONiX USB Keyboard

      /dev/input/event4: SONiX USB Keyboard Consumer Control

      /dev/input/event5: SONiX USB Keyboard System Control

      /dev/input/event6: PixArt USB Optical Mouse

      /dev/input/event7: BRLTTY 6.3 Linux Screen Driver Keyboard

      Select the device event number [0-7]: 0 #You need to enter the serial number corresponding to sunxi-keyboard

      Input driver version is 1.0.1

      Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100

      Input device name: "sunxi-keyboard"

      Supported events:

      Event type 0 (EV_SYN)

      Event type 1 (EV_KEY)

      Event code 2 (KEY_1)

      Event code 28 (KEY_ENTER)

      Properties:

      Testing ... (interrupt to exit)


      #The following are the key values reported after pressing KEY1 and KEY2


      Event: time 1693555298.132314, type 1 (EV_KEY), code 2 (KEY_1), value 1

      Event: time 1693555298.132314, -------------- SYN_REPORT ------------

      Event: time 1693555298.226071, type 1 (EV_KEY), code 2 (KEY_1), value 0

      Event: time 1693555298.226071, -------------- SYN_REPORT ------------

      Event: time 1693555298.601042, type 1 (EV_KEY), code 28 (KEY_ENTER), value 1

      Event: time 1693555298.601042, -------------- SYN_REPORT ------------

      Event: time 1693555298.710415, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0

      Event: time 1693555298.710415, -------------- SYN_REPORT ------------

    2. linux6.1

      orangepi@orangepizero2w:~$ evtest

      No device specified, trying to scan all of /dev/input/event*

      Not running as root, no devices may be available.

      Available devices:

      /dev/input/event0: axp20x-pek

      /dev/input/event1: 5070800.lradc

      /dev/input/event2: SONiX USB Keyboard

      /dev/input/event3: SONiX USB Keyboard Consumer Control

      /dev/input/event4: SONiX USB Keyboard System Control

      /dev/input/event5: PixArt USB Optical Mouse

      /dev/input/event6: sunxi-ir

      Select the device event number [0-6]: 1 #You need to enter the serial number corresponding to 5070800.lradc

      Input driver version is 1.0.1

      Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100

      Input device name: "5070800.lradc"

      Supported events:

      Event type 0 (EV_SYN)

      Event type 1 (EV_KEY)

      Event code 2 (KEY_1)

      Event code 28 (KEY_ENTER)

      Properties:

      Testing ... (interrupt to exit)


      #The following are the key values reported after pressing KEY1 and KEY2


      Event: time 1694075818.810877, type 1 (EV_KEY), code 2 (KEY_1), value 1

      Event: time 1694075818.810877, -------------- SYN_REPORT ------------

      Event: time 1694075818.961345, type 1 (EV_KEY), code 2 (KEY_1), value 0

      Event: time 1694075818.961345, -------------- SYN_REPORT ------------

      Event: time 1694075819.536128, type 1 (EV_KEY), code 28 (KEY_ENTER), value 1

      Event: time 1694075819.536128, -------------- SYN_REPORT ------------

      Event: time 1694075819.705009, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0

      Event: time 1694075819.705009, -------------- SYN_REPORT ------------

  2. If you need to modify the key values reported after KEY1 and KEY2 are pressed, you can use the following method:

    1. There is a sun50i-h618-lradc-keys.dts file under the /usr/src/ path, through which we can define KEY1 and KEY2 as the desired key values.

      orangepi@orangepizero2w:~$ cd /usr/src/

      orangepi@orangepizero2w:/usr/src$ ls *.dts

      sun50i-h618-lradc-keys.dts

    2. The contents of the sun50i-h618-lradc-keys.dts file in the linux5.4 system are as follows:

      1. a) KEY1 correspondence: modify key0 = <600 2>; where 2 is the number corresponding to the desired key value

      2. b) KEY2 correspondence: modify key1 = <800 28>; where 28 is the number corresponding to the desired key value

        orangepi@orangepizero2w:/usr/src$ sudo vim sun50i-h618-lradc-keys.dts

        /dts-v1/;

        /plugin/;


        / {

        fragment@0 {

        target = <&keyboard>;


        __overlay__ {

        status = "okay";


        key0 = <600 2>;

        key1 = <800 28>;

        };

        };

        };

    3. The contents of the c.linux6.1 system sun50i-h618-lradc-keys.dts file are as follows:

      1. a) KEY1 corresponding: modify linux,code = <2>; the 2 in > it is the number corresponding to the desired key value

      2. b) KEY2 correspondence: modify linux,code = <28>; the 28 > in it is the number corresponding to the desired key value

        orangepi@orangepizero2w:/usr/src$ sudo vim sun50i-h618-lradc-keys.dts

        /dts-v1/;

        /plugin/;


        / {

        fragment@0 {

        target = <&r_lradc>;


        __overlay__ {

        status = "okay";


        button-500 {

        label = "KEY_1";

        linux,code = <2>;

        };


        button-800 {

        label = "KEY_ENTER";

        linux,code = <28>;

        };

        };

        };

        };

    4. For the key values that can be set, please refer to the macro definition in the input-event-codes.h header file. Its path in the kernel source code is:

      orange-pi-5.4-sun50iw9/include/uapi/linux/input-event-codes.h

      orange-pi-6.1-sun50iw9/include/uapi/linux/input-event-codes.h

    5. After modification, use the orangepi-add-overlay command to add the sun50i-h618-lradc-keys.dts configuration to the system.

      orangepi@orangepizero2w:/usr/src$ sudo orangepi-add-overlay sun50i-h618-lradc-keys.dts

      Compiling the overlay

      Copying the compiled overlay file to /boot/overlay-user/

      Reboot is required to apply the changes

    6. Then restart the system and the customized key values will take effect.

Network connection test

Ethernet port test

  1. There is no wired network interface on the main board of the development board. We can expand the 100M wired network interface through a 24pin expansion board.

    Zero2w-img107.png

  2. Then plug one end of the network cable into the Ethernet interface of the expansion board, and the other end of the network cable into the router, and make sure the network is smooth.

  3. After the system starts, it will automatically assign an IP address to the Ethernet card through DHCP, and no other configuration is required.

  4. The command to view the IP address in the Linux system of the development board is as follows:

    Please do not copy the following commands. For example, the network node name in debian12 is end0, and the following command needs to be modified to ip a s end0.

    orangepi@orangepi:~$ ip a s eth0

    3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

    link/ether 5e:ac:14:a5:93:b3 brd ff:ff:ff:ff:ff:ff

    inet 192.168.1.16/24 brd 192.168.1.255 scope global dynamic noprefixroute eth0

    valid_lft 259174sec preferred_lft 259174sec

    inet6 240e:3b7:3240:c3a0:e269:8305:dc08:135e/64 scope global dynamic noprefixroute

    valid_lft 259176sec preferred_lft 172776sec

    inet6 fe80::957d:bbbd:4928:3604/64 scope link noprefixroute

    valid_lft forever preferred_lft forever

    There are three ways to check the IP address after the development board is started:

    1. Connect the HDMI display, then log in to the system and use the ip a s eth0 command to check the IP address.

    2. Enter the ip a s eth0 command in the debugging serial terminal to view the IP address.

    3. If there is no debugging serial port or HDMI display, you can also check the IP address of the development board's network port through the router's management interface. However, with this method, people often fail to see the IP address of the development board. If you can't see it, here's how to debug it:

    A) First check whether the Linux system has started normally. If the green light of the development board flashes, it usually means that it has started normally. If only the red light is on, or the red and green lights are not on, it means that the system has not started normally;

    B) Check whether the network cable is plugged in tightly, or try another network cable;

    C) Try another router (I have encountered many problems with routers, such as the router being unable to assign an IP address normally, or the IP address being assigned normally but not being visible in the router);

    D) If there is no router to replace, you can only connect an HDMI display or use the debugging serial port to check the IP address.


    In addition, it should be noted that the development board's DHCP automatic allocation of IP addresses does not require any settings.

  5. The command to test network connectivity is as follows. The ping command can be interrupted by pressing the Ctrl+C shortcut key.

    Please do not copy the following commands. For example, the network node name in debian12 is end0. The following command needs to be modified to ping www.baidu.com -I end0.

    orangepi@orangepi:~$ ping www.baidu.com -I eth0

    PING www.a.shifen.com (14.215.177.38) from 192.168.1.12 eth0: 56(84) bytes of data.

    64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=1 ttl=56 time=6.74 ms

    64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=2 ttl=56 time=6.80 ms

    64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=3 ttl=56 time=6.26 ms

    64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=4 ttl=56 time=7.27 ms

    ^C

    --- www.a.shifen.com ping statistics ---

    4 packets transmitted, 4 received, 0% packet loss, time 3002ms

    rtt min/avg/max/mdev = 6.260/6.770/7.275/0.373 ms

WIFI connection test

Please do not connect to WIFI by modifying the /etc/network/interfaces configuration file. There will be problems in connecting to the WIFI network in this way.

Server version image connects to WIFI through commands

When the development board is not connected to Ethernet or HDMI display, but only to the serial port, it is recommended to use the commands demonstrated in this section to connect to the WIFI network. Because nmtui can only display characters in some serial port software (such as minicom) and cannot display the graphical interface normally. Of course, if the development board is connected to an Ethernet or HDMI display, you can also use the commands demonstrated in this section to connect to the WIFI network.

  1. First log in to the Linux system, there are three ways:

    a. If the development board is connected to a network cable, you can remotely log in to the Linux system through ssh.

    b. If the development board is connected to the debugging serial port, you can use the serial port terminal to log in to the Linux system.

    c. If the development board is connected to an HDMI display, you can log in to the Linux system through the HDMI display terminal.

  1. First use the nmcli dev wifi command to scan the surrounding WIFI hotspots

    orangepi@orangepi:~$ nmcli dev wifi

    Zero2w-img108.png

  2. Then use the nmcli command to connect to the scanned WIFI hotspot, where:

    1. wifi_name needs to be replaced with the name of the WIFI hotspot you want to connect to

    2. wifi_passwd needs to be replaced with the password of the WIFI hotspot you want to connect to.

      orangepi@orangepi:~$ sudo nmcli dev wifi connect wifi_name password wifi_passwd

      Device 'wlan0' successfully activated with 'cf937f88-ca1e-4411-bb50-61f402eef293'.

  3. You can check the IP address of the wifi through the ip addr show wlan0 command

    orangepi@orangepi:~$ ip a s wlan0

    11: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

    link/ether 23:8c:d6:ae:76:bb brd ff:ff:ff:ff:ff:ff

    inet 192.168.1.11/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0

    valid_lft 259192sec preferred_lft 259192sec

    inet6 240e:3b7:3240:c3a0:c401:a445:5002:ccdd/64 scope global dynamic noprefixroute

    valid_lft 259192sec preferred_lft 172792sec

    inet6 fe80::42f1:6019:a80e:4c31/64 scope link noprefixroute

    valid_lft forever preferred_lft forever

  4. Use the ping command to test the connectivity of the wifi network. The ping command can be interrupted by pressing the Ctrl+C shortcut key.

    orangepi@orangepi:~$ ping www.orangepi.org -I wlan0

    PING www.orangepi.org (182.92.236.130) from 192.168.1.49 wlan0: 56(84) bytes of data.

    64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=1 ttl=52 time=43.5 ms

    64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=2 ttl=52 time=41.3 ms

    64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=3 ttl=52 time=44.9 ms

    64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=4 ttl=52 time=45.6 ms

    64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=5 ttl=52 time=48.8 ms

    ^C

    --- www.orangepi.org ping statistics ---

    5 packets transmitted, 5 received, 0% packet loss, time 4006ms

    rtt min/avg/max/mdev = 41.321/44.864/48.834/2.484 ms

Server version image connects to WIFI graphically

  1. First log in to the Linux system, there are three ways:

    a. If the development board is connected to a network cable, you can remotely log in to the Linux system through ssh.

    b. If the development board is connected to the debugging serial port, you can use the serial port terminal to log in to the Linux system (please use MobaXterm for the serial port software, the graphical interface cannot be displayed using minicom)

    c. If the development board is connected to an HDMI display, you can log in to the Linux system through the HDMI display terminal.

  2. Then enter the nmtui command in the command line to open the wifi connection interface

    orangepi@orangepi:~$ sudo nmtui

  3. Enter the nmtui command to open the interface as shown below

    Zero2w-img109.png

  4. Select Activate a connect and press Enter

    Zero2w-img110.png

  5. Then you can see all the searched WIFI hotspots

    Zero2w-img111.png

  6. Select the WIFI hotspot you want to connect to, then use the Tab key to position the cursor on Activate and press Enter.

    Zero2w-img112.png

  7. Then a dialog box for entering the password will pop up. Enter the corresponding password in Password and press Enter to start connecting to WIFI.

    Zero2w-img113.png

  8. After the WIFI connection is successful, a "*" will be displayed in front of the connected WIFI name.

    Zero2w-img114.png

  9. You can check the IP address of the wifi through the ip a s wlan0 command

    orangepi@orangepi:~$ ip a s wlan0

    11: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

    link/ether 24:8c:d3:aa:76:bb brd ff:ff:ff:ff:ff:ff

    inet 192.168.1.11/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0

    valid_lft 259069sec preferred_lft 259069sec

    inet6 240e:3b7:3240:c4a0:c401:a445:5002:ccdd/64 scope global dynamic noprefixroute

    valid_lft 259071sec preferred_lft 172671sec

    inet6 fe80::42f1:6019:a80e:4c31/64 scope link noprefixroute

    valid_lft forever preferred_lft forever

  10. Use the ping command to test the connectivity of the wifi network. The ping command can be interrupted by pressing the Ctrl+C shortcut key.

    orangepi@orangepi:~$ ping www.orangepi.org -I wlan0

    PING www.orangepi.org (182.92.236.130) from 192.168.1.49 wlan0: 56(84) bytes of data.

    64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=1 ttl=52 time=43.5 ms

    64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=2 ttl=52 time=41.3 ms

    64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=3 ttl=52 time=44.9 ms

    64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=4 ttl=52 time=45.6 ms

    64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=5 ttl=52 time=48.8 ms

    ^C

    --- www.orangepi.org ping statistics ---

    5 packets transmitted, 5 received, 0% packet loss, time 4006ms

    rtt min/avg/max/mdev = 41.321/44.864/48.834/2.484 ms

Test method for desktop image

  1. Click the network configuration icon in the upper right corner of the desktop (please do not connect the network cable when testing WIFI)

    Zero2w-img115.png

  2. Click More networks in the pop-up drop-down box to see all scanned WIFI hotspots, and then select the WIFI hotspot you want to connect to.

    Zero2w-img116.png

  3. Then enter the password of the WIFI hotspot and click Connect to start connecting to WIFI

    Zero2w-img117.png

  4. After connecting to WIFI, you can open the browser to check whether you can access the Internet. The browser entrance is as shown below

    Zero2w-img118.png

  5. If you can open other web pages after opening the browser, it means the WIFI connection is normal.

    Zero2w-img119.png

Method to create WIFI hotspot through create_ap

create_ap is a script that helps quickly create WIFI hotspots on Linux, and supports bridge and NAT modes. It can automatically combine hostapd, dnsmasq and iptables to complete the setting of WIFI hotspots, avoiding users from complicated configurations. The github address is as follows:

https://github.com/oblique/create_ap

The Linux image released by OPi has been pre-installed with the create_ap script. You can use the create_ap command to create a WIFI hotspot. The basic command format of create_ap is as follows:


create_ap [options] <wifi-interface> [<interface-with-internet>] [<access-point-name> [<passphrase>]]


* options: You can use this parameter to specify the encryption method, frequency band of WIFI hotspot, bandwidth mode, network sharing method, etc. You can get the options through create_ap -h.

* wifi-interface: The name of the wireless network card

* interface-with-internet: The name of the network card that can connect to the Internet, usually eth0

* access-point-name: Hotspot name

* passphrase: hotspot password

create_ap method to create WIFI hotspot in NAT mode

  1. Enter the following command to create a WIFI hotspot with the name orangepi and password orangepi in NAT mode

    Note that in the following command, Debian12 needs to modify eth0 to end0

    orangepi@orangepi:~$ sudo create_ap -m nat wlan0 eth0 orangepi orangepi --no-virt

  1. If the following information is output, it means that the WIFI hotspot is successfully created.

    orangepi@orangepi:~$ sudo create_ap -m nat wlan0 eth0 orangepi orangepi --no-virt

    Config dir: /tmp/create_ap.wlan0.conf.TQkJtsz1

    PID: 26139

    Network Manager found, set wlan0 as unmanaged device... DONE

    Sharing Internet using method: nat

    hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlan0.conf.TQkJtsz1/hostapd_ctrl

    wlan0: interface state UNINITIALIZED->ENABLED

    wlan0: AP-ENABLED

    wlan0: STA ce:bd:9a:dd:a5:86 IEEE 802.11: associated

    wlan0: AP-STA-CONNECTED ce:bd:9a:dd:a5:86

    wlan0: STA ce:bd:9a:dd:a5:86 RADIUS: starting accounting session D4FBF7E5C604F169

    wlan0: STA ce:bd:9a:dd:a5:86 WPA: pairwise key handshake completed (RSN)

    wlan0: EAPOL-4WAY-HS-COMPLETED ce:bd:9a:dd:a5:86

  2. At this time, take out your mobile phone and find the WIFI hotspot named orangepi created by the development board in the searched WIFI list. Then you can click orangepi to connect to the hotspot. The password is orangepi set above.

    Zero2w-img120.png

  3. The display after successful connection is as shown below

    Zero2w-img121.png

  4. In NAT mode, the wireless device connected to the development board's hotspot requests an IP address from the development board's DHCP service, so there will be two different network segments. For example, the development board's IP here is 192.168.1.X

    Note that in the following command, Debian12 needs to modify eth0 to end0.

    orangepi@orangepi:~$ sudo ifconfig eth0

    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

    inet 192.168.1.150 netmask 255.255.255.0 broadcast 192.168.1.255

    inet6 fe80::938f:8776:5783:afa2 prefixlen 64 scopeid 0x20<link>

    ether 4a:a0:c8:25:42:82 txqueuelen 1000 (Ethernet)

    RX packets 25370 bytes 2709590 (2.7 MB)

    RX errors 0 dropped 50 overruns 0 frame 0

    TX packets 3798 bytes 1519493 (1.5 MB)

    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    device interrupt 83

    The DHCP service of the development board will assign the IP address of 192.168.12.0/24 to the device connected to the hotspot by default. At this time, click on the connected WIFI hotspot orangepi, and then you can see that the IP address of the mobile phone is 192.168.12.X.

    Zero2w-img121.png

    Zero2w-img122.png

  5. If you want to specify a different network segment for the connected device, you can specify it through the -g parameter. For example, use the -g parameter to specify the network segment of the access point AP as 192.168.2.1.

    Note that in the following command, Debian12 needs to modify eth0 to end0.

    orangepi@orangepi:~$ sudo create_ap -m nat wlan0 eth0 orangepi orangepi -g 192.168.2.1 --no-virt

    At this time, after connecting to the hotspot through the mobile phone, click on the connected WIFI hotspot orangepi, and then you can see that the IP address of the mobile phone is 192.168.2.X

    Zero2w-img121.png

    Zero2w-img122.png

  1. Without specifying the --freq-band parameter, the hotspot created by default is in the 2.4G frequency band. If you want to create a hotspot in the 5G frequency band, you can specify it through the --freq-band 5 parameter. The specific command is as follows

    Note that in the following command, Debian12 needs to modify eth0 to end0

    orangepi@orangepi:~$ sudo create_ap -m nat wlan0 eth0 orangepi orangepi --freq-band 5 --no-virt

  1. If you need to hide the SSID, you can specify the --hidden parameter. The specific command is as follows

    Note that in the following command, Debian12 needs to modify eth0 to end0.

    orangepi@orangepi:~$ sudo create_ap -m nat wlan0 eth0 orangepi orangepi --hidden --no-virt

    At this time, the mobile phone cannot search for WIFI hotspots. You need to manually specify the WIFI hotspot name and enter the password to connect to the WIFI hotspot.

    Zero2w-img123.png

create_ap method to create WIFI hotspot in bridge mode

  1. Enter the following command to create a WIFI hotspot with the name orangepi and password orangepi in bridge mode

    Note that in the following command, Debian12 needs to modify eth0 to end0.

    orangepi@orangepi:~$ sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --no-virt

  1. If the following information is output, it means that the WIFI hotspot is successfully created.

    orangepi@orangepi:~$ sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --no-virt

    Config dir: /tmp/create_ap.wlan0.conf.zAcFlYTx

    PID: 27707

    Network Manager found, set wlan0 as unmanaged device... DONE

    Sharing Internet using method: bridge

    Create a bridge interface... br0 created.

    hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlan0.conf.zAcFlYTx/hostapd_ctrl

    wlan0: interface state UNINITIALIZED->ENABLED

    wlan0: AP-ENABLED

    wlan0: STA ce:bd:9a:dd:a5:86 IEEE 802.11: associated

    wlan0: AP-STA-CONNECTED ce:bd:9a:dd:a5:86

    wlan0: STA ce:bd:9a:dd:a5:86 RADIUS: starting accounting session 937BF40E51897A7B

    wlan0: STA ce:bd:9a:dd:a5:86 WPA: pairwise key handshake completed (RSN)

    wlan0: EAPOL-4WAY-HS-COMPLETED ce:bd:9a:dd:a5:86

  2. At this time, take out your mobile phone and find the WIFI hotspot named orangepi created by the development board in the searched WIFI list. Then you can click orangepi to connect to the hotspot. The password is orangepi set above.

    Zero2w-img120.png

  3. The display after successful connection is as shown below

    Zero2w-img121.png

  4. In bridge mode, the wireless device connected to the hotspot of the development board also requests an IP address from the DHCP service of the main router (the router to which the development board is connected). For example, the IP of the development board here is 192.168.1.X

    orangepi@orangepi:~$ sudo ifconfig eth0

    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

    inet 192.168.1.150 netmask 255.255.255.0 broadcast 192.168.1.255

    inet6 fe80::938f:8776:5783:afa2 prefixlen 64 scopeid 0x20<link>

    ether 4a:a0:c8:25:42:82 txqueuelen 1000 (Ethernet)

    RX packets 25370 bytes 2709590 (2.7 MB)

    RX errors 0 dropped 50 overruns 0 frame 0

    TX packets 3798 bytes 1519493 (1.5 MB)

    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    device interrupt 83

    The IP of the device connected to the WIFI hotspot is also assigned by the main router, so the mobile phone connected to the WIFI hotspot and the development board are in the same network segment. At this time, click on the connected WIFI hotspot orangepi, and then you can see the IP address of the mobile phone. Also 192.168.1.X.

    Zero2w-img121.png

    Zero2w-img122.png

  5. Without specifying the --freq-band parameter, the hotspot created by default is in the 2.4G frequency band. If you want to create a hotspot in the 5G frequency band, you can specify it through the --freq-band parameter. The specific command is as follows

    Note that in the following command, Debian12 needs to modify eth0 to end0.

    orangepi@orangepi:~$ sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --freq-band 5 --no-virt

  1. If you need to hide the SSID, you can specify the --hidden parameter. The specific command is as follows

    Note that in the following command, Debian12 needs to modify eth0 to end0.

    orangepi@orangepi:~$ sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --hidden --no-virt

    At this time, the mobile phone cannot search for WIFI hotspots. You need to manually specify the WIFI hotspot name and enter the password to connect to the WIFI hotspot.

    Zero2w-img123.png

How to set a static IP address

Please do not set a static IP address by modifying the /etc/network/interfaces configuration file.

Use the nmtui command to set a static IP address

  1. First run the nmtui command

    orangepi@orangepi:~$ sudo nmtui

  2. Then select Edit a connection and press the Enter key

    Zero2w-img124.png

  3. Then select the network interface for which a static IP address needs to be set. For example, to set the static IP address of the Ethernet interface, select Wired connection 1.

    Zero2w-img125.png

  4. Then select Edit via the Tab key and press the Enter key

    Zero2w-img126.png

  5. Then use the Tab key to move the cursor to the <Automatic> position shown in the figure below to configure IPv4

    Zero2w-img127.png

  6. Then press Enter, select Manual through the up and down arrow keys, and then press Enter to confirm.

    Zero2w-img128.png

  7. The display after selection is as shown below

    Zero2w-img129.png

  8. Then move the cursor to <Show> via the Tab key

    Zero2w-img130.png

  9. Then press Enter. After pressing Enter, the following setting interface will pop up.

    Zero2w-img131.png

  10. Then you can set the IP address (Addresses), gateway (Gateway) and DNS server address as shown in the figure below (there are many other setting options, please explore by yourself), please set according to your specific needs. The values set in the image below are just an example

    Zero2w-img132.png

  11. After setting, move the cursor to <OK> in the lower right corner, and then press Enter to confirm.

    Zero2w-img133.png

  12. Then click <Back> to return to the previous level selection interface

    Zero2w-img134.png

  13. Then select Activate a connection, then move the cursor to <OK>, and finally click Enter

    Zero2w-img135.png

  14. Then select the network interface that needs to be set, such as Wired connection 1, then move the cursor to <Deactivate>, and then press the Enter key to disable Wired connection 1

    Zero2w-img136.png

  15. Then please do not move the cursor, and then press the Enter key to re-enable Wired connection 1, so that the static IP address set previously will take effect.

    Zero2w-img137.png

  16. Then you can exit nmtui through the <Back> and Quit buttons

    Zero2w-img138.png Zero2w-img139.png

  17. Then through ip a s eth0 you can see that the IP address of the network port has become the static IP address set previously.

    Note that in the following command, Debian12 needs to modify eth0 to end0.

    orangepi@orangepi:~$ ip a s eth0

    3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

    link/ether 5e:ac:14:a5:92:b3 brd ff:ff:ff:ff:ff:ff

    inet 192.168.1.177/24 brd 192.168.1.255 scope global noprefixroute eth0

    valid_lft forever preferred_lft forever

    inet6 241e:3b8:3240:c3a0:e269:8305:dc08:135e/64 scope global dynamic noprefixroute

    valid_lft 259149sec preferred_lft 172749sec

    inet6 fe80::957d:bbbe:4928:3604/64 scope link noprefixroute

    valid_lft forever preferred_lft forever

  18. Then you can test the network connectivity to check whether the IP address is configured OK. The ping command can be interrupted by using the Ctrl+C shortcut key.

    Note that in the following command, Debian12 needs to modify eth0 to end0.

    orangepi@orangepi:~$ ping 192.168.1.177 -I eth0

    PING 192.168.1.47 (192.168.1.47) from 192.168.1.188 eth0: 56(84) bytes of data.

    64 bytes from 192.168.1.47: icmp_seq=1 ttl=64 time=0.233 ms

    64 bytes from 192.168.1.47: icmp_seq=2 ttl=64 time=0.263 ms

    64 bytes from 192.168.1.47: icmp_seq=3 ttl=64 time=0.273 ms

    64 bytes from 192.168.1.47: icmp_seq=4 ttl=64 time=0.269 ms

    64 bytes from 192.168.1.47: icmp_seq=5 ttl=64 time=0.275 ms

    ^C

    --- 192.168.1.47 ping statistics ---

    5 packets transmitted, 5 received, 0% packet loss, time 4042ms

    rtt min/avg/max/mdev = 0.233/0.262/0.275/0.015 ms

Use nmcli command to set static IP address

  1. If you want to set a static IP address for the network port, please plug the network cable into the development board first. If you need to set a static IP address for WIFI, please connect to WIFI first, and then start setting the static IP address.

  2. Then you can view the name of the network device through the nmcli con show command, as shown below

    1. orangepi is the name of the WIFI network interface (the names are not necessarily the same)

    2. Wired connection 1 is the name of the Ethernet interface

      orangepi@orangepi:~$ nmcli con show
      NAMEUUID TYPE DEVICE
      orangepicfc4f922-ae48-46f1-84e1-2f19e9ec5e2awifi wlan0
      Wired connection 19db058b7-7701-37b8-9411-efc2ae8bfa30ethernet eth0

  3. 中Then enter the following command, where

    1. "Wired connection 1" means setting the static IP address of the Ethernet port. If you need to set the static IP address of WIFI, please change it to the name corresponding to the WIFI network interface (can be obtained through the nmcli con show command)

    2. ipv4.addresses is followed by the static IP address to be set, which can be modified to the value you want to set.

    3. ipv4.gateway represents the address of the gateway

      orangepi@orangepi:~$ sudo nmcli con mod "Wired connection 1" \
      ipv4.addresses "192.168.1.110" \

      ipv4.gateway "192.168.1.1" \

      ipv4.dns "8.8.8.8" \

      ipv4.method "manual"

  4. Then restart the linux system

    orangepi@orangepi:~$ sudo reboot

  5. Then re-enter the Linux system and use the ip addr show eth0 command to see that the IP address has been set to the desired value.

    orangepi@orangepi:~$ ip addr show eth0

    3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

    link/ether 5e:ae:14:a5:91:b3 brd ff:ff:ff:ff:ff:ff

    inet 192.168.1.110/32 brd 192.168.1.110 scope global noprefixroute eth0

    valid_lft forever preferred_lft forever

    inet6 240e:3b7:3240:c3a0:97de:1d01:b290:fe3a/64 scope global dynamic noprefixroute

    valid_lft 259183sec preferred_lft 172783sec

    inet6 fe80::3312:861a:a589:d3c/64 scope link noprefixroute

    valid_lft forever preferred_lft forever

How to set up the Linux system to automatically connect to the network for the first time

The development board has an Ethernet port. If you want to remotely log in to the Linux system of the development board through the Ethernet port, you only need to plug in a network cable that can access the Internet normally. After starting the Linux system, it will automatically connect to the Ethernet port through DHCP. Assign an IP address, and then we can obtain the IP address of the Ethernet port through the HDMI screen, serial port, or view the router's background, and then log in to the Linux system remotely.

The development board also has wireless WIFI. If you want to remotely log in to the Linux system of the development board through WIFI, you need to remotely log in to the Linux system through ssh through the IP address of the Ethernet port and then use commands to connect to WIFI, or use commands on the HDMI screen or serial port. Connect to WIFI.

But if there is no HDMI screen and serial port module, although there is a network cable, the IP address of the development board cannot be viewed through the router background. Or if there is no HDMI screen, serial port module and network cable, and only WIFI can be connected, you can use the method introduced in this section to automatically connect to WIFI and set the static IP address of WIFI or automatically set the static IP address of the Ethernet port.

To use the method in this section, you first need to prepare a Linux system machine. For example, a computer or virtual machine with Ubuntu system installed.

Why do you need a Linux system machine? Because the root file system of the Linux system of the development board burned in the TF card is in ext4 format. The Linux system machine can mount it normally and then modify the configuration file in it.

If you want to modify it in a Windows system, you can use the software Paragon ExtFS for Windows. Since this software requires payment, and there is currently no similar free software that is easy to use, I will not demonstrate it in detail here.

In addition, if you have any problems when trying to use Paragon ExtFS for Windows, please solve it yourself. We will not answer questions.

  1. First burn the Linux image of the development board you want to use into a TF card, and then use a card reader to insert the TF card with the Linux image of the development board into a machine with a Linux system (such as a machine with Ubuntu system Computer, the following uses Ubuntu computer as an example for demonstration)

  2. When the TF card is inserted into the Ubuntu computer, the Ubuntu computer will generally automatically mount the Linux root file system partition in the TF card. From the following command, we can know that /media/test/opi_root is the Linux root file in the TF card. System mounting path

    test@test:~$ df -h | grep "media"

    /dev/sdd1    1.4G    1.2G    167M    88% /media/test/opi_root

    test@test:~$ ls /media/test/opi_root

    bin    boot    dev    etc    home    lib    lost+found    media    mnt    opt    proc    root    run
    sbin    selinux    srv    sys    tmp    usr    var

  3. Then enter the /boot directory of the Linux system burned in the TF card

    test@test:~$ cd /media/test/opi_root/boot/

  4. Then copy the orangepi_first_run.txt.template to orangepi_first_run.txt. Through the orangepi_first_run.txt configuration file, you can set the development board to automatically connect to a WIFI hotspot when the Linux system starts for the first time. You can also set the WIFI or Ethernet port Static IP address.

    test@test:/media/test/opi_root/boot$ sudo cp orangepi_first_run.txt.template orangepi_first_run.txt

  5. You can open the orangepi_first_run.txt file through the following command, and then you can view and modify the contents.

    test@test:/media/test/opi_root/boot$ sudo vim orangepi_first_run.txt

  6. Variable usage instructions in the orangepi_first_run.txt file

    1. FR_general_delete_this_file_after_completion The variable is used to set whether to delete the orangepi_first_run.txt file after the first startup. The default is 1, which means deletion. If set to 0, orangepi_first_run.txt will be renamed after the first startup.orangepi_first_run.txt.old, Generally, just keep the default value

    2. FR_net_change_defaults The variable is used to set whether to change the default network settings. This must be set to 1, otherwise all network settings will not take effect.

    3. FR_net_ethernet_enabled The variable is used to control whether to enable the configuration of the Ethernet port. If you need to set the static IP address of the Ethernet port, please set it to 1

    4. FR_net_wifi_enabled The variable is used to control whether to enable WIFI configuration. If you need to set the development board to automatically connect to WIFI hotspots, you must set it to 1. Also please note that if this variable is set to 1, the Ethernet port settings will be invalid. That is to say, the WIFI and Ethernet ports cannot be set at the same time (why, because it is not necessary...)

    5. FR_net_wifi_ssid Variable is used to set the name of the WIFI hotspot you want to connect to

    6. FR_net_wifi_key Variable is used to set the password of the WIFI hotspot you want to connect to

    7. FR_net_use_static Variables are used to set whether the static IP address of the WIFI or Ethernet port needs to be set.

    8. FR_net_static_ip The variable is used to set the static IP address. Please set it according to your actual situation.

    9. FR_net_static_gateway Variables are used to set the gateway. Please set according to your actual situation.

  7. Here are some specific setting examples:

    1. For example, if you want the Linux system of the development board to automatically connect to the WIFI hotspot after it is started for the first time, you can set it like this:

      1. a) Set FR_net_change_defaults to 1

      2. b) Set FR_net_wifi_enabled to 1

      3. c) Set FR_net_wifi_ssid to the name of the WIFI hotspot you want to connect to

      4. d) Set FR_net_wifi_key to the password of the WIFI hotspot you want to connect to

    2. For example, you want the Linux system of the development board to automatically connect to the WIFI hotspot after the first startup, and set the WIFI IP address to a specific static IP address (so that when the Linux system starts, you can directly use the set static IP address to ssh remotely Log in to the development board, there is no need to check the IP address of the development board through the router background), you can set it like this:

      1. a) Set FR_net_change_defaults to 1

      2. b) Set FR_net_wifi_enabled to 1

      3. c) Set FR_net_wifi_ssid to the name of the WIFI hotspot you want to connect to

      4. d) Set FR_net_wifi_key to the password of the WIFI hotspot you want to connect to

      5. e) Set FR_net_use_static to 1

      6. f) Set FR_net_static_ip to the desired IP address

      7. g) Set R_net_static_gateway to the corresponding gateway address

    3. For example, if you want the development board's Linux system to automatically set the IP address of the Ethernet port to the desired static IP address after it is started for the first time, you can set it like this

      1. a) Set FR_net_change_default to 1

      2. b) Set FR_net_ethernet_enabled to 1

      3. c) Set FR_net_use_static to 1

      4. d) Set FR_net_static_ip to the desired IP address

      5. e) Set FR_net_static_gateway to the corresponding gateway address

  8. After modifying the orangepi_first_run.txt file, you can exit the /boot directory of the development board Linux system in the TF card, uninstall the TF card, and then insert the TF card into the development board to start.

  9. If a static IP address is not set, you still need to check the IP address through the router background. If a static IP address is set, you can ping the set static IP address on the computer. If you can ping, it means that the system has started normally, and The network has been set up correctly, and then you can use the set IP address to ssh to remotely log in to the Linux system of the development board.

    After the development board's Linux system is started for the first time, orangepi_first_run.txt will be deleted or renamed to orangepi_first_run.txt.old. At this time, even if the orangepi_first_run.txt configuration file is reset, and then the development board's Linux system is restarted, orangepi_first_run. The configuration in txt will not take effect again, because this configuration will only take effect when the Linux system is started for the first time after burning it. Please pay special attention to this point.

SSH remote login development board

Linux systems enable ssh remote login by default and allow root users to log in to the system. Before ssh login, you first need to ensure that the Ethernet or wifi network is connected, and then use the ip addr command or obtain the IP address of the development board by checking the router

SSH remote login development board under Ubuntu

  1. Obtain the IP address of the development board
  2. Then you can remotely log in to the Linux system through the ssh command

test@test:~$ ssh orangepi@192.168.1.xxx          (Need to be replaced with the IP address of the development board)

orangepi@192.168.1.xx's password:          (Enter your password here, the default password is orangepi)

Note that when entering a password, the specific content of the entered password will not be displayed on the screen. Please do not think that there is something wrong. Just press Enter after entering it.

If you are prompted to refuse the connection, as long as you are using the image provided by Orange Pi, please do not doubt whether the orangepi password is incorrect, but look for other reasons.

  1. After successfully logging into the system, the display is as shown below

    Zero2w-img140.png

    If ssh cannot log in to the Linux system normally, first check whether the IP address of the development board can be pinged. If there is no problem with pinging, you can log in to the Linux system through the serial port or HDMI display and enter the following command on the development board before trying again. Can it be connected?:


    root@orangepi:~# reset_ssh.sh


    If it still doesn't work, please try restarting the system.

SSH remote login development board under Windows

  1. First obtain the IP address of the development board

  2. You can use MobaXterm to remotely log in to the development board under Windows. First create a new ssh session.

    1. Open Session

    2. Then select SSH in Session Setting

    3. Then enter the IP address of the development board in Remote host

    4. Then enter the username root or orangepi of the linux system in Specify username.

    5. Finally click OK

      Zero2w-img141.png

  3. You will then be prompted to enter a password. The default passwords for both root and orangepi users are orangepi.

    Note that when entering a password, the specific content of the entered password will not be displayed on the screen. Please do not think that there is any malfunction. Just press Enter after entering the password.

    Zero2w-img142.png

  4. After successfully logging into the system, the display is as shown below

    Zero2w-img143.png

HDMI test

HDMI display test

  1. Use Mini HDMI to HDMI cable to connect the Orange Pi development board and HDMI display

    Zero2w-img14.png

  2. After starting the Linux system, if there is image output on the HDMI display, it means that the HDMI interface is working normally.

    Note that although many laptops have HDMI interfaces, the HDMI interface of the laptop generally only has the output function and does not have the HDMI in function, which means that the HDMI output of other devices cannot be displayed on the laptop screen

    When you want to connect the HDMI of the development board to the HDMI interface of your laptop, please first confirm that your laptop supports the HDMI in function

    When HDMI does not display, please first check whether the HDMI cable is plugged in tightly. After confirming that the wiring is OK, you can try a different screen to see if there is any display.

HDMI to VGA display test

  1. First you need to prepare the following accessories

    1. HDMI to VGA converter

      Zero2w-img144.png

    2. A VGA cable and a Mini HDMI male to HDMI female adapter

      Zero2w-img145.png Zero2w-img146.png

    3. A monitor or TV that supports VGA interface

  2. HDMI to VGA display test is as follows

    Zero2w-img147.png

    When using HDMI to VGA display, the development board and the Linux 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.

How to set HDMI resolution in Linux5.4 system

Note: This method is only applicable to systems with Linux 5.4 kernel.

  1. There is a disp_mode variable in /boot/orangepiEnv.txt of the Linux system, which can be used to set the resolution of HDMI output. The default resolution of the Linux system is 1080p60

    orangepi@orangepi:~$ sudo vim /boot/orangepiEnv.txt

    verbosity=1

    console=both

    disp_mode=1080p60

    fb0_width=1920

    fb0_height=1080

  2. The disp_mode variable supports setting values as shown in the table below

  3. disp_mode supported values HDMI resolution HDMI refresh rate
    480i 720x480 60
    576i 720x480 50
    480p 720x480 60
    576p 720x576 60
    720p50 1280x720 50
    720p60 1280x720 60
    1080i50 1920x1080 50
    1080i60 1920x1080 60
    1080p24 1920x1080 24
    1080p50 1920x1080 50
    1080p60 1920x1080 60

    Note: Linux systems currently do not support 4K resolution.

  1. Change the value of the disp_mode variable to the resolution you want to output, then restart the system, and HDMI will output the set resolution.

  2. The method of checking the HDMI output resolution is as follows. If the displayed resolution is the same as the set resolution, it means that the settings on the development board are correct.

    orangepi@orangepi:~$ sudo cat /sys/class/disp/disp/attr/sys

    Zero2w-img148.png

How to modify the width and height of Framebuffer in Linux5.4 system

Note: This method is only applicable to systems with Linux 5.4 kernel.

There are two variables, fb0_width and fb0_height, in /boot/orangepiEnv.txt of the Linux system. You can use them to set the width and height of the Framebuffer. The Linux system defaults to fb0_width=1920 and fb0_height=1080.

orangepi@orangepi:~$ sudo vim /boot/orangepiEnv.txt

verbosity=1

console=both

disp_mode=1080p60

fb0_width=1920

fb0_height=1080

The reference values corresponding to different resolutions of fb0_width and fb0_height are as follows::

HDMI resolution fb0_width fb0_height
480p 720 480
576p 720 576
720p 1280 720
1080p 1920 1080

Under the same HDMI resolution, when the values set by fb0_width and fb0_height are larger, the text displayed on the screen will be smaller. When the values of fb0_width and fb0_height are set smaller, the text displayed on the screen will be larger.

Framebuffer cursor setting

  1. The softcursor used by Framebuffer, the method to set the cursor to blink or not to blink is as follows

    root@orangepi:~# echo 1 > /sys/class/graphics/fbcon/cursor_blink #Cursor flashes

    root@orangepi:~# echo 0 > /sys/class/graphics/fbcon/cursor_blink #Cursor does not flash

  2. If you need to hide the cursor, you can add vt.global_cursor_default=0 to the extraargs variable in /boot/orangepiEnv.txt (the value of extraargs will be assigned to the bootargs environment variable and eventually passed to the kernel) (if vt.global_cursor_default=1, it will be displayed cursor), then restart the system and you will see that the cursor has disappeared.

    orangepi@orangepi:~$ sudo vim /boot/orangepiEnv.txt

    verbosity=1

    console=both

    disp_mode=1080p60

    fb0_width=1920

    fb0_height=1080

    extraargs=vt.global_cursor_default=0

How to use Bluetooth

Testing method for desktop image

  1. Click the Bluetooth icon in the upper right corner of the desktop

    Zero2w-img149.png

  2. Then select the adapter

    Zero2w-img150.png

  3. If prompted with the following interface, please select Yes.

    Zero2w-img151.png

  4. Then set the Visibility Setting to Always visible in the Bluetooth adapter setting interface, and then turn it off.

    Zero2w-img152.png

  5. Then open the configuration interface of the Bluetooth device

    Zero2w-img153.png

  6. Click Search to start scanning for surrounding Bluetooth devices

    Zero2w-img154.png

  7. Then select the Bluetooth device you want to connect, and then right-click the mouse to pop up the operation interface for the Bluetooth device. Select Pair to start pairing. The demonstration here is pairing with an Android phone.

    Zero2w-img155.png

  8. When pairing, a pairing confirmation box will pop up in the upper right corner of the desktop. Just select Confirm to confirm. At this time, you also need to confirm on the mobile phone.

    Zero2w-img156.png

  9. After pairing with the mobile phone, you can select the paired Bluetooth device, then right-click and select Send a File to start sending a picture to the mobile phone.

    Zero2w-img157.png

  10. The interface for sending pictures is as follows

    Zero2w-img158.png

How to use server version image

  1. After entering the system, you can first check whether there is a Bluetooth device node through the hciconfig command. If it exists, it means that the Bluetooth initialization is normal.

    orangepi@orangepi:~$ sudo apt update && sudo apt install -y bluez

    orangepi@orangepi:~$ hciconfig -a

    hci0: Type: Primary Bus: UART

    BD Address: 3E:61:3D:19:0E:52 ACL MTU: 1021:8 SCO MTU: 240:3

    UP RUNNING

    RX bytes:925 acl:0 sco:0 events:72 errors:0

    TX bytes:5498 acl:0 sco:0 commands:72 errors:0

    Features: 0xbf 0xff 0x8d 0xfe 0xdb 0x3d 0x7b 0xc7

    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3

    Link policy: RSWITCH SNIFF

    Link mode: SLAVE ACCEPT

    Name: 'orangepi'

    Class: 0x3c0000

    Service Classes: Rendering, Capturing, Object Transfer, Audio

    Device Class: Miscellaneous,

    HCI Version: 5.0 (0x9) Revision: 0x400

    LMP Version: 5.0 (0x9) Subversion: 0x400

    Manufacturer: Spreadtrum Communications Shanghai Ltd (492)

  2. Use bluetoothctl to scan for Bluetooth devices

    orangepi@orangepi:~$ sudo bluetoothctl

    [NEW] Controller 10:11:12:13:14:15 orangepizero2w [default]

    Agent registered

    [bluetooth]# power on #enable controller

    Changing power on succeeded

    [bluetooth]# discoverable on #Set the controller to be discoverable

    Changing discoverable on succeeded

    [CHG] Controller 10:11:12:13:14:15 Discoverable: yes

    [bluetooth]# pairable on #Set the controller to be pairable

    Changing pairable on succeeded

    [bluetooth]# scan on #Start scanning for surrounding Bluetooth devices

    Discovery started

    [CHG] Controller 10:11:12:13:14:15 Discovering: yes

    [NEW] Device 76:60:79:29:B9:31 76-60-79-29-B9-31

    [NEW] Device 9C:2E:A1:42:71:11 Xiaomi mobile phone

    [NEW] Device DC:72:9B:4C:F4:CF orangepi

    [bluetooth]# scan off #After scanning to the Bluetooth device you want to connect, you can turn off the scan, and then write down the MAC address of the Bluetooth device. The Bluetooth device tested here is an Android phone, the Bluetooth name is orangepi, and the corresponding MAC address is DC:72:9B:4C :F4:CF

    Discovery stopped

    [CHG] Controller 10:11:12:13:14:15 Discovering: no

    [CHG] Device DC:72:9B:4C:F4:CF RSSI is nil

  3. After scanning the device you want to pair, you can pair it. For pairing, you need to use the MAC address of the device.

    [bluetooth]# pair DC:72:9B:4C:F4:CF #Pair using the MAC address of the scanned Bluetooth device

    Attempting to pair with DC:72:9B:4C:F4:CF

    [CHG] Device DC:72:9B:4C:F4:CF Connected: yes

    Request confirmation

    [leeb1m[agent] Confirm passkey 764475 (yes/no): yes #Enter yes here, you also need to confirm on the mobile phone

    [CHG] Device DC:72:9B:4C:F4:CF Modalias: bluetooth:v010Fp107Ed1436

    [CHG] Device DC:72:9B:4C:F4:CF UUIDs: 0000046a-0000-1000-8000-00805f9b34fb

    [CHG] Device DC:72:9B:4C:F4:CF ServicesResolved: yes

    [CHG] Device DC:72:9B:4C:F4:CF Paired: yes

    Pairing successful #Prompt pairing successful

    [CHG] Device DC:72:9B:4C:F4:CF ServicesResolved: no

    [CHG] Device DC:72:9B:4C:F4:CF Connected: no

  4. After successful pairing, the Bluetooth interface of the mobile phone will appear as follows:

    Zero2w-img159.png

  5. To connect to a Bluetooth device, you need to install the pulseaudio-module-bluetooth software package, and then start the pulseaudio service

    orangepi@orangepi:~$ sudo apt update

    orangepi@orangepi:~$ sudo apt -y install pulseaudio-module-bluetooth

    orangepi@orangepi:~$ pulseaudio --start

  6. How to connect Bluetooth devices

    orangepi@orangepi:~$ sudo bluetoothctl

    Agent registered

    [bluetooth]# paired-devices #View the MAC address of a paired Bluetooth device

    Device DC:72:9B:4C:F4:CF orangepi

    [bluetooth]# connect DC:72:9B:4C:F4:CF #Connect to Bluetooth device using MAC address

    Attempting to connect to DC:72:9B:4C:F4:CF

    [CHG] Device DC:72:9B:4C:F4:CF Connected: yes

    Connection successful

    [CHG] Device DC:72:9B:4C:F4:CF ServicesResolved: yes

    [CHG] Controller 10:11:12:13:14:15 Discoverable: no

    [orangepi]# #If this prompt appears, the connection is successful.

  7. After connecting the Bluetooth device, you can see the prompt that the audio for calls and media has been connected in the Bluetooth configuration interface of the Android phone.

    Zero2w-img159.png

USB interface test

The USB interface can be connected to a USB hub to expand the number of USB interfaces.

USB interface extension description

As shown in the figure below, there are only two Type-C USB2.0 interfaces on the main board of the development board, which cannot directly connect USB Type-A mice, keyboards and other USB devices.

Zero2w-img160.png

If you only purchased the motherboard and not the 24pin expansion board, you can prepare a Type-C to USB cable as shown in the figure below, plug one end of the Type-C interface into the Type-C interface of the motherboard, and then plug the other end into You can connect USB devices such as mouse and keyboard. If you feel that one USB interface is not enough, you can also expand multiple USB interfaces through USB Hub.

Zero2w-img24.png

If you purchase a 24pin expansion board, you do not need a Type-C to USB cable, because the 24pin expansion board can expand two USB2.0 interfaces.

Zero2w-img107.png

How to set USB0 to HOST mode

As shown in the figure below, there are two Type-C interfaces on the main board 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

Zero2w-img160.png

USB0 of the Linux system released by Orange Pi is set to Device mode by default, so when there is no need to use USB0 Device mode, it is recommended to use USB0 for power supply, so that USB1 can be used directly to connect USB devices

If you need to use USB0 to connect USB devices, you need to set USB0 to HOST mode. The method is as follows:

  1. First run orangepi-config. Ordinary users remember to add sudo permissions.

    orangepi@orangepi:~$ sudo orangepi-config

  2. Then select System

    Zero2w-img80.png

  3. Then select Hardware

    Zero2w-img81.png

  4. Then use the keyboard's arrow keys to locate the location shown in the picture below, and then use the space to select usb0-host

    Zero2w-img161.png

  5. Then select <Save>to save

    Zero2w-img83.png

  6. Then select <Back>

    Zero2w-img84.png

  7. Then select <Reboot>to restart the system to make the configuration take effect.

    Zero2w-img85.png

  8. After restarting, USB0 can use USB devices such as mouse and keyboard normally.

Connect USB mouse or keyboard to test

  1. Insert the USB interface keyboard into the USB interface of the Orange Pi development board
  2. Connect the Orange Pi development board to the HDMI display
  3. If the mouse or keyboard can operate the operating system normally, it means that the USB interface is working normally (the mouse can only be used in the desktop version of the system)

Connect USB storage device for testing

  1. First insert the U disk or USB mobile hard disk into the USB interface of the Orange Pi development board
  2. Execute the following command. If you can see the output of sdX, it means the USB disk is successfully recognized.

orangepi@orangepi:~$ cat /proc/partitions | grep "sd*"
major minor #blocksname
8030044160 sda
8130043119 sda1

  1. Use the mount command to mount the U disk to /mnt, and then you can view the files in the U disk
  2. orangepi@orangepi:~$ sudo mount /dev/sda1 /mnt/

    orangepi@orangepi:~$ ls /mnt/

    test.txt

  1. After mounting, you can check the capacity usage and mount point of the U disk through the df -h command.
  2. orangepi@orangepi:~$ df -h | grep "sd"

    /dev/sda1     29G    208K    29G    1% /mnt

USB Ethernet card test

  1. The currently tested and usable USB Ethernet cards are as follows. Among them, the RTL8153 USB Gigabit network card can be used normally when inserted into the USB 2.0 Host interface of the development board for testing, but the speed cannot reach Gigabit. Please note this.
serial number model
1 RTL8152B USB 100M network card
2 RTL8153 USB Gigabit network card
  1. First insert the USB network card into the USB interface of the development board, and then insert the network cable into the USB network card to ensure that the network cable can access the Internet normally. If you can see the following log information through the dmesg command, it means that the USB network card is recognized normally.

    orangepi@orangepi:~$ dmesg | tail

    [ 121.985016] usb 3-1: USB disconnect, device number 2

    [ 126.873772] sunxi-ehci 5311000.ehci3-controller: ehci_irq: highspeed device connect

    [ 127.094054] usb 3-1: new high-speed USB device number 3 using sunxi-ehci

    [ 127.357472] usb 3-1: reset high-speed USB device number 3 using sunxi-ehci

    [ 127.557960] r8152 3-1:1.0 eth1: v1.08.9

    [ 127.602642] r8152 3-1:1.0 enx00e04c362017: renamed from eth1

    [ 127.731874] IPv6: ADDRCONF(NETDEV_UP): enx00e04c362017: link is not ready

    [ 127.763031] IPv6: ADDRCONF(NETDEV_UP): enx00e04c362017: link is not ready

    [ 129.892465] r8152 3-1:1.0 enx00e04c362017: carrier on

    [ 129.892583] IPv6: ADDRCONF(NETDEV_CHANGE): enx00e04c362017: link becomes ready

  2. Then you can see the device node of the USB network card and the automatically assigned IP address through the ifconfig command

    orangepi@orangepi:~$ sudo ifconfig

    enx00e04c362017: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

    inet 192.168.1.177 netmask 255.255.255.0 broadcast 192.168.1.255

    inet6 fe80::681f:d293:4bc5:e9fd prefixlen 64 scopeid 0x20<link>

    ether 00:e0:4c:36:20:17 txqueuelen 1000 (Ethernet)

    RX packets 1849 bytes 134590 (134.5 KB)

    RX errors 0 dropped 125 overruns 0 frame 0

    TX packets 33 bytes 2834 (2.8 KB)

    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

  3. The command to test network connectivity is as follows

    orangepi@orangepi:~$ ping www.baidu.com -I enx00e04c362017

    PING www.a.shifen.com (14.215.177.38) from 192.168.1.12 eth0: 56(84) bytes of data.

    64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=1 ttl=56 time=6.74 ms

    64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=2 ttl=56 time=6.80 ms

    64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=3 ttl=56 time=6.26 ms

    64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=4 ttl=56 time=7.27 ms

    ^C

    --- www.a.shifen.com ping statistics ---

    4 packets transmitted, 4 received, 0% packet loss, time 3002ms

    rtt min/avg/max/mdev = 6.260/6.770/7.275/0.373 ms

USB camera test

  1. First insert the USB camera into the USB interface of the Orange Pi development board

  2. Then you can see through the lsmod command that the kernel automatically loads the following modules

    orangepi@orangepi:~$ lsmod

    Module Size Used by
    uvcvideo 106496 0

  3. Through the v4l2-ctl command, you can see that the device node information of the USB camera is/dev/video0

    orangepi@orangepi:~$ sudo apt update

    orangepi@orangepi:~$ sudo apt install -y v4l-utils

    orangepi@orangepi:~$ v4l2-ctl --list-devices

    USB 2.0 Camera (usb-sunxi-ehci-1):

    /dev/video0

    Note that the l in v4l2 is the lowercase letter l, not the number 1.

    In addition, the serial number of the video may not always be video0, please refer to what you actually see.

  4. Use fswebcam to test the USB camera

    1. Install fswebcam

      orangepi@orangepi:~$ sudo apt update

      orangepi@orangepi:~$ sudo apt-get install -y fswebcam

    2. After installing fswebcam, you can use the following command to take pictures

      1. a) -d Option to specify the device node of the USB camera

      2. b) --no-banner Used to remove watermarks from photos

      3. c) -r option is used to specify the resolution of the photo

      4. d) -S Option to skip previous frames

      5. e) ./image.jpg Used to set the name and path of the generated photo

        orangepi@orangepi:~$ sudo fswebcam -d /dev/video0 \

        --no-banner -r 1280x720 -S 5 ./image.jpg

    3. In the server version of Linux system, after taking the picture, you can use the scp command to transfer the taken picture to the Ubuntu PC for mirror viewing.

      orangepi@orangepi:~$ scp image.jpg test@192.168.1.55:/home/test (Modify the IP address and path according to the actual situation)

    4. In the desktop version of Linux system, you can directly view the captured pictures through the HDMI display

  5. Use mjpg-streamer to test the USB camera

    1. Download mjpg-streamer

      1. a) Github download address:

        orangepi@orangepi:~$ git clone https://github.com/jacksonliam/mjpg-streamer

      2. b) The image download address of Gitee is:

        orangepi@orangepi:~$ git clone https://gitee.com/leeboby/mjpg-streamer

    2. Install dependent software packages

      1. a) Ubuntu system

        orangepi@orangepi:~$ sudo apt-get install -y cmake libjpeg8-dev

      2. b) Debian system

        orangepi@orangepi:~$ sudo apt-get install -y cmake libjpeg62-turbo-dev

    3. Compile and install mjpg-streamer

      orangepi@orangepi:~$ cd mjpg-streamer/mjpg-streamer-experimental

      orangepi@orangepi:~/mjpg-streamer/mjpg-streamer-experimental$ make -j4

      orangepi@orangepi:~/mjpg-streamer/mjpg-streamer-experimental$ sudo make install

    4. Then enter the following command to start mjpg_streamer

      Note that the serial number of the video is not always video0, please refer to what you actually see.

      orangepi@orangepi:~/mjpg-streamer/mjpg-streamer-experimental$ export LD_LIBRARY_PATH=.

      orangepi@orangepi:~/mjpg-streamer/mjpg-streamer-experimental$ sudo ./mjpg_streamer -i "./input_uvc.so -d \

      /dev/video0 -u -f 30" -o "./output_http.so -w ./www"

    5. Then enter [the IP address of the development board: 8080] in the Ubuntu PC or Windows PC or mobile phone browser on the same LAN as the development board to see the video output by the camera.

      Zero2w-img162.png

Audio test

How to play audio using the command line

Headphone interface audio playback test

  1. There is no headphone interface on the main board of the development board. We can expand it through a 24pin expansion board.

    Zero2w-img107.png

  2. Use the aplay -l command to view the sound card devices supported by the Linux system

    1. The output of the linux5.4 system is as follows, where card 0: audiocodec is the sound card device required for headphone playback

      root@orangepi:~# aplay -l

      **** List of PLAYBACK Hardware Devices ****

      card 0: audiocodec [audiocodec], device 0: soc@3000000:codec_plat-5096000.codec 5096000.codec-0 []

      Subdevices: 1/1

      Subdevice #0: subdevice #0

    2. The output of the b.linux6.1 system is as follows, where audiocodec is the sound card device required for headphone playback.

      root@orangepi:~# aplay -l

      **** List of PLAYBACK Hardware Devices ****

      card 0: audiocodec [audiocodec], device 0: CDC PCM Codec-0 [CDC PCM Codec-0]

      Subdevices: 1/1

      Subdevice #0: subdevice #0

  3. Then use the aplay command to play the audio, and the sound can be heard through the headphones

    root@orangepi:~# aplay -D hw:0,0 /usr/share/sounds/alsa/audio.wav

    Playing WAVE 'audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

    If there is noise during the headphone test, please pull out some of the headphones and do not plug them all the way in.

HDMI audio playback test

  1. First use the Mini HDMI to HDMI cable to connect the Orange Pi development board to the TV (other HDMI displays need to ensure that they can play audio)

  2. HDMI audio playback does not require other settings, just use the aplay command to play directly

    root@orangepi:~# aplay -D hw:2,0 /usr/share/sounds/alsa/audio.wav

Test audio methods on desktop systems

  1. First open the file manager

    Zero2w-img163.png

  2. Then find the following file (if there is no such audio file in the system, you can upload an audio file to the system yourself)

    Zero2w-img164.png

  3. Then select the audio.wav file, right-click and select open with vlc to start playing.

    Zero2w-img165.png

  4. How to switch between different audio devices such as HDMI playback and headphone playback

    1. First open the volume control interface

      Zero2w-img166.png

    2. When playing audio, the audio device options that can be used by the Playback software will be displayed in Playback, as shown in the figure below. Here you can set which audio device needs to be played.

      Zero2w-img167.png

Infrared reception test

  1. There is no infrared receiver on the main board of the development board. We can expand it through a 24pin expansion board.

    Zero2w-img107.png

  2. Install ir-keytable infrared test software

  3. orangepi@orangepi:~$ sudo apt update

    orangepi@orangepi:~$ sudo apt-get install -y ir-keytable

  1. Then execute ir-keytable to view the information of the infrared device

    1. linux5.4 system output is as follows
    2. orangepi@orangepi:~$ ir-keytable

      Found /sys/class/rc/rc0/ with:

      Name: sunxi-ir
      Driver: sunxi-rc-recv
      Default keymap: rc_map_sunxi
      Input device: /dev/input/event1
      LIRC device: /dev/lirc0
      Attached BPF protocols: Operation not permitted
      Supported kernel protocols: lirc nec
      Enabled kernel protocols: lirc nec
      bus: 25, vendor/product: 0001:0001, version: 0x0100
      Repeat delay = 500 ms, repeat period = 125 ms
    1. The output of the linux6.1 system is as follows

      orangepi@orangepi:~$ ir-keytable

      Found /sys/class/rc/rc0/ with:

      Name: sunxi-ir

      Driver: sunxi-ir

      Default keymap: rc-empty

      Input device: /dev/input/event5

      LIRC device: /dev/lirc0

      Attached BPF protocols: Operation not permitted

      Supported kernel protocols: lirc rc-5 rc-5-sz jvc sony nec sanyo mce_kbd rc-6 sharp xmp imon rc-mm

      Enabled kernel protocols: lirc

      bus: 25, vendor/product: 0001:0001, version: 0x0100

      Repeat delay = 500 ms, repeat period = 125 ms

  1. Before testing the infrared reception function, you need to prepare an Orange Pi-specific infrared remote control. Other remote controls do not support it.

    Zero2w-img168.png

  2. Then enter the ir-keytable -t command in the terminal, and then use the infrared remote control to press the button against the infrared receiver of the Orange Pi development board to see the received key code in the terminal.

    1. linux5.4 system output is as follows
    2. orangepi@orangepi:~$ sudo ir-keytable -t

      Testing events. Please, press CTRL-C to abort.

      1598339152.260376: event type EV_MSC(0x04): scancode = 0xfb0413

      1598339152.260376: event type EV_SYN(0x00).

      1598339152.914715: event type EV_MSC(0x04): scancode = 0xfb0410

    1. linux6.1 system output is as follows

      orangepi@orangepi:~$ sudo ir-keytable -c -p NEC -t

      Old keytable cleared

      Protocols changed to nec

      Testing events. Please, press CTRL-C to abort.

      202.063219: lirc protocol(nec): scancode = 0x45c

      202.063249: event type EV_MSC(0x04): scancode = 0x45c

      202.063249: event type EV_SYN(0x00).

Temperature sensor

How to check the temperature in linux5.4 system

H618 has a total of 4 temperature sensors. The command to view the temperature is as follows:

The displayed temperature value needs to be divided by 1000, and the unit is Celsius.

  1. sensor0: CPU temperature sensor, the first command is used to view the type of temperature sensor, the second command is used to view the value of the temperature sensor
  2. orangepi@orangepi:~$ cat /sys/class/thermal/thermal_zone0/type

    cpu_thermal_zone

    orangepi@orangepi:~$ cat /sys/class/thermal/thermal_zone0/temp

    57734

  1. sensor1: DDR temperature sensor, the first command is used to view the type of temperature sensor, the second command is used to view the value of the temperature sensor

    orangepi@orangepi:~$ cat /sys/class/thermal/thermal_zone1/type

    ddr_thermal_zone

    orangepi@orangepi:~$ cat /sys/class/thermal/thermal_zone1/temp

    57410

  2. sensor2: GPU temperature sensor, the first command is used to view the type of temperature sensor, the second command is used to view the value of the temperature sensor

    orangepi@orangepi:~$ cat /sys/class/thermal/thermal_zone2/type

    gpu_thermal_zone

    orangepi@orangepi:~$ cat /sys/class/thermal/thermal_zone2/temp

    59273

  3. sensor3: VE's temperature sensor. The first command is used to view the type of temperature sensor, and the second command is used to view the value of the temperature sensor.

    orangepi@orangepi:~$ cat /sys/class/thermal/thermal_zone3/type

    ve_thermal_zone

    orangepi@orangepi:~$ cat /sys/class/thermal/thermal_zone3/temp

    58949

How to check the temperature in linux6.1 system

orangepi@orangepi:~$ sensors

cpu_thermal-virtual-0

Adapter: Virtual device

temp1:          +47.4°C (crit = +110.0°C)


gpu_thermal-virtual-0

Adapter: Virtual device

temp1:          +48.7°C (crit = +110.0°C)


ddr_thermal-virtual-0

Adapter: Virtual device

temp1:          +47.8°C (crit = +110.0°C)


ve_thermal-virtual-0

Adapter: Virtual device

temp1:          +47.2°C (crit = +110.0°C)

40 Pin Interface pin description

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.

  1. For the order of the 40 Pin interface pins of the Orange Pi Zero 2w development board, please refer to the silk screen diagram on the development board.

    Zero2w-img169.png

  2. The functions of the 40 Pin interface pins on the development board are as shown in the table below

  3. GPIO NO. GPIO Function pin
    3.3V 1
    264 PI8 TWI1-SDA 3
    263 PI7 TWI1-SCL 5
    269 PI13 PWM3/UART4_TX 7
    GND 9
    226 PH2 UART5_TX 11
    227 PH3 UART5_RX 13
    261 PI5 TWI0_SCL/UART2_TX 15
    3.3V 17
    231 PH7 SPI1_MOSI 19
    232 PH8 SPI1_MISO 21
    230 PH6 SPI1_CLK 23
    GND 25
    266 PI10 TWI2-SDA/UART3_RX 27
    256 PI0 29
    271 PI15 31
    268 PI12 PWM2 33
    258 PI2 35
    272 PI16 37
    GND 39
    pin Function GPIO GPIO NO.
    2 5V
    4 5V
    6 GND
    8 UART0_TX PH0 224
    10 UART0_RX PH1 225
    12 PI1 257
    14 GND
    16 PWM4/UART4_RX PI14 270
    18 PH4 228
    20 GND
    22 TWI0_SDA/UART2_RX PI6 262
    24 SPI1_CS0 PH5 229
    26 SPI1_CS1 PH9 233
    28 TWI2-SCL/UART3_TX PI9 265
    30 GND
    32 PWM1 PI11 267
    34 GND
    36 PC12 76
    38 PI4 260
    40 PI3 259
  1. There are a total of 28 GPIO ports in the 40pin interface. The high-level voltage of all GPIO ports is 3.3v

How to install wiringOP

Note that wiringOP is already pre-installed in the linux image released by Orange Pi. Unless the wiringOP code is updated, there is no need to re-download, compile and install, you can just use it directly.


The storage path of the compiled wiringOP deb package in orangepi-build is:

orangepi-build/external/cache/debs/arm64/wiringpi_x.xx.deb


After entering the system, you can run the gpio readall command. If you can see the following output, it means that wiringOP has been pre-installed and can be used normally.

Zero2w-img170.png

WiringOP currently mainly adapts to the functions of setting GPIO port input and output, setting GPIO port output high and low levels, and setting pull-up and pull-down resistors. Functions such as hardware PWM cannot be used.

  1. Download the code of wiringOP

    orangepi@orangepi:~$ sudo apt update

    orangepi@orangepi:~$ sudo apt install -y git

    orangepi@orangepi:~$ git clone https://github.com/orangepi-xunlong/wiringOP.git -b next

    Note that the source code needs to download the code of wiringOP next branch. Please don't miss the -b next parameter.

    If there is a problem downloading the code from GitHub, you can directly use the wiringOP source code that comes with the Linux image. The storage location is: /usr/src/wiringOP.

  2. Compile and install wiringOP

    orangepi@orangepi:~$ cd wiringOP

    orangepi@orangepi:~/wiringOP$ sudo ./build clean

    orangepi@orangepi:~/wiringOP$ sudo ./build

  3. The output of the test gpio readall command is as follows

    Zero2w-img170.png

40pin interface GPIO, I2C, UART, SPI and PWM testing

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.

40pin GPIO port test

  1. The following uses pin No. 7 - corresponding to GPIO PI13 - corresponding to wPi serial number 2 - as an example to demonstrate how to set the high and low levels of the GPIO port.

    Zero2w-img171.png

  2. First set the GPIO port to output mode, and the third parameter needs to be the serial number of the wPi corresponding to the input pin.

    root@orangepi:~/wiringOP# gpio mode 2 out

  3. Then set the GPIO port to output a 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 is set successfully.

    root@orangepi:~/wiringOP# gpio write 2 0

  4. Then set the GPIO port to output a high level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 3.3v, it means the setting of the high level is successful.

    root@orangepi:~/wiringOP# gpio write 2 1

  5. The setting method for other pins is similar. You only need to modify the serial number of wPi to the serial number corresponding to the pin.

How to set the pull-down resistor of 40 Pin GPIO port

  1. The following uses pin No. 7—corresponding to GPIO PI13—corresponding to wPi serial number 2—as an example to demonstrate how to set the pull-up and pull-down resistors of the GPIO port.

    Zero2w-img171.png

  2. First, you need to set the GPIO port to input mode, and the third parameter needs to be the serial number of the wPi corresponding to the input pin.

    root@orangepi:~/wiringOP# gpio mode 2 in

  3. After setting to input mode, execute the following command to set the GPIO port to pull-up mode.

    root@orangepi:~/wiringOP# gpio mode 2 up

  4. Then enter the following command to read the level of the GPIO port. If the level is 1, it means that the pull-up mode is set successfully.

    root@orangepi:~/wiringOP# gpio read 2

    1

  5. Then execute the following command to set the GPIO port to pull-down mode

    root@orangepi:~/wiringOP# gpio mode 2 down

  6. Then enter the following command to read the level of the GPIO port. If the level is 0, it means that the pull-down mode is set successfully.

    root@orangepi:~/wiringOP# gpio read 2

    0

40pin SPI test

  1. 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
GPIO NO. GPIO Function pin
3.3V 1
264 PI8 TWI1-SDA 3
263 PI7 TWI1-SCL 5
269 PI13 PWM3/UART4_TX 7
GND 9
226 PH2 UART5_TX 11
227 PH3 UART5_RX 13
261 PI5 TWI0_SCL/UART2_TX 15
3.3V 17
231 PH7 SPI1_MOSI 19
232 PH8 SPI1_MISO 21
230 PH6 SPI1_CLK 23
GND 25
266 PI10 TWI2-SDA/UART3_RX 27
256 PI0 29
271 PI15 31
268 PI12 PWM2 33
258 PI2 35
272 PI16 37
GND 39
pin Function GPIO GPIO NO.
2 5V
4 5V
6 GND
8 UART0_TX PH0 224
10 UART0_RX PH1 225
12 PI1 257
14 GND
16 PWM4/UART4_RX PI14 270
18 PH4 228
20 GND
22 TWI0_SDA/UART2_RX PI6 262
24 SPI1_CS0 PH5 229
26 SPI1_CS1 PH9 233
28 TWI2-SCL/UART3_TX PI9 265
30 GND
32 PWM1 PI11 267
34 GND
36 PC12 76
38 PI4 260
40 PI3 259
  1. In Linux systems, spi1 is turned off by default and needs to be turned on manually before it can be used. The opening steps are as follows:

    1. First run orangepi-config. Ordinary users remember to add sudo permissions.

      orangepi@orangepi:~$ sudo orangepi-config

    2. Then select System

      Zero2w-img80.png

    3. Then select Hardware

      Zero2w-img81.png

    4. Then use the keyboard's arrow keys to locate the position shown in the figure below, and then use the space to select the dtbo configuration of the SPI you want to open.

    5. dtbo configuration illustrate
      spi1-cs0-cs1-spidev Open cs0 and cs1 of spi1 at the same time
      spi1-cs0-spidev Only open cs0 of spi1
      spi1-cs1-spidev Only open cs1 of spi1

      Zero2w-img172.png

    1. Then select <Save> to save

      Zero2w-img83.png

    2. Then select <Back>

      Zero2w-img84.png

    3. Then select <Reboot>to restart the system to make the configuration take effect.

      Zero2w-img85.png

  1. Then check whether there is a spidev1.x device node in the Linux system. If it exists, it means that the SPI1 configuration has taken effect.

    orangepi@orangepi:~$ ls /dev/spidev1*

    /dev/spidev1.0 /dev/spidev1.1

    Note that only when you open spi1-cs0-cs1-spidev, you will see the device nodes of the two spi.

  2. Next, start the spi loopback test. Do not short-circuit the mosi and miso pins of SPI1 first. The output result of running spidev_test is as follows. You can see that the data of TX and RX are inconsistent.

    orangepi@orangepi:~$ sudo spidev_test -v -D /dev/spidev1.0

    spi mode: 0x0

    bits per word: 8

    max speed: 500000 Hz (500 KHz)

    TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@.…▒..................▒.

    RX | FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF | ............................….

  3. Then short-circuit the two pins of SPI1 mosi (pin 19 in the 40pin interface) and miso (pin 21 in the 40pin interface) and then run spidev_test. The output is as follows. You can see the sending and receiving The data is the same, indicating that the loopback test passed.

    orangepi@orangepi:~$ sudo spidev_test -v -D /dev/spidev1.0

    spi mode: 0x0

    bits per word: 8

    max speed: 500000 Hz (500 KHz)

    TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@.…▒..................▒.

    RX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@.…▒..................▒.

40pin I2C test

  1. As can be seen from the table below, the i2c available for the 40pin interface are i2c0, i2c1 and i2c2
GPIO NO. GPIO Function pin
3.3V 1
264 PI8 TWI1-SDA 3
263 v TWI1-SCL 5
269 PI13 PWM3/UART4_TX 7
GND 9
226 PH2 UART5_TX 11
227 PH3 UART5_RX 13
261 PI5 TWI0_SCL/UART2_TX 15
3.3V 17
231 PH7 SPI1_MOSI 19
232 PH8 SPI1_MISO 21
230 PH6 SPI1_CLK 23
GND 25
266 PI10 TWI2-SDA/UART3_RX 27
256 PI0 29
271 PI15 31
268 PI12 PWM2 33
258 PI2 35
272 PI16 37
GND 39
pin Function GPIO GPIO NO.
2 5V
4 5V
6 GND
8 UART0_TX PH0 224
10 UART0_RX PH1 225
12 PI1 257
14 GND
16 PWM4/UART4_RX PI14 270
18 PH4 228
20 GND
22 TWI0_SDA/UART2_RX PI6 262
24 SPI1_CS0 PH5 229
26 SPI1_CS1 PH9 233
28 TWI2-SCL/UART3_TX PI9 265
30 GND
32 PWM1 PI11 267
34 GND
36 PC12 76
38 PI4 260
40 PI3 259
  1. i2c is turned off by default in Linux systems and needs to be turned on manually to use it. The opening steps are as follows:

    1. First run orangepi-config. Ordinary users remember to add sudo permissions.

      orangepi@orangepi:~$ sudo orangepi-config

    2. Then select System

      Zero2w-img80.png

    3. Then select Hardware

      Zero2w-img81.png

    4. Then use the keyboard's arrow keys to locate the position shown in the picture below, and then use the space to select the corresponding i2c configuration in the picture below.

    5. Multiplexing function in 40pin Corresponding dtbo configuration
      40pin - i2c0 pi-i2c0
      40pin - i2c1 pi-i2c1
      40pin - i2c2 pi-i2c2

      Zero2w-img173.png

    1. Then select <Save> to save

      Zero2w-img83.png

    2. Then select <Back>

      Zero2w-img84.png

    3. Then select <Reboot> to restart the system to make the configuration take effect.

      Zero2w-img85.png

  1. After starting the Linux system, first confirm that there is an open i2c device node under /dev

    orangepi@orangepi:~$ ls /dev/i2c-*

    /dev/i2c-*

    Sometimes the i2c device node and the i2c bus serial number do not correspond one to one. For example, the i2c device node of the i2c1 bus may be /dev/i2c-3.

    The method to accurately confirm the device node under /dev corresponding to the i2c bus is:


    1. First run the following command to check the corresponding relationship of i2c

      orangepi@orangepizero2w:~$ ls /sys/devices/platform/soc*/*/i2c-* | grep "i2c-[0-9]"

      /sys/devices/platform/soc/5002000.i2c/i2c-0:

      /sys/devices/platform/soc/5002400.i2c/i2c-3:

      /sys/devices/platform/soc/5002800.i2c/i2c-4:

      /sys/devices/platform/soc/5002c00.i2c/i2c-5:

      /sys/devices/platform/soc/6000000.hdmi/i2c-2:

      /sys/devices/platform/soc/7081400.i2c/i2c-1:


    2. In the above output

      1. a) 5002000 is the register base address of the i2c0 bus, and i2c-0 shown behind it is its corresponding i2c device node

      2. b) 5002400 is the register base address of the i2c1 bus, and i2c-3 shown behind it is its corresponding i2c device node

      3. c) 5002800 is the register base address of the i2c2 bus, and i2c-4 shown behind it is its corresponding i2c device node

  1. Then start testing i2c, first install i2c-tools

    orangepi@orangepi:~$ sudo apt-get update

    orangepi@orangepi:~$ sudo apt-get install -y i2c-tools

  2. Then connect an i2c device to the i2c pin of the 40pin connector

  3. Then use the i2cdetect -y x x command. If the address of the connected i2c device can be detected, it means that i2c can be used normally.

    Note that x in the i2cdetect -y x command needs to be replaced with the serial number of the device node corresponding to the i2c bus.

    Different i2c device addresses are different. The 0x50 address in the picture below is just an example. Please refer to what you actually see.

    Zero2w-img174.png

40pin UART test

  1. 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.
GPIO NO. GPIO Function pin
3.3V 1
264 PI8 TWI1-SDA 3
263 PI7 TWI1-SCL 5
269 PI13 PWM3/UART4_TX 7
GND 9
226 PH2 UART5_TX 11
227 PH3 UART5_RX 13
261 PI5 TWI0_SCL/UART2_TX 15
3.3V 17
231 PH7 SPI1_MOSI 19
232 PH8 SPI1_MISO 21
230 PH6 SPI1_CLK 23
GND 25
266 PI10 TWI2-SDA/UART3_RX 27
256 PI0 29
271 PI15 31
268 PI12 PWM2 33
258 PI2 35
272 PI16 37
GND 39
pin Function GPIO GPIO NO.
2 5V
4 5V
6 GND
8 UART0_TX PH0 224
10 UART0_RX PH1 225
12 PI1 257
14 GND
16 PWM4/UART4_RX PI14 270
18 PH4 228
20 GND
22 TWI0_SDA/UART2_RX PI6 262
24 SPI1_CS0 PH5 229
26 SPI1_CS1 PH9 233
28 TWI2-SCL/UART3_TX PI9 265
30 GND
32 PWM1 PI11 267
34 GND
36 PC12 76
38 PI4 260
40 PI3 259
  1. 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:

    1. First run orangepi-config. Ordinary users remember to add sudo permissions.

      orangepi@orangepi:~$ sudo orangepi-config

    2. Then select System

      Zero2w-img80.png

    3. Then select Hardware

      Zero2w-img81.png

    4. Then use the keyboard's arrow keys to locate the position shown in the picture below, and then use the space to select the serial port you want to open.

    5. Multiplexing function in 40pin Corresponding dtbo configuration
      40pin - uart2 pi-uart2
      40pin - uart3 pi-uart3
      40pin - uart4 pi-uart4
      40pin - uart5 ph-uart5

      Zero2w-img175.png

    1. Then select <Save> to save

      Zero2w-img83.png

    2. Then select <Back>

      Zero2w-img84.png

    3. Then select <Reboot> to restart the system to make the configuration take effect.

      Zero2w-img85.png

  1. After entering the Linux system, first confirm whether there is a uart5 device node under /dev

    Note that the linux5.4 system is /dev/ttyASx.

    orangepi@orangepi:~$ ls /dev/ttyS*

    /dev/ttySx

  2. 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.

  3. 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.

    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.

    orangepi@orangepi:~$ gpio serial /dev/ttySx # linux-6.1 test command

    orangepi@orangepi:~$ gpio serial /dev/ttyASx # linux-5.4 test command


    Out: 0: -> 0

    Out: 1: -> 1

    Out: 2: -> 2

    Out: 3: -> 3^C

PWM test method

  1. As can be seen from the following table, the available pwm are pwm1, pwm2, pwm3 and pwm4.
GPIO NO. GPIO Function Pin
3.3V 1
264 PI8 TWI1-SDA 3
263 PI7 TWI1-SCL 5
269 PI13 PWM3/UART4_TX 7
GND 9
226 PH2 UART5_TX 11
227 PH3 UART5_RX 13
261 PI5 TWI0_SCL/UART2_TX 15
3.3V 17
231 PH7 SPI1_MOSI 19
232 PH8 SPI1_MISO 21
230 PH6 SPI1_CLK 23
GND 25
266 PI10 TWI2-SDA/UART3_RX 27
256 PI0 29
271 PI15 31
268 PI12 PWM2 33
258 PI2 35
272 PI16 37
GND 39
Pin Function GPIO GPIO NO.
2 5V
4 5V
6 GND
8 UART0_TX PH0 224
10 UART0_RX PH1 225
12 PI1 257
14 GND
16 PWM4/UART4_RX PI14 270
18 PH4 228
20 GND
22 TWI0_SDA/UART2_RX PI6 262
24 SPI1_CS0 PH5 229
26 SPI1_CS1 PH9 233
28 TWI2-SCL/UART3_TX PI9 265
30 GND
32 PWM1 PI11 267
34 GND
36 PC12 76
38 PI4 260
40 PI3 259
  1. pwm is turned off by default in Linux systems and needs to be turned on manually to use it. The opening steps are as follows:

    1. First run orangepi-config. Ordinary users remember to add sudo permissions.

      orangepi@orangepi:~$ sudo orangepi-config

    2. Then select System

      Zero2w-img80.png

    3. Then select Hardware

      Zero2w-img81.png

    4. Then use the keyboard's arrow keys to locate the position shown in the figure below, and then use the space to select the configuration corresponding to the pwm you want to open.

      Zero2w-img176.png

    5. Then select <Save> to save

      Zero2w-img83.png

    6. Then select <Back>

      Zero2w-img84.png

    7. Then select <Reboot> to restart the system to make the configuration take effect.

      Zero2w-img85.png

  2. After restarting, you can start the PWM test

    Please execute the following commands under the root user.

    1. Enter the following command on the command line to make pwm1 output a 50Hz square wave

      root@orangepi:~# echo 1 > /sys/class/pwm/pwmchip0/export

      root@orangepi:~# echo 20000000 > /sys/class/pwm/pwmchip0/pwm1/period

      root@orangepi:~# echo 1000000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle

      root@orangepi:~# echo 1 > /sys/class/pwm/pwmchip0/pwm1/enable

    2. Enter the following command on the command line to make pwm2 output a 50Hz square wave

    3. root@orangepi:~# echo 2 > /sys/class/pwm/pwmchip0/export

      root@orangepi:~# echo 20000000 > /sys/class/pwm/pwmchip0/pwm2/period

      root@orangepi:~# echo 1000000 > /sys/class/pwm/pwmchip0/pwm2/duty_cycle

      root@orangepi:~# echo 1 > /sys/class/pwm/pwmchip0/pwm2/enable

    1. Enter the following command on the command line to make pwm3 output a 50Hz square wave
    2. root@orangepi:~# echo 3 > /sys/class/pwm/pwmchip0/export

      root@orangepi:~# echo 20000000 > /sys/class/pwm/pwmchip0/pwm3/period

      root@orangepi:~# echo 1000000 > /sys/class/pwm/pwmchip0/pwm3/duty_cycle

      root@orangepi:~# echo 1 > /sys/class/pwm/pwmchip0/pwm3/enable

    1. Enter the following command on the command line to make pwm4 output a 50Hz square wave
    2. root@orangepi:~# echo 4 > /sys/class/pwm/pwmchip0/export

      root@orangepi:~# echo 20000000 > /sys/class/pwm/pwmchip0/pwm4/period

      root@orangepi:~# echo 1000000 > /sys/class/pwm/pwmchip0/pwm4/duty_cycle

      root@orangepi:~# echo 1 > /sys/class/pwm/pwmchip0/pwm4/enable

      Zero2w-img177.png

How to install and use wiringOP-Python

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.

wiringOP-Python is the Python language version of wiringOP library, used to operate the development board's GPIO, I2C, SPI, UART and other hardware resources in the Python program

Also please note that all the following commands are operated under the root user.

How to install wiringOP-Python

  1. First install dependency packages

    root@orangepi:~# sudo apt-get update

    root@orangepi:~# sudo apt-get -y install git swig python3-dev python3-setuptools

  2. Then use the following command to download the source code of wiringOP-Python

  3. Note that the following git clone--recursive command will automatically download the source code of wiringOP, because wiringOP-Python depends on wiringOP. Please make sure there are no errors during the download process due to network problems.

    If there is a problem downloading the code from GitHub, you can directly use the wiringOP-Python source code that comes with the Linux image. The storage location is: /usr/src/wiringOP-Python

    root@orangepi:~# git clone --recursive https://github.com/orangepi-xunlong/wiringOP-Python -b next

    root@orangepi:~# cd wiringOP-Python

    root@orangepi:~/wiringOP-Python# git submodule update --init --remote

  1. Then use the following command to compile wiringOP-Python and install it into the Linux system of the development board

    root@orangepi:~# cd wiringOP-Python

    root@orangepi:~/wiringOP-Python# python3 generate-bindings.py > bindings.i

    root@orangepi:~/wiringOP-Python# sudo python3 setup.py install

  2. Then enter the following command. If helpful information is output, it means wiringOP-Python is successfully installed. Press the q key to exit the help information interface.

  3. root@orangepi:~/wiringOP-Python# python3 -c "import wiringpi; help(wiringpi)"

    Help on module wiringpi:


    NAME

    wiringpi


    DESCRIPTION

    # This file was automatically generated by SWIG (http://www.swig.org).
    # Version 4.0.2
    #
    # Do not make changes to this file unless you know what you are doing--modify
    # the SWIG interface file instead.
  1. The steps to test whether wiringOP-Python is installed successfully under the python command line are as follows:

    1. First use the python3 command to enter the command line mode of > python3
    2. root@orangepi:~# python3

    1. Then import the python module of wiringpi
    2. >>> import wiringpi;

    1. Finally, enter the following command to view the help information of > wiringOP-Python. Press the q key to exit the help information > interface.
    2. >>> help(wiringpi)

      Help on module wiringpi:


      NAME

      wiringpi


      DESCRIPTION

      # This file was automatically generated by SWIG (http://www.swig.org).
      # Version 4.0.2
      #
      # Do not make changes to this file unless you know what you are doing--modify
      # the SWIG interface file instead.


      CLASSES

      builtins.object
      GPIO
      I2C
      Serial
      nes


      class GPIO(builtins.object)
      | GPIO(pinmode=0)
      |


      >>>

40pin GPIO port test

Like wiringOP, wiringOP-Python can also determine which GPIO pin to operate by specifying the wPi number. Because there is no command to view the wPi number in wiringOP-Python, you can only view the board's wPi number and physics through the gpio command in wiringOP Correspondence of pins.

Zero2w-img170.png
  1. The following uses pin No. 7 - corresponding to GPIO PI13 - corresponding to wPi serial number 2 - as an example to demonstrate how to set the high and low levels of the GPIO port.

    Zero2w-img171.png

  2. The steps for testing directly with commands are as follows:

    1. First set the GPIO port to output mode, where the first parameter of the pinMode function is the serial number of the wPi corresponding to the pin, and the second parameter is the GPIO mode.

      root@orangepi:~/wiringOP-Python# python3 -c "import wiringpi; \

      from wiringpi import GPIO; wiringpi.wiringPiSetup() ; \

      wiringpi.pinMode(2, GPIO.OUTPUT) ; "

    2. Then set the GPIO port to output a 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 is set successfully.

      root@orangepi:~/wiringOP-Python# python3 -c "import wiringpi; \

      from wiringpi import GPIO; wiringpi.wiringPiSetup() ;\

      wiringpi.digitalWrite(2, GPIO.LOW)"

    3. Then set the GPIO port to output a high level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 3.3v, it means the setting of the high level is successful.

      root@orangepi:~/wiringOP-Python# python3 -c "import wiringpi; \

      from wiringpi import GPIO; wiringpi.wiringPiSetup() ;\

      wiringpi.digitalWrite(2, GPIO.HIGH)"

  3. The steps for testing in the command line of python3 are as follows:

    1. First use the python3 command to enter the command line mode of python3

      root@orangepi:~# python3

    2. Then import the python module of wiringpi

      >>> import wiringpi

      >>> from wiringpi import GPIO

    3. Then set the GPIO port to output mode, where the first parameter of the pinModefunction is the serial number of the wPi corresponding to the pin, and the second parameter is the GPIO mode.

      >>> wiringpi.wiringPiSetup()

      0

      >>> wiringpi.pinMode(2, GPIO.OUTPUT)

    4. Then set the GPIO port to output a 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 is set successfully.

      >>> wiringpi.digitalWrite(2, GPIO.LOW)

    5. Then set the GPIO port to output a high level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 3.3v, it means the setting of the high level is successful.

      >>> wiringpi.digitalWrite(2, GPIO.HIGH)

  4. For wiringOP-Python to set the GPIO high and low levels in the python code, you can refer to the blink.py test program in the examples. The blink.py test program will set the voltage of all GPIO ports in the 40 Pin of the development board to continuously change high and low.

    root@orangepi:~/wiringOP-Python# cd examples

    root@orangepi:~/wiringOP-Python/examples# ls blink.py

    blink.py

    root@orangepi:~/wiringOP-Python/examples# python3 blink.py

40pin SPI test

  1. 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
GPIO NO. GPIO Function Pin
3.3V 1
264 PI8 TWI1-SDA 3
263 PI7 TWI1-SCL 5
269 PI13 PWM3/UART4_TX 7
GND 9
226 PH2 UART5_TX 11
227 PH3 UART5_RX 13
261 PI5 TWI0_SCL/UART2_TX 15
3.3V 17
231 PH7 SPI1_MOSI 19
232 PH8 SPI1_MISO 21
230 PH6 SPI1_CLK 23
GND 25
266 PI10 TWI2-SDA/UART3_RX 27
256 PI0 29
271 PI15 31
268 PI12 PWM2 33
258 PI2 35
272 PI16 37
GND 39
Pin Function GPIO GPIO NO.
2 5V
4 5V
6 GND
8 UART0_TX PH0 224
10 UART0_RX PH1 225
12 PI1 257
14 GND
16 PWM4/UART4_RX PI14 270
18 PH4 228
20 GND
22 TWI0_SDA/UART2_RX PI6 262
24 SPI1_CS0 PH5 229
26 SPI1_CS1 PH9 233
28 TWI2-SCL/UART3_TX PI9 265
30 GND
32 PWM1 PI11 267
34 GND
36 PC12 76
38 PI4 260
40 PI3 259
  1. In Linux systems, spi1 is turned off by default and needs to be turned on manually before it can be used. The opening steps are as follows:

    1. First run orangepi-config. Ordinary users remember to add sudo permissions.

      orangepi@orangepi:~$ sudo orangepi-config

    2. Then select System

      Zero2w-img80.png

    3. Then select Hardware

      Zero2w-img81.png

    4. Then use the keyboard's arrow keys to locate the position shown in the figure below, and then use the space to select the dtbo configuration of the SPI you want to open.

    5. dtbo configuration illustrate
      spi1-cs0-cs1-spidev Open cs0 and cs1 of spi1 at the same time
      spi1-cs0-spidev Only open cs0 of spi1
      spi1-cs1-spidev Only open cs1 of spi1
    1. Then select <Save> to save

      Zero2w-img83.png

    2. Then select <Back>

      Zero2w-img84.png

    3. Then select <Reboot> to restart the system to make the configuration take effect.

      Zero2w-img85.png

  1. Then check whether there is a spidev1.x device node in the Linux system. If it exists, it means that the SPI1 configuration has taken effect.

    orangepi@orangepi:~$ ls /dev/spidev1*

    /dev/spidev1.0 /dev/spidev1.1

    Note that only when you open spi1-cs0-cs1-spidev, you will see the device nodes of the two spi.

  2. Then you can use the spidev_test.py program in examples to test the SPI loopback function. The spidev_test.py program needs to specify the following two parameters:

    1. --channel: Specify the channel number of SPI

    2. --port: Specify the port number of the SPI

  3. Without shorting the mosi and miso pins of SPI1, the output result of running spidev_test.py is as follows. You can see that the data of TX and RX are inconsistent.

    root@orangepi:~/wiringOP-Python# cd examples

    root@orangepi:~/wiringOP-Python/examples# python3 spidev_test.py \

    --channel 1 --port 0

    spi mode: 0x0

    max speed: 500000 Hz (500 KHz)

    Opening device /dev/spidev1.1

    TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…|

    RX | FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |.............….|

  1. Then use Dupont wire to short-circuit the txd (pin 19 in the 40pin interface) and rxd (pin 21 in the 40pin interface) of SPI1 and then run spidev_test.py. The output is as follows, you can see If the data sent and received are the same, it means that the SPI1 loopback test is normal.

    root@orangepi:~/wiringOP-Python# cd examples

    root@orangepi:~/wiringOP-Python/examples# python3 spidev_test.py \

    --channel 1 --port 0

    spi mode: 0x0

    max speed: 500000 Hz (500 KHz)

    Opening device /dev/spidev1.1

    TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…|

    RX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…|

40pin I2C test

  1. As can be seen from the table below, the i2c available for the 40pin interface are i2c0, i2c1 and i2c2
GPIO NO. GPIO Function Pin
3.3V 1
264 PI8 TWI1-SDA 3
263 v TWI1-SCL 5
269 PI13 PWM3/UART4_TX 7
GND 9
226 PH2 UART5_TX 11
227 PH3 UART5_RX 13
261 PI5 TWI0_SCL/UART2_TX 15
3.3V 17
231 PH7 SPI1_MOSI 19
232 PH8 SPI1_MISO 21
230 PH6 SPI1_CLK 23
GND 25
266 PI10 TWI2-SDA/UART3_RX 27
256 PI0 29
271 PI15 31
268 PI12 PWM2 33
258 PI2 35
272 PI16 37
GND 39
Pin Function GPIO GPIO NO.
2 5V
4 5V
6 GND
8 UART0_TX PH0 224
10 UART0_RX PH1 225
12 PI1 257
14 GND
16 PWM4/UART4_RX PI14 270
18 PH4 228
20 GND
22 TWI0_SDA/UART2_RX PI6 262
24 SPI1_CS0 PH5 229
26 SPI1_CS1 PH9 233
28 TWI2-SCL/UART3_TX PI9 265
30 GND
32 PWM1 PI11 267
34 GND
36 PC12 76
38 PI4 260
40 PI3 259
  1. i2c is turned off by default in Linux systems and needs to be turned on manually to use it. The opening steps are as follows:

    1. First run orangepi-config. Ordinary users remember to add sudo permissions.

      orangepi@orangepi:~$ sudo orangepi-config

    2. Then select System

      Zero2w-img80.png

    3. Then select Hardware

      Zero2w-img81.png

    4. Then use the keyboard's arrow keys to locate the position shown in the picture below, and then use the space to select the corresponding i2c configuration in the picture below.

    5. Multiplexing function in 40pin Corresponding dtbo configuration
      40pin - i2c0 pi-i2c0
      40pin - i2c1 pi-i2c1
      40pin - i2c2 pi-i2c2

      Zero2w-img173.png

    1. Then select <Save> to save

      Zero2w-img83.png

    2. Then select <Back>

      Zero2w-img84.png

    3. Then select <Reboot> to restart the system to make the configuration take effect.

      Zero2w-img85.png

  1. After starting the Linux system, first confirm that there is an open i2c device node under /dev

    orangepi@orangepi:~$ ls /dev/i2c-*

    /dev/i2c-*

    注意,这里说的Linux镜像具体指的是从Orange Pi资料下载页面下载的Debian或者Ubuntu这样的Linux发行版镜像。

    Sometimes the i2c device node and the i2c bus serial number do not correspond one to one. For example, the i2c device node of the i2c1 bus may be /dev/i2c-3.

    The method to accurately confirm the device node under /dev corresponding to the i2c bus is:


    1. First run the following command to check the corresponding relationship of i2c

      orangepi@orangepizero2w:~$ ls /sys/devices/platform/soc*/*/i2c-* | grep "i2c-[0-9]"

      /sys/devices/platform/soc/5002000.i2c/i2c-0:

      /sys/devices/platform/soc/5002400.i2c/i2c-3:

      /sys/devices/platform/soc/5002800.i2c/i2c-4:

      /sys/devices/platform/soc/5002c00.i2c/i2c-5:

      /sys/devices/platform/soc/6000000.hdmi/i2c-2:

      /sys/devices/platform/soc/7081400.i2c/i2c-1:


    2. In the above output

      1. a) 5002000 is the register base address of the i2c0 bus, and i2c-0 shown behind it is its corresponding i2c device node

      2. b) 5002400 is the register base address of the i2c1 bus, and i2c-3 shown behind it is its corresponding i2c device node

      3. c) 5002800 is the register base address of the i2c2 bus, and i2c-4 shown behind it is its corresponding i2c device node

  1. Then start testing i2c, first install i2c-tools

    orangepi@orangepi:~$ sudo apt-get update

    orangepi@orangepi:~$ sudo apt-get install -y i2c-tools

  2. Then connect an i2c device to the i2c pin of the 40pin connector. Here we take the DS1307 RTC module as an example.

    Zero2w-img178.png

  3. Then use the i2cdetect -y xcommand. If the address of the connected i2c device can be detected, it means that the i2c device is connected correctly.

    Note that x in the i2cdetect -y x command needs to be replaced with the serial number of the device node corresponding to the i2c bus.

    Zero2w-img179.png

  1. Then you can run the ds1307.py test program in examples to read the RTC time

    Note that the x in i2c-x in the following command needs to be replaced with the serial number of the device node corresponding to the i2c bus.

    root@orangepi:~/wiringOP-Python# cd examples

    root@orangepi:~/wiringOP-Python/examples# python3 ds1307.py --device \

    "/dev/i2c-x"

    Thu 2022-06-16 04:35:46

    Thu 2022-06-16 04:35:47

    Thu 2022-06-16 04:35:48

    ^C

    exit

40pin UART test

  1. 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.
GPIO NO. GPIO Function Pin
3.3V 1
264 PI8 TWI1-SDA 3
263 PI7 TWI1-SCL 5
269 PI13 PWM3/UART4_TX 7
GND 9
226 PH2 UART5_TX 11
227 PH3 UART5_RX 13
261 PI5 TWI0_SCL/UART2_TX 15
3.3V 17
231 PH7 SPI1_MOSI 19
232 PH8 SPI1_MISO 21
230 PH6 SPI1_CLK 23
GND 25
266 PI10 TWI2-SDA/UART3_RX 27
256 PI0 29
271 PI15 31
268 PI12 PWM2 33
258 PI2 35
272 PI16 37
GND 39
Pin Function GPIO GPIO NO.
2 5V
4 5V
6 GND
8 UART0_TX PH0 224
10 UART0_RX PH1 225
12 PI1 257
14 GND
16 PWM4/UART4_RX PI14 270
18 PH4 228
20 GND
22 TWI0_SDA/UART2_RX PI6 262
24 SPI1_CS0 PH5 229
26 SPI1_CS1 PH9 233
28 TWI2-SCL/UART3_TX PI9 265
30 GND
32 PWM1 PI11 267
34 GND
36 PC12 76
38 PI4 260
40 PI3 259
  1. 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::

    1. First run orangepi-config. Ordinary users remember to add sudo permissions.

      orangepi@orangepi:~$ sudo orangepi-config

    2. Then select System

      Zero2w-img80.png

    3. Then select Hardware

      Zero2w-img81.png

    4. Then use the keyboard's arrow keys to locate the position shown in the picture below, and then use the space to select the serial port you want to open.

    5. Multiplexing function in 40pin Corresponding dtbo configuration
      40pin - uart2 pi-uart2
      40pin - uart3 pi-uart3
      40pin - uart4 pi-uart4
      40pin - uart5 ph-uart5

      Zero2w-img175.png

    1. Then select <Save> to save

      Zero2w-img83.png

    2. Then select <Back>

      Zero2w-img84.png

    3. Then select <Reboot> to restart the system to make the configuration take effect.

      Zero2w-img85.png

  1. After entering the Linux system, first confirm whether there is a uart5 device node under /dev

    注意, linux5.4系统为/dev/ttyASx.

    orangepi@orangepi:~$ ls /dev/ttyS*

    /dev/ttySx

  2. 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.

  3. 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.

    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.

    orangepi@orangepi:~$ gpio serial /dev/ttySx        # linux-6.1 test command

    orangepi@orangepi:~$ gpio serial /dev/ttyASx        # linux-5.4 test command


    Out: 0: -> 0

    Out: 1: -> 1

    Out: 2: -> 2

    Out: 3: -> 3^C

  4. Finally, you can run the serialTest.py 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.

    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.

    root@orangepi:~/wiringOP-Python# cd examples

    root@orangepi:~/wiringOP-Python/examples# python3 serialTest.py --device "/dev/ttySx" # linux6.1 use

    root@orangepi:~/wiringOP-Python/examples# python3 serialTest.py --device "/dev/ttyASx" # linux5.4 use


    Out: 0: -> 0

    Out: 1: -> 1

    Out: 2: -> 2

    Out: 3: -> 3

    Out: 4:^C

    exit

Hardware watchdog test

The watchdog_test program is pre-installed in the Linux system released by Orange Pi and can be tested directly.

The method to run the watchdog_test program is as follows:

  1. The second parameter 10 represents the counting time of the watchdog. If the dog is not fed within this time, the system will restart.

  2. We can feed the dog by pressing any key on the keyboard (except ESC). After feeding the dog, the program will print a line "keep alive" to indicate that the dog feeding is successful.

    orangepi@orangepi:~$ sudo watchdog_test 10

    open success

    options is 33152,identity is sunxi-wdt

    put_usr return,if 0,success:0

    The old reset time is: 16

    return ENOTTY,if -1,success:0

    return ENOTTY,if -1,success:0

    put_user return,if 0,success:0

    put_usr return,if 0,success:0

    keep alive

    keep alive

    keep alive

Check the chipid of H618 chip

The 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.

orangepi@orangepi:~$ cat /sys/class/sunxi_info/sys_info | grep "chipid"

sunxi_chipid : 338020004c0048080147478824681ed1

Python related instructions

How to compile and install Python source code

If 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.

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).

  1. First install the dependency packages needed to compile Python

    orangepi@orangepi:~$ sudo apt-get update

    orangepi@orangepi:~$ sudo apt-get install -y build-essential zlib1g-dev \

    libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev \

    libreadline-dev libffi-dev curl libbz2-dev

  2. Then download the latest version of Python3.9 source code and unzip it

    orangepi@orangepi:~$ wget \

    https://www.python.org/ftp/python/3.9.10/Python-3.9.10.tgz

    orangepi@orangepi:~$ tar xvf Python-3.9.10.tgz

  3. Then run the configuration command

    orangepi@orangepi:~$ cd Python-3.9.10

    orangepi@orangepi:~$ ./configure --enable-optimizations

  4. Then compile and install Python3.9. The compilation time takes about half an hour.

    orangepi@orangepi:~$ make -j4

    orangepi@orangepi:~$ sudo make altinstall

  5. After installation, you can use the following command to check the version number of the Python you just installed.

    orangepi@orangepi:~$ python3.9 --version

    Python 3.9.10

  6. Then update pip

    orangepi@orangepi:~$ /usr/local/bin/python3.9 -m pip install --upgrade pip

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.

  1. First install python3-pip

    orangepi@orangepi:~$ sudo apt-get update

    orangepi@orangepi:~$ sudo apt-get install -y python3-pip

  2. How to permanently change the pip source under Linux

    1. First create a new ~/.pip directory, then add the pip.conf configuration file, and set the pip source in it to Tsinghua source.

      orangepi@orangepi:~$ mkdir -p ~/.pip

      orangepi@orangepi:~$ cat <<EOF > ~/.pip/pip.conf

      [global]

      timeout = 6000

      index-url = https://pypi.tuna.tsinghua.edu.cn/simple

      trusted-host = pypi.tuna.tsinghua.edu.cn

      EOF

    2. Then use pip3 to install the Python library very quickly

  3. How to temporarily change the pip source under Linux, where <packagename> needs to be replaced with a specific package name

    orangepi@orangepi:~$ pip3 install <packagename> -i \

    https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn

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.

orangepi@orangepi:~$ enable_docker.sh

You can use the following command to test docker. If hello-world can be run, docker can be used normally.

orangepi@orangepi:~$ docker run hello-world

Unable to find image 'hello-world:latest' locally

latest: Pulling from library/hello-world

256ab8fe8778: Pull complete

Digest: sha256:7f0a9f93b4aa3022c3a4c147a449ef11e0941a1fd0bf4a8e6c9408b2600777c5

Status: Downloaded newer image for hello-world:latest


Hello from Docker!

This message shows that your installation appears to be working correctly.

.….

When using the docker command, if you are prompted for permission denied, please add the current user to the docker user group so that you can run the docker command without sudo.

orangepi@orangepi:~$ sudo usermod -aG docker $USER

Note: You need to log out and log in again to the system to take effect. You can also restart the system.

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 of Home Assistant, please refer to the official documentation or corresponding books.

Installation via docker

  1. First, please install docker and ensure that docker can run normally. For the installation steps of docker, please refer to the instructions in the How to Install Docker section.

  2. Then you can search for the docker image of Home Assistant

    orangepi@orangepi:~$ docker search homeassistant

  3. 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.

    orangepi@orangepi:~$ docker pull homeassistant/home-assistant

    Using default tag: latest

    latest: Pulling from homeassistant/home-assistant

    be307f383ecc: Downloading

    5fbc4c07ac88: Download complete

    ...... (Omit some output)

    3cc6a1510c9f: Pull complete

    7a4e4d5b979f: Pull complete

    Digest: sha256:81d381f5008c082a37da97d8b08dd8b358dae7ecf49e62ce3ef1eeaefc4381bb

    Status: Downloaded newer image for homeassistant/home-assistant:latest

    docker.io/homeassistant/home-assistant:latest

  4. Then you can use the following command to view the docker image of Home Assistant you just downloaded

    orangepi@orangepi:~$ docker images homeassistant/home-assistant

    REPOSITORY                                    TAG       IMAGE       ID       CREATED       SIZE

    homeassistant/home-assistant       latest       bfa0ab9e1cf5       2 months ago       1.17GB

  5. At this point you can run the Home Assistant docker container

    orangepi@orangepi:~$ docker run -d \

    --name homeassistant \

    --privileged \

    --restart=unless-stopped \

    -e TZ=Asia/Shanghai \

    -v /home/orangepi/home-assistant:/config \

    --network=host \

    homeassistant/home-assistant:latest

  6. Then enter【the IP address of the development board: 8123】in the browser to see the Home Assistant interface

    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.

    Zero2w-img180.png

  7. Then enter your name, username and password and click Create Account

    Zero2w-img181.png

  8. Then follow the interface prompts to set according to your own preferences, and then click Next

    Zero2w-img182.png

  9. Then click Next

    Zero2w-img183.png

  10. Then click Finish

    Zero2w-img184.png

  11. The main interface finally displayed by Home Assistant is as shown below

    Zero2w-img185.png

  12. Method to stop Home Assistant container

    1. The command to view the docker container is as follows

      orangepi@orangepi:~$ docker ps -a

    2. The command to stop the Home Assistant container is as follows

      orangepi@orangepi:~$ docker stop homeassistant

    3. The command to delete the Home Assistant container is as follows

      orangepi@orangepi:~$ docker rm homeassistant

Installation via python

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 "How to Change the Pip Source of Python"

  1. First install dependency packages

    orangepi@orangepi:~$ sudo apt-get update

    orangepi@orangepi:~$ sudo apt-get install -y python3 python3-dev python3-venv \

    python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \

    libopenjp2-7 libtiff5 libturbojpeg0-dev tzdata

    If it is debian12, please use the following command:

    orangepi@orangepi:~$ sudo apt-get update

    orangepi@orangepi:~$ sudo apt-get install -y python3 python3-dev python3-venv \

    python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \

    libopenjp2-7 libturbojpeg0-dev tzdata

  2. Then you need to compile and install Python3.9. For the method, please refer to the Python source code compilation and installation method section.

    The default Python version of Debian Bullseye is Python3.9, so there is no need to compile and install it.

    The default Python version of Ubuntu Jammy is Python3.10, so there is no need to compile and install it.

    The default Python version of Debian Bookworm is Python3.11, so there is no need to compile and install it.

  3. Then create a Python virtual environment

    Debian Bookworm is python3.11, please remember to replace the corresponding command.

    orangepi@orangepi:~$ sudo mkdir /srv/homeassistant

    orangepi@orangepi:~$ sudo chown orangepi:orangepi /srv/homeassistant

    orangepi@orangepi:~$ cd /srv/homeassistant

    orangepi@orangepi:~$ python3.9 -m venv .

    orangepi@orangepi:~$ source bin/activate

    (homeassistant) orangepi@orangepi:/srv/homeassistant$

  4. Then install the required Python packages

    (homeassistant) orangepi@orangepi:/srv/homeassistant$ python3 -m pip install wheel

  5. Then you can install Home Assistant Core

    (homeassistant) orangepi@orangepi:/srv/homeassistant$ pip3 install homeassistant

  6. Then enter the following command to run Home Assistant Core

    (homeassistant) orangepi@orangepi:/srv/homeassistant$ hass

  7. Then enter【development board IP address: 8123】 in the browser to see the Home Assistant interface

    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.

    Zero2w-img180.png

OpenCV installation method

Use apt to install OpenCV

  1. The installation command is as follows

    orangepi@orangepi:~$ sudo apt-get update

    orangepi@orangepi:~$ sudo apt-get install -y libopencv-dev python3-opencv

  2. Then use the following command to print the version number of OpenCV. The output is normal, indicating that the OpenCV installation is successful.

    1. The version of OpenCV in Ubuntu22.04 is as follows:

      orangepi@orangepi:~$ python3 -c "import cv2; print(cv2.__version__)"

      4.5.4

    2. The version of OpenCV in Ubuntu20.04 is as follows:

      orangepi@orangepi:~$ python3 -c "import cv2; print(cv2.__version__)"

      4.2.0

    3. The version of OpenCV in Debian11 is as follows:

      orangepi@orangepi:~$ python3 -c "import cv2; print(cv2.__version__)"

      4.5.1

    4. The version of OpenCV in Debian12 is as follows:

      orangepi@orangepi:~$ python3 -c "import cv2; print(cv2.__version__)"

      4.6.0

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.

Debian system installation method

  1. First set the default locale to Chinese

    1. Enter the following command to start configuring locale

      orangepi@orangepi:~$ sudo dpkg-reconfigure locales

    2. Then select zh_CN.UTF-8 UTF-8 in the pop-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 Tab key to move the cursor to <OK>, and then return Car can be used)

      Zero2w-img186.png

    3. Then set the default locale to zh_CN.UTF-8

      Zero2w-img187.png

    4. After exiting the interface, the locale setting will begin. The output displayed on the command line is as follows:

      orangepi@orangepi:~$ sudo dpkg-reconfigure locales

      Generating locales (this might take a while)...

      en_US.UTF-8... done

      zh_CN.UTF-8... done

      Generation complete.

  2. Then open Input Method

    Zero2w-img188.png

  3. Then select OK

    Zero2w-img189.png

  4. Then select Yes

    Zero2w-img190.png

  5. Then select fcitx

    Zero2w-img191.png

  6. Then select OK

    Zero2w-img192.png

  7. Then restart the Linux system to make the configuration take effect.

  8. Then open Fcitx configuration

    Zero2w-img193.png

  9. Then click the + sign as shown in the picture below

    Zero2w-img194.png

  10. Then search Google Pinyin and click OK

    Zero2w-img195.png

  11. Then put Google Pinyin on top

    Zero2w-img196.png

    Zero2w-img197.png

  12. Then open the Geany editor to test the Chinese input method

    Zero2w-img198.png

  13. The Chinese input method test is as follows

    Zero2w-img199.png

  14. You can switch between Chinese and English input methods through the Ctrl+Space shortcut key

  15. 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

    orangepi@orangepi:~$ sudo vim /etc/default/locale

    # File generated by update-locale

    LC_MESSAGES=zh_CN.UTF-8

    LANG=zh_CN.UTF-8

    LANGUAGE=zh_CN.UTF-8

  16. Then restart the system and you will see that the system is displayed in Chinese.

    Zero2w-img200.png

Installation method of Ubuntu 20.04 system

  1. First open Language Support

    Zero2w-img201.png

  2. Then find the Chinese (China) option

    Zero2w-img202.png

  3. 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:

    Zero2w-img203.png

  4. Note that this step is not easy to drag, please be patient and try it a few times.

  1. Then select Apply System-Wide to apply the Chinese settings to the entire system

    Zero2w-img204.png

  2. Then set the Keyboard input method system system to fcitx

    Zero2w-img205.png

  3. Then restart the Linux system to make the configuration take effect

  4. 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

    Zero2w-img206.png

  5. Then you can see that the desktop is displayed in Chinese

    Zero2w-img207.png

  6. Then we can open Geany to test the Chinese input method. The opening method is as shown in the figure below

    Zero2w-img208.png

  7. 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.

    Zero2w-img209.png

Installation method of Ubuntu 22.04 system

  1. First open Language Support

    Zero2w-img201.png

  2. Then find the Chinese (China) option

    Zero2w-img210.png

  3. 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:

    Zero2w-img211.png

  4. Note that this step is not easy to drag, please be patient and try it a few times.

  1. Then select Apply System-Wide to apply the Chinese settings to the entire system

    Zero2w-img212.png

  2. Then restart the Linux system to make the configuration take effect

  3. 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.

    Zero2w-img206.png

  4. Then you can see that the desktop is displayed in Chinese

    Zero2w-img207.png

  5. Then open the Fcitx5 configuration program

    Zero2w-img213.png

  6. Then choose to use Pinyin input method

    Zero2w-img214.png

  7. The interface after selection is as shown below, then click OK

    Zero2w-img215.png

  8. Then we can open Geany to test the Chinese input method. The opening method is as shown in the figure below

    Zero2w-img208.png

  9. 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.

    Zero2w-img216.png

How to remotely log in to the Linux system desktop

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. The document link is as follows:

https://knowledgebase.nomachine.com/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.

  1. First download the installation package of the NoMachine software Linux arm64 deb version, and then install it into the Linux system of the development board

    1. 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:
    2. Note that this download link may change, please look for the Armv8/Arm64 version of the deb package.

      https://downloads.nomachine.com/download/?id=118&distro=ARM

      Zero2w-img217.png

    1. In addition, you can also download the NoMachine installation package from the official tool.

      Zero2w-img218.png

      First enter the remote login software-NoMachine folder

      Zero2w-img219.png

      Then download the arm64 version of the deb installation package

      Zero2w-img220.png

    2. Then upload the downloaded nomachine_x.x.x_x_arm64.deb to the Linux system of the development board

    3. Then use the following command to install NoMachine in the Linux system of the development board

      orangepi@orangepi:~$ sudo dpkg -i nomachine_x.x.x_x_arm64_arm64.deb

  1. Then download the installation package of the Windows version of the NoMachine software. The download address is as follows
  2. Note that this download link may change.

    https://downloads.nomachine.com/download/?id=9

    Zero2w-img221.png

  1. Then install NoMachine in Windows. Please restart your computer after installation.

  2. Then open NoMachine in Window

    Zero2w-img222.png

  3. 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.

    Zero2w-img223.png

  4. Then click OK

    Zero2w-img224.png

  5. 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.

    Zero2w-img225.png

  6. Then click OK in the next interface.

  7. Finally you can see the desktop of the development board Linux system

    Zero2w-img226.png

Remote login using VNC

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.

  1. First run the set_vnc.sh script to set up vnc, remember to add sudo permissions

    orangepi@orangepi:~$ sudo set_vnc.sh

    You will require a password to access your desktops.


    Password:        #Set the vnc password here, 8 characters

    Verify:        #Set the vnc password here, 8 characters

    Would you like to enter a view-only password (y/n)? n

    xauth: file /root/.Xauthority does not exist


    New 'X' desktop is orangepi:1


    Creating default startup script /root/.vnc/xstartup

    Starting applications specified in /root/.vnc/xstartup

    Log file is /root/.vnc/orangepi:1.log


    Killing Xtightvnc process ID 3047


    New 'X' desktop is orangepi:1


    Starting applications specified in /root/.vnc/xstartup

    Log file is /root/.vnc/orangepi:1.log

  2. The steps to use MobaXterm software to connect to the development board Linux system desktop are as follows:

    1. First click Session, then select VNC, then fill in the IP address and port of the development board, and finally click OK to confirm.
    2. Zero2w-img227.png

    1. Then enter the VNC password set earlier

      Zero2w-img228.png

    2. After successful login, the interface is displayed as shown below, and then you can remotely operate the desktop of the development board Linux system.

    3. Zero2w-img229.png

QT installation method

  1. Use the following script to install QT5 and QT Creator

    orangepi@orangepi:~$ install_qt.sh

  2. After installation, the QT version number will be automatically printed.

    1. The qt version that comes with Ubuntu20.04 is 5.12.8

      orangepi@orangepi:~$ install_qt.sh

      ......

      QMake version 3.1

      Using Qt version 5.12.8 in /usr/lib/aarch64-linux-gnu

    2. The QT version that comes with Ubuntu22.04 is 5.15.3

      orangepi@orangepi:~$ install_qt.sh

      ......

      QMake version 3.1

      Using Qt version 5.15.3 in /usr/lib/aarch64-linux-gnu

    3. The QT version that comes with Debian11 is 5.15.2

      orangepi@orangepi:~$ install_qt.sh

      ......

      QMake version 3.1

      Using Qt version 5.15.2 in /usr/lib/aarch64-linux-gnu

    4. The QT version that comes with Debian12 is 5.15.8

      orangepi@orangepi:~$ install_qt.sh

      ......

      QMake version 3.1

      Using Qt version 5.15.8 in /usr/lib/aarch64-linux-gnu

  3. Then you can see the QT Creator startup icon in Applications

    Zero2w-img230.png

    You can also use the following command to open QT Creator

    orangepi@orangepi:~$ qtcreator

  4. The interface after QT Creator is opened is as follows

    Zero2w-img231.png

  5. The version of QT Creator is as follows

    1. The default version of QT Creator in Ubuntu20.04 is as follows

      Zero2w-img232.png

    2. The default version of QT Creator in Ubuntu22.04 is as follows

      Zero2w-img233.png

    3. The default version of QT Creator in Debian11 is as follows

      Zero2w-img234.png

    4. The default version of QT Creator in Debian12 is as follows

      Zero2w-img235.png

  6. Then set up QT

    1. First open Help->About Plugins....

      Zero2w-img236.png

    2. Then remove the check mark of ClangCodeModel

      Zero2w-img237.png

    3. After setting up, you need to restart QT Creator

    4. Then make sure the GCC compiler used by QT Creator. If the default is Clang, please change it to GCC.

      Debian12 please skip this step.

      Zero2w-img238.png

      Zero2w-img239.png

  7. Then you can open a sample code

    Zero2w-img240.png

  8. After clicking on the sample code, the corresponding instruction document will automatically open. You can read the instructions carefully.

    Zero2w-img241.png

  9. Then click Configure Project

    Zero2w-img242.png

  10. Then click the green triangle in the lower left corner to compile and run the sample code

    Zero2w-img243.png

  11. 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.

    Zero2w-img244.png

  12. References

    https://wiki.qt.io/Install_Qt_5_on_Ubuntu

    https://download.qt.io/archive/qtcreator

    https://download.qt.io/archive/qt

ROS installation method

How to install ROS 1 Noetic on Ubuntu20.04

  1. The currently active version of ROS 1 is as follows, the recommended version is Noetic Ninjemys
Zero2w-img245.png
Zero2w-img246.png

http://docs.ros.org

https://wiki.ros.org/Distributions

  1. The link to the official installation documentation of ROS 1 Noetic Ninjemys is as follows:

    http://wiki.ros.org/noetic/Installation/Ubuntu

  2. In the official installation documentation of ROS Noetic Ninjemys, Ubuntu recommends using Ubuntu20.04, so please ensure that the system used by the development board is Ubuntu20.04 desktop system.

    http://wiki.ros.org/noetic/Installation

    Zero2w-img247.png

  3. Then use the script below to install ros1

    orangepi@orangepi:~$ install_ros.sh ros1

  4. 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 in ROS.

  5. Note that when running 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 /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.


    https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml

    Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml

    ERROR: error loading sources list:

    The read operation timed out

    orangepi@orangepi:~$ source /opt/ros/noetic/setup.bash

    orangepi@orangepi:~$ sudo rosdep init

    Wrote /etc/ros/rosdep/sources.list.d/20-default.list

    Recommended: please run


    rosdep update

    orangepi@orangepi:~$ rosdep update

    reading in sources list data from /etc/ros/rosdep/sources.list.d

    Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml

    Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml

    Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml

    Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml

    Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml

    Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml

    Skip end-of-life distro "ardent"

    Skip end-of-life distro "bouncy"

    Skip end-of-life distro "crystal"

    Skip end-of-life distro "dashing"

    Skip end-of-life distro "eloquent"

    Add distro "foxy"

    Add distro "galactic"

    Skip end-of-life distro "groovy"

    Add distro "humble"

    Skip end-of-life distro "hydro"

    Skip end-of-life distro "indigo"

    Skip end-of-life distro "jade"

    Skip end-of-life distro "kinetic"

    Skip end-of-life distro "lunar"

    Add distro "melodic"

    Add distro "noetic"

    Add distro "rolling"

    updated cache in /home/orangepi/.ros/rosdep/sources.cache

  1. 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.

    orangepi@orangepi:~$ test_ros.sh

  2. After running the test_ros.sh script, a small turtle as shown in the picture below will pop up.

    Zero2w-img248.png

  3. Then please keep the terminal window you just opened at the top

  4. Zero2w-img249.png

  1. At this time, press the direction keys on the keyboard to control the little turtle to move up, down, left, and right.

    Zero2w-img250.png

How to install ROS 2 Galactic on Ubuntu20.04

  1. The currently active version of ROS 2 is as follows, the recommended version is Galactic Geochelone

    Zero2w-img251.png

    Zero2w-img252.png

    http://docs.ros.org

    http://docs.ros.org/en/galactic/Releases.html

  2. The link to the official installation documentation of ROS 2 Galactic Geochelone is as follows:

    docs.ros.org/en/galactic/Installation.html

    http://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html

  3. In the official installation documentation of ROS 2 Galactic Geochelone, Ubuntu Linux recommends using Ubuntu20.04, so please ensure that the system used by the development board is the Ubuntu20.04 desktop system. There are several ways to install ROS 2. The following demonstrates how to install ROS 2 Galactic Geochelone through Debian packages.

  4. Use the install_ros.sh script to install ros2

    orangepi@orangepi:~$ install_ros.sh ros2

  5. 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.

    usage: ros2 [-h] Call `ros2 <command> -h` for more detailed usage. ...


    ros2 is an extensible command-line tool for ROS 2.


    optional arguments:

    -h, --help show this help message and exit


    Commands:

    action Various action related sub-commands

    bag Various rosbag related sub-commands

    component Various component related sub-commands

    daemon Various daemon related sub-commands

    doctor Check ROS setup and other potential issues

    interface Show information about ROS interfaces

    launch Run a launch file

    lifecycle Various lifecycle related sub-commands

    multicast Various multicast related sub-commands

    node Various node related sub-commands

    param Various param related sub-commands

    pkg Various package related sub-commands

    run Run a package specific executable

    security Various security related sub-commands

    service Various service related sub-commands

    topic Various topic related sub-commands

    wtf Use `wtf` as alias to `doctor`


    Call `ros2 <command> -h` for more detailed usage.

  6. Then you can use the test_ros.sh script to test whether ROS 2 is installed successfully. If you can see the following print, it means ROS 2 can run normally.

    orangepi@orangepi:~$ test_ros.sh

    [INFO] [1671174101.200091527] [talker]: Publishing: 'Hello World: 1'

    [INFO] [1671174101.235661048] [listener]: I heard: [Hello World: 1]

    [INFO] [1671174102.199572327] [talker]: Publishing: 'Hello World: 2'

    [INFO] [1671174102.204196299] [listener]: I heard: [Hello World: 2]

    [INFO] [1671174103.199580322] [talker]: Publishing: 'Hello World: 3'

    [INFO] [1671174103.204019965] [listener]: I heard: [Hello World: 3]

  7. Run the following command to open rviz2

    orangepi@orangepi:~$ source /opt/ros/galactic/setup.bash

    orangepi@orangepi:~$ ros2 run rviz2 rviz2

    Zero2w-img253.png

  8. For how to use ROS, please refer to the documentation of ROS 2.

    http://docs.ros.org/en/galactic/Tutorials.html

How to install ROS 2 Humble on Ubuntu22.04

  1. Use the install_ros.sh script to install_ros.sh

    orangepi@orangepi:~$ install_ros.sh ros2

  2. 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.

    usage: ros2 [-h] Call `ros2 <command> -h` for more detailed usage. ...


    ros2 is an extensible command-line tool for ROS 2.


    optional arguments:

    -h, --help show this help message and exit


    Commands:

    action Various action related sub-commands

    bag Various rosbag related sub-commands

    component Various component related sub-commands

    daemon Various daemon related sub-commands

    doctor Check ROS setup and other potential issues

    interface Show information about ROS interfaces

    launch Run a launch file

    lifecycle Various lifecycle related sub-commands

    multicast Various multicast related sub-commands

    node Various node related sub-commands

    param Various param related sub-commands

    pkg Various package related sub-commands

    run Run a package specific executable

    security Various security related sub-commands

    service Various service related sub-commands

    topic Various topic related sub-commands

    wtf Use `wtf` as alias to `doctor`


    Call `ros2 <command> -h` for more detailed usage.

  3. 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.

    orangepi@orangepi:~$ test_ros.sh

    [INFO] [1671174101.200091527] [talker]: Publishing: 'Hello World: 1'

    [INFO] [1671174101.235661048] [listener]: I heard: [Hello World: 1]

    [INFO] [1671174102.199572327] [talker]: Publishing: 'Hello World: 2'

    [INFO] [1671174102.204196299] [listener]: I heard: [Hello World: 2]

    [INFO] [1671174103.199580322] [talker]: Publishing: 'Hello World: 3'

    [INFO] [1671174103.204019965] [listener]: I heard: [Hello World: 3]

  4. Run the following command to open rviz2

    orangepi@orangepi:~$ source /opt/ros/humble/setup.bash

    orangepi@orangepi:~$ ros2 run rviz2 rviz2

    Zero2w-img254.png

  5. Reference documentation

    http://docs.ros.org/en/humble/index.html

    http://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html

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.

  1. The Linux image released by OPi comes with the deb package of the kernel header file by default, and the storage location is /opt/

    orangepi@orangepi:~$ ls /opt/linux-headers*

    /opt/linux-headers-xxx-sun50iw9_x.x.x_arm64.deb

  2. Use the following command to install the deb package of the kernel header file

    orangepi@orangepi:~$ sudo dpkg -i /opt/linux-headers*.deb

  3. After installation, you can see the folder where the kernel header file is located under /usr/src.

    orangepi@orangepi:~$ ls /usr/src

    linux-headers-x.x.x

  4. 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.

    orangepi@orangepi:~$ cd /usr/src/hello/

    orangepi@orangepi:/usr/src/hello$ sudo make

    make -C /lib/modules/5.4.125/build M=/usr/src/hello modules

    make[1]: Entering directory '/usr/src/linux-headers-5.4.125'

    CC [M] /usr/src/hello/hello.o

    Building modules, stage 2.

    MODPOST 1 modules

    CC [M] /usr/src/hello/hello.mod.o

    LD [M] /usr/src/hello/hello.ko

    make[1]: Leaving directory '/usr/src/linux-headers-5.4.125'

  5. After compilation, the hello.ko kernel module will be generated

    orangepi@orangepi:/usr/src/hello$ ls *.ko

    hello.ko

  6. Use the insmod command to insert the hello.ko kernel module into the kernel

    orangepi@orangepi:/usr/src/hello$ sudo insmod hello.ko

  7. 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.

    orangepi@orangepi:/usr/src/hello$ dmesg | grep "Hello"

    [ 2871.893988] Hello Orange Pi -- init

  8. Use the rmmod command to uninstall the hello.ko kernel module

    orangepi@orangepi:/usr/src/hello$ sudo rmmod hello

    orangepi@orangepi:/usr/src/hello$ dmesg | grep "Hello"

    [ 2871.893988] Hello Orange Pi -- init

    [ 3173.800892] Hello Orange Pi -- exit

Testing of some programming languages supported by Linux system

Debian Bullseye system

  1. 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.

    1. The version of a.gcc is as follows

      orangepi@orangepi:~$ gcc --version

      gcc (Debian 10.2.1-6) 10.2.1 20210110

      Copyright (C) 2020 Free Software Foundation, Inc.

      This is free software; see the source for copying conditions. There is NO

      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    2. Write the hello_world.c program in C language

      orangepi@orangepi:~$ vim hello_world.c

      #include <stdio.h>


      int main(void)

      {

      printf("Hello World!\n");


      return 0;

      }

    3. Then compile and run hello_world.c

      orangepi@orangepi:~$ gcc -o hello_world hello_world.c

      orangepi@orangepi:~$ ./hello_world

      Hello World!

  2. Debian Bullseye has Python3 installed by default

    1. The specific version of Python is as follows

      orangepi@orangepi:~$ python3

      Python 3.9.2 (default, Feb 28 2021, 17:03:44)

      [GCC 10.2.1 20210110] on linux

      Type "help", "copyright", "credits" or "license" for more information.

      >>>

      Use the Ctrl+D shortcut key to exit python's interactive mode.

    2. Write the hello_world.py program in Python language

      orangepi@orangepi:~$ vim hello_world.py

      print('Hello World!')

    3. The result of running hello_world.py is as follows

      orangepi@orangepi:~$ python3 hello_world.py

      Hello World!

  3. Debian Bullseye does not install Java compilation tools and operating environment by default.

    1. You can use the following command to install openjdk. The latest version in Debian Bullseye is openjdk-17

      orangepi@orangepi:~$ sudo apt install -y openjdk-17-jdk

    2. After installation, you can check the Java version.

      orangepi@orangepi:~$ java --version

    3. Write the Java version of hello_world.java

      orangepi@orangepi:~$ vim hello_world.java

      public class hello_world

      {

      public static void main(String[] args)

      {

      System.out.println("Hello World!");

      }

      }

    4. Then compile and run hello_world.java

      orangepi@orangepi:~$ javac hello_world.java

      orangepi@orangepi:~$ java hello_world

      Hello World!

Debian Bookworm system

  1. 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.

    1. The version of a.gcc is as follows

      orangepi@orangepi:~$ gcc --version

      gcc (Debian 12.2.0-14) 12.2.0

      Copyright (C) 2022 Free Software Foundation, Inc.

      This is free software; see the source for copying conditions. There is NO

      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    2. Write the hello_world.c program in C language

      orangepi@orangepi:~$ vim hello_world.c

      #include <stdio.h>


      int main(void)

      {

      printf("Hello World!\n");


      return 0;

      }

    3. Then compile and run hello_world.c

      orangepi@orangepi:~$ gcc -o hello_world hello_world.c

      orangepi@orangepi:~$ ./hello_world

      Hello World!

  2. Debian Bookworm has Python3 installed by default

    1. The specific version of Python is as follows

      orangepi@orangepi:~$ python3

      Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux

      Type "help", "copyright", "credits" or "license" for more information.

      >>>

      Use the Ctrl+D shortcut key to exit python's interactive mode.

    2. Write the hello_world.py program in Python language

      orangepi@orangepi:~$ vim hello_world.py

      print('Hello World!')

    3. The result of running hello_world.py is as follows

      orangepi@orangepi:~$ python3 hello_world.py

      Hello World!

  3. Debian Bookworm does not install Java compilation tools and operating environment by default.

    1. You can use the following command to install openjdk. The latest version in Debian Bookworm is openjdk-17

      orangepi@orangepi:~$ sudo apt install -y openjdk-17-jdk

    2. After installation, you can check the Java version.

      orangepi@orangepi:~$ java --version

    3. Write the Java version of hello_world.java

      orangepi@orangepi:~$ vim hello_world.java

      public class hello_world

      {

      public static void main(String[] args)

      {

      System.out.println("Hello World!");

      }

      }

    4. Then compile and run hello_world.java

      orangepi@orangepi:~$ javac hello_world.java

      orangepi@orangepi:~$ java hello_world

      Hello World!

Ubuntu Focal system

  1. 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.

    1. The version of a.gcc is as follows

      orangepi@orangepi:~$ gcc --version

      gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

      Copyright (C) 2019 Free Software Foundation, Inc.

      This is free software; see the source for copying conditions. There is NO

      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    2. Write the hello_world.c program in C language

      orangepi@orangepi:~$ vim hello_world.c

      #include <stdio.h>


      int main(void)

      {

      printf("Hello World!\n");


      return 0;

      }

    3. Then compile and run hello_world.c

      orangepi@orangepi:~$ gcc -o hello_world hello_world.c

      orangepi@orangepi:~$ ./hello_world

      Hello World!

  2. Ubuntu Focal has Python3 installed by default

    1. The specific version of Python3 is as follows

      orangepi@orangepi:~$ python3

      Python 3.8.10 (default, Nov 14 2022, 12:59:47)

      [GCC 9.4.0] on linux

      Type "help", "copyright", "credits" or "license" for more information.

      >>>

      Use the Ctrl+D shortcut key to exit python's interactive mode.

    2. Write the hello_world.py program in Python language

      orangepi@orangepi:~$ vim hello_world.py

      print('Hello World!')

    3. The result of running hello_world.py is as follows

      orangepi@orangepi:~$ python3 hello_world.py

      Hello World!

  3. Ubuntu Focal does not have Java compilation tools and running environment installed by default.

    1. You can use the following command to install openjdk-17

      orangepi@orangepi:~$ sudo apt install -y openjdk-17-jdk

    2. After installation, you can check the Java version.

      orangepi@orangepi:~$ java --version

      openjdk 17.0.2 2022-01-18

      OpenJDK Runtime Environment (build 17.0.2+8-Ubuntu-120.04)

      OpenJDK 64-Bit Server VM (build 17.0.2+8-Ubuntu-120.04, mixed mode, sharing)

    3. Write the Java version of hello_world.java

      orangepi@orangepi:~$ vim hello_world.java

      public class hello_world

      {

      public static void main(String[] args)

      {

      System.out.println("Hello World!");

      }

      }

    4. Then compile and run hello_world.java

      orangepi@orangepi:~$ javac hello_world.java

      orangepi@orangepi:~$ java hello_world

      Hello World!

Ubuntu Jammy system

  1. 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.

    1. The version of a.gcc is as follows

      orangepi@orangepi:~$ gcc --version

      gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0

      Copyright (C) 2021 Free Software Foundation, Inc.

      This is free software; see the source for copying conditions. There is NO

      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    2. Write the hello_world.c program in C language

      orangepi@orangepi:~$ vim hello_world.c

      #include <stdio.h>


      int main(void)

      {

      printf("Hello World!\n");


      return 0;

      }

    3. Then compile and run hello_world.c

      orangepi@orangepi:~$ gcc -o hello_world hello_world.c

      orangepi@orangepi:~$ ./hello_world

      Hello World!

  2. Ubuntu Jammy has Python3 installed by default

    1. The specific version of Python3 is as follows

      orangepi@orangepi:~$ python3

      Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux

      Type "help", "copyright", "credits" or "license" for more information.

      >>>

      Use the Ctrl+D shortcut key to exit python's interactive mode.

    2. Write the hello_world.py program in Python language

      orangepi@orangepi:~$ vim hello_world.py

      print('Hello World!')

    3. The result of running hello_world.py is as follows

      orangepi@orangepi:~$ python3 hello_world.py

      Hello World!

  3. Ubuntu Jammy does not install Java compilation tools and operating environment by default.

    1. You can use the following command to install openjdk-18

      orangepi@orangepi:~$ sudo apt install -y openjdk-18-jdk

    2. After installation, you can check the Java version.

      orangepi@orangepi:~$ java --version

      openjdk 18.0.2-ea 2022-07-19

      OpenJDK Runtime Environment (build 18.0.2-ea+9-Ubuntu-222.04)

      OpenJDK 64-Bit Server VM (build 18.0.2-ea+9-Ubuntu-222.04, mixed mode, sharing)

    3. Write the Java version of hello_world.java

      orangepi@orangepi:~$ vim hello_world.java

      public class hello_world

      {

      public static void main(String[] args)

      {

      System.out.println("Hello World!");

      }

      }

    4. Then compile and run hello_world.java

      orangepi@orangepi:~$ javac hello_world.java

      orangepi@orangepi:~$ java hello_world

      Hello World!

Method of uploading files to the development board Linux system

Method to upload files to the development board Linux system in Ubuntu PC

How to upload files using scp command

  1. Use the scp command to upload files to the Linux system of the development board in Ubuntu PC. The specific command is as follows

    1. file_path: Needs to be replaced with the path of the file to be uploaded

    2. orangepi: This is the user name of the development board's Linux system. It can also be replaced with something else, such as root.

    3. 192.168.xx.xx: This is the IP address of the development board. Please modify it according to the actual situation.

    4. /home/orangepi: The path in the development board Linux system can also be modified to other paths.

      test@test:~$ scp file_path orangepi@192.168.xx.xx:/home/orangepi/

  2. If you want to upload a folder, you need to add the -r parameter

    test@test:~$ scp -r dir_path orangepi@192.168.xx.xx:/home/orangepi/

  3. There are more usages of scp, please use the following command to view the man manual

  4. test@test:~$ man scp

How to upload files using filezilla

  1. First install filezilla in Ubuntu PC

    test@test:~$ sudo apt install -y filezilla

  2. Then use the following command to open filezilla

    test@test:~$ filezilla

  3. The interface after opening filezilla is as shown below. At this time, the remote site on the right is empty.

    Zero2w-img255.png

  4. The method of connecting the development board is as shown in the figure below

  5. Zero2w-img256.png

  1. Then choose to save the password and click OK

    Zero2w-img257.png

  2. Then select Always trust this host and click OK

  3. Zero2w-img258.png

  1. 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.
  2. Zero2w-img259.png

  1. 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.
  2. Zero2w-img260.png

  1. After the upload is completed, you can go to the corresponding path in the development board Linux system to view the uploaded file.

  2. The method of uploading a folder is the same as the method of uploading a file, so I won't go into details here.

Method to upload files from Windows PC to development board Linux system

How to upload files using filezilla

  1. First download the installation file of the Windows version of the filezilla software. The download link is as follows

https://filezilla-project.org/download.php?type=client

Zero2w-img261.png
Zero2w-img262.png
  1. The downloaded installation package is as shown below, then double-click to install it directly

    FileZilla_Server_1.5.1_win64-setup.exe

    During the installation process, please select Decline on the following installation interface, and then select Next>

    Zero2w-img263.png

  1. The interface after opening filezilla is as shown below. At this time, the remote site on the right is empty.
  2. Zero2w-img264.png

  1. The method of connecting the development board is as shown in the figure below:
  2. Zero2w-img256.png

  1. Then choose to save the password and click OK
  2. Zero2w-img265.png

  1. Then select Always trust this host and click OK
  2. Zero2w-img266.png

  1. 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.
  2. Zero2w-img267.png

  1. 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 on the Windows 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.
  2. Zero2w-img268.png

  1. After the upload is completed, you can go to the corresponding path in the development board Linux system to view the uploaded file.

  2. The method of uploading a folder is the same as the method of uploading a file, so I won't go into details here.

Instructions for using the logo on and off the machine

  1. The power on/off logo will only be displayed on the desktop version of the system by default.

  2. Set the bootlogo variable to false in /boot/orangepiEnv.txt to turn off the switch logo.

    orangepi@orangepi:~$ sudo vim /boot/orangepiEnv.txt

    verbosity=1

    bootlogo=false

  3. Set the bootlogo variable to true in /boot/orangepiEnv.txt to enable the power on/off logo.

    orangepi@orangepi:~$ sudo vim /boot/orangepiEnv.txt

    verbosity=1

    bootlogo=true

  4. The location of the boot logo picture in the Linux system is

    /usr/share/plymouth/themes/orangepi/watermark.png

  5. After replacing the boot logo image, you need to run the following command to take effect

    orangepi@orangepi:~$ sudo update-initramfs -u

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:

Zero2w-img269.png

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:

  1. First run orangepi-config. Ordinary users remember to add sudo permissions.

    orangepi@orangepi:~$ sudo orangepi-config

  2. Then select System

    Zero2w-img80.png

  3. Then select Hardware

    Zero2w-img81.png

  4. Then use the keyboard's arrow keys to locate the position shown in the picture below, and then use the space to select the dtbo configuration of the SPI you want to open.

    Zero2w-img270.png

  5. Then select <Save> to save

    Zero2w-img83.png

  6. Then select <Back>

    Zero2w-img84.png

  7. Then select <Reboot> to restart the system to make the configuration take effect.

    Zero2w-img85.png

How to shut down and restart the development board

  1. 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.

    orangepi@orangepi:~$ sudo poweroff

    Note that after turning off the development board, you need to unplug and replug the power supply before it can be turned on.

  2. 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.

    Zero2w-img269.png

    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.4.

  3. Use the reboot command to restart the Linux system in the development board

    orangepi@orangepi:~$ sudo reboot

Linux SDK——orangepi-build usage instructions

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:~$ lsb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 22.04 LTS

Release: 22.04

Codename: jammy

If the computer is installed with a Windows system and does not have Ubuntu 22.04 installed on it, you can consider usingVirtualBox or VMware 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 orangepi-build can be used normally in WSL. In addition, please do not compile the Linux system on the development board. Use orangepi-build. The installation image download address of Ubuntu 22.04 amd64 version is:

https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04/ubuntu-22.04-desktop-amd64.iso

After 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:

  1. For the method of replacing Tsinghua Source, please refer to the instructions on this page.
  2. https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

  1. Note that the Ubuntu version needs to be switched to 22.04.
  2. Zero2w-img271.png

  1. The contents of the /etc/apt/sources.list file that need to be replaced are:
  2. test@test:~$ sudo mv /etc/apt/sources.list cat /etc/apt/sources.list.bak

    test@test:~$ sudo vim /etc/apt/sources.list

    # The source code image is commented by default to improve apt update speed. You can uncomment it yourself if necessary.

    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse

    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse

    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse

    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse

    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse

    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse

    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse

    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse


    # Pre-release software source, not recommended to be enabled

    # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse

    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse

  1. After the replacement, you need to update the package information and ensure that no errors are reported.
  2. test@test:~$ sudo apt-get update

  1. 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.

Obtain the source code of linux sdk

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

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 next.

Zero2w-img272.png

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:

branch u-boot Version linux Kernel version
current u-boot v2018.05 linux5.4
next u-boot v2021.07 linux6.1

The branch mentioned here is not the same thing as the branch of orangepi-build source code, please don't get confused. This branch is mainly used to distinguish different kernel source code versions.

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:

  1. build.sh: Compile startup script

  2. external: Contains configuration files needed to compile the image, specific scripts, and source code of some programs, etc.

  3. LICENSE: GPL 2 license file

  4. README.md: orangepi-build documentation

  5. scripts: Common script for compiling linux images

test@test:~/orangepi-build$ ls

build.sh      external      LICENSE      README.md      scripts

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.

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.

Zero2w-img273.png

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/

After toolchains is downloaded, it will contain multiple versions of cross-compilation 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:

  1. linux5.4
  2. gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu

  1. linux6.1
  2. 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:

  1. v2018.05
  2. gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi

  1. v2021.07
  2. gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu

orangepi-build complete directory structure description

  1. 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.

    1. 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

      1. a) Linux5.4
      2. https://github.com/orangepi-xunlong/linux-orangepi/tree/orange-pi-5.4-sun50iw9

      1. b) Linux6.1
      2. https://github.com/orangepi-xunlong/linux-orangepi/tree/orange-pi-6.1-sun50iw9

    1. 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

      1. a) v2018.05
      2. https://github.com/orangepi-xunlong/u-boot-orangepi/tree/v2018.05-h618

      1. b) v2021.07
      2. https://github.com/orangepi-xunlong/u-boot-orangepi/tree/v2021.07-sunxi

  1. 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 linux image, the files and folders that can be seen in orangepi-build are:

    1. build.sh: Compile startup script

    2. 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 compilation process is also stored in external.

    3. kernel: Store the source code of the linux kernel

    4. LICENSE: GPL 2 license file

    5. README.md: orangepi-build documentation

    6. output: Store compiled u-boot, linux and other deb packages, compilation logs, and compiled images and other files

    7. scripts: Common script for compiling linux images

    8. toolchains: Store cross-compilation tool chain

    9. u-boot: Store the source code of u-boot

    10. userpatches: Store the configuration files needed to compile the script

    11. test@test:~/orangepi-build$ ls

      build.sh      external      kernel      LICENSE      output      README.md      scripts      toolchains      u-boot      userpatches

Compile u-boot

  1. Run the build.sh script, remember to add sudo permissions

test@test:~/orangepi-build$ sudo ./build.sh

  1. Select U-boot package and press Enter
  2. Zero2w-img274.png

  1. Then select the model of the development board
  2. Zero2w-img275.png

  1. Then select the branch type of u-boot

    1. The current branch will compile the u-boot v2018.05 version code that needs to be used by the linux5.4 image.

    2. The next branch will compile the u-boot v2021.07 version code that needs to be used by the linux6.1 image.

      Zero2w-img276.png

  2. 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 branch.

    1. If the development board you purchased has a memory size of 1.5GB, please select the first option.

    2. If the development board you purchased has 1GB or 2GB or 4GB memory size, please choose the second option.

      Zero2w-img277.png

  1. Then it will start to compile u-boot. Some of the information prompted when compiling the next branch is as follows:

    1. Version of u-boot source code
    2. [ o.k. ] Compiling u-boot [ v2021.07 ]

    1. Version of the cross-compilation tool chain
    2. [ o.k. ] Compiler version [ aarch64-linux-gnu-gcc 11 ]

    1. Path to the compiled u-boot deb package
    2. [ o.k. ] Target directory [ orangepi-build/output/debs/u-boot ]

    1. The package name of the compiled u-boot deb package
    2. [ o.k. ] File name [ linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb ]

    1. Compilation time
    2. [ o.k. ] Runtime [ 1 min ]

    1. Repeat the command to compile u-boot. Use the following command without selecting through the graphical interface. You can start compiling u-boot directly.
    2. [ o.k. ] Repeat Build Options [ sudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=u-boot ]

  1. View the compiled u-boot deb package
  2. test@test:~/orangepi-build$ ls output/debs/u-boot/

    linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb

  1. 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:
  2. Set the IGNORE_UPDATES variable in uuserpatches/config-default.conf to "yes"

    test@test:~/orangepi-build$ vim userpatches/config-default.conf

    ......

    IGNORE_UPDATES="yes"

    ......

  1. When debugging u-boot code, you can use the following method to update u-boot in the linux image for testing

    1. First upload the compiled deb package of u-boot to the Linux system of the development board.
    2. test@test:~/orangepi-build$ cd output/debs/u-boot

      test@test:~/orangepi_build/output/debs/u-boot$ scp \

      linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb root@192.168.1.xxx:/root

    1. Install the new u-boot deb package just uploaded
    2. orangepi@orangepi:~$ sudo dpkg -i linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb

    1. Then run the nand-sata-install script
    2. orangepi@orangepi:~$ sudo nand-sata-install

    1. Then select 5 Install/Update the bootloader on SD/eMMC
    2. Zero2w-img278.png

    1. After pressing the Enter key, a Warning will pop up first.
    2. Zero2w-img279.png

    1. Press the Enter key again to start updating u-boot. After the update is completed, the following information will be displayed.
    2. Zero2w-img280.png

    1. Then you can restart the development board to test whether the u-boot modification has taken effect.

Compile the linux kernel

  1. Run the build.sh script, remember to add sudo permissions

test@test:~/orangepi-build$ sudo ./build.sh

  1. Select Kernel package and press Enter
  2. Zero2w-img281.png

  1. Then you will be prompted whether you need to display the kernel configuration interface. If you do not need to modify the kernel configuration, select the first one. If you need to modify the kernel configuration, select the second one.
  2. Zero2w-img282.png

  1. Then select the model of the development board
  2. Zero2w-img275.png

  1. Then select the branch type of the kernel source code
  2. a. The current branch will compile the linux5.4 kernel source code
    b. The next branch will compile the linux6.1 kernel source code
    Zero2w-img276.png
  1. 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.
  2. Zero2w-img283.png

    1. 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.
    2. test@test:~/orangepi-build$ sudo ./build.sh KERNEL_CONFIGURE=no

    1. b. You can also set KERNEL_CONFIGURE=no in the orangepi-build/userpatches/config-default.confconfiguration file to permanently disable this function.

    2. 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.

    3. Zero2w-img284.png

  1. Part of the information prompted when compiling the next branch kernel source code is explained as follows:

    1. Version of the linux kernel source code
    2. [ o.k. ] Compiling current kernel [ 6.1.31 ]

    1. The version of the cross-compilation tool chain used
    2. [ o.k. ] Compiler version [ aarch64-linux-gnu-gcc 11 ]

    1. The default configuration file used by the kernel and the path where it is stored are as follows
    2. [ o.k. ] Using kernel config file [ orangepi-build/external/config/kernel/linux-6.1-sun50iw9-next.config ]

    1. The path to the kernel-related deb package generated by compilation
    2. [ o.k. ] Target directory [ output/debs/ ]

    1. The package name of the kernel image deb package generated by compilation
    2. [ o.k. ] File name [ linux-image-next-sun50iw9_x.x.x_arm64.deb ]

    1. Compilation time
    2. [ o.k. ] Runtime [ 10 min ]

    1. 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.
    2. [ o.k. ] Repeat Build Options [ sudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=kernel KERNEL_CONFIGURE=no ]

  1. View the kernel-related deb package generated by compilation

    1. linux-dtb-next-sun50iw9_x.x.x_arm64.deb Contains dtb files used by the kernel

    2. linux-headers-next-sun50iw9_x.x.x_arm64.deb Contains kernel header files

    3. linux-image-next-sun50iw9_x.x.x_arm64.deb Contains kernel images and kernel modules

    4. test@test:~/orangepi-build$ ls output/debs/linux-*

      output/debs/linux-dtb-next-sun50iw9_x.x.x_arm64.deb

      output/debs/linux-headers-next-sun50iw9_x.x.x_arm64.deb

      output/debs/linux-image-next-sun50iw9_x.x.x_arm64.deb

  1. 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 found), otherwise the modifications will be restored. The method is as follows:
  2. Set the IGNORE_UPDATES variable in userpatches/config-default.conf to "yes"

    test@test:~/orangepi-build$ vim userpatches/config-default.conf

    IGNORE_UPDATES="yes"

  1. If the kernel is modified, you can use the following method to update the kernel and kernel module of the development board Linux system

    1. Upload the compiled deb package of the Linux kernel to the Linux system of the development board
    2. 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

    1. Install the deb package of the new linux kernel just uploaded.
    2. orangepi@orangepi:~$ sudo dpkg -i linux-image-next-sun50iw9_x.x.x_arm64.deb

    1. Then restart the development board and check whether the kernel-related modifications have taken effect.
    2. orangepi@orangepi:~$ sudo reboot

Compile rootfs

  1. Run the build.sh script, remember to add sudo permissions

test@test:~/orangepi-build$ sudo ./build.sh

  1. Select Rootfs and all deb packages and press Enter
  2. Zero2w-img285.png

  1. Then select the model of the development board
  2. Zero2w-img275.png

  1. Then select the branch type of the kernel source code. Different versions of the kernel source code maintain different rootfs types.

    1. In the current branch, you can see three options: debian11, ubuntu20.04, and ubuntu22.04.

    2. In the next branch, you can see three options: debian11, debian12, and ubuntu22.04.

    3. Zero2w-img276.png

  1. Then select the type of rootfs
  2. Zero2w-img286.png

  1. Then select the type of image

    1. Image with console interface (server) Represents the image of the server version, which is relatively small in size.

    2. Image with desktop environment Represents an image with a desktop, which is relatively large in size.

    3. Zero2w-img287.png

  1. 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)
  2. Zero2w-img288.png

  1. 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.
  2. Zero2w-img289.png

    Zero2w-img290.png

    You can then select additional packages that need to be installed. Please press the Enter key here to skip directly.

    Zero2w-img291.png

  1. Then the compilation of rootfs will start. Some of the information prompted during compilation are as follows:

    1. Type of rootfs
    2. [ o.k. ] local not found [ Creating new rootfs cache for bullseye ]

    1. The storage path of the compiled rootfs compressed package
    2. [ o.k. ] Target directory [ orangepi-build/external/cache/rootfs ]

    1. The name of the rootfs compressed package generated by compilation
    2. [ o.k. ] File name [ bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4 ]

  1. View the compiled rootfs compressed package

    1. bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4 It is a compressed package of rootfs. The meaning of each field in the name is
    2. 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 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
    1. bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.list Lists the package names of all packages installed by rootfs
    2. test@test:~/orangepi-build$ ls external/cache/rootfs/

      bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4

      bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.current

      bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.list

  1. 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.

Compile linux image

  1. Run the build.sh script, remember to add sudo permissions

test@test:~/orangepi-build$ sudo ./build.sh

  1. Select Full OS image for flashing and press Enter
  2. Zero2w-img292.png

  1. Then select the model of the development board
  2. Zero2w-img275.png

  1. Then select the branch type of the kernel source code. Different versions of the kernel source code maintain different rootfs types.

    1. In the current branch, you can see three options: debian11, ubuntu20.04, and ubuntu22.04.

    2. In the next branch, you can see three options: debian11, debian12, and ubuntu22.04.

    3. Zero2w-img276.png

  1. 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 branch.

    1. If the development board you purchased has a memory size of 1.5GB, please select the first option.

    2. If the development board you purchased has 1GB or 2GB or 4GB memory size, please choose the second option.

      Zero2w-img277.png

  2. Then select the type of rootfs

  3. Zero2w-img286.png

  1. Then select the type of image

    1. Image with console interface (server) Represents the image of the server version, which is relatively small in size.

    2. Image with desktop environmentRepresents an image with a desktop, which is relatively large in size.

    3. Zero2w-img287.png

  1. 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)
  2. Zero2w-img288.png

  1. 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.
  2. Zero2w-img289.png

    Zero2w-img290.png

    You can then select additional packages that need to be installed. Please press the Enter key here to skip directly.

    Zero2w-img291.png

  1. Then the compilation of the linux image will begin. The general process of compilation is as follows
  2. 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.
    n. Then update initramfs
    o. Finally, write the bin file of u-boot into the image through the dd command.
  1. After compiling the image, the following message will be displayed

    1. The storage path of the compiled image
    2. [ o.k. ] Done building [ output/images/orangepizero2w_x.x.x_debian_bullseye_linux6.1.xx_xfce_desktop/orangepizero2w_x.x.x_debian_bullseye_linux6.1.xx_xfce_desktop.img ]

    1. Compilation time
    2. [ o.k. ] Runtime [ 19 min ]

    1. Repeat the command to compile the image. Use the following command to start compiling the image directly without selecting it through the graphical interface.
    2. [ o.k. ] Repeat Build Options [ sudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=image RELEASE=bullseye BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=yes ]

Instructions for using the Orange Pi OS Arch system

Orange Pi OS Arch system function adaptation status

Motherboard functions OPi OS Arch
HDMI video OK
HDMI Audio OK
Type-C USB2.0 x 2 OK
TF Card Startup OK
WIFI OK
Bluetooth OK
LED Light OK
40pin GPIO OK
40pin I2C OK
40pin SPI OK
40pin UART OK
40pin PWM OK
Temperature Sensor OK
Hardware watchdog OK
Mali GPU NO
Video codec NO
24pin expansion board function OPi OS Arch
100M network port OK
100M Ethernet port light OK
USB2.0 HOST x 2 OK
Infrared reception OK
Headphone audio playback OK
On/off button OK
LRADC Custom buttons x 2 OK
TV-OUT NO

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.

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). The setup steps of the user wizard are as follows:

  1. After burning the system, when you start it for the first time and enter the desktop, you will see the user wizard program shown in the figure below.

    Zero2w-img293.png

  2. First you need to select the language you want

    Zero2w-img294.png

  3. After selecting the language, the user wizard will immediately switch to the corresponding language interface, as shown below in Chinese

    Zero2w-img295.png

  4. Then select the area

    Zero2w-img296.png

  5. Then select the keyboard model

    Zero2w-img297.png

  6. Then create a new username and set a password

    Zero2w-img298.png

  7. Then make sure there is no problem with the selection, and then click the install button

    Zero2w-img299.png

  8. Then wait for the installation to complete

    Zero2w-img300.png

  9. After the installation is complete, you need to click the Finish button to restart the system.

    Zero2w-img301.png

  10. 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 manually close the Orange Pi Hello program every time you start it.

    Zero2w-img302.png

    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.

How to set DT overlays

The multiplexing functions such as I2C/SPI/UART/PWM in the 40-pin development board are turned off by default in the kernel's dts, and the corresponding DT overlays need to be manually turned on before they can be used.

The method to open DT overlays in OPi OS Arch system is as follows:

  1. First open the /boot/extlinux/extlinux.conf configuration file

[orangepi@orangepi-pc ~]$ sudo vim /boot/extlinux/extlinux.conf

  1. Then open the corresponding configuration by adding FDTOVERLAYS /dtbs/allwinner/overlay/xxx.dtbo in /boot/extlinux/extlinux.conf
  2. 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.

    [orangepi@orangepi-pc ~]$ sudo vim /boot/extlinux/extlinux.conf

    LABEL Orange Pi

    KERNEL /Image

    FDT /dtbs/allwinner/sun50i-h616-orangepi-zero2w.dtb

    FDTOVERLAYS /dtbs/allwinner/overlay/xxx.dtbo #Configuration that needs to be added

  1. 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.

    /boot/dtbs/allwinner/overlay/

  2. The DT overlays configuration that can be used by the development board is as follows

  3. Functions on the development board Corresponding DT overlays configuration
    40pin - i2c0 sun50i-h616-pi-i2c0.dtbo
    40pin - i2c1 sun50i-h616-pi-i2c1.dtbo
    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 - spi1 cs0 cs1 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
  1. If you need to open multiple configurations at the same time, just add the paths of multiple configurations directly after FDTOVERLAYS. For example, the configuration of opening i2c1 and uart5 at the same time is as follows
  2. [orangepi@orangepi-pc ~]$ sudo vim /boot/extlinux/extlinux.conf

    LABEL Orange Pi

    KERNEL /Image

    FDT /dtbs/allwinner/sun50i-h616-orangepi-zero2w.dtb

    FDTOVERLAYS /dtbs/allwinner/overlay/sun50i-h616-pi-i2c1.dtbo /dtbs/allwinner/overlay/sun50i-h616-ph-uart5.dtbo

  1. After setting, you need to restart the system for the configuration to take effect.
  2. [orangepi@orangepi-pc ~]$ sudo reboot

How to install software

You can use the pacman package management tool to install software that is not available in OPi OS. For 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.

[orangepi@orangepi-pc ~]$ sudo pacman -Syy vim

Android 12 TV system usage instructions

Supported Android versions

Android Version Kernel version
Android 12 TV Version linux5.4

Android 12 TV function adaptation status

Motherboard functions Android12 TV
HDMI video OK
HDMI Audio OK
Type-C USB2.0 x 2 OK
TF card startup OK
WIFI OK
Bluetooth OK
USB Camera OK
LED Light OK
40pin GPIO OK
40pin I2C OK
40pin SPI1 OK
40pin UART OK
40pin PWM OK
Temperature Sensor OK
Hardware watchdog OK
Mali GPU OK
Video codec OK
24pin Expansion board function Android12 TV
100M network port OK
100M Ethernet port light OK
USB2.0 HOST x 2 OK
Infrared reception OK
Headphone audio playback OK
On/off button OK
LRADC Custom buttons x 2 OK, The default setting is the volume up and down keys.
TV-OUT OK

Onboard LED light display instructions

green light red light
u-boot startup phase Off on
Kernel boot to enter the system on on

How to return to the previous interface in Android

We 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-clicking the mouse, and the keyboard cannot return.

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 the return key on the remote control to return to the previous menu. The location of the return key is as shown below. Shown:

Zero2w-img303.png

How to use ADB

Use network connection adb debugging

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.

  1. Make sure the service.adb.tcp.port of the Android system is set to 5555 port number

apollo-p2:/ # getprop | grep "adb.tcp"

[service.adb.tcp.port]: [5555]

  1. 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
  2. apollo-p2:/ # setprop service.adb.tcp.port 5555

    apollo-p2:/ # stop adbd

    apollo-p2:/ # start adbd

  1. Install adb tool on Ubuntu PC
  2. test@test:~$ sudo apt-get update

    test@test:~$ sudo apt-get install -y adb

  1. Then connect network adb on Ubuntu PC
  2. test@test:~$ adb connect 192.168.1.xxx:5555 (Need to be modified to the IP address of the development board)

    * daemon not running; starting now at tcp:5037

    * daemon started successfully

    connected to 192.168.1.xxx:5555


    test@test:~$ adb devices

    List of devices attached

    192.168.1.xxx:5555 device

  1. Then you can log in to the android system through adb shell on Ubuntu PC
  2. test@test:~$ adb shell

    apollo-p2:/ #

Use data cable to connect adb debugging

  1. 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.
Zero2w-img304.png Zero2w-img305.png
  1. Install adb tool on Ubuntu PC
  2. test@test:~$ sudo apt-get update

    test@test:~$ sudo apt-get install -y adb

  1. Check whether the ADB device is recognized
  2. test@test:~$ adb devices

    List of devices attached

    4c00146473c28651dd0 device

  1. Then you can log in to the android system through adb shell on Ubuntu PC
  2. test@test:~$ adb shell

    apollo-p2:/ $

View how to set HDMI display resolution

  1. Enter first Settings

    Zero2w-img306.png

  2. Then select Device Preferences

    Zero2w-img307.png

  3. Then select Display & Sound

    Zero2w-img308.png

  4. Then select Advanced display settings

    Zero2w-img309.png

  5. Then select HDMI output mode

    Zero2w-img310.png

  6. 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.

    Zero2w-img311.png

  7. The HDMI output of the development board supports 4K display. When connected to a 4K TV, you can see the 4K resolution option.

    Zero2w-img312.png

HDMI to VGA display test

  1. First you need to prepare the following accessories

    1. HDMI to VGA converter
    2. Zero2w-img144.png

    1. A VGA cable and a Mini HDMI male to HDMI female adapter
    2. Zero2w-img145.png Zero2w-img146.png

    1. A monitor or TV that supports VGA interface
  1. HDMI to VGA display test is as follows
  2. Zero2w-img313.png

    When using HDMI to VGA display, the development board and the 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.

WI-FI connection method

  1. Choose first Settings
Zero2w-img306.png
  1. Then select Network & Internet
  2. Zero2w-img314.png

  1. Then turn on WI-FI
  2. Zero2w-img315.png

  1. After turning on WI-FI, you can see the searched signals under Available networks.
  2. Zero2w-img316.png

  1. After selecting the WI-FI you want to connect to, the password input interface shown below will pop up.
  2. Zero2w-img317.png

  1. 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.
  2. Zero2w-img318.png

  1. The display after successful WI-FI connection is as shown below
  2. Zero2w-img319.png

How to use WI-FI hotspot

  1. First, please make sure that the Ethernet port is connected to the network cable and can access the Internet normally.
  2. Then select Settings
Zero2w-img306.png
  1. Then select Network & Internet
  2. Zero2w-img314.png

  1. Then select WIFI hotspot
  2. Zero2w-img320.png

  1. 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)
  2. Zero2w-img321.png

  1. 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_7132) 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.
  2. Zero2w-img322.png

  1. 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 WI-FI Hotspot of the development board can be used normally.
  2. Zero2w-img323.png

How to check the IP address of the Ethernet port

  1. 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.
Zero2w-img107.png
  1. Then make sure the network port of the expansion board is connected to the router or switch

  2. Then open Settings

    Zero2w-img324.png

  3. Then select Network & Internet

    Zero2w-img325.png

  4. Then you can see the IP address of the development board's wired network port at the location shown in the picture below.

    Zero2w-img326.png

Bluetooth connection method

  1. Choose first Settings
Zero2w-img306.png
  1. Then select Bluetooth
  2. Zero2w-img327.png

  1. Then Open Bluetooth Enable
  2. Zero2w-img328.png

  1. Then click Pair new deviceto start scanning for surrounding Bluetooth devices
  2. Zero2w-img329.png

  1. The searched Bluetooth devices will be displayed under Available devices
  2. Zero2w-img330.png

  1. Then click on the Bluetooth device you want to connect to start pairing. When the following interface pops up, please use the mouse to select the Pairoption
  2. Zero2w-img331.png

  1. 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.
  2. Zero2w-img332.png

  1. After pairing is completed, open Paired devices and you will see the paired Bluetooth devices.
  2. Zero2w-img333.png

  1. 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.
  2. Zero2w-img334.png

  1. Pictures received by the Bluetooth system of the development board Android system can be viewed in Received files.
  2. Zero2w-img335.png

How to set USB0 to HOST mode

As shown in the figure below, there are two Type-C interfaces 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.

Zero2w-img160.png

USB0 of the 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 power supply, so that USB1 can be directly used to connect USB devices .

If you want to use USB0 to connect USB devices, you need to set USB0 to HOST mode. The method is as follows:

  1. Run the following command to set USB0 to HOST mode:
  2. apollo-p2:/ # cat /sys/devices/platform/soc@3000000/soc@3000000\:usbc0@0/usb_host

    host_chose finished!

    apollo-p2:/ #

  1. Run the following command to switch back to Device mode
  2. apollo-p2:/ # cat /sys/devices/platform/soc@3000000/soc@3000000\:usbc0@0/usb_device

    device_chose finished!

    apollo-p2:/ #

  1. The command to view the current mode of USB0 is
  2. apollo-p2:/ # cat /sys/devices/platform/soc@3000000/soc@3000000\:usbc0@0/otg_role

    usb_host

How to use USB camera

  1. First insert the USB (UVC protocol) camera into the USB interface of the development board
  2. If the USB camera is recognized normally, the corresponding video device node will be generated under /dev

console:/ # ls /dev/video0

/dev/video0

  1. 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 "How to use ADB".

  2. Download the USB camera test APP from the official tool on the development board information download page

  3. Zero2w-img336.png

    Zero2w-img337.png

  1. 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.
  2. test@test:~$ adb install usbcamera.apk

  1. After installation, you can see the startup icon of the USB camera on the Android desktop.
  2. Zero2w-img338.png

  1. Then double-click to open the USB camera APP and you can see the output video of the USB camera.

Android system ROOT description

The Android system released by Orange Pi has been ROOT and can be tested using the following method.

  1. Download from the official tool on the development board data download page rootcheck.apk
Zero2w-img336.png
Zero2w-img339.png
  1. 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 "How to use ADB".

  2. 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.

  3. test@test:~$ adb install rootcheck.apk

  1. After installation, you can see the startup icon of the ROOT test tool on the Android desktop.
  2. Zero2w-img340.png

  1. The display interface after opening the ROOT test tool for the first time is as shown below
  2. Zero2w-img341.png

  1. 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.
  2. Zero2w-img342.png

How to use MiracastReceiver to cast the mobile phone screen to the development board

  1. 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.

  2. Then open the MiracastReceiverapplication in the Android system of the development board

    Zero2w-img343.png

  3. The interface after MiracastReceiver is opened is as follows

    Zero2w-img344.png

  4. 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.

    Zero2w-img345.png

  5. 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.

    Zero2w-img346.png

  6. 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

    Zero2w-img347.png

  7. Then you can see the content of the mobile phone screen on the HDMI screen connected to the development board

    Zero2w-img348.png

Method of turning on and off the machine through buttons or infrared remote control

We 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.

Zero2w-img107.png

The location of the power button on the 24pin expansion board is as shown in the figure below:

Zero2w-img269.png

The location of the infrared remote control power button is as follows:

Zero2w-img349.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 figure below, and then select OK to shut down the Android system.

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.

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.

40pin GPIO port test method

  1. First open wiringOP APP on the desktop
Zero2w-img351.png
  1. Then click the GPIO_TEST button to open the GPIO test interface
  2. Zero2w-img352.png

  1. 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 theBLINK 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.
  2. Zero2w-img353.png

  1. Then click the GPIO READALL button, and the output information is as shown below:
  2. Zero2w-img354.png

  1. 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.
  2. Zero2w-img355.png

  1. 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.
  2. Zero2w-img356.png

  1. 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.
  2. Zero2w-img357.png

  1. 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.
  2. Zero2w-img358.png

40pin UART test method

  1. 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.
GPIO NO. GPIO Function Pin
3.3V 1
264 PI8 TWI1-SDA 3
263 PI7 TWI1-SCL 5
269 PI13 PWM3 7
GND 9
226 PH2 UART5_TX 11
227 PH3 UART5_RX 13
261 PI5 UART2_TX 15
3.3V 17
231 PH7 SPI1_MOSI 19
232 PH8 SPI1_MISO 21
230 PH6 SPI1_CLK 23
GND 25
266 PI10 TWI2-SDA 27
256 PI0 29
271 PI15 31
268 PI12 PWM2 33
258 PI2 35
272 PI16 37
GND 39
Pin Function GPIO GPIO NO.
2 5V
4 5V
6 GND
8 UART0_TX PH0 224
10 UART0_RX PH1 225
12 PI1 257
14 GND
16 PWM4 PI14 270
18 PH4 228
20 GND
22 UART2_RX PI6 262
24 SPI1_CS0 PH5 229
26 SPI1_CS1 PH9 233
28 TWI2-SCL PI9 265
30 GND
32 PWM1 PI11 267
34 GND
36 PC12 76
38 PI4 260
40 PI3 259
  1. The device node corresponding to uart2 is /dev/ttyAS2, and the device node corresponding to uart5 is/dev/ttyAS5
  2. apollo-p2:/ # ls /dev/ttyAS*

    /dev/ttyAS0      /dev/ttyAS1      /dev/ttyAS2      /dev/ttyAS5

  1. First open wiringOP APP on the desktop
  2. Zero2w-img351.png

  1. Then click the UART_TESTbutton to open the UART test interface
  2. Zero2w-img359.png

  1. The serial port test interface of wiringOP is as shown in the figure below
  2. Zero2w-img360.png

  1. Then select the /dev/ttyAS2 or/dev/ttyAS5 node in the selection box

    Zero2w-img361.png

  2. 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.

  3. Zero2w-img362.png

  1. Then use Dupont wire to short the rx and tx pins of uart

  2. Then you can enter a paragraph of characters in the send edit box below and click the SEND button to start sending.

  3. Zero2w-img363.png

  1. If everything is normal, the received string will be displayed in the receiving box
  2. Zero2w-img364.png

40pin SPI test method

  1. 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
GPIO NO. GPIO Function Pin
3.3V 1
264 PI8 TWI1-SDA 3
263 PI7 TWI1-SCL 5
269 PI13 PWM3 7
GND 9
226 PH2 UART5_TX 11
227 PH3 UART5_RX 13
261 PI5 UART2_TX 15
3.3V 17
231 PH7 SPI1_MOSI 19
232 PH8 SPI1_MISO 21
230 PH6 SPI1_CLK 23
GND 25
266 PI10 TWI2-SDA 27
256 PI0 29
271 PI15 31
268 PI12 PWM2 33
258 PI2 35
Pin Function GPIO GPIO NO.
2 5V
4 5V
6 GND
8 UART0_TX PH0 224
10 UART0_RX PH1 225
12 PI1 257
14 GND
16 PWM4 PI14 270
18 PH4 228
20 GND
22 UART2_RX PI6 262
24 SPI1_CS0 PH5 229
26 SPI1_CS1 PH9 233
28 TWI2-SCL PI9 265
30 GND
32 PWM1 PI11 267
34 GND
36 PC12 76
  1. The device node corresponding to SPI1 CS0 is /dev/spidev1.0, and the device node corresponding to SPI1 CS1 is /dev/spidev1.1
  2. apollo-p2:/ # ls /dev/spidev1.*

    /dev/spidev1.0      /dev/spidev1.1

  1. Here is a demonstration to test the SPI1 interface through the w25qxx module. First, connect the w25qxx module to the SPI1 interface.
  2. 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.

  1. Then open wiringOP APP on the desktop
  2. Zero2w-img351.png

  1. Then click the SPI_TEST button to open the SPI test interface
  2. Zero2w-img365.png

  1. 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

    Zero2w-img366.png

  2. Then click the OPEN button to initialize the SPI

  3. Zero2w-img367.png

  1. 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
  2. Zero2w-img368.png

  1. Finally, the APP will display the read ID information of the onboard SPI Flash.
  2. Zero2w-img369.png

  1. If the w25qxx module connected to 40pin SPI1 is read, the ID information of the onboard SPI Flash is also similar.

40pin I2C test method

  1. As can be seen from the table below, the Android12 TV system has i2c1 and i2c2 turned on by default.
GPIO NO. GPIO Function Pin
3.3V 1
264 PI8 TWI1-SDA 3
263 PI7 TWI1-SCL 5
269 PI13 PWM3 7
GND 9
226 PH2 UART5_TX 11
227 PH3 UART5_RX 13
261 PI5 UART2_TX 15
3.3V 17
231 PH7 SPI1_MOSI 19
232 PH8 SPI1_MISO 21
230 PH6 SPI1_CLK 23
GND 25
266 PI10 TWI2-SDA 27
256 PI0 29
271 PI15 31
268 PI12 PWM2 33
258 PI2 35
272 PI16 37
GND 39
Pin Function GPIO GPIO NO.
2 5V
4 5V
6 GND
8 UART0_TX PH0 224
10 UART0_RX PH1 225
12 PI1 257
14 GND
16 PWM4 PI14 270
18 PH4 228
20 GND
22 UART2_RX PI6 262
24 SPI1_CS0 PH5 229
26 SPI1_CS1 PH9 233
28 TWI2-SCL PI9 265
30 GND
32 PWM1 PI11 267
34 GND
36 PC12 76
38 PI4 260
40 PI3 259
  1. The device node corresponding to i2c1 is /dev/i2c-1, and the device node corresponding to i2c2 is /dev/i2c-2
  2. apollo-p2:/ # ls /dev/i2c-*

    /dev/i2c-1      /dev/i2c-2      /dev/i2c-5

  1. First open wiringOP APP on the desktop
  2. Zero2w-img351.png

  1. Then click the I2C_TEST button to open the i2c test interface
  2. Zero2w-img370.png

  1. The i2c test interface of wiringOP is shown in the figure below
  2. Zero2w-img371.png

  1. Then click the device node selection box in the upper left corner to select the i2c you want to test
  2. Zero2w-img372.png

  1. Then connect an i2c device to the 40pin i2c pin. Here we take the ds1307 rtc module as an example.
  2. Zero2w-img178.png

  1. 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.

    apollo-p2:/ # i2cdetect -y 1

    Or

    apollo-p2:/ # i2cdetect -y 2

    Zero2w-img373.png

  2. Then set the i2c address to 0x68 in wiringOP, and then click the OPEN button to open i2c

    Zero2w-img374.png

  3. After clicking the OPEN button to open i2c, the display is as follows

    Zero2w-img375.png

  4. Then we test writing a value to the register of the rtc module, for example, writing 0x55 to the 0x1c address

    1. We first set the address of the register to be written to 0x1c

      Zero2w-img376.png

    2. Then set the value to be written to 0x55

      Zero2w-img377.png

    3. Then click the WRITE BYTE button to perform the writing action

      Zero2w-img378.png

  5. 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.

    Zero2w-img379.png

40pin PWM test

  1. As can be seen from the table below, the available pwm are pwm1, pwm2, pwm3 and pwm4.
GPIO NO. GPIO Function Pin
3.3V 1
264 PI8 TWI1-SDA 3
263 PI7 TWI1-SCL 5
269 PI13 PWM3 7
GND 9
226 PH2 UART5_TX 11
227 PH3 UART5_RX 13
261 PI5 UART2_TX 15
3.3V 17
231 PH7 SPI1_MOSI 19
232 PH8 SPI1_MISO 21
230 PH6 SPI1_CLK 23
GND 25
266 PI10 TWI2-SDA 27
256 PI0 29
271 PI15 31
268 PI12 PWM2 33
258 PI2 35
272 PI16 37
GND 39
Pin Function GPIO GPIO NO.
2 5V
4 5V
6 GND
8 UART0_TX PH0 224
10 UART0_RX PH1 225
12 PI1 257
14 GND
16 PWM4 PI14 270
18 PH4 228
20 GND
22 UART2_RX PI6 262
24 SPI1_CS0 PH5 229
26 SPI1_CS1 PH9 233
28 TWI2-SCL PI9 265
30 GND
32 PWM1 PI11 267
34 GND
36 PC12 76
38 PI4 260
40 PI3 259
  1. First click the wiringOP icon to open wiringOP APP
  2. Zero2w-img351.png

  1. Then click the PWM_TEST button on the main interface of wiringOP to enter the PWM test interface
  2. Zero2w-img380.png

  1. The PWM test interface is as follows
  2. Zero2w-img381.png

  1. 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.
  2. Zero2w-img382.png

  1. Then you can set the PWM period. The default configuration is 50000ns. The converted PWM frequency is 20KHz
  2. Zero2w-img383.png

  1. Then click the EXPORTbutton to export PWM
  2. Zero2w-img384.png

  1. Then drag the progress bar below to change the PWM duty cycle, and then check Enable to output the PWM waveform.
  2. Zero2w-img385.png

  1. Then use an oscilloscope to measure the corresponding pins in the 40pin development board and you can see the following waveform.
  2. Zero2w-img386.png

How to compile Android 12 source code

Download the source code of Android 12

  1. 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

    1. Google Cloud Drive
    2. Zero2w-img387.png

  1. 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:
  2. test@test:~$ md5sum -c H618-Android12-Src.tar.gz.md5sum

    H618-Android12-Src.tar.gzaa: OK

    H618-Android12-Src.tar.gzab: OK

    ......

  1. Then you need to merge multiple compressed files into one, and then extract the Android source code. The command looks like this:
  2. test@test:~$ cat H618-Android12-Src.tar.gza* > H618-Android12-Src.tar.gz

    test@test:~$ tar -xvf H618-Android12-Src.tar.gz

  1. Then unzip the compressed package of the files modified by Orange Pi Zero2w
  2. test@test:~$ tar zxf opizero2w_android12_patches.tar.gz

    test@test:~$ ls

    opizero2w_android12_patches opizero2w_android12_patches.tar.gz

  1. Then copy the files modified by Orange Pi Zero2w to the Android source code
  2. test@test:~$ cp -rf opizero2w_android12_patches/* H618-Android12-Src/

Compile the source code of Android 12

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:

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.

  1. First install the software packages needed to compile Android12 source code

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

  1. Then compile the code in the longan folder, which mainly contains u-boot and linux kernel

    1. First run ./build.sh config to set compilation options
    2. test@test:~$ cd H618-Android12-Src/longan

      test@test:~/H618-Android12-Src/longan$ ./build.sh config


      Welcome to mkscript setup progress

      All available platform:

      0. android

      1. linux

      Choice [android]: 0

      All available ic:

      0. h618

      Choice [h618]: 0

      All available board:

      0. ft

      1. p1

      2. p2

      3. p7

      4. p7l

      5. perf1

      6. perf2

      7. perf3

      8. qa

      Choice [p2]: 2

      All available flash:

      0. default

      1. nor

      Choice [default]: 0

      All available kern_ver:

      0. linux-5.4

      Choice [linux-5.4]: 0

      All available arch:

      0. arm

      1. arm64

      Choice [arm64]: 1

      ......

      *** Default configuration is based on 'sun50iw9p1smp_h618_android_defconfig'

      #

      # configuration written to .config

      #

      make[1]: Leaving directory '/home/test/H618-Android12-Src/longan/out/kernel/build'

      make: Leaving directory '/home/test/H618-Android12-Src/longan/kernel/linux-5.4'

      INFO: clean buildserver

      INFO: prepare_buildserver

    1. Then run the ./build.sh script to start compilation.
    2. test@test:~/H618-Android12-Src/longan$ ./build.sh

    1. After compilation is completed, you will see the following output
    2. 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: ----------------------------------------

  1. Then use the following command to compile the Android source code and generate the final Android image
  2. 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

  1. The storage path of the Android image generated by compilation is:

    longan/out/h618_android12_p2_uart0.img

Appendix

User manual update history

Version Date Release Notes
v1.0 2023-09-14 initial version

Image update history

Date Release Notes
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


  • initial version