8,367
edits
Changes
Created page with "'''Orange Pi 4A''' '''User Manual''' <div class="figure"> 575x419px|_MG_3225 </div> <span id="basic-characteristics-of-orange-pi-4a"></s..."
'''Orange Pi 4A'''
'''User Manual'''
<div class="figure">
[[File:Orange_Pi_4A-image2.jpeg|575x419px|_MG_3225]]
</div>
<span id="basic-characteristics-of-orange-pi-4a"></span>
= Basic characteristics of Orange Pi 4A =
<span id="what-is-orange-pi-4a"></span>
== What is Orange Pi 4A ==
The Orange Pi 4A adopts the Allwinner T527 eight core Cortex-A55+HiFI4 DSP+RISV-V multi-core heterogeneous industrial grade processor, supporting 2TOPS NPU to meet the needs of edge intelligent AI acceleration applications; Supports 2GB/4GB LPDDR4/4X and provides H.265 4K@60fps And H.264 4K@60fps Video decoding, H.264 4K@25fps code; Rich interfaces, including commonly used functional interfaces such as Gigabit Ethernet, PCIe 2.0, USB 2.0, MIPI-CSI, MIPI-DSI, 40Pin expansion interface, etc. Supports operating systems such as Ubuntu, Debian, Android 13, etc.
Orange Pi 4A can provide a solid hardware foundation for the scenario landing of generative AI and artificial intelligence algorithms, and can be widely used in intelligent industrial control, intelligent business display, retail payment, intelligent education, commercial robots, vehicle terminals, visual assistant driving, edge computing, intelligent power distribution terminals, etc.
<span id="the-purpose-of-orange-pi-4a"></span>
== The purpose of Orange Pi 4A ==
We can use it to achieve:
* A small Linux desktop computer
* A small Linux network server
* Android tablet
* Android game consoles, etc
'''Of course, there are many other features as well. With a powerful ecosystem and various expansion accessories, Orange Pi can help users easily achieve delivery from creativity to prototype to mass production. It is an ideal creative platform for makers, dreamers, and hobbyists.'''
<span id="who-is-orange-pi-4a-designed-for"></span>
== Who is Orange Pi 4A designed for ==
Orange Pi development board is not only a consumer product, but also designed for anyone who wants to use technology for creative innovation. It is a simple, fun, and practical tool that you can use to create the world around you.
<span id="hardware-features-of-orange-pi-4a"></span>
== Hardware Features of Orange Pi 4A ==
{| class="wikitable"
|-
| style="text-align: center;"| '''Introduction to Hardware Features'''
| style="text-align: center;"|
|-
| style="text-align: center;"| '''Processor'''
| style="text-align: center;"| <span class="mark">T527</span>,8-core ARM CortexTM-A55@1.8GHz
HIFI4 Audio DSP@600MHz
RISC-V@200MHz
GPU:G57 MC1
VPU: H.265 4K@60fps Decoding, H.264 4K@60fps Decoding, H.264 4K@25fps code
<span class="mark">NPU:2TOPS</span>
|-
| style="text-align: center;"| '''Memory'''
| style="text-align: center;"| LPDDR4/4X:2GB/4GB optional
|-
| style="text-align: center;"| '''Storage'''
| style="text-align: center;"| EMMC module optional: 16GB/32GB/64GB/128GB optional
<span class="mark">SPI Flash:128Mb (default paste), 256Mb optional</span>
M.2 M-KEY Socket:PCIe2.0 NVMe SSD
uSD card slot:supports up to 128GB uSD card
|-
| style="text-align: center;"| '''Wi Fi+Bluetooth'''
| style="text-align: center;"| Wi Fi+Bluetooth two in one module
Wi-Fi5.0+BT 5.0,BLE
|-
| style="text-align: center;"| '''Ethernet'''
| style="text-align: center;"| <span class="mark">10/100/1000Mbps Ethernet</span>
|-
| style="text-align: center;"| '''Display'''
| style="text-align: center;"| 1x HDMI TX 2.0 interface up to 4K@60fps
1x 4-lane MIPI-DSI
1x eDP1.3
|-
| style="text-align: center;"| '''Camera'''
| style="text-align: center;"| 1x 2-lane MIPI-CSI camera interface
1x 4-lane MIPI-CSI camera interface
|-
| style="text-align: center;"| '''USB'''
| style="text-align: center;"| <span class="mark">1xUSB Type-A 2.0</span>
<span class="mark">3xUSB Type-A 2.0 HOS</span><span class="mark">T</span>
1xUSB 2.0 HOST reserved for customer expansion
|-
| style="text-align: center;"| '''ADC'''
| style="text-align: center;"| Reserved 4pin interface, capable of connecting 2 ADCs, with a maximum input of 1.8V
|-
| style="text-align: center;"| '''Audio frequency'''
| style="text-align: center;"| 3.5mm headphone jack audio input/output
|-
| style="text-align: center;"| '''Key'''
| style="text-align: center;"| 1* BOOT,1*RESET,1 *PWR ON
|-
| style="text-align: center;"| '''RTC'''
| style="text-align: center;"| 2Pin backup battery interface (Pitch=1.27mm)
|-
| style="text-align: center;"| '''40Pin'''
| style="text-align: center;"| 40Pin function extension interface, supporting the following interface types:
<span class="mark">GPIO、UART、I2C、SPI、PWM</span>
|-
| style="text-align: center;"| '''DEBUG'''
| style="text-align: center;"| <span class="mark">3Pin debugging serial port</span>
|-
| style="text-align: center;"| '''Power Supply'''
| style="text-align: center;"| <span class="mark">Type-C 5V 5A DCIN</span>
|-
| style="text-align: center;"| '''Supported OS'''
| style="text-align: center;"| Ubuntu、Debian、Android13, etc
|-
| style="text-align: center;"| '''Introduction to appearance specifications'''
| style="text-align: center;"|
|-
| style="text-align: center;"| '''PCB'''
| style="text-align: center;"| 89mm*56mm*1.6mm
|-
| style="text-align: center;"| '''Weight'''
| style="text-align: center;"| 52g
|}
<span id="top-and-bottom-views-of-range-pi-4a"></span>
== Top and Bottom Views of Range Pi 4A ==
'''Top level view:'''
[[File:Orange_Pi_4A-image3.png|439x269px]]
'''Bottom level view:'''
[[File:Orange_Pi_4A-image4.png|448x278px]]
<span id="interface-details-of-range-pi-4a"></span>
== Interface Details of Range Pi 4A ==
<div class="figure">
[[File:Orange_Pi_4A-image5.png|466x746px|1731934096557]]
</div>
[[File:Orange_Pi_4A-image6.png|575x251px]]
'''The diameter of the four positioning holes is 3.0mm.'''
<span id="introduction-to-using-the-development-board"></span>
= '''Introduction to using the development board''' =
<span id="prepare-the-necessary-accessories"></span>
== Prepare the necessary accessories ==
<ol style="list-style-type: decimal;">
<li><p>TF card, high-speed SanDisk card with a minimum capacity of 8GB and class 10 or above</p>
<p>[[File:Orange_Pi_4A-image7.png|124x96px]]</p></li>
<li><p>TF card reader, used for reading and writing TF cards</p>
<p>[[File:Orange_Pi_4A-image8.png|139x96px]]</p></li>
<li><p>HDMI interface display</p>
<p>[[File:Orange_Pi_4A-image9.png|313x205px]]</p></li>
<li><p>HDMI to HDMI cable, used to connect the development board to an HDMI monitor or TV for display</p>
<p>[[File:Orange_Pi_4A-image10.png|199x129px]]</p></li>
<li><p>10.1-inch MIPI screen, used to display the system interface of the development board (this screen includes adapter board and OPi5Plus/OPi5B/OPi5Pro/OPi5Max/OPi4A universal)</p>
<div class="figure">
[[File:Orange_Pi_4A-image11.jpeg|223x203px|IMG_7546]]
</div></li>
<li><p>Power adapter, Orange Pi 4A recommends using a 5V/5A Type-C power supply for power supply</p>
<p>[[File:Orange_Pi_4A-image12.png|196x152px]]</p>
<p>'''The Type-C power interface of the development board does not support PD negotiation function and only supports a fixed 5V voltage input.'''</p></li>
<li><p>USB interface mouse and keyboard, any standard USB interface mouse and keyboard can be used to control the Orange Pi development board</p>
<p>[[File:Orange_Pi_4A-image13.png|224x191px]]</p></li>
<li><p>USB camera</p>
<p>[[File:Orange_Pi_4A-image14.png|255x148px]]</p></li>
<li><p>100Mbps or 1G Ethernet cable, used to connect the development board to the Internet</p>
<p>[[File:Orange_Pi_4A-image15.png|143x112px]]</p></li>
<li><p>A 5V cooling fan, as shown in the figure below, has a dedicated 5V output interface on the development board for connecting to the cooling fan, with a spacing of '''2.54mm'''. The power interface of the cooling fan can be purchased according to this specification.</p>
<p>'''Note that once the development board is plugged in, the 5V pin can be used directly without any additional settings. Additionally, the voltage output from the 5V pin cannot be adjusted or turned off through software.'''</p>
<p>[[File:Orange_Pi_4A-image16.png|420x124px]]</p></li>
<li><p>USB 2.0 male to male data cable, used for adb debugging, burning images to eMMC and other functions</p>
<div class="figure">
[[File:Orange_Pi_4A-image17.png|158x155px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]
</div></li>
<li><p>When using the serial port debugging function, USB to TTL module and DuPont cable are required to connect the development board and computer</p>
<p>[[File:Orange_Pi_4A-image18.png|176x145px]] [[File:Orange_Pi_4A-image19.png|305x110px]]</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 above figure, other similar 3.3V USB to TTL modules are generally acceptable.'''</p></li>
<li><p>X64 computer with Ubuntu and Windows operating systems installed</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| 1
| style="text-align: left;"| Ubuntu22.04 PC
| style="text-align: left;"| Optional, used for compiling Android and Linux source code
|-
| style="text-align: left;"| 2
| style="text-align: left;"| Windows PC
| style="text-align: left;"| Used for burning Android and Linux images
|}
<span id="download-the-image-of-the-development-board-and-related-materials"></span>
== Download the image of the development board and related materials ==
# The download link for the Chinese version of the materials is
'''http://www.orangepi.cn/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-4A.html'''
<ol start="2" style="list-style-type: decimal;">
<li><p>The download link for the English version of the material is</p>
<p>'''http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-4A.html'''</p></li>
<li><p>The information mainly includes</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Linux source code''':saved on Github</p></li>
<li><p>'''Android''' '''image''':saved on Google Drive</p></li>
<li><p>'''Ubuntu''' '''image''':saved on Google Drive</p></li>
<li><p>'''Debian image''':saved on Google Drive</p></li>
<li><p>'''User manual and schematic diagram:'''saved on Google Drive</p></li>
<li><p>'''Official tools:'''saved on Google Drive. Mainly including the software required during the use of the development board</p></li></ol>
</li></ol>
<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 ==
'''Note that the Linux image referred to here specifically refers to Linux distribution images such as Debian or Ubuntu downloaded from the Orange Pi data download page.'''
<span id="method-of-burning-linux-images-using-balenaetcher"></span>
=== '''Method of burning Linux images using BalenaEtcher''' ===
# First prepare a TF card with a capacity of 16GB or more. The transmission speed of the TF card must be '''class 10''' or above. It is recommended to use a TF card of SanDisk and other brands
# Then use the card reader to insert the TF card into the computer
# Download the compressed file of the Linux operating system image that you want to burn from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi's download page'''], and then use decompression software to decompress it. In the decompressed file, the file ending with "'''.img'''" is the operating system image file, which is usually over 1GB in size
# Then download the Linux image burning software - '''balenaEtcher''', from the download link
[https://www.balena.io/etcher/ '''https://www.balena.io/etcher/''']
<ol start="5" style="list-style-type: decimal;">
<li><p>After entering the balenaEtcher download page, clicking the green download button will jump to the software download location</p>
<p>[[File:Orange_Pi_4A-image20.png|456x219px]]</p></li>
<li><p>Then you can choose to download the portable version of BalenaEtcher software. The portable version does not require installation and can be opened by double clicking</p>
<p>[[File:Orange_Pi_4A-image21.png|468x173px]]</p></li>
<li><p>If you are downloading a version of balenaEtcher that requires installation, please install it first before using it. If you download the portable version of balenaEtcher, simply double-click to open it. The interface of balenaEtcher after opening is shown in the following figure</p>
<p>[[File:Orange_Pi_4A-image22.png|335x211px]]</p></li></ol>
'''When opening balenaEtcher, if prompted with the following error:'''
[[File:Orange_Pi_4A-image23.png|206x162px]]
'''Please select balenaEtcher and right-click, then choose to run as administrator.'''
<div class="figure">
[[File:Orange_Pi_4A-image24.png|300x104px|图形用户界面, 文本, 应用程序 描述已自动生成]]
</div>
<ol start="8" style="list-style-type: decimal;">
<li><p>The specific steps to use balenaEtcher to burn the Linux image are aa follow</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First select the path of the Linux image file to burned</p></li>
<li><p>Then select the drive letter of the TF card</p></li>
<li><p>Finally, click Flash to start burning the Linux image to the TF card</p>
<div class="figure">
[[File:Orange_Pi_4A-image25.png|501x281px|03]]
</div></li></ol>
</li>
<li><p>The interface displayed during the process of burning a Linux image by balenaEtcher is shown in the following figure. In addition, the progress bar displaying purple indicates that the Linux image is being burned to the TF card</p>
<p>[[File:Orange_Pi_4A-image26.png|506x317px]]</p></li>
<li><p>After the Linux image is burned, balenaEtcher will also verify the image burned to the TF card by default to ensure that there are no problems during the burning process. As shown in the following figure, a green progress bar indicates that the image has been burned and balenaEtcher is verifying the burned image</p>
<p>[[File:Orange_Pi_4A-image27.png|519x325px]]</p></li>
<li><p>After successful burning, the display interface of balenaEtcher is shown in the following figure. If a green indicator icon is displayed, it indicates that the image burning is successful. At this time, you can exit balenaEtcher, then unplug the TF card and insert it into the TF card slot of the development board for use</p>
<div class="figure">
[[File:Orange_Pi_4A-image28.png|523x324px|04]]
</div></li></ol>
<span id="method-of-burning-linux-images-using-win32diskimager"></span>
=== '''Method of burning Linux images using Win32Diskimager''' ===
<ol style="list-style-type: decimal;">
<li><p>First prepare an 8GB or larger capacity TF card, TF card transmission speed must be '''class10''' or above, it is recommended to use Sandisk and other brands of TF card</p></li>
<li><p>Then use the card reader to insert the TF card into the computer</p></li>
<li><p>Then format the TF card</p>
<ol style="list-style-type: lower-alpha;">
<li>You can use '''SD Card Formatter''' to format TF cards. The download address is</li></ol>
</li></ol>
[https://www.sdcard.org/downloads/formatter/eula_windows/SDCardFormatterv5_WinEN.zip '''https://www.sdcard.org/downloads/formatter/eula_windows/SDCardFormatterv5_WinEN.zip''']
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>After downloading the software, decompress and install it. Then open the software</p></li>
<li><p>If only a TF card is inserted into the computer, the drive letter of the TF card will be displayed in the column of "'''Select card'''". 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</p>
<div class="figure">
[[File:Orange_Pi_4A-image29.png|209x228px|选区_199]]
</div></li>
<li><p>Then click "'''Format'''", a warning box will pop up before formatting, select "'''Yes (Y)'''" will start formatting</p></li></ol>
[[File:Orange_Pi_4A-image30.png|304x147px]]
<ol start="5" style="list-style-type: lower-alpha;">
<li><p>After formatting the TF card, the message as shown in the following figure will pop up. Click OK</p>
<p>[[File:Orange_Pi_4A-image31.png|186x149px]]</p></li></ol>
<!-- -->
<ol start="4" style="list-style-type: decimal;">
<li><p>Download the compressed Linux operating system image file you want to burn from [http://www.orangepi.org/html/serviceAndSupport/index.html '''the data download page of Orange Pi'''], and then use the decompression software to decompress it. Files ending with "'''.img''' "in the decompressed files are the image files of the operating system, and the size is generally more than 1GB</p></li>
<li><p>Burn Linux image to TF card using '''Win32Diskimager'''</p>
<ol style="list-style-type: lower-alpha;">
<li>The download page for Win32Diskimager is</li></ol>
</li></ol>
[http://sourceforge.net/projects/win32diskimager/files/Archive/ '''http://sourceforge.net/projects/win32diskimager/files/Archive/''']
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>After downloading, install it directly. The interface of '''Win32Diskimager''' is as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First select the path of the image</p></li>
<li><p>Then confirm that the drive letter of the TF card is consistent with that displayed in the "'''Device'''" column</p></li>
<li><p>Finally click "'''Write'''" to start burn</p>
<div class="figure">
[[File:Orange_Pi_4A-image32.png|297x206px|14]]
</div></li></ol>
</li>
<li><p>After the image writing is completed, click the "'''Exi'''t" button to exit, and then you can pull out the TF card and insert it into the development board to start</p></li></ol>
<span id="method-for-burning-linux-images-to-tf-cards-based-on-ubuntu-pc"></span>
== Method for burning Linux images to TF cards based on Ubuntu PC ==
'''Note that the Linux image referred to here specifically refers to Linux distribution images such as Debian or Ubuntu downloaded from the Orange Pi data download page, while Ubuntu PC refers to a personal computer with the Ubuntu system installed.'''
# Firstly, prepare a TF card with 8GB or larger capacity, and the transfer speed of the TF card must be '''class10''' or above. It is recommended to use TF cards from brands such as SanDisk
# Then use a card reader to insert the TF card into the computer
<!-- -->
# Download the balenaEtcher software from the following link:
[https://www.balena.io/etcher/ '''https://www.balena.io/etcher/''']
<ol start="2" style="list-style-type: decimal;">
<li><p>After entering the balenaEtcher download page, clicking the green download button will jump to the software download location</p>
<p>[[File:Orange_Pi_4A-image20.png|489x235px]]</p></li>
<li><p>Then choose to download the Linux version of the software</p>
<p>[[File:Orange_Pi_4A-image33.png|485x184px]]</p></li>
<li><p>Download the compressed file of the Linux operating system image that you want to burn from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi download page'''], and then use decompression software to decompress it. In the decompressed file, the file ending with "'''.img'''" is the operating system image file, which is usually over 1GB in size. The decompression command for the compressed file ending in 7z is as follows:</p>
<p>test@test:~$ '''7z x Orangepi4a_1.0.0_ubuntu_jammy_desktop_linux5.15.147.7z'''</p>
<p>test@test:~$ '''ls Orangepi4a_1.0.0_ubuntu_jammy_desktop_linux5.15.147.*'''</p>
<p>Orangepi4a_1.0.0_ubuntu_jammy_desktop_linux5.15.147.7z '''Orangepi4a_1.0.0_ubuntu_jammy_desktop_linux5.15.147.sha''' #Verification and file</p>
<p>'''Orangepi4a_1.0.0_ubuntu_jammy_desktop_linux5.15.147.img''' #Image file</p></li>
<li><p>After decompressing the image, you can first use the '''sha256sum -c *.sha''' command to calculate if the checksum is correct. If the prompt is '''successful''', it means that the downloaded image is correct and can be safely burned to the TF card. If the prompt is that the '''checksum does not match''', it means that the downloaded image has a problem. Please try downloading it again</p>
<p>test@test:~$ '''sha256sum -c *.sha'''</p>
<p>Orangepi4a_1.0.0_ubuntu_jammy_desktop_linux5.15.147.img: '''success'''</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 displayed after opening balenaEtcher is shown in the following figure</p>
<p>[[File:Orange_Pi_4A-image34.png|423x251px]]</p></li>
<li><p>The specific steps for burning a Linux image using balenaEtcher are as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First select the path of the Linux image file to burned</p></li>
<li><p>Then select the drive letter of the TF card</p></li>
<li><p>Finally, click Flash to start burning the Linux image to the TF card</p>
<div class="figure">
[[File:Orange_Pi_4A-image25.png|501x281px|03]]
</div></li></ol>
</li>
<li><p>The interface displayed during the process of burning a Linux image by balenaEtcher is shown in the following figure. In addition, the progress bar displaying purple indicates that the Linux image is being burned to the TF card</p>
<p>[[File:Orange_Pi_4A-image35.png|576x247px]]</p></li>
<li><p>After the Linux image is burned, balenaEtcher will also verify the image burned to the TF card by default to ensure that there are no problems during the burning process. As shown in the following figure, a green progress bar indicates that the image has been burned and balenaEtcher is verifying the burned image</p>
<p>[[File:Orange_Pi_4A-image36.png|576x252px]]</p></li>
<li><p>After successful burning, the display interface of balenaEtcher is shown in the following figure. If a green indicator icon is displayed, it indicates that the image burning is successful. At this time, you can exit balenaEtcher, then unplug the TF card and insert it into the TF card slot of the development board for use</p>
<p>[[File:Orange_Pi_4A-image37.png|576x340px]]</p></li></ol>
<span id="method-for-burning-linux-images-to-emmc"></span>
== Method for burning Linux images to eMMC ==
[[#method-for-burning-linux-images-to-emmc|See the method of burning Linux images to EMMC]]
<span id="method-of-burning-android-image-to-tf-card"></span>
== Method of burning Android image to TF card ==
'''The Android image of the development board can only be burned to a TF card using PhoenixCard software on the Windows platform, and the version of PhoenixCard software must be PhonixCard-4.2.8.'''
'''Please do not use software that burns 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 not possible to burn Android images to TF cards on Linux and Mac platforms.'''
<ol style="list-style-type: decimal;">
<li><p>Firstly, please ensure that the Windows system has installed '''Microsoft Visual C++ 2008 Redistrbutable - x86'''</p>
<p>[[File:Orange_Pi_4A-image38.png|449x293px]]</p></li>
<li><p>If '''Microsoft Visual C++ 2008 Redistrbutable - x86''' is not installed, formatting the TF card with '''PhoenixCard''' or burning the Android image will prompt the following error</p>
<div class="figure">
[[File:Orange_Pi_4A-image39.png|527x369px|NUQB$Q%(){1CV6M6WK4N`5J]]
</div></li>
<li><p>The installation package for '''Microsoft Visual C++ 2008 Redistrbutable - x86''' can be downloaded from the '''[http://www.orangepi.org/html/serviceAndSupport/index.html official tool]''' of Orange Pi 4A or from the [https://www.microsoft.com/zh-cn/download/details.aspx?id=26368 '''Microsoft official website''']</p>
<p>[[File:Orange_Pi_4A-image40.png|240x93px]] [[File:Orange_Pi_4A-image41.png|200x95px]]</p></li>
<li><p>Firstly, prepare a TF card with 8GB or larger capacity, and the transfer speed of the TF card must be '''class10''' or above. It is recommended to use TF cards from brands such as SanDisk</p></li>
<li><p>Then use a 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's download page''']. Please ensure that the version of the PhonenixCrad tool is '''PhonexCard-4.2.8. Do not use PhonixCard software below version 4.2.8 to burn the Android image''', as Android images burned by PhonixCard tools below this version may have problems</p>
<div class="figure">
[[File:Orange_Pi_4A-image42.jpeg|576x169px|微信图片_20241119192834]]
</div></li>
<li><p>Then use decompression software to decompress the downloaded Android image compressed file. In the decompressed file, the file ending with "'''.img'''" is the Android image file, with a size of 1GB or more. If you don't know how to decompress the compressed file of an Android image, you can install a '''360 compression software''' to decompress the image.</p>
<p>[[File:Orange_Pi_4A-image43.png|438x158px]]</p></li>
<li><p>Then use decompression software to extract '''PhonixCard4.2.8.zip'''. This software does not require installation, just find PhoenixCard in the extracted folder and open it</p>
<p>[[File:Orange_Pi_4A-image44.png|576x113px]]</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 it is not displayed, you can try unplugging the TF card or clicking the "'''Refresh Drive Letter'''" button in PhoenixCard</p></li></ol>
[[File:Orange_Pi_4A-image45.png|575x137px]]
<ol start="10" style="list-style-type: decimal;">
<li><p>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)</p>
<div class="figure">
[[File:Orange_Pi_4A-image46.jpeg|576x317px|微信图片_20241119192853]]
</div>
<p>'''If there is a problem with formatting, please try unplugging and unplugging the TF card before testing again. If the problem persists after unplugging and unplugging the TF card again, you can restart your Windows computer or switch to another computer and try again.'''</p></li>
<li><p>Then start writing the Android image to the TF card</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Firstly, select the path of the Android image in the "'''Firmware'''" column</p></li>
<li><p>Select "'''Startup Card'''" in the "'''Types of Cards to Make'''" section</p></li>
<li><p>Then click the "'''Burn Card'''" button to start burning</p>
<div class="figure">
[[File:Orange_Pi_4A-image47.jpeg|576x452px|微信图片_20241119192912]]
</div></li></ol>
</li>
<li><p>After burning, the display of PhoenixCard is shown in the following figure. Click the "'''Close'''" button to exit PhoenixCard, and then you can unplug the TF card from the computer and insert it into the development board to start it</p>
<p>[[File:Orange_Pi_4A-image48.png|575x452px]]</p>
<p>'''After burning the Android system, only one 128 MB partition can be seen on the TF card in Windows, as shown in the following figure (some computers may pop up more than twenty disk partitions, but can only open the 128 MB partition). Please note that this is normal and do not burn out the TF card. The reason for this is that the Android system has over twenty partitions, but most of them cannot be recognized properly in the Windows system. At this point, please feel free to unplug the TF card and insert it into the development board to start.'''</p>
<p>[[File:Orange_Pi_4A-image49.png|193x45px]]</p>
<p>'''After starting the Android system, use the following command to see these twenty partitions in the TF card:'''</p>
<p>[[File:Orange_Pi_4A-image50.png|391x116px]]</p>
<p>'''Using the df -h command, you can see that after burning the 32GB TF card to the Android system, there is still approximately 24GB of space available for use (not all of the twenty partitions will be mounted to the Android system, so focus on the visible partitions).'''</p>
<p>[[File:Orange_Pi_4A-image51.png|371x192px]]</p></li></ol>
<span id="method-for-burning-android-images-to-emmc"></span>
== Method for burning Android images to eMMC ==
'''The Android image of the development board can only be burned to eMMC using PhoenixCard software on the Windows platform, and the version of PhoenixCard software must be PhonixCard-4.2.8.'''
'''Please do not use software that burns 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 not possible to burn Android images to eMMC on Linux and Mac platforms.'''
<ol style="list-style-type: decimal;">
<li><p>The development board has reserved an expansion interface for the eMMC module. Before burning the system to eMMC, it is necessary to purchase an eMMC module that matches the eMMC interface of the development board. Then install the eMMC module onto the development board. The method of inserting the eMMC module into the development board is as follows:</p>
<p>[[File:Orange_Pi_4A-image52.png|115x84px]] [[File:Orange_Pi_4A-image53.png|120x87px]]</p>
<p>[[File:Orange_Pi_4A-image54.png|270x159px]]</p></li>
<li><p>Firstly, please note that this method requires the use of a TF card and is mainly divided into the following two steps</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, use PhoenixCard to burn the Android firmware onto the TF card as a production card</p></li>
<li><p>Then use a TF card to burn the Android firmware into eMMC</p></li></ol>
</li>
<li><p>Please ensure that the Windows system has installed '''Microsoft Visual C++ 2008 Redistrbutable - x86'''</p>
<p>[[File:Orange_Pi_4A-image38.png|449x293px]]</p></li>
<li><p>If '''Microsoft Visual C++ 2008 Redistrbutable - x86''' is not installed, formatting the TF card with PhoenixCard or burning the Android image will prompt the following error</p>
<div class="figure">
[[File:Orange_Pi_4A-image39.png|527x369px|NUQB$Q%(){1CV6M6WK4N`5J]]
</div></li>
<li><p>The installation package for '''Microsoft Visual C++ 2008 Redistrbutable - x86''' can be downloaded from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''official tool'''] of Orange Pi 4A or from the [https://www.microsoft.com/zh-cn/download/details.aspx?id=26368 '''Microsoft official website''']</p>
<p>[[File:Orange_Pi_4A-image40.png|240x93px]] [[File:Orange_Pi_4A-image41.png|200x95px]]</p></li>
<li><p>Then prepare an 8GB or larger capacity TF card, TF card transmission speed must be '''class10''' or above, it is recommended to use Sandisk and other brands of TF card</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 writing tool from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Data download page of Orange Pi''']. Please ensure that the version of the PhonenixCrad tool is '''PhonixCard-4.2.8. Do not use PhonixCard software later than 4.2.8 to burn Android images'''. Android images written by PhonixCard tools later than this version may have problems</p>
<div class="figure">
[[File:Orange_Pi_4A-image42.jpeg|576x169px|微信图片_20241119192834]]
</div></li>
<li><p>Then use the 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, the size of which is more than 1GB. If you do not know how to decompress the Android image package, you can install a [https://yasuo.360.cn/ '''360 compression software'''] to decompress the image.</p>
<p>[[File:Orange_Pi_4A-image43.png|438x158px]]</p></li>
<li><p>Then use the decompression software to decompress '''PhonixCard4.2.8.zip'''. The software does not need to be installed. Find PhoenixCard in the decompressed folder and open it</p>
<p>[[File:Orange_Pi_4A-image44.png|576x113px]]</p></li>
<li><p>打开PhoenixCard后,如After PhoenixCard is opened, if the TF card is recognized normally, the TF card's drive letter and capacity will be displayed in the middle list. '''Please make sure that the drive letter displayed is the same as that of the TF card you want to burn'''. If it is not displayed, try to remove and insert the TF card, or click "'''Refresh Drive Letter'''" in PhoenixCard</p></li></ol>
[[File:Orange_Pi_4A-image55.png|576x154px]]
<ol start="12" style="list-style-type: decimal;">
<li><p>After confirming the drive letter, format the TF card and click the "'''Restore Card'''" button in PhoenixCard. (If the "'''Restore Card'''" button is gray and cannot be pressed, click the "'''Refresh Drive Letter'''" button first.)</p>
<div class="figure">
[[File:Orange_Pi_4A-image46.jpeg|576x317px|微信图片_20241119192853]]
</div>
<p>'''If there is any problem with formatting, please try to remove and insert the TF card and test again. If there is still a problem after removing and inserting the TF card, restart the Window computer or change another computer to try again.'''</p></li>
<li><p>Then start writing the Android image to the TF card</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Firstly, select the path of the Android image in the "'''Firmware'''" column</p></li>
<li><p>Select "'''Mass Production Card'''" in the "'''Types of Card Production'''" section</p></li>
<li><p>Then click the "'''Burn Card'''" button to start burning</p>
<div class="figure">
[[File:Orange_Pi_4A-image47.jpeg|576x452px|微信图片_20241119192912]]
</div></li></ol>
</li>
<li><p>After burning, the display of PhoenixCard is shown in the following figure. Click the "'''Close'''" button to exit PhoenixCard</p>
<p>[[File:Orange_Pi_4A-image56.png|575x356px]]</p></li>
<li><p>Then insert the TF card into the development board. After powering on and starting the development board, the Android firmware in the TF card will be automatically burned to the eMMC of the development board. After the burning is completed, it will automatically shut down and the LED light on the development board will turn off</p></li>
<li><p>At this point, you can unplug the TF card and then power it back on, which will start the Android system in eMMC</p></li></ol>
<span id="launch-the-orange-pie-development-board"></span>
== Launch the Orange Pie development board ==
# Insert the TF card with the burned image into the TF card slot of the Orange Pie development board
# The development board has an HDMI interface, which can be connected to a TV or HDMI monitor through an HDMI to HDMI cable. If you purchase an LCD screen, you can also use the LCD screen to display the system interface of the development board.
# Connect a USB mouse and keyboard to control the Orange Pie development board
# The development board has an Ethernet port that can be plugged into a network cable for internet access
# Connect a '''high-quality''' power adapter with a 5V/5A (5V/4A is also acceptable) USB Type C interface
'''Remember not to insert a power adapter with a voltage output greater than 5V, as it may burn out the development board.'''
'''Many unstable phenomena during the power on startup process of the system are basically caused by power supply problems, so a reliable power adapter is very important. If you notice continuous restarts during the startup process, please replace the power supply or Type C data cable and try again.'''
<ol start="6" style="list-style-type: decimal;">
<li><p>Then turn on the power adapter switch. If everything is normal, the HDMI monitor will be able to see the system startup screen</p></li>
<li><p>If you want to view the system's output information by debugging the serial port, please connect the development board to the computer using a serial port cable. For the method of connecting the serial port, please refer to the section on [[#instructions-for-debugging-serial-ports|'''debugging the serial port usage''']]</p></li></ol>
<span id="instructions-for-debugging-serial-ports"></span>
== Instructions for Debugging Serial Ports ==
<span id="debugging-serial-port-connection-instructions"></span>
=== Debugging serial port connection instructions ===
<ol style="list-style-type: decimal;">
<li><p>First, you need to prepare a '''3.3v''' USB to TTL module, and then plug one end of the USB interface of the USB to TTL module into the USB interface of the computer</p>
<div class="figure">
[[File:Orange_Pi_4A-image57.jpeg|575x179px|微信图片_20241119193047]]
</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 following figure</p>
<p>[[File:Orange_Pi_4A-image58.png|497x125px]]</p></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 wires</p>
<ol style="list-style-type: lower-alpha;">
<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 development board</p></li>
<li><p>'''Connect the TX of the USB to TTL module to the RX''' of the development board</p></li></ol>
</li>
<li><p>The schematic diagram of connecting a USB to TTL module to a computer and Orange Pi development board is shown below</p>
<div class="figure">
[[File:Orange_Pi_4A-image59.jpeg|576x208px|微信图片_20241119193153]]
</div>
<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 randomly connect the TX and RX of the serial port first. If there is no output from the test serial port, then switch the order of TX and RX. This way, there will always be a correct order.'''</p></li></ol>
<span id="instructions-for-debugging-serial-ports-on-ubuntu-platform"></span>
=== Instructions for Debugging Serial Ports on Ubuntu Platform ===
'''There are many serial debugging software that can be used under Linux, such as Putty, Minicom, etc. Below is a demonstration of how to use Putty.'''
<ol style="list-style-type: decimal;">
<li><p>Firstly, insert the USB to TTL module into the USB interface of the Ubuntu computer. If the USB to TTL module is recognized as connected properly, the corresponding device node name can be seen in the '''/dev''' section of the Ubuntu PC. Remember this node name, which will be used later when setting up the serial port software</p>
<p>test@test:~$ '''ls /dev/ttyUSB*'''</p>
<p>'''/dev/ttyUSB0'''</p></li>
<li><p>Then use the following command to install Putty on Ubuntu PC</p>
<p>test@test:~$ '''sudo apt update'''</p>
<p>test@test:~$ '''sudo apt install -y putty'''</p></li>
<li><p>Then run putty, remember to '''add sudo privileges'''</p>
<p>test@test:~$ '''sudo putty'''</p></li>
<li><p>After executing the putty command, the following interface will pop up</p>
<p>[[File:Orange_Pi_4A-image60.png|332x290px]]</p></li>
<li><p>Firstly, select the settings interface for the serial port</p>
<div class="figure">
[[File:Orange_Pi_4A-image61.jpeg|337x297px|微信图片_20241119193301]]
</div></li>
<li><p>Then set the parameters of the serial port</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Set '''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 serial port)</p></li>
<li><p>Set '''Flow control''' to '''None'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image62.jpeg|398x352px|微信图片_20241119193320]]
</div></li></ol>
</li>
<li><p>After completing the settings on the serial port interface, return to the Session interface</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, select '''Connection type''' as '''Serial'''</p></li>
<li><p>Then click the '''Open''' button to connect to the serial port</p>
<div class="figure">
[[File:Orange_Pi_4A-image63.jpeg|376x333px|微信图片_20241119193326]]
</div></li></ol>
</li>
<li><p>Then start the development board and you can see the Log information output by the system from the opened serial port terminal</p>
<p>[[File:Orange_Pi_4A-image64.png|376x249px]]</p></li></ol>
<span id="instructions-for-debugging-serial-ports-on-windows-platform"></span>
=== Instructions for Debugging Serial Ports on Windows Platform ===
'''There are many serial debugging software that can be used under Windows, such as SecureCRT, MobaXterm, etc. Below is a demonstration of how to use MobaXterm. This software has a free version and can be used without purchasing a serial number.'''
<ol style="list-style-type: decimal;">
<li><p>下载MobaXterm</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The download link for MobaXterm is as follows</p>
<p>[https://mobaxterm.mobatek.net/ '''https://mobaxterm.mobatek.net/''']</p></li>
<li><p>After entering the MobaXterm download webpage, click '''GET XOBATERM NOW!'''</p>
<p>[[File:Orange_Pi_4A-image65.png|382x233px]]</p></li>
<li><p>Then choose to download the Home version</p>
<p>[[File:Orange_Pi_4A-image66.png|353x231px]]</p></li>
<li><p>Then select the Portable version, and after downloading, there is no need to install it. Simply open it and you can use it</p>
<div class="figure">
[[File:Orange_Pi_4A-image67.png|322x175px|选区_232]]
</div></li></ol>
</li>
<li><p>After downloading, use decompression software to extract the downloaded compressed file and obtain the executable software of MobaXterm. Then double-click to open it</p>
<p>[[File:Orange_Pi_4A-image68.png|576x83px]]</p></li>
<li><p>After opening the software, the steps to set up a serial port connection are as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Open the session settings interface</p></li>
<li><p>Select serial port type</p></li>
<li><p>Select the port number for the serial port (choose 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></li>
<li><p>Choose a baud rate of '''115200''' for the serial port</p></li>
<li><p>Finally, click the "'''OK'''" button to complete the setup</p></li></ol>
</li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image69.jpeg|576x292px|微信图片_20241119193339]]
</div>
<ol start="4" style="list-style-type: decimal;">
<li><p>After clicking the "'''OK'''" button, you will enter the interface below. At this time, you can start the development board and see the output information of the serial port</p>
<div class="figure">
[[File:Orange_Pi_4A-image70.jpeg|576x292px|微信图片_20241119193346]]
</div></li></ol>
<span id="instructions-for-powering-the-5v-pin-in-the-40-pin-interface-of-the-development-board"></span>
== Instructions for powering the 5V pin in the 40 pin interface of the development board ==
'''The recommended power supply method for the development board is to use a 5V/5A or 5V/4A Type C interface power cord plugged into the Type C power interface of the development board for power supply. If you need to use the 5V pin in the 40 pin interface to power the development board, please ensure that the power cord used can meet the power supply requirements of the development board. If there is unstable usage, please switch back to the Type C power supply.'''
<ol style="list-style-type: decimal;">
<li><p>Firstly, it is necessary to prepare a power cord as shown in the following diagram</p>
<div class="figure">
[[File:Orange_Pi_4A-image71.jpeg|323x232px|图片4]]
</div>
<p>'''The power cord shown in the picture can be purchased on Taobao, please search and purchase it yourself.'''</p></li>
<li><p>Use the 5V pin in the 40 pin interface to power the development board, and connect the power cord as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The USB A port of the power cord shown in the above figure needs to be plugged into a 5V/5A power adapter connector ('''it is not recommended to plug it into the USB port of the computer for power supply, as it may be unstable to use if there are too many peripherals connected to the development board''')</p></li>
<li><p>The red DuPont wire needs to be plugged into the 5V pin of the 40 pin interface on the development board</p></li>
<li><p>The black DuPont wire needs to be plugged into the GND pin of the 40 pin interface</p></li>
<li><p>The positions of the 5V pin and GND pin of the 40 pin interface in the development board are shown in the following figure. '''Remember not to connect them in reverse'''</p>
<p>[[File:Orange_Pi_4A-image72.png|456x110px]]</p></li></ol>
</li></ol>
<span id="instructions-for-using-debianubuntu-server-and-gnome-desktop-system"></span>
= Instructions for using Debian/Ubuntu Server and Gnome desktop system =
<span id="supported-linux-image-types-and-kernel-versions"></span>
== Supported Linux image types and kernel versions ==
{| class="wikitable"
|-
| style="text-align: center;"| '''Linux image type'''
| style="text-align: left;"| '''Kernel version'''
| style="text-align: center;"| '''Server version'''
| style="text-align: center;"| '''Desktop version'''
|-
| style="text-align: center;"| '''Ubuntu 22.04 - Jammy'''
| style="text-align: left;"| '''Linux5.15'''
| style="text-align: center;"| '''support'''
| style="text-align: center;"| '''support'''
|-
| style="text-align: center;"| '''Debian 12 - Bookworm'''
| style="text-align: left;"| '''Linux5.15'''
| style="text-align: center;"| '''support'''
| style="text-align: center;"| '''support'''
|}
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 following description, '''Ubuntu images and Debian images are generally referred to as Linux images'''.
<div class="figure">
[[File:Orange_Pi_4A-image73.png|291x171px|1732016137510]]
</div>
The naming convention for Linux images is:
'''Development board model _ version number _ Linux release type _ release code _ server or desktop _ kernel version'''
<ol style="list-style-type: lower-alpha;">
<li><p>'''Development board model:''' They are all '''Orangepi4a'''. The model names of different development boards are generally different. Before burning the image, please ensure that the model name of the selected image matches the development board.</p></li>
<li><p>'''Version number:''' For example, '''1.x.x''', this version number will increase with the update of the image function, and the last digit of the version number of the Linux image on the development board is even.</p></li>
<li><p>'''Types of Linux distributions:''' Currently supports '''Ubuntu''' and '''Debian'''. Due to Ubuntu's origin from Debian, there is generally not much difference in usage between the two systems. But there are still some differences in the default configuration and command usage of some software. In addition, Ubuntu and Debian each maintain their own supported software repositories, and there are also some differences in the supported installable software packages. These require personal experience to gain a deeper understanding. For more details, you can refer to the official documentation provided by Ubuntu and Debian.</p></li>
<li><p>'''Release code:''' Used to distinguish between different versions of specific Linux distributions such as Ubuntu or Debian. Among them, '''jammy''' is the Ubuntu distribution, referring to Ubuntu 22.04. The biggest difference between different versions is that many of the software in the software repository maintained by the new version of Ubuntu system are newer than those in the old version, such as Python and GCC compilation toolchains. '''bookworm''' is the specific version code for Debian, with '''bookworm''' representing Debian12.</p></li>
<li><p>'''Server or Desktop:''' Used to indicate whether the system has a desktop environment. If it is a '''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, and the system is mainly operated and controlled using the command line. If it is '''desktop_gnome''', it means that the system has the GNOME desktop environment installed by default. The image occupies a relatively large amount of storage space and resources, and can be operated through the interface with a monitor, mouse, and keyboard. Of course, the desktop version of the system can also be operated through the command line like the server version.</p></li>
<li><p>'''Kernel version:''' Used to represent the version number of the Linux kernel, currently supporting '''linux5.15'''.</p></li></ol>
<span id="linux-kernel-driver-adaptation-situation"></span>
== linux kernel driver adaptation situation ==
{| class="wikitable"
|-
| style="text-align: center;"| '''Function'''
| style="text-align: center;"| '''Linux5.15'''
|-
| style="text-align: center;"| '''HDMI video'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''HDMI audio'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''USB2.0 x 4'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''TF card startup'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''eMMC'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''NVME SSD recognition'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Gigabit Ethernet'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''WIFI'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Bluetooth'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''RTC chip'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Earphone audio'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''LCD screen'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''EDP'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''CAM1'''
| style="text-align: center;"| '''Kernel driver OK, 3A not tuned'''
|-
| style="text-align: center;"| '''CAM2'''
| style="text-align: center;"| '''Kernel driver OK, 3A not tuned'''
|-
| style="text-align: center;"| '''LED lamp'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin GPIO'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin I2C'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin SPI'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin UART'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin PWM'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Key'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Temperature sensor'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''hardware watchdog'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Mali GPU'''
| style="text-align: center;"| '''NO'''
|-
| style="text-align: center;"| '''Video Encoding and Decoding'''
| style="text-align: center;"| '''NO'''
|}
<span id="explanation-of-linux-command-format-in-this-manual"></span>
== Explanation of linux Command Format in This Manual ==
<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 boxes below</p>
<p>As shown below, the content in the yellow box represents the content that needs special attention, except for the commands inside.</p></li>
<li><p>Description of prompt types before commands</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The prompt in front of the command refers to the content in the red part of the box below, which is not part of Linux commands. 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>
<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>
<li><p>'''orangepi@orangepi:~$''' The prompt indicates that this command was entered in the '''linux system of the development board''', and the last '''$''' of the prompt indicates that the current user of the system is a regular user. When executing privileged commands, '''sudo''' needs to be added</p></li>
<li><p>'''root@orangepi:~#''' The prompt indicates that this command was entered in the '''linux system of the development board''', and 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</p></li>
<li><p>'''test@test:~$''' The prompt indicates that this command was entered on an Ubuntu PC or Ubuntu virtual machine, not on the Linux system of the development board. The '''$''' at the end of the prompt indicates that the current user of the system is a regular user. When executing privileged commands, '''sudo''' needs to be added</p></li>
<li><p>'''root@test:~#''' The prompt indicates that this command was entered on an Ubuntu PC or Ubuntu virtual machine, not on the Linux system of the development board. The '''#''' at the end of the prompt indicates that the current system user is the root user and can execute any command they want</p></li></ol>
</li>
<li><p>What are the commands that need to be entered?</p>
<ol style="list-style-type: lower-alpha;">
<li><p>As shown below, '''the bold black part represents''' the commands that need to be inputted, and the content below the commands is the output (some commands have output, while others may not). This part of the content does not need to be inputted</p>
<p>root@orangepi:~# '''cat /boot/orangepiEnv.txt'''</p>
<p>'''verbosity=7'''</p>
<p>bootlogo=false</p>
<p>'''console=serial'''</p></li>
<li><p>As shown below, some commands that cannot be written on one line will be moved to the next line, and any black and bold parts are commands that need to be entered. When these commands are inputted on a single line, the '\' at the end of each line needs to be removed, which is not part of the command. Also, different parts of the command have spaces, please don't miss them</p>
<p>orangepi@orangepi:~$ '''echo \'''</p>
<p>'''"deb [arch=$(dpkg --print-architecture) \'''</p>
<p>'''signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \'''</p>
<p>'''https://download.docker.com/linux/debian \'''</p>
<p>'''$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null'''</p></li></ol>
</li></ol>
<span id="linux-system-login-instructions"></span>
== linux system login instructions ==
<span id="linux-system-default-login-account-and-password"></span>
=== linux system default login account and password ===
{| class="wikitable"
|-
| style="text-align: left;"| '''account number'''
| style="text-align: left;"| '''password'''
|-
| style="text-align: left;"| '''root'''
| style="text-align: left;"| '''orangepi'''
|-
| style="text-align: left;"| '''orangepi'''
| style="text-align: left;"| '''orangepi'''
|}
'''Note that when entering the password, the specific content of the entered password will not be displayed on the screen. Please do not assume that there is any malfunction. After entering, simply press Enter.'''
'''When the password prompt is incorrect 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, do not suspect that the password is incorrect, but instead look for other reasons.'''
<span id="method-for-setting-up-automatic-login-for-linux-system-terminals"></span>
=== Method for setting up automatic login for linux system terminals ===
<ol style="list-style-type: decimal;">
<li><p>The linux system defaults to automatically logging into the terminal, and the default login username is '''orangepi'''</p>
<p>[[File:Orange_Pi_4A-image74.png|396x240px]]</p></li>
<li><p>The following command can be used to set the root user to automatically log in to the terminal</p>
<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>
<p>orangepi@orangepi:~$ '''sudo auto_login_cli.sh -d'''</p></li>
<li><p>The following command can be used to reset the automatic login of Orangepi users to the terminal</p>
<p>orangepi@orangepi:~$ '''sudo auto_login_cli.sh orangepi'''</p></li></ol>
<span id="linux-desktop-system-automatic-login-instructions"></span>
=== linux Desktop System Automatic Login Instructions ===
<ol style="list-style-type: decimal;">
<li><p>After the desktop version system starts, it will automatically log in to the desktop without entering a password</p>
<div class="figure">
[[File:Orange_Pi_4A-image75.png|576x324px|Screenshot from 2024-08-27 11-30-45]]
</div></li></ol>
<span id="linux-desktop-system-root-user-automatic-login-setting-method"></span>
=== Linux Desktop System Root User Automatic Login Setting Method ===
<ol style="list-style-type: decimal;">
<li><p>Execute the following command to set the desktop system to automatically log in as the root user</p>
<p>orangepi@orangepi:~$ '''sudo desktop_login.sh root'''</p></li>
<li><p>Then restart the system, and it will automatically log in to the desktop as the root user</p>
<div class="figure">
[[File:Orange_Pi_4A-image76.png|576x324px|Screenshot from 2024-08-27 11-31-55]]
</div></li>
<li><p>Execute the following command to reset the desktop system to use Orangepi for automatic user login</p>
<p>orangepi@orangepi:~$ '''sudo desktop_login.sh orangepi'''</p></li></ol>
<span id="how-to-disable-the-desktop-in-linux-desktop-system"></span>
=== How to disable the desktop in Linux desktop system ===
<ol style="list-style-type: decimal;">
<li><p>First enter the following command in the command line''', please remember to add sudo permissions'''</p>
<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>
<p>orangepi@orangepi:~$ '''sudo reboot'''</p></li>
<li><p>The command to reopen the desktop is as follows, '''please remember to add sudo permissions'''</p>
<p>orangepi@orangepi:~$ '''sudo systemctl start lightdm.service'''</p>
<p>orangepi@orangepi:~$ '''sudo systemctl enable lightdm.service'''</p></li></ol>
<span id="onboard-led-light-test-instructions"></span>
== Onboard LED light test instructions ==
<ol style="list-style-type: decimal;">
<li><p>There are three LED lights on the development board, one green light, one red light, and one PCIe indicator light. Their locations are shown in the figure below:</p></li>
<li><p>'''As long as the development board is powered on, the red LED light will be always on. This is controlled by hardware and cannot be turned off by software.'''</p></li>
<li><p>The green LED light will keep flashing after the kernel starts, which is controlled by software.</p></li>
<li><p>The PCIe indicator will flash when there is data transmission on the PCIe interface.</p></li>
<li><p>The method of setting the green light on and off and flashing is as follows:</p>
<p>'''Note: The following operations must be performed as the root user.'''</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First enter the green light settings directory</p>
<p>root@orangepi:~# '''cd /sys/class/leds/status_led'''</p></li>
<li><p>The command to set the green light to stop flashing is as follows</p>
<p>root@orangepi:/sys/class/leds/status_led# '''echo none > trigger'''</p></li>
<li><p>The command to set the green light to always be on is as follows</p>
<p>root@orangepi:/sys/class/leds/status_led# '''echo default-on > trigger'''</p></li>
<li><p>The command to set the green light to flash is as follows</p>
<p>root@orangepi:/sys/class/leds/status_led# '''echo heartbeat > trigger'''</p></li></ol>
</li></ol>
<span id="linux-system-rootfs-partition-capacity-operation-instructions-in-tf-card"></span>
== Linux system rootfs partition capacity operation instructions in TF card ==
<span id="the-capacity-of-the-rootfs-partition-in-the-tf-card-will-be-automatically-expanded-at-the-first-startup"></span>
=== The capacity of the rootfs partition in the TF card will be automatically expanded at the first startup ===
<ol style="list-style-type: decimal;">
<li><p>After burning the Linux image of the development board to the TF card, you can check the usage of the TF card capacity in the '''Ubuntu computer'''. The steps are as follows:</p>
<p>'''Note that not doing this step will not affect the automatic expansion of the Linux system on the development board. Here I just want to explain how to check the capacity of the TF card after burning the Linux image to the TF card.'''</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First install the gparted software in the Ubuntu computer</p>
<p>test@test:~$ '''sudo apt install -y gparted'''</p></li>
<li><p>Then open gparted</p>
<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>
<p>[[File:Orange_Pi_4A-image77.png|575x210px]]</p></li>
<li><p>The above picture 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) is actually only allocated 4.05GiB, leaving 10.79GiB unallocated</p></li></ol>
</li>
<li><p>Then you can insert the TF card with the Linux system burned into the development board to start it. When the TF card starts the Linux system for the first time, the '''orangepi-resize-filesystem.service''' systemd service will be used to call the '''orangepi-resize-filesystem''' script to automatically expand the rootfs partition''', so there is no need to expand it manually.'''</p></li>
<li><p>After logging into the system, you can use the '''df -h'''command to check the size of the 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>
orangepi@orangepi:~$ '''df -h'''
Filesystem Size Used Avail Use% Mounted on
udev 430M 0 430M 0% /dev
tmpfs 100M 5.6M 95M 6% /run
'''/dev/mmcblk0p1 15G 915M 14G 7% /'''
tmpfs 500M 0 500M 0% /dev/shm
<ol start="4" style="list-style-type: decimal;">
<li><p>After booting 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 to check the status of the TF card again. As shown in the figure below, the capacity of the rootfs partition (/dev/sdc1) has been expanded to 14.69GiB</p>
<p>[[File:Orange_Pi_4A-image78.png|575x211px]]</p></li></ol>
'''It should be noted that the Linux system has only one partition in ext4 format and does not use a separate BOOT partition to store kernel images and other files, so there is no problem of expanding the BOOT partition.'''
<span id="how-to-disable-automatic-expansion-of-rootfs-partition-capacity-in-tf-card"></span>
=== How to disable automatic expansion of rootfs partition capacity in TF card ===
<ol style="list-style-type: decimal;">
<li><p>First, burn the Linux image of the development board to the TF card in the Ubuntu computer (not available on Windows), '''then unplug and re-insert the TF card.'''</p></li>
<li><p>Then the Ubuntu computer will generally automatically mount the TF card partition. If the automatic mounting is normal, you can see the following output using the ls command</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>
<li><p>Then switch the current user to the root user in the Ubuntu computer</p>
<p>test@test:~$ '''sudo -i'''</p>
<p>[sudo] test 的密码:</p>
<p>root@test:~'''#'''</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>
<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/root# '''touch .no_rootfs_resize'''</p>
<p>root@test:/media/test/opi_root/root# '''ls .no_rootfs*'''</p>
<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, if it detects the '''.no_rootfs_resize''' file in the '''/root''' directory, it will no longer automatically expand the rootfs.</p></li>
<li><p>After disabling automatic expansion of rootfs, you can enter the Linux system and see that the total capacity of the rootfs partition is only 4GB (the image of the desktop version is tested here), which is much smaller than the actual capacity of the TF card, indicating that the automatic expansion of rootfs is successfully disabled.</p>
<p>orangepi@orangepi:~$ '''df -h'''</p>
<p>Filesystem Size Used Avail Use% Mounted on</p>
<p>udev 925M 0 925M 0% /dev</p>
<p>tmpfs 199M 3.2M 196M 2% /run</p>
<p>'''/dev/mmcblk0p1 4.0G 3.2G 686M 83% /'''</p></li>
<li><p>If you need to expand the capacity of the rootfs partition in the TF card, just execute the following command and restart the Linux system of the development board.</p></li></ol>
'''注意,请在root用户下执行下面的命令。'''
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 can see that the rootfs partition has been expanded to the actual capacity of the TF card.
root@orangepi:~# '''df -h'''
Filesystem Size Used Avail Use% Mounted on
udev 925M 0 925M 0% /dev
tmpfs 199M 3.2M 196M 2% /run
'''/dev/mmcblk0p1 15G 3.2G 12G 23% /'''
<span id="how-to-manually-expand-the-rootfs-partition-capacity-in-the-tf-card"></span>
=== How to manually expand the rootfs partition capacity in the TF card ===
'''If the total capacity of the TF card is large, such as 128GB, and you do not want the Linux system rootfs partition to use all the capacity of the TF card, but 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. Then you can use the content introduced in this section to manually expand the capacity of the rootfs partition in the TF.'''
<ol style="list-style-type: decimal;">
<li><p>First, burn the Linux image of the development board to the TF card in the Ubuntu computer (not available on Windows), '''then unplug and re-insert the TF card.'''</p></li>
<li><p>Then the Ubuntu computer will generally automatically mount the TF card partition. If the automatic mounting is normal, you can see the following output using the ls command</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>
<li><p>Then switch the current user to the root user in the Ubuntu computer</p>
<p>test@test:~$ '''sudo -i'''</p>
<p>[sudo] test 的密码:</p>
<p>root@test:~'''#'''</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>
<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/root# '''touch .no_rootfs_resize'''</p>
<p>root@test:/media/test/opi_root/root# '''ls .no_rootfs*'''</p>
<p>'''.no_rootfs_resize'''</p></li></ol>
<!-- -->
<ol start="5" style="list-style-type: decimal;">
<li><p>Then install the gparted software in the Ubuntu computer</p>
<p>test@test:~$ '''sudo apt install -y gparted'''</p></li>
<li><p>Then open gparted</p>
<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 figure below shows 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) is actually only allocated 4.05GiB, leaving 10.79GiB unallocated</p>
<p>[[File:Orange_Pi_4A-image77.png|575x210px]]</p></li>
<li><p>Then select the rootfs partition (/dev/sdc1)</p>
<p>[[File:Orange_Pi_4A-image79.png|575x211px]]</p></li>
<li><p>Click the right button of the mouse again to see the operation options shown in the figure below. If the TF card has been mounted, you need to Umount the rootfs partition of the TF card first.</p>
<p>[[File:Orange_Pi_4A-image80.png|436x298px]]</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>
<p>[[File:Orange_Pi_4A-image81.png|444x302px]]</p></li>
<li><p>After the '''Resize/Move''' option is turned on, the following setting interface will pop up</p>
<p>[[File:Orange_Pi_4A-image82.png|315x193px]]</p></li>
<li><p>Then you can directly drag the position shown in the figure below to set the capacity, or you can set the size of the rootfs partition by setting the number in '''New size(MiB)'''</p>
<p>[[File:Orange_Pi_4A-image83.png|320x191px]]</p></li>
<li><p>After setting the capacity, click '''Resize/Move''' in the lower right corner.</p>
<p>[[File:Orange_Pi_4A-image84.png|327x196px]]</p></li>
<li><p>After final confirmation, click the green '''√''' as shown below</p>
<p>[[File:Orange_Pi_4A-image85.png|392x270px]]</p></li>
<li><p>Then select '''Apply''' to officially start expanding the capacity of the rootfs partition</p>
<p>[[File:Orange_Pi_4A-image86.png|399x116px]]</p></li>
<li><p>After the expansion is completed, click '''Close'''.</p>
<p>[[File:Orange_Pi_4A-image87.png|399x172px]]</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 that the manual expansion is successful.</p>
<p>root@orangepi:~# '''df -h'''</p>
<p>Filesystem Size Used Avail Use% Mounted on</p>
<p>udev 925M 0 925M 0% /dev</p>
<p>tmpfs 199M 3.2M 196M 2% /run</p>
<p>'''/dev/mmcblk0p1 7.7G 3.2G 4.4G 42% /'''</p></li></ol>
<span id="how-to-reduce-the-capacity-of-the-rootfs-partition-in-the-tf-card"></span>
=== How to reduce the capacity of the rootfs partition in the 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.'''
<ol style="list-style-type: decimal;">
<li><p>First, insert the TF card you want to operate into the Ubuntu computer (not available on Windows)</p></li>
<li><p>Then install the gparted software in the Ubuntu computer</p>
<p>test@test:~$ '''sudo apt install -y gparted'''</p></li>
<li><p>Then open gparted</p>
<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>
<p>[[File:Orange_Pi_4A-image88.png|575x217px]]</p></li>
<li><p>Then select the rootfs partition (/dev/sdc1)</p>
<p>[[File:Orange_Pi_4A-image89.png|575x217px]]</p></li>
<li><p>Click the right button of the mouse again to see the operation options shown in the figure below. If the TF card has been mounted, you need to Umount the rootfs partition of the TF card first.</p>
<p>[[File:Orange_Pi_4A-image90.png|400x274px]]</p></li>
<li><p>Then select the rootfs partition again, right-click, and select '''Resize/Move''' to start setting the size of the rootfs partition</p>
<p>[[File:Orange_Pi_4A-image91.png|399x273px]]</p></li>
<li><p>After the '''Resize/Move''' option is turned on, the following setting interface will pop up</p>
<p>[[File:Orange_Pi_4A-image92.png|315x188px]]</p></li>
<li><p>Then you can directly drag the position shown in the figure below to set the capacity, or you can set the size of the rootfs partition by setting the number in '''New sieze(MiB)'''</p>
<p>[[File:Orange_Pi_4A-image83.png|318x190px]]</p></li>
<li><p>After setting the capacity, click '''Resize/Move''' in the lower right corner.</p>
<p>[[File:Orange_Pi_4A-image84.png|327x196px]]</p></li>
<li><p>After final confirmation, click '''the green √''' as shown below</p>
<p>[[File:Orange_Pi_4A-image85.png|392x270px]]</p></li>
<li><p>Then select '''Apply''' to officially start expanding the capacity of the rootfs partition</p>
<p>[[File:Orange_Pi_4A-image86.png|365x106px]]</p></li>
<li><p>After the expansion is completed, click '''Close'''.</p>
<p>[[File:Orange_Pi_4A-image87.png|379x164px]]</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 the same as the size set previously, it means that the capacity reduction is successful.</p>
<p>root@orangepi:~# '''df -h'''</p>
<p>Filesystem Size Used Avail Use% Mounted on</p>
<p>udev 925M 0 925M 0% /dev</p>
<p>tmpfs 199M 3.2M 196M 2% /run</p>
<p>'''/dev/mmcblk0p1 7.7G 3.2G 4.4G 42% /'''</p></li></ol>
<span id="network-connection-test"></span>
== Network connection test ==
<span id="ethernet-port-test"></span>
=== Ethernet port test ===
<ol style="list-style-type: decimal;">
<li><p>First, plug one end of the network cable into the Ethernet port of the development board, and the other end of the network cable into the router, and make sure the network is unobstructed.</p></li>
<li><p>After the system starts, the IP address will be automatically assigned to the Ethernet card through DHCP, '''and no other configuration is required'''</p></li>
<li><p>The command to check the IP address in the Linux system of the development board is as follows:</p>
<p>orangepi@orangepi:~$ '''ip a s eth0'''</p>
<p>2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000</p>
<p>link/ether 3a:3a:57:82:eb:1f brd ff:ff:ff:ff:ff:ff</p>
<p>inet '''192.168.2.163'''/24 brd 192.168.2.255 scope global dynamic noprefixroute eth0</p>
<p>valid_lft 42902sec preferred_lft 42902sec</p>
<p>inet6 fdcd:e671:36f4::a39/128 scope global dynamic noprefixroute</p>
<p>valid_lft 42904sec preferred_lft 42904sec</p>
<p>inet6 fdcd:e671:36f4:0:7b67:e74e:f0e1:849a/64 scope global temporary dynamic</p>
<p>valid_lft 604504sec preferred_lft 86095sec</p>
<p>inet6 fdcd:e671:36f4:0:d098:7f17:6cea:4de4/64 scope global mngtmpaddr noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p>
<p>inet6 fe80::cc72:d313:9846:a5e0/64 scope link noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p></li></ol>
'''There are three ways to check the IP address after the development board is started:'''
'''1. Connect an HDMI display, then log in to the system and use the ip a s eth0 command to view the IP address'''
'''2. Enter the ip a s eth0 command in the debug serial port terminal to view the IP address'''
'''3. If there is no debug serial port and no HDMI display, you can also view the IP address of the development board network port through the router's management interface. However, this method often causes some people to be unable to see the IP address of the development board normally. If you can't see it, the debugging method is as follows:'''
'''A) First check whether the Linux system has started normally. If the green light on the development board flashes, it is generally started normally. If only the red light is on, or neither the red light nor the green light is 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 (there are many problems with routers, such as the router cannot allocate IP addresses normally, or the IP address has been allocated normally but cannot be seen in the router);'''
'''D) If there is no router to replace, you can only connect an HDMI display or use the debug serial port to view the IP address.'''
'''It should also be noted that the development board DHCP automatically assigns IP addresses without any settings.'''
<ol start="4" style="list-style-type: decimal;">
<li><p>The command to test network connectivity is as follows. The '''ping''' command can be interrupted by pressing '''Ctrl+C'''</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>64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=1 ttl=56 time=6.74 ms</p>
<p>64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=2 ttl=56 time=6.80 ms</p>
<p>64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=3 ttl=56 time=6.26 ms</p>
<p>64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=4 ttl=56 time=7.27 ms</p>
<p>^C</p>
<p>--- www.a.shifen.com ping statistics ---</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>
<span id="wifi-connection-test"></span>
=== WIFI connection test ===
'''Please do not connect to WIFI by modifying the /etc/network/interfaces configuration file. This method may cause problems when connecting to the WIFI network.'''
<span id="server-version-image-connects-to-wifi-through-command"></span>
==== Server version image connects to WIFI through command ====
'''When the development board is not connected to Ethernet, not connected to HDMI display, and only connected to the serial port, it is recommended to use the command demonstrated in this section to connect to the WIFI network. Because nmtui can only display characters in some serial port software (such as minicom), it cannot display the graphical interface normally. Of course, if the development board is connected to Ethernet or HDMI display, you can also use the command demonstrated in this section to connect to the WIFI network.'''
Log in to the Linux system first. There are three ways to do this:
<ol style="list-style-type: lower-alpha;">
<li><p>If the development board is connected to the network cable, you can log in to the Linux system remotely through SSH</p></li>
<li><p>If the development board is connected to the debug serial port, you can use the serial terminal to log in to the Linux system</p></li>
<li><p>If the development board is connected to the HDMI display, you can log in to the Linux system through the HDMI display terminal</p></li></ol>
<!-- -->
<ol style="list-style-type: decimal;">
<li><p>First use the '''nmcli dev wifi''' command to scan the surrounding WIFI hotspots</p>
<p>orangepi@orangepi:~$ '''nmcli dev wifi'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image93.png|575x250px|选区_011]]
</div></li>
<li><p>Then use the '''nmcli''' command to connect to the scanned WIFI hotspot, where:</p>
<ol style="list-style-type: lower-alpha;">
<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 WIFI hotspot you want to connect to</p>
<p>orangepi@orangepi:~$ '''sudo nmcli dev wifi connect wifi_name password wifi_passwd'''</p>
<p>Device 'wlan0' successfully activated with 'cf937f88-ca1e-4411-bb50-61f402eef293'.</p></li></ol>
</li>
<li><p>Use the '''ip addr show wlan0''' command to view the IP address of the wifi</p>
<p>orangepi@orangepi:~$ '''ip a s wlan0'''</p>
<p>11: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> 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>inet '''192.168.1.11'''/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0</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>valid_lft 259192sec preferred_lft 172792sec</p>
<p>inet6 fe80::42f1:6019:a80e:4c31/64 scope link noprefixroute</p>
<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>
<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>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=1 ttl=52 time=43.5 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=2 ttl=52 time=41.3 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=3 ttl=52 time=44.9 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=4 ttl=52 time=45.6 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=5 ttl=52 time=48.8 ms</p>
<p>^C</p>
<p>--- www.orangepi.org ping statistics ---</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>
<span id="the-server-version-image-connects-to-wifi-through-a-graphical-method"></span>
==== The server version image connects to WIFI through a graphical method ====
# Log in to the Linux system first. There are three ways to do this:
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>If the development board is connected to the network cable, you can log in to the Linux system remotely through ssh</p></li>
<li><p>b. If the development board is connected to the debug serial port, you can use the serial terminal to log in to the Linux system (use MobaXterm as the serial software, and the graphical interface cannot be displayed using minicom)</p></li>
<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></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<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>
<li><p>Enter the nmtui command to open the interface as shown below</p>
<p>[[File:Orange_Pi_4A-image94.png|345x215px]]</p></li>
<li><p>Select '''Activate a connect''' and press Enter</p>
<p>[[File:Orange_Pi_4A-image95.png|349x216px]]</p></li>
<li><p>Then you can see all the searched WIFI hotspots</p>
<p>[[File:Orange_Pi_4A-image96.png|358x226px]]</p></li>
<li><p>Select the WIFI hotspot you want to connect to, then use the Tab key to position the cursor at '''Activate''' and press Enter.</p>
<p>[[File:Orange_Pi_4A-image97.png|357x226px]]</p></li>
<li><p>Then a dialog box for entering a password will pop up. Enter the corresponding password in '''Password''' and press Enter to start connecting to WIFI.</p>
<p>[[File:Orange_Pi_4A-image98.png|354x226px]]</p></li>
<li><p>After the WIFI connection is successful, a "*" will be displayed in front of the connected WIFI name</p>
<div class="figure">
[[File:Orange_Pi_4A-image99.jpeg|350x224px|微信图片_20241119193751]]
</div></li>
<li><p>You can view the IP address of the wifi through the'''ip a s wlan0''' command</p>
<p>orangepi@orangepi:~$ '''ip a s wlan0'''</p>
<p>11: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> 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>inet '''192.168.1.11'''/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0</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>valid_lft 259071sec preferred_lft 172671sec</p>
<p>inet6 fe80::42f1:6019:a80e:4c31/64 scope link noprefixroute</p>
<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>
<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>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=1 ttl=52 time=43.5 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=2 ttl=52 time=41.3 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=3 ttl=52 time=44.9 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=4 ttl=52 time=45.6 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=5 ttl=52 time=48.8 ms</p>
<p>^C</p>
<p>--- www.orangepi.org ping statistics ---</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>
<span id="testing-methods-for-desktop-images"></span>
==== Testing methods for desktop images ====
<ol style="list-style-type: decimal;">
<li><p>Click on the upper right corner of the desktop (please do not connect the network cable when testing WIFI)</p>
<p>[[File:Orange_Pi_4A-image100.png|289x201px]]</p></li>
<li><p>Select '''Wi-Fi Settings''' in the drop-down box that pops up.</p>
<p>[[File:Orange_Pi_4A-image101.png|338x172px]]</p></li>
<li><p>Then you can see the searched WIFI hotspots under '''Visible Networks'''</p>
<p>[[File:Orange_Pi_4A-image102.png|420x260px]]</p></li>
<li><p>Then click on the WIFI hotspot you want to connect to, and then enter the password to start connecting to WIFI</p>
<p>[[File:Orange_Pi_4A-image103.png|423x262px]]</p>
<p>[[File:Orange_Pi_4A-image104.png|421x258px]]</p>
<p>'''create_ap is a script that helps quickly create a WIFI hotspot on Linux. It supports bridge and NAT modes and can automatically combine hostapd, dnsmasq and iptables to complete the setting of WIFI hotspot, avoiding users from making complex configurations. The github address is as follows:'''</p></li></ol>
[https://github.com/oblique/create_ap '''https://github.com/oblique/create_ap''']
'''The Linux image released by Orange Pi has pre-installed 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:''' This parameter can be used to specify encryption method, frequency band of WIFI hotspot, bandwidth mode, network sharing method, etc. You can get the specific 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 be connected to the Internet, usually eth0
'''* access-point-name:''' hotspot name
'''* passphrase:''' hotspot password
<span id="create_ap-method-to-create-a-wifi-hotspot-in-nat-mode"></span>
==== create_ap method to create a WIFI hotspot in NAT mode ====
# Enter the following command to create a WIFI hotspot in NAT mode with the name '''orangepi''' and the password '''orangepi'''
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --no-virt'''
<ol start="2" style="list-style-type: decimal;">
<li><p>If the following information is output, it means that the WIFI hotspot is created successfully</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>PID: 26139</p>
<p>Network Manager found, set wlan0 as unmanaged device... DONE</p>
<p>Sharing Internet using method: nat</p>
<p>hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlan0.conf.TQkJtsz1/hostapd_ctrl</p>
<p>wlan0: interface state UNINITIALIZED->ENABLED</p>
<p>wlan0: AP-ENABLED</p>
<p>wlan0: STA ce:bd:9a:dd:a5:86 IEEE 802.11: associated</p>
<p>wlan0: AP-STA-CONNECTED ce:bd:9a:dd:a5:86</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: EAPOL-4WAY-HS-COMPLETED ce:bd:9a:dd:a5:86</p></li>
<li><p>Take out your phone and find the WIFI hotspot named '''orangepi''' created by the development board in the searched WIFI list. Then click '''orangepi''' to connect to the hotspot. The password is '''orangepi''' set above.</p>
<p>[[File:Orange_Pi_4A-image105.png|230x183px]]</p></li>
<li><p>The display after successful connection is as shown below</p>
<p>[[File:Orange_Pi_4A-image106.png|233x111px]]</p></li>
<li><p>In NAT mode, the wireless device connected to the development board hotspot requests an IP address from the development board's DHCP service, so there will be two different network segments. For example, the IP of the development board here is 192.168.1.X</p>
<p>orangepi@orangepi:~$ '''sudo ifconfig eth0'''</p>
<p>eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500</p>
<p>inet '''192.168.1.150''' netmask 255.255.255.0 broadcast 192.168.1.255</p>
<p>inet6 fe80::938f:8776:5783:afa2 prefixlen 64 scopeid 0x20<link></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 errors 0 dropped 50 overruns 0 frame 0</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>device interrupt 83</p>
<p>The DHCP service of the development board will assign an IP address of '''192.168.12.0/24''' to the device connected to the hotspot by default. At this time, click 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>[[File:Orange_Pi_4A-image106.png|271x129px]]</p>
<p>[[File:Orange_Pi_4A-image107.png|274x155px]]</p></li>
<li><p>If you want to specify a different network segment for the connected device, you can specify it through the -g parameter, such as using the -g parameter to specify the network segment of the access point AP as 192.168.2.1</p>
<p>orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi -g 192.168.2.1 --no-virt'''</p></li></ol>
At this time, after connecting to the hotspot through the mobile phone, click the connected WIFI hotspot '''orangepi''', and then you can see that the IP address of the mobile phone is '''192.168.2.X'''.
[[File:Orange_Pi_4A-image106.png|286x137px]]
[[File:Orange_Pi_4A-image108.png|302x174px]]
<ol start="7" style="list-style-type: decimal;">
<li>If you do not specify the '''--freq-band''' parameter, the default hotspot created is the 2.4G band. If you want to create a 5G band hotspot, you can specify it with the '''--freq-band 5''' parameter. The specific command is as follows</li></ol>
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --freq-band 5 --no-virt'''
<ol start="8" style="list-style-type: decimal;">
<li>If you need to hide the SSID, you can specify the '''--hidden''' parameter. The specific command is as follows</li></ol>
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --hidden --no-virt'''
At this time, the mobile phone cannot search for the WIFI hotspot. You need to manually specify the WIFI hotspot name and enter the password to connect to the WIFI hotspot.
[[File:Orange_Pi_4A-image109.png|237x198px]]
<span id="create_ap-method-to-create-a-wifi-hotspot-in-bridge-mode"></span>
==== create_ap method to create a WIFI hotspot in bridge mode ====
# Enter the following command to create a WIFI hotspot in bridge mode with the name '''orangepi''' and the password '''orangepi'''
orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --no-virt'''
<ol start="2" style="list-style-type: decimal;">
<li><p>If the following information is output, it means that the WIFI hotspot is created successfully</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>PID: 27707</p>
<p>Network Manager found, set wlan0 as unmanaged device... DONE</p>
<p>Sharing Internet using method: bridge</p>
<p>Create a bridge interface... br0 created.</p>
<p>hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlan0.conf.zAcFlYTx/hostapd_ctrl</p>
<p>wlan0: interface state UNINITIALIZED->ENABLED</p>
<p>wlan0: AP-ENABLED</p>
<p>wlan0: STA ce:bd:9a:dd:a5:86 IEEE 802.11: associated</p>
<p>wlan0: AP-STA-CONNECTED ce:bd:9a:dd:a5:86</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: EAPOL-4WAY-HS-COMPLETED ce:bd:9a:dd:a5:86</p></li>
<li><p>Take out your mobile phone and find the WIFI hotspot named '''orangepi''' created by the development board in the searched WIFI list. Then click '''orangepi''' to connect to the hotspot. The password is the '''orangepi''' set above.</p>
<p>[[File:Orange_Pi_4A-image105.png|265x211px]]</p></li>
<li><p>The display after successful connection is as shown below</p>
<p>[[File:Orange_Pi_4A-image106.png|273x130px]]</p></li>
<li><p>In bridge mode, the wireless device connected to the development board hotspot 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 address of the development board here is '''192.168.1.X'''</p>
<p>orangepi@orangepi:~$ '''sudo ifconfig eth0'''</p>
<p>eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500</p>
<p>inet '''192.168.1.150''' netmask 255.255.255.0 broadcast 192.168.1.255</p>
<p>inet6 fe80::938f:8776:5783:afa2 prefixlen 64 scopeid 0x20<link></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 errors 0 dropped 50 overruns 0 frame 0</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>device interrupt 83</p>
<p>The IP address of the device connected to the WIFI hotspot is also assigned by the main router, so the mobile phone and development board connected to the WIFI hotspot are in the same network segment. At this time, click the connected WIFI hotspot '''orangepi''', and then you can see that the IP address of the mobile phone is also '''192.168.1.X'''.</p>
<p>[[File:Orange_Pi_4A-image106.png|284x136px]]</p>
<p>[[File:Orange_Pi_4A-image110.png|282x159px]]</p></li>
<li><p>If you do not specify the '''--freq-band''' parameter, the default hotspot created is the 2.4G band. If you want to create a 5G band hotspot, you can specify it with the '''--freq-band 5''' parameter. The specific command is as follows</p></li></ol>
orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --freq-band 5 --no-virt'''
<ol start="7" style="list-style-type: decimal;">
<li>If you need to hide the SSID, you can specify the '''--hidden''' parameter. The specific command is as follows</li></ol>
orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --hidden --no-virt'''
At this time, the mobile phone cannot search for the WIFI hotspot. You need to manually specify the WIFI hotspot name and enter the password to connect to the WIFI hotspot.
[[File:Orange_Pi_4A-image109.png|228x191px]]
<span id="how-to-set-a-static-ip-address"></span>
=== How to set a static IP address ===
'''Please do not set a static IP address by modifying the /etc/network/interfaces configuration file.'''
<span id="using-nmtui-command-to-set-static-ip-address"></span>
==== Using nmtui command to set static IP address ====
<ol style="list-style-type: decimal;">
<li><p>First run the '''nmtui''' command</p>
<p>orangepi@orangepi:~$ '''sudo nmtui'''</p></li>
<li><p>Then select '''Edit a connection''' and press Enter</p>
<p>[[File:Orange_Pi_4A-image111.png|227x247px]]</p></li>
<li><p>Then select the network interface for which you want to set a static IP address. For example, to set a static IP address for an '''Ethernet'''interface, select '''Wired connection 1'''.</p>
<p>[[File:Orange_Pi_4A-image112.png|310x149px]]</p></li>
<li><p>Then select '''Edit''' using the '''Tab''' key and press Enter</p>
<p>[[File:Orange_Pi_4A-image113.png|316x144px]]</p></li>
<li><p>Then use the Tab key to move the cursor to the '''<Automatic>''' position shown in the figure below to configure IPv4</p>
<p>[[File:Orange_Pi_4A-image114.png|575x240px]]</p></li>
<li><p>Then press Enter, use the up and down arrow keys to select '''Manual''', and then press Enter to confirm.</p>
<p>[[File:Orange_Pi_4A-image115.png|576x237px]]</p></li>
<li><p>The display after selection is as shown below</p>
<p>[[File:Orange_Pi_4A-image116.png|575x240px]]</p></li>
<li><p>Then use the Tab key to move the cursor to '''<Show>'''</p>
<p>[[File:Orange_Pi_4A-image117.png|576x241px]]</p></li>
<li><p>Then press Enter, and the following setting interface will pop up.</p>
<p>[[File:Orange_Pi_4A-image118.png|575x450px]]</p></li>
<li><p>Then you can set the IP address, gateway and DNS server address as shown in the figure below (there are many other setting options, please explore them yourself). Please set them according to your specific needs. '''The values set in the figure below are just an example.'''</p>
<p>[[File:Orange_Pi_4A-image119.png|576x233px]]</p></li>
<li><p>After setting, move the cursor to '''<OK>''' in the lower right corner and press Enter to confirm.</p>
<p>[[File:Orange_Pi_4A-image120.png|576x116px]]</p></li>
<li><p>Then click '''<Back>''' to return to the previous selection interface</p>
<p>[[File:Orange_Pi_4A-image121.png|330x325px]]</p></li>
<li><p>Then select '''Activate a connection''', move the cursor to '''<OK>''', and press Enter</p>
<p>[[File:Orange_Pi_4A-image122.png|331x248px]]</p></li>
<li><p>Then select the network interface you want to set, such as '''Wired connection 1''', then move the cursor to '''<Deactivate>''', and press Enter to disable '''Wired connection 1'''</p>
<p>[[File:Orange_Pi_4A-image123.png|576x224px]]</p></li>
<li><p>Then please do not move the cursor, and press the Enter key to re-enable '''Wired connection 1''', so that the static IP address set previously will take effect.</p>
<p>[[File:Orange_Pi_4A-image124.png|576x224px]]</p></li>
<li><p>Then you can exit nmtui by pressing the '''<Back>''' and '''Quit''' buttons.</p>
<p>[[File:Orange_Pi_4A-image125.png|300x253px]] [[File:Orange_Pi_4A-image126.png|227x252px]]</p></li>
<li><p>Then use '''ip a s eth0''' to see that the IP address of the network port has become the static IP address set earlier.</p>
<p>orangepi@orangepi:~$ '''ip a s eth0'''</p>
<p>3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> 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>inet '''192.168.1.177'''/24 brd 192.168.1.255 scope global noprefixroute eth0</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>valid_lft 259149sec preferred_lft 172749sec</p>
<p>inet6 fe80::957d:bbbe:4928:3604/64 scope link noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p></li>
<li><p>Then you can test the network connectivity to check if the IP address is configured OK. The '''ping''' command can be interrupted by pressing '''Ctrl+C'''.</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>64 bytes from 192.168.1.47: icmp_seq=1 ttl=64 time=0.233 ms</p>
<p>64 bytes from 192.168.1.47: icmp_seq=2 ttl=64 time=0.263 ms</p>
<p>64 bytes from 192.168.1.47: icmp_seq=3 ttl=64 time=0.273 ms</p>
<p>64 bytes from 192.168.1.47: icmp_seq=4 ttl=64 time=0.269 ms</p>
<p>64 bytes from 192.168.1.47: icmp_seq=5 ttl=64 time=0.275 ms</p>
<p>^C</p>
<p>--- 192.168.1.47 ping statistics ---</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>
<span id="use-nmcli-command-to-set-static-ip-address"></span>
==== Use nmcli command to set static IP address ====
<ol style="list-style-type: decimal;">
<li><p>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.'''</p></li>
<li><p>Then use the '''nmcli con show''' command to view the name of the network device, as shown below</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''orangepi'''is the name of the WIFI network interface (the name may not be the same)</p></li>
<li><p>b.'''Wired connection 1''' is the name of the Ethernet interface</p>
<p>orangepi@orangepi:~$ '''nmcli con show'''</p>
<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>
</li>
<li><p>Then enter the following command, where</p>
<p>a. '''"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 (which can be obtained through the '''nmcli con show''' command)</p>
<p>b. The static IP address to be set after '''ipv4.addresses''' can be changed to the value you want to set</p>
<p>c.'''ipv4.gateway''' means the address of the gateway</p>
<p>orangepi@orangepi:~$ '''sudo nmcli con mod "Wired connection 1" \'''</p>
<p>'''ipv4.addresses "192.168.1.110" \'''</p>
<p>'''ipv4.gateway "192.168.1.1" \'''</p>
<p>'''ipv4.dns "8.8.8.8" \'''</p>
<p>'''ipv4.method "manual"'''</p></li>
<li><p>Then restart the Linux system</p>
<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>
<p>orangepi@orangepi:~$ '''ip addr show eth0'''</p>
<p>3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> 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>inet '''192.168.1.110'''/32 brd 192.168.1.110 scope global noprefixroute eth0</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>valid_lft 259183sec preferred_lft 172783sec</p>
<p>inet6 fe80::3312:861a:a589:d3c/64 scope link noprefixroute</p>
<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-when-it-starts-for-the-first-time"></span>
=== How to set up the Linux system to automatically connect to the network when it starts 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 a network cable that can access the Internet normally into the Ethernet port. After starting the Linux system, an IP address will be automatically assigned to the Ethernet port through DHCP. Then we can obtain the IP address of the Ethernet port through the HDMI screen, serial port or by checking the router background, and then we can remotely log in to the Linux system.'''
'''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 the IP address of the Ethernet port through ssh and connect to WIFI through commands, or connect to WIFI through commands in the HDMI screen or serial port.'''
'''However, 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 described 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 files in it.'''
'''If you want to modify it in Windows, you can use Paragon ExtFS for Windows. Since this software needs to be paid, and there is no similar free software that is easy to use, I will not demonstrate it here.'''
'''In addition, if you have any problems using Paragon ExtFS for Windows, please solve them yourself. We will not answer your questions.'''
<ol style="list-style-type: decimal;">
<li><p>First, burn the Linux image of the development board you want to use to the TF card, and then use the card reader to insert the TF card with the burned development board Linux image into the machine with the Linux system installed (such as a computer with Ubuntu system installed, the following demonstration will take the Ubuntu computer as an example)</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 path where the Linux root file system in the TF card is mounted.</p>
<p>test@test:~$ '''df -h | grep "media"'''</p>
<p>/dev/sdd1 1.4G 1.2G 167M 88% '''/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>
<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>
<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 Linux system to automatically connect to a WIFI hotspot when it starts for the first time, or you can set a static IP address for the WIFI or Ethernet port.</p>
<p>test@test:/media/test/opi_root/boot$ '''sudo cp orangepi_first_run.txt.template orangepi_first_run.txt'''</p></li>
<li><p>Use the following command to open the orangepi_first_run.txt file, 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>
<li><p>Instructions for using variables in the orangepi_first_run.txt file</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The '''FR_general_delete_this_file_after_completion''' variable is used to set whether to delete the orangepi_first_run.txt file after the first startup. The default value is 1, which means deletion. If it is set to 0, orangepi_first_run.txt will be renamed to orangepi_first_run.txt.old after the first startup. Generally, keep the default value</p></li>
<li><p>The '''FR_net_change_defaults''' 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''' variable is used to control whether to enable the configuration of the Ethernet port. If you need to set a static IP address for the Ethernet port, please set it to 1</p></li>
<li><p>The '''FR_net_wifi_enabled''' variable is used to control whether to enable the WIFI configuration. If you need to set the development board to automatically connect to the WIFI hotspot, you must set it to 1. Also, please note that if this variable is set to 1, the Ethernet port setting will be invalid. In other words, the WIFI and Ethernet ports cannot be set at the same time (why, because there is no need...)</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 WIFI hotspot you want to connect to</p></li>
<li><p>'''FR_net_use_static''' variable is used to set whether to set a static IP address for the WIFI or Ethernet port</p></li>
<li><p>'''FR_net_static_ip''' 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''' variable is used to set the gateway. Please set it according to your actual situation.</p></li></ol>
</li>
<li><p>Here are some specific setting examples:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>For example, if you want the Linux system of the development board to automatically connect to the WIFI hotspot after the first startup, you can set it like this:</p>
<p>a) Set '''FR_net_change_defaults''' to '''1'''</p>
<p>b) Set '''FR_net_wifi_enabled''' to '''1'''</p>
<p>c) Set '''FR_net_wifi_ssid''' to the name of the WIFI hotspot you want to connect to</p>
<p>d) Set '''FR_net_wifi_key''' to the password of the WIFI hotspot you want to connect to</p></li>
<li><p>For example, if 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 remotely log in to the development board through SSH, without having to check the IP address of the development board through the router background), you can set it like this:</p>
<p>a) Set '''FR_net_change_defaults''' to '''1'''</p>
<p>b) Set '''FR_net_wifi_enabled''' to '''1'''</p>
<p>c) Set '''FR_net_wifi_ssid''' to the name of the WIFI hotspot you want to connect to</p>
<p>d) Set '''FR_net_wifi_key''' to the password of the WIFI hotspot you want to connect to</p>
<p>e) Set '''FR_net_use_static''' to '''1'''</p>
<p>f) Set '''FR_net_static_ip''' to the desired IP address</p>
<p>g) Set '''FR_net_static_gateway''' to the corresponding gateway address</p></li>
<li><p>For example, if you want the Linux system of the development board to automatically set the IP address of the Ethernet port to the desired static IP address after the first startup, you can set it like this:</p></li></ol>
</li></ol>
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>Set '''FR_net_change_defaults''' to '''1'''</p>
<p>b) Set '''FR_net_ethernet_enabled''' to '''1'''</p>
<p>c) Set '''FR_net_use_static''' to '''1'''</p>
<p>d) Set '''FR_net_static_ip''' to the desired IP address</p>
<p>e) Set '''FR_net_static_gateway''' to the corresponding gateway address</p></li></ol>
<!-- -->
<ol start="8" style="list-style-type: decimal;">
<li><p>After modifying the orangepi_first_run.txt file, you can exit the /boot directory of the Linux system of the development board in the TF card, then uninstall the TF card, and then you can insert the TF card into the development board to start it.</p></li>
<li><p>If you do not set a static IP address, you still need to check the IP address through the router background. If you set a static IP address, you can ping the static IP address set on the computer. If you can ping, it means that the system has started normally and the network has been set correctly. Then you can use the set IP address to remotely log in to the Linux system of the development board through ssh</p></li></ol>
'''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 you reset the orangepi_first_run.txt configuration file and restart the development board's Linux system, the configuration in orangepi_first_run.txt will not take effect again, because this configuration will only take effect at the first startup after burning the Linux system. Please pay special attention to this.'''
<span id="ssh-remote-login-development-board"></span>
== SSH remote login development board ==
'''By default, Linux systems enable SSH remote login and allow the root user to log in. Before logging in through SSH, you must first ensure that the Ethernet or WiFi network is connected, and then use the ip addr command or check the router to obtain the IP address of the development board.'''
<span id="ssh-remote-login-to-the-development-board-under-ubuntu"></span>
=== SSH remote login to the development board under Ubuntu ===
# Get the IP address of the development board
# 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)
orangepi@192.168.1.xx's password: (Enter the password here. The default password is orangepi)
'''Note that when you enter the password, the screen will not display the specific content of the password you entered. Please do not think that there is any malfunction. Just press Enter after entering it.'''
'''If the prompt refuses to connect, as long as you are using the image provided by Orange Pi, please do not doubt whether the password orangepi is wrong, but look for other reasons.'''
<ol start="3" style="list-style-type: decimal;">
<li><p>After successfully logging into the system, the display is as shown below</p>
<p>[[File:Orange_Pi_4A-image127.png|575x337px]]</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 the ping is successful, you can log in to the Linux system through the serial port or HDMI display and then enter the following command on the development board to try to connect:'''</p></li></ol>
root@orangepi:~# '''reset_ssh.sh'''
'''If it still doesn't work, please re-burn the system and try again.'''
<span id="ssh-remote-login-development-board-under-windows"></span>
=== SSH remote login development board under Windows ===
<ol style="list-style-type: decimal;">
<li><p>First obtain the IP address of the development board</p></li>
<li><p>You can use MobaXterm to remotely log in to the development board under Windows. First, create a new ssh session</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Open '''Session'''</p>
<p>b. Then select '''SSH''' in '''Session Setting'''</p>
<p>c. Then enter the IP address of the development board in '''Remote host'''</p>
<p>d. Then enter the Linux '''system username''' root or '''orangepi''' in Specify username</p>
<p>e. Finally, click '''OK'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image128.png|575x292px|13]]
</div></li></ol>
</li>
<li><p>You will then be prompted to enter a password. The default password for both root and orangepi users is orangepi</p>
<p>'''Please note that when you enter the password, the specific content of the password will not be displayed on the screen. Please do not think that there is any malfunction. Just press Enter after entering it.'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image129.jpeg|576x157px|微信图片_20241119194022]]
</div></li>
<li><p>After successfully logging into the system, the display is as shown below</p>
<p>[[File:Orange_Pi_4A-image130.png|576x419px]]</p></li></ol>
<span id="hdmi-test"></span>
== HDMI test ==
<span id="hdmi-display-test"></span>
=== HDMI display test ===
<ol style="list-style-type: decimal;">
<li><p>HDMI to HDMI cable to connect Orange Pi development board and HDMI display</p>
<p>[[File:Orange_Pi_4A-image10.png|199x129px]]</p></li>
<li><p>After starting the Linux system, if the HDMI display has image output, it means that the HDMI interface is working properly</p></li></ol>
'''Note that although many laptops have HDMI interfaces, the HDMI interfaces of laptops generally only have output functions and do not have HDMI in functions, 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 the laptop, please first confirm that your laptop supports the HDMI in function.'''
'''When there is no display on HDMI, please first check whether the HDMI cable is plugged in tightly. After confirming that the connection is OK, you can try a different screen to see if there is any display.'''
<span id="hdmi-to-vga-display-test"></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><p>HDMI to VGA converter</p>
<p>[[File:Orange_Pi_4A-image131.png|155x104px]]</p></li>
<li><p>A VGA cable</p>
<p>[[File:Orange_Pi_4A-image132.png|148x133px]]</p></li>
<li><p>A monitor or TV that supports VGA interface</p></li></ol>
</li>
<li><p>HDMI to VGA display test is as follows</p>
<p>[[File:Orange_Pi_4A-image133.png|575x347px]]</p>
<p>'''When using HDMI to VGA display, the development board and the Linux system of the development board do not need to do any settings, as long as the HDMI interface of the development board can 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>
<span id="how-to-use-bluetooth"></span>
== How to use Bluetooth ==
<span id="testing-methods-for-desktop-images-1"></span>
=== Testing methods for desktop images ===
<ol style="list-style-type: decimal;">
<li><p>First click on the area in the upper right corner of the desktop</p>
<p>[[File:Orange_Pi_4A-image134.png|256x164px]]</p></li>
<li><p>Then open '''Bluetooth Settings'''</p>
<p>[[File:Orange_Pi_4A-image135.png|296x274px]]</p></li>
<li><p>Bluetooth is turned on by default, and the Bluetooth devices scanned nearby will be displayed under '''Devices'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image136.png|415x272px|Screenshot from 2024-09-10 10-27-08]]
</div></li>
<li><p>Then click on the device you want to connect to start pairing. After pairing starts, a pairing confirmation box will pop up. Select '''Confirm'''to confirm. At this time, you also need to confirm on the phone.</p>
<p>[[File:Orange_Pi_4A-image137.png|390x279px]]</p></li>
<li><p>After pairing with the phone, you can select the paired Bluetooth device and then select '''Send Files''' to start sending a file to the phone.</p>
<p>[[File:Orange_Pi_4A-image138.png|395x257px]]</p></li>
<li><p>Then select the file path to be sent, and click '''Select''' to start sending.</p>
<p>[[File:Orange_Pi_4A-image139.png|367x214px]]</p></li>
<li><p>The interface for sending files is shown below</p>
<p>[[File:Orange_Pi_4A-image140.png|374x173px]]</p></li></ol>
<span id="how-to-use-the-server-version-image"></span>
=== How to use the server version image ===
<ol style="list-style-type: decimal;">
<li><p>After entering the system, you can first use the '''hciconfig''' command to check whether there is a Bluetooth device node. If it exists, it means that Bluetooth initialization is normal</p>
<p>orangepi@orangepi:~$ '''sudo apt update && sudo apt install -y bluez'''</p>
<p>orangepi@orangepi:~$ '''hciconfig -a'''</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>UP RUNNING</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>Features: 0xbf 0xff 0x8d 0xfe 0xdb 0x3d 0x7b 0xc7</p>
<p>Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3</p>
<p>Link policy: RSWITCH SNIFF</p>
<p>Link mode: SLAVE ACCEPT</p>
<p>Name: 'orangepi'</p>
<p>Class: 0x3c0000</p>
<p>Service Classes: Rendering, Capturing, Object Transfer, Audio</p>
<p>Device Class: Miscellaneous,</p>
<p>HCI Version: 5.0 (0x9) Revision: 0x400</p>
<p>LMP Version: 5.0 (0x9) Subversion: 0x400</p>
<p>Manufacturer: Spreadtrum Communications Shanghai Ltd (492)</p></li>
<li><p>Use '''bluetoothctl''' to scan for Bluetooth devices</p>
<p>orangepi@orangepi:~$ '''sudo bluetoothctl'''</p>
<p>[NEW] Controller 10:11:12:13:14:15 orangepi4a [default]</p>
<p>Agent registered</p>
<p>[bluetooth]# '''power on # Enable controller'''</p>
<p>Changing power on succeeded</p>
<p>[bluetooth]# '''discoverable on #Set the controller to be discoverable'''</p>
<p>Changing discoverable on succeeded</p>
<p>[CHG] Controller 10:11:12:13:14:15 Discoverable: yes</p>
<p>[bluetooth]# '''pairable on #Set the controller to be pairable'''</p>
<p>Changing pairable on succeeded</p>
<p>[bluetooth]# '''scan on #Start scanning the surrounding Bluetooth devices'''</p>
<p>Discovery started</p>
<p>[CHG] Controller 10:11:12:13:14:15 Discovering: yes</p>
<p>[NEW] Device 76:60:79:29:B9:31 76-60-79-29-B9-31</p>
<p>[NEW] Device 9C:2E:A1:42:71:11 Mi phones</p>
<p>'''[NEW] Device DC:72:9B:4C:F4:CF orangepi'''</p>
<p>[bluetooth]# '''scan off #After scanning the Bluetooth device you want to connect to, you can close the scan and 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'''</p>
<p>Discovery stopped</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>
<li><p>After scanning the device you want to pair, you can pair it. Pairing requires the MAC address of the 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>[CHG] Device DC:72:9B:4C:F4:CF Connected: yes</p>
<p>Request confirmation</p>
<p>[leeb1m[agent] Confirm passkey 764475 (yes/no): '''yes''' '''#Enter yes here, and you will also need to confirm on your phone'''</p>
<p>[CHG] Device DC:72:9B:4C:F4:CF Modalias: bluetooth:v010Fp107Ed1436</p>
<p>[CHG] Device DC:72:9B:4C:F4:CF UUIDs: 0000046a-0000-1000-8000-00805f9b34fb</p>
<p>[CHG] Device DC:72:9B:4C:F4:CF ServicesResolved: yes</p>
<p>[CHG] Device DC:72:9B:4C:F4:CF Paired: yes</p>
<p>'''Pairing successful #Prompt that pairing is successful'''</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>
<li><p>After pairing is successful, the Bluetooth interface of the mobile phone is displayed as follows</p>
<p>[[File:Orange_Pi_4A-image141.png|189x167px]]</p></li>
<li><p>To connect to a Bluetooth device, you need to install the '''pulseaudio-module-bluetooth''' package and then start the '''pulseaudio''' service.</p>
<p>orangepi@orangepi:~$ '''sudo apt update'''</p>
<p>orangepi@orangepi:~$ '''sudo''' '''apt -y install pulseaudio-module-bluetooth'''</p>
<p>orangepi@orangepi:~$ '''pulseaudio --start'''</p></li>
<li><p>How to connect to Bluetooth devices</p>
<p>orangepi@orangepi:~$ '''sudo bluetoothctl'''</p>
<p>Agent registered</p>
<p>[bluetooth]# '''paired-devices #View the MAC address of the paired Bluetooth device'''</p>
<p>Device DC:72:9B:4C:F4:CF orangepi</p>
<p>[bluetooth]# '''connect DC:72:9B:4C:F4:CF #Use MAC address to connect to Bluetooth device'''</p>
<p>Attempting to connect to DC:72:9B:4C:F4:CF</p>
<p>[CHG] Device DC:72:9B:4C:F4:CF Connected: yes</p>
<p>Connection successful</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>'''[orangepi]# #This prompt indicates that the connection is successful'''</p></li>
<li><p>After connecting to the Bluetooth device, you can see the prompt that the audio for calls and media has been connected on the Bluetooth configuration interface of the Android phone.</p>
<div class="figure">
[[File:Orange_Pi_4A-image142.jpeg|223x232px|Screenshot_20201205_142413]]
</div></li></ol>
<span id="usb-interface-test"></span>
== USB interface test ==
'''The USB port can be connected to a USB hub to expand the number of USB ports.'''
<span id="test-by-connecting-usb-mouse-or-keyboard"></span>
=== Test by connecting USB mouse or keyboard ===
# Insert the USB keyboard into the USB port of the Orange Pi development board.
# Connect the Orange Pi development board to the HDMI display
# If the mouse or keyboard can operate the system normally, it means that the USB interface is working properly (the mouse can only be used in the desktop version of the system)
<span id="test-by-connecting-usb-storage-device"></span>
=== Test by connecting USB storage device ===
# First, insert the USB flash drive or USB mobile hard disk into the USB port of the Orange Pi development board.
# Execute the following command. If you can see the output of sdX, it means that the USB disk has been successfully recognized.
orangepi@orangepi:~$ '''cat /proc/partitions | grep "sd*"'''
major minor #blocks name
8 0 30044160 '''sda'''
8 1 30043119 '''sda1'''
<ol start="3" style="list-style-type: decimal;">
<li>Use the mount command to mount the USB drive to '''/mnt,''' and then you can view the files in the USB drive.</li></ol>
orangepi@orangepi:~$ '''sudo mount /dev/sda1 /mnt/'''
orangepi@orangepi:~$ '''ls /mnt/'''
test.txt
<ol start="4" style="list-style-type: decimal;">
<li>After mounting, you can use the '''df -h''' command to view the capacity usage and mount point of the USB drive.</li></ol>
orangepi@orangepi:~$ '''df -h | grep "sd"'''
/dev/sda1 29G 208K 29G 1% /mnt
<span id="usb-ethernet-card-test"></span>
=== USB Ethernet Card Test ===
# The USB Ethernet cards that '''have been tested''' and can be used are as follows. The RTL8153 USB Gigabit Ethernet card can be used normally when inserted into the USB 2.0 Host interface of the development board, but the speed cannot reach Gigabit. Please note this.
{| class="wikitable"
|-
| style="text-align: left;"| Serial number
| style="text-align: left;"| model
|-
| style="text-align: left;"| 1
| style="text-align: left;"| RTL8152B USB 100M LAN
|-
| style="text-align: left;"| 2
| style="text-align: left;"| RTL8153 USB Gigabit LAN
|}
<ol start="2" style="list-style-type: decimal;">
<li><p>First, insert the USB network card into the USB port 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 the following log information can be seen through the '''dmesg''' command, it means that the USB network card is recognized normally.</p>
<p>orangepi@orangepi:~$ '''dmesg | tail'''</p>
<p>[ 121.985016] usb 3-1: USB disconnect, device number 2</p>
<p>[ 126.873772] sunxi-ehci 5311000.ehci3-controller: ehci_irq: highspeed device connect</p>
<p>[ 127.094054] usb 3-1: new high-speed USB device number 3 using sunxi-ehci</p>
<p>[ 127.357472] usb 3-1: reset high-speed USB device number 3 using sunxi-ehci</p>
<p>[ 127.557960] r8152 3-1:1.0 eth1: v1.08.9</p>
<p>[ 127.602642] r8152 3-1:1.0 enx00e04c362017: renamed from eth1</p>
<p>[ 127.731874] 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.892583] IPv6: ADDRCONF(NETDEV_CHANGE): enx00e04c362017: link becomes ready</p></li>
<li><p>Then use the ifconfig command to see the device node of the USB network card and the automatically assigned IP address</p>
<p>orangepi@orangepi:~$ '''sudo ifconfig'''</p>
<p>'''eth1''': flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500</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<link></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 errors 0 dropped 125 overruns 0 frame 0</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>
<li><p>The command to test network connectivity is as follows</p>
<p>orangepi@orangepi:~$ '''ping www.baidu.com -I eth1'''</p>
<p>PING www.a.shifen.com (14.215.177.38) from 192.168.1.12 eth0: 56(84) bytes of data.</p>
<p>64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=1 ttl=56 time=6.74 ms</p>
<p>64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=2 ttl=56 time=6.80 ms</p>
<p>64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=3 ttl=56 time=6.26 ms</p>
<p>64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=4 ttl=56 time=7.27 ms</p>
<p>^C</p>
<p>--- www.a.shifen.com ping statistics ---</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>
<span id="usb-camera-test"></span>
=== USB camera test ===
<ol style="list-style-type: decimal;">
<li><p>First, insert the USB camera into the USB port 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>
<p>orangepi@orangepi:~$ '''lsmod'''</p>
<p>Module Size Used by</p>
<p>'''uvcvideo 106496 0'''</p></li>
<li><p>Through the v4l2-ctl command, you can see that the device node information of the USB camera is /dev/video0</p>
<p>orangepi@orangepi:~$ '''sudo apt update'''</p>
<p>orangepi@orangepi:~$ '''sudo''' '''apt install -y v4l-utils'''</p>
<p>orangepi@orangepi:~$ '''v4l2-ctl --list-devices'''</p>
<p>USB 2.0 Camera (usb-sunxi-ehci-1):</p>
<p>/dev/video0</p>
<p>'''Note that the l in v4l2 is a lowercase letter l, not the number 1.'''</p>
<p>'''In addition, the video number is not always video0, please refer to the actual one you see.'''</p></li>
<li><p>Use fswebcam to test the USB camera</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Install fswebcam</p>
<p>orangepi@orangepi:~$ '''sudo''' '''apt update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y fswebcam'''</p></li>
<li><p>After installing fswebcam, you can use the following command to take pictures</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The -d option is used to specify the device node of the USB camera</p></li>
<li><p>--no-banner is used to remove the watermark of the photo</p></li>
<li><p>The -r option is used to specify the resolution of the photo</p></li>
<li><p>-S option is used to set the number of frames to skip ahead</p></li>
<li><p>./image.jpg is used to set the name and path of the generated photo</p>
<p>orangepi@orangepi:~$ '''sudo''' '''fswebcam -d /dev/video0 \'''</p>
<p>'''--no-banner -r 1280x720 -S 5 ./image.jpg'''</p></li></ol>
</li>
<li><p>In the server version of Linux, after taking a photo, you can use the scp command to transfer the photo 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>
<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><p>Test USB camera using mjpg-streamer</p>
<ol style="list-style-type: lower-alpha;">
<li><p>download mjpg-streamer</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Github download address:</p>
<p>orangepi@orangepi:~$ '''git clone https://github.com/jacksonliam/mjpg-streamer'''</p></li>
<li><p>The mirror download address of Gitee is:</p>
<p>orangepi@orangepi:~$ '''git clone https://gitee.com/leeboby/mjpg-streamer'''</p></li></ol>
</li>
<li><p>Install dependent packages</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Ubuntu System</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y cmake libjpeg8-dev'''</p></li>
<li><p>DebianSystem</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y cmake libjpeg62-turbo-dev'''</p></li></ol>
</li>
<li><p>Compile and install mjpg-streamer</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$ '''sudo make install'''</p></li>
<li><p>Then enter the following command to start mjpg_streamer</p>
<p>'''Note that the video number is not always video0. Please refer to the actual video number.'''</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 "./input_uvc.so -d \'''</p>
<p>'''/dev/video0 -u -f 30" -o "./output_http.so -w ./www"'''</p></li>
<li><p>Then enter '''[IP address of the development board: 8080]''' in the browser of Ubuntu PC, Windows PC or mobile phone in the same LAN as the development board to see the video output by the camera.</p>
<div class="figure">
[[File:Orange_Pi_4A-image143.jpeg|576x279px|微信图片_20241119194131]]
</div></li></ol>
</li></ol>
<span id="audio-test"></span>
== Audio Test ==
<span id="how-to-play-audio-using-the-command-line"></span>
=== How to play audio using the command line ===
<span id="headphone-jack-audio-playback-test"></span>
==== Headphone jack audio playback test ====
<ol style="list-style-type: decimal;">
<li><p>First, plug the earphone into the earphone jack of the development board.</p>
<p>[[File:Orange_Pi_4A-image144.png|331x105px]]</p></li>
<li><p>Use the '''aplay -l''' command to view the sound card devices supported by the Linux system, where '''audiocodec''' is the sound card device required for headphone playback.</p>
<p>root@orangepi:~# '''aplay -l'''</p>
<p>**** List of PLAYBACK Hardware Devices ****</p>
<p>'''card 0: audiocodec [audiocodec], device 0: sunxi-snd-plat-aaudio-sunxi-snd-codec 7110000.codec-0 []'''</p>
<p>'''Subdevices: 1/1'''</p>
<p>'''Subdevice #0: subdevice #0'''</p>
<p>card 1: sndi2s1 [sndi2s1], device 0: sunxi-snd-plat-i2s-snd-soc-dummy-dai snd-soc-dummy-dai-0 []</p>
<p>Subdevices: 1/1</p>
<p>Subdevice #0: subdevice #0</p>
<p>card 2: sndhdmi [sndhdmi], device 0: sunxi-snd-plat-i2s-soc@3000000:hdmi_codec soc@3000000:hdmi_code []</p>
<p>Subdevices: 1/1</p>
<p>Subdevice #0: subdevice #0</p></li>
<li><p>Then use the '''aplay''' command to play the audio, and the headphones will be able to hear the sound</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>
'''If there is noise during the headphone test, please pull the headphones out a little instead of plugging them all the way in.'''
<span id="hdmi-audio-playback-test"></span>
==== HDMI audio playback test ====
<ol style="list-style-type: decimal;">
<li><p>First, use an 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>No additional settings are required for HDMI audio playback. Just use the '''aplay''' command to play it.</p>
<p>root@orangepi:~# '''aplay -D hw:2,0 /usr/share/sounds/alsa/audio.wav'''</p></li></ol>
<span id="testing-audio-methods-on-desktop-systems"></span>
=== Testing Audio Methods on Desktop Systems ===
# First open the file manager
[[File:Orange_Pi_4A-image145.png|259x190px]]
<ol start="2" style="list-style-type: decimal;">
<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>
<p>[[File:Orange_Pi_4A-image146.png|286x174px]]</p></li>
<li><p>Then select the audio.wav file, right-click and choose to open it with vlc to start playing</p>
<p>[[File:Orange_Pi_4A-image147.png|290x174px]]</p></li>
<li><p>How to switch between different audio devices such as HDMI playback and headphone playback</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First click on the area in the upper right corner</p>
<p>[[File:Orange_Pi_4A-image134.png|256x164px]]</p></li>
<li><p>Then select '''Settings'''</p>
<p>[[File:Orange_Pi_4A-image148.png|262x254px]]</p></li>
<li><p>Then find '''Sound'''</p>
<p>[[File:Orange_Pi_4A-image149.png|308x193px]]</p></li>
<li><p>Then select the audio device you want to play in the drop-down selection box of Output Device ('''select Audio Codec to output the sound from the headphones, select HDMI Audio to output the sound from HDMI''')</p>
<p>[[File:Orange_Pi_4A-image150.png|310x196px]]</p></li></ol>
</li></ol>
<span id="how-to-test-recording-using-commands"></span>
=== How to test recording using commands ===
<ol style="list-style-type: decimal;">
<li><p>The Orange Pi 4A development board does not have an onboard MIC, so you can only record audio through headphones with a MIC function. After plugging a headphone with a MIC function into the development board, run the following command to record an audio clip through the headphone:</p>
<p>orangepi@orangepi:~$ '''arecord -D hw:0,0 -d 5 -f S16_LE -t wav /tmp/test.wav'''</p></li></ol>
<span id="temperature-sensor"></span>
== Temperature sensor ==
T527 has a total of 6 temperature sensors. The command to check the temperature is as follows:
'''The displayed temperature value needs to be divided by 1000 to get the unit in Celsius.'''
<ol style="list-style-type: lower-alpha;">
<li>sensor0:CPUL 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></ol>
orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone0/type'''
'''cpul'''_thermal_zone
orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone0/temp'''
'''54925'''
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>sensor1:CPUB 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>
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone1/type'''</p>
<p>'''cpub'''_thermal_zone</p>
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone1/temp'''</p>
<p>'''54990'''</p></li>
<li><p>sensor2:The temperature sensor of the GPU. 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>
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone2/type'''</p>
<p>'''gpu'''_thermal_zone</p>
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone2/temp'''</p>
<p>'''55056'''</p></li>
<li><p>sensor3:NPU 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>
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone3/type'''</p>
<p>'''npu'''_thermal_zone</p>
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone3/temp'''</p>
<p>'''54686'''</p></li>
<li><p>sensor4: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></li></ol>
orangepi@orangepi:~# '''cat /sys/class/thermal/thermal_zone4/type'''
'''ddr'''_thermal_zone
orangepi@orangepi:~# '''cat /sys/class/thermal/thermal_zone4/temp'''
'''54925'''
<ol start="6" style="list-style-type: lower-alpha;">
<li>sensor5:The temperature sensor of axp2202, 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></ol>
orangepi@orangepi:~# '''cat /sys/class/thermal/thermal_zone5/type'''
'''axp2202-usb'''
orangepi@orangepi:~# '''cat /sys/class/thermal/thermal_zone5/temp'''
'''45600'''
<span id="pin-interface-pin-description"></span>
== 40 Pin Interface Pin Description ==
<ol style="list-style-type: decimal;">
<li><p>For the order of the 40-pin interface pins on the Orange Pi 4A development board, please refer to the silkscreen diagram on the development board.</p>
<div class="figure">
[[File:Orange_Pi_4A-image151.jpeg|459x149px|微信图片_20241119194148]]
</div></li>
<li><p>The functions of the 40 pin interface pins of the development board are shown in the following table</p>
<ol style="list-style-type: lower-alpha;">
<li>Below is the complete pin diagram of 40pin</li></ol>
</li></ol>
[[File:Orange_Pi_4A-image152.png|575x191px]]
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>The table below is a picture of the left half of the complete table above, which can be seen more clearly</p>
<p>[[File:Orange_Pi_4A-image153.png|576x375px]]</p></li>
<li><p>The table below is the right half of the complete table above, which can be seen more clearly</p></li></ol>
[[File:Orange_Pi_4A-image154.png|575x384px]]
<ol start="3" style="list-style-type: decimal;">
<li>There are '''28''' GPIO ports in the 40-pin interface, and the 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 pre-installed in the Linux image released by Orange Pi. Unless the wiringOP code is updated, you do not need to download, compile and install it again. You can 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 wiringOP has been pre-installed and can be used normally.'''
[[File:Orange_Pi_4A-image155.png|575x354px]]
<ol style="list-style-type: decimal;">
<li><p>Download the wiringOP code</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 be downloaded from the wiringOP next branch, so don’t miss the -b next parameter.'''</p>
<p>'''If you have problems downloading the code from GitHub, you can directly use the wiringOP source code that comes with the Linux image, which is stored in /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>Test the output of the gpio readall command as follows</p>
<p>[[File:Orange_Pi_4A-image155.png|575x354px]]</p></li></ol>
<span id="pin-interface-gpio-i2c-uart-spi-and-pwm-test"></span>
== 40pin interface GPIO, I2C, UART, SPI and PWM test ==
<span id="pin-gpio-port-test"></span>
=== 40pin GPIO port test ===
<ol style="list-style-type: decimal;">
<li><p>Below, we take pin 7, which corresponds to GPIO PB4, and wPi number 2 as an example to demonstrate how to set the high and low levels of the GPIO port.</p>
<p>[[File:Orange_Pi_4A-image156.png|575x119px]]</p></li>
<li><p>First set the GPIO port to output mode, where the third parameter needs to input the wPi number corresponding to the pin</p>
<p>orangepi@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 that the low level is set successfully</p>
<p>orangepi@orangepi:~/wiringOP$ '''gpio write 2 0'''</p>
<p>Using gpio readall, you can see that the value of pin 7 (V) has changed to 0</p>
<p>[[File:Orange_Pi_4A-image157.png|576x120px]]</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 that the high level is set successfully.</p>
<p>orangepi@orangepi:~/wiringOP$ '''gpio write 2 1'''</p>
<p>Using gpio readall, you can see that the value of pin 7 (V) has changed to 1</p>
<p>[[File:Orange_Pi_4A-image158.png|576x119px]]</p></li>
<li><p>The setting method of other pins is similar. Just change the serial number of wPi to the serial number corresponding to the pin.</p></li></ol>
<span id="how-to-set-pull-up-and-pull-down-resistors-on-pin-gpio"></span>
=== How to set pull-up and pull-down resistors on pin GPIO ===
<ol style="list-style-type: decimal;">
<li><p>Below, we take pin 7, which corresponds to GPIO PB4 and wPi number 2, as an example to demonstrate how to set the pull-up and pull-down resistors of the GPIO port.</p>
<p>[[File:Orange_Pi_4A-image156.png|575x119px]]</p></li>
<li><p>First, you need to set the GPIO port to input mode. The third parameter needs to enter the wPi number corresponding to the pin.</p>
<p>orangepi@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>orangepi@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>orangepi@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>orangepi@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>orangepi@orangepi:~/wiringOP$ '''gpio read 2'''</p>
<p>'''0'''</p></li></ol>
<span id="pin-spi-test"></span>
=== 40 Pin SPI Test ===
<ol style="list-style-type: decimal;">
<li><p>As shown in the figure below, the available SPIs of Orange Pi 4A are SPI1 and SPI2.</p>
<p>[[File:Orange_Pi_4A-image152.png|575x191px]]</p></li>
<li><p>The corresponding pins of SPI1 and SPI2 in 40 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
|
| style="text-align: left;"| '''SPI1 corresponds to 40pin'''
| style="text-align: left;"| '''SPI2 corresponds to 40pin'''
|-
| '''MOSI'''
| style="text-align: left;"| '''Pin 19'''
| style="text-align: left;"| '''Pin 15'''
|-
| '''MISO'''
| style="text-align: left;"| '''Pin 21'''
| style="text-align: left;"| '''Pin 29'''
|-
| '''CLK'''
| style="text-align: left;"| '''Pin 23'''
| style="text-align: left;"| '''Pin 13'''
|-
| '''CS0'''
| style="text-align: left;"| '''Pin 24'''
| style="text-align: left;"| '''Pin 11'''
|}
'''In Linux system, the SPI function in 40pin is disabled by default and needs to be enabled manually before it can be used.'''
'''Add the following red font configuration to /boot/extlinux/extlinux.conf, and then restart the Linux system to enable spi1 and spi2. Note that when opening multiple configurations at the same time, the following red font content needs to be separated by spaces and written in one line.'''
'''orangepi@orangepi4a:~$''' '''sudo vim /boot/extlinux/extlinux.conf'''
label Orange Pi
kernel /boot/uImage
initrd /boot/uInitrd
fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb
append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles
'''FDTOVERLAYS /boot/dtb/allwinner/overlay/sun55i-t527-spi1-cs0-spidev.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-spi2-cs0-spidev.dtbo'''
<ol start="3" style="list-style-type: decimal;">
<li><p>Then check whether the device node of '''spidevx.x''' exists in the Linux system. If it exists, it means that the SPI configuration has taken effect.</p>
<p>orangepi@orangepi:~$ '''ls /dev/spidev*'''</p>
<p>/dev/spidev1.0 /dev/spidev2.0</p></li>
<li><p>Do not short the mosi and miso pins of SPI1 or SPI2. The output 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>'''or'''</p>
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev2.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 the mosi and miso pins of SPI1 or SPI2 and run spidev_test. The output is as follows. You can see that the data sent and received are the same.</p>
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev1.0'''</p>
<p>'''or'''</p>
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev2.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>
=== 40 pin I2C test ===
<ol style="list-style-type: decimal;">
<li><p>As can be seen from the figure below, the available i2c buses for Orange Pi 4A are i2c1, i2c4 and i2c5, a total of three i2c buses.</p>
<p>[[File:Orange_Pi_4A-image152.png|575x191px]]</p></li>
<li><p>The corresponding pins of the three groups of I2C buses in 40 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''I2CBus'''
| style="text-align: left;"| '''SDA correspond 40pin'''
| style="text-align: left;"| '''SCL correspond 40pin'''
| style="text-align: left;"| '''Dtbo Corresponding configuration'''
|-
| style="text-align: left;"| '''I2C1'''
| style="text-align: left;"| '''Pin 12'''
| style="text-align: left;"| '''Pin 7'''
| style="text-align: left;"| '''sun55i-t527-i2c1'''
|-
| style="text-align: left;"| '''I2C4'''
| style="text-align: left;"| '''Pin 3'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''sun55i-t527-i2c4'''
|-
| style="text-align: left;"| '''I2C5'''
| style="text-align: left;"| '''Pin 27'''
| style="text-align: left;"| '''Pin 28'''
| style="text-align: left;"| '''sun55i-t527-i2c5'''
|}
'''In Linux system, the i2c function in 40pin is disabled by default and needs to be enabled manually before it can be used.'''
'''Add the following red font configuration to /boot/extlinux/extlinux.conf, and then restart the Linux system to enable i2c1, i2c4 and i2c5,Note that when opening multiple configurations at the same time, the contents in red font below need to be separated by spaces and written in one line.'''
'''orangepi@orangepi4a:~$ sudo vim /boot/extlinux/extlinux.conf'''
label Orange Pi
kernel /boot/uImage
initrd /boot/uInitrd
fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb
append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles
'''FDTOVERLAYS''' '''/boot/dtb/allwinner/overlay/sun55i-t527-i2c1.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-i2c4.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-i2c5.dtbo'''
<ol start="3" style="list-style-type: decimal;">
<li><p>After starting the Linux system, first confirm that the i2c device node exists under /dev</p>
<p>orangepi@orangepi:~$ '''ls /dev/i2c-*'''</p>
<p>'''/dev/i2c-0 /dev/i2c-1 /dev/i2c-3 /dev/i2c-31 /dev/i2c-4 /dev/i2c-5 /dev/i2c-6'''</p></li>
<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 40 pin connector</p>
<p>'''Please select the 5V and 3.3V pins according to the specific i2c device. Different i2c devices may require different voltage values.'''</p></li>
<li><p>Then use the '''i2cdetect -y''' command. If the address of the connected i2c device can be detected, it means that i2c can be used normally.</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 1''' #i2c1 command</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 4''' #i2c4 command</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 5''' #i2c5 command</p></li></ol>
[[File:Orange_Pi_4A-image159.png|342x125px]]
<span id="pinuart-test"></span>
=== 40 pinUART test ===
<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, Orange Pi 4A has six uart buses: uart2, uart3, uart4, uart5, uart6 and uart7.</p>
<p>[[File:Orange_Pi_4A-image152.png|575x191px]]</p></li>
<li><p>The corresponding pins of the six UART bus groups in the 40 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''UART Bus'''
| style="text-align: left;"| '''RX corresponds to 40pin'''
| style="text-align: left;"| '''TX corresponds to 40pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''UART2'''
| style="text-align: left;"| '''Pin 13'''
| style="text-align: left;"| '''Pin 11'''
| style="text-align: left;"| '''sun55i-t527-uart2'''
|-
| style="text-align: left;"| '''UART3'''
| style="text-align: left;"| '''Pin 33'''
| style="text-align: left;"| '''Pin 32'''
| style="text-align: left;"| '''sun55i-t527-uart3'''
|-
| style="text-align: left;"| '''UART4'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''Pin 3'''
| style="text-align: left;"| '''sun55i-t527-uart4'''
|-
| style="text-align: left;"| '''UART5'''
| style="text-align: left;"| '''Pin 23'''
| style="text-align: left;"| '''Pin 24'''
| style="text-align: left;"| '''sun55i-t527-uart5'''
|-
| style="text-align: left;"| '''UART6'''
| style="text-align: left;"| '''Pin 26'''
| style="text-align: left;"| '''Pin 22'''
| style="text-align: left;"| '''sun55i-t527-uart6'''
|-
| style="text-align: left;"| '''UART7'''
| style="text-align: left;"| '''Pin 10'''
| style="text-align: left;"| '''Pin 8'''
| style="text-align: left;"| '''sun55i-t527-uart7'''
|}
'''In Linux system, the UART function in 40pin is disabled by default and needs to be enabled manually before it can be used.'''
'''Add the following red font configuration to /boot/extlinux/extlinux.conf, and then restart the Linux system to open uart2, uart3, uart4, uart5, uart6 and uart7. Note that when opening multiple configurations at the same time, the following red font content needs to be separated by spaces and written in one line.'''
'''orangepi@orangepi4a:~$ sudo vim /boot/extlinux/extlinux.conf'''
label Orange Pi
kernel /boot/uImage
initrd /boot/uInitrd
fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb
append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles
'''FDTOVERLAYS /boot/dtb/allwinner/overlay/sun55i-t527-uart2.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart3.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart4.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart5.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart6.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart7.dtbo'''
<ol start="3" style="list-style-type: decimal;">
<li><p>After entering the Linux system, first confirm whether there is a uart device node under '''/dev'''</p>
<p>orangepi@orangepi:~$ '''ls /dev/ttyAS*'''</p>
<p>/dev/ttyAS0 /dev/ttyAS1 /dev/ttyAS2 /dev/ttyAS3 /dev/ttyAS4 /dev/ttyAS5 /dev/ttyAS6 /dev/ttyAS7</p></li>
<li><p>Then start testing the UART interface. First use the Dupont line to short-circuit the rx and tx of the UART interface to be tested.</p></li>
<li><p>Use the '''gpio serial''' command to test the loopback function of the serial port as shown below. If you can see the following print, it means that the serial port communication is normal (ttyASX needs to be replaced with the corresponding uart node name, please do not copy it)</p>
<p>orangepi@orangepi:~$ '''gpio serial /dev/ttyASX'''</p>
<p>Out: 0: -> 0</p>
<p>Out: 1: -> 1</p>
<p>Out: 2: -> 2</p>
<p>Out: 3: -> 3^C</p></li></ol>
<span id="how-to-test-pwm-using-sysclasspwm"></span>
=== How to test PWM using /sys/class/pwm/ ===
<ol style="list-style-type: decimal;">
<li><p>According to the table below, the Orange Pi 4A has 14 PWM channels available, including pwm1, pwm2, pwm4, pwm5, pwm6, pwm7, pwm8, pwm9, pwm10, pwm11, pwm12, pwm13, pwm14, and pwm15</p>
<p>[[File:Orange_Pi_4A-image152.png|575x191px]]</p></li>
<li><p>The corresponding pins of PWM in 40pin are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''PWM Bus'''
| style="text-align: left;"| '''Corresponding to 40pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''PWM0-1'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''sun55i-t527-pwm1'''
|-
| style="text-align: left;"| '''PWM0-2'''
| style="text-align: left;"| '''Pin 31'''
| style="text-align: left;"| '''sun55i-t527-pwm2'''
|-
| style="text-align: left;"| '''PWM0-4'''
| style="text-align: left;"| '''Pin 8'''
| style="text-align: left;"| '''sun55i-t527-pwm4'''
|-
| style="text-align: left;"| '''PWM0-5'''
| style="text-align: left;"| '''Pin 10'''
| style="text-align: left;"| '''sun55i-t527-pwm5'''
|-
| style="text-align: left;"| '''PWM0-6'''
| style="text-align: left;"| '''Pin 11'''
| style="text-align: left;"| '''sun55i-t527-pwm6'''
|-
| style="text-align: left;"| '''PWM0-7'''
| style="text-align: left;"| '''Pin 13'''
| style="text-align: left;"| '''sun55i-t527-pwm7'''
|-
| style="text-align: left;"| '''PWM0-8'''
| style="text-align: left;"| '''Pin 7'''
| style="text-align: left;"| '''sun55i-t527-pwm8'''
|-
| style="text-align: left;"| '''PWM0-9'''
| style="text-align: left;"| '''Pin 12'''
| style="text-align: left;"| '''sun55i-t527-pwm9'''
|-
| style="text-align: left;"| '''PWM0-10'''
| style="text-align: left;"| '''Pin 35'''
| style="text-align: left;"| '''sun55i-t527-pwm10'''
|-
| style="text-align: left;"| '''PWM0-11'''
| style="text-align: left;"| '''Pin 38'''
| style="text-align: left;"| '''sun55i-t527-pwm11'''
|-
| style="text-align: left;"| '''PWM0-12'''
| style="text-align: left;"| '''Pin 32'''
| style="text-align: left;"| '''sun55i-t527-pwm12'''
|-
| style="text-align: left;"| '''PWM0-13'''
| style="text-align: left;"| '''Pin 33'''
| style="text-align: left;"| '''sun55i-t527-pwm13'''
|-
| style="text-align: left;"| '''PWM0-14'''
| style="text-align: left;"| '''Pin 16'''
| style="text-align: left;"| '''sun55i-t527-pwm14'''
|-
| style="text-align: left;"| '''PWM0-15'''
| style="text-align: left;"| '''Pin 18'''
| style="text-align: left;"| '''sun55i-t527-pwm15'''
|}
'''In Linux system, the PWM function in 40pin is disabled by default and needs to be enabled manually before it can be used.'''
'''Add the following configuration in red font to /boot/extlinux/extlinux.conf, and then restart the Linux system to turn on pwm1, pwm2, pwm4, pwm5, pwm6, pwm7, pwm8, pwm9, pwm10, pwm11, pwm12, pwm13, pwm14 and pwm15. If you only need to turn on one, just fill in one.'''
'''orangepi@orangepi4a:~$ sudo vim /boot/extlinux/extlinux.conf'''
label Orange Pi
kernel /boot/uImage
initrd /boot/uInitrd
fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb
append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles
'''FDTOVERLAYS /boot/dtb/allwinner/overlay/sun55i-t527-pwm1.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm2.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm4.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm5.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm6.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm7.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm8.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm9.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm10.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm11.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm12.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm13.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm14.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm15.dtbo'''
<ol start="3" style="list-style-type: decimal;">
<li><p>After restarting, you can start the PWM test</p>
<p>'''Please execute the following commands as the root user.'''</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Enter the following command in the command line to make pwm1 output a 50Hz square wave</p>
<p>root@orangepi:~# '''echo 1 > /sys/class/pwm/pwmchip0/export'''</p>
<p>root@orangepi:~# '''echo 20000000 > /sys/class/pwm/pwmchip0/pwm1/period'''</p>
<p>root@orangepi:~# '''echo 1000000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle'''</p>
<p>root@orangepi:~# '''echo 1 > /sys/class/pwm/pwmchip0/pwm1/enable'''</p></li>
<li><p>Enter the following command in the command line to make pwm2 output a 50Hz square wave</p></li></ol>
</li></ol>
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'''
<ol start="3" style="list-style-type: lower-alpha;">
<li>Enter the following command in the command line to make pwm4 output a 50Hz square wave</li></ol>
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'''
<ol start="4" style="list-style-type: lower-alpha;">
<li><p>Other PWM test methods are similar and will not be described here.</p>
<div class="figure">
[[File:Orange_Pi_4A-image160.jpeg|574x344px|69D96433378187B10005CDD2A52881B0]]
</div></li></ol>
<span id="installation-and-use-of-wiringop-python"></span>
== Installation and use of wiringOP-Python ==
'''wiringOP-Python is the Python version of wiringOP, which is used to operate the GPIO, I2C, SPI, UART and other hardware resources of the development board in Python programs.'''
'''Also note that all the commands below are performed under the root user.'''
<span id="installation-of-wiringop-python"></span>
=== Installation of wiringOP-Python ===
<ol style="list-style-type: decimal;">
<li><p>First install the dependency package</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 that there are no errors during the download process due to network problems.'''
If you have problems downloading the code from GitHub, you can directly use the wiringOP-Python source code that comes with the Linux image, which is stored in /'''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 > bindings.i'''</p>
<p>root@orangepi:~/wiringOP-Python# '''sudo python3 setup.py install'''</p></li>
<li><p>Then enter the following command. If help information is output, it means wiringOP-Python has been successfully installed. Press the '''q''' key to exit the help information interface.</p></li></ol>
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.
<ol start="5" style="list-style-type: decimal;">
<li><p>The steps to test whether wiringOP-Python is successfully installed in the python command line are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li>First use the python3 command to enter the python3 command line mode</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>
>>> '''import wiringpi;'''
<ol start="3" style="list-style-type: lower-alpha;">
<li>Finally, enter the following command to view the help information of wiringOP-Python. Press the '''q''' key to exit the help information interface.</li></ol>
>>> '''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)
|
>>>
<span id="pin-gpio-port-test-1"></span>
=== 40 pin GPIO port test ===
'''WiringOP-Python is the same as wiringOP. It 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, the correspondence between the board's wPi number and the physical pin can only be viewed through the gpio command in wiringOP.'''
[[File:Orange_Pi_4A-image155.png|575x354px]]
<ol style="list-style-type: decimal;">
<li><p>Below, we take pin 7, which corresponds to GPIO PB4 and wPi number 2, as an example to demonstrate how to set the high and low levels of the GPIO port.</p>
<p>[[File:Orange_Pi_4A-image156.png|575x119px]]</p></li>
<li><p>The steps for testing directly using commands are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, set the GPIO port to output mode. The first parameter of the '''pinMode''' function is the wPi number corresponding to the pin, and the second parameter is the GPIO mode.</p>
<p>root@orangepi:~/wiringOP-Python# '''python3 -c "import wiringpi; \'''</p>
<p>'''from wiringpi import GPIO; wiringpi.wiringPiSetup() ; \'''</p>
<p>'''wiringpi.pinMode(2, GPIO.OUTPUT) ; "'''</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 that the low level is set successfully.</p>
<p>root@orangepi:~/wiringOP-Python# '''python3 -c "import wiringpi; \'''</p>
<p>'''from wiringpi import GPIO; wiringpi.wiringPiSetup() ;\'''</p>
<p>'''wiringpi.digitalWrite(2, GPIO.LOW)"'''</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 that the high level is set successfully.</p>
<p>root@orangepi:~/wiringOP-Python# '''python3 -c "import wiringpi; \'''</p>
<p>'''from wiringpi import GPIO; wiringpi.wiringPiSetup() ;\'''</p>
<p>'''wiringpi.digitalWrite(2, GPIO.HIGH)"'''</p></li></ol>
</li>
<li><p>The steps for testing in the python3 command line are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First use the python3 command to enter the python3 command line mode</p>
<p>root@orangepi:~# '''python3'''</p></li>
<li><p>Then import the Python module of wiringPi</p>
<p>>>> '''import wiringpi'''</p>
<p>>>> '''from wiringpi import GPIO'''</p></li>
<li><p>Then set the GPIO port to output mode, where the first parameter of the '''pinMode''' function is the wPi number corresponding to the pin, and the second parameter is the GPIO mode</p>
<p>>>> '''wiringpi.wiringPiSetup()'''</p>
<p>0</p>
<p>>>> '''wiringpi.pinMode(2, GPIO.OUTPUT)'''</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 that the low level is set successfully.</p>
<p>>>> '''wiringpi.digitalWrite(2, GPIO.LOW)'''</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 that the high level is set successfully.</p>
<p>>>> '''wiringpi.digitalWrite(2, GPIO.HIGH)'''</p></li></ol>
</li>
<li><p>wiringOP-Python For setting the GPIO high and low levels in Python code, please 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 pins of the development board to change continuously.</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>
=== 40 pin SPI test ===
<ol style="list-style-type: decimal;">
<li><p>As shown in the figure below, the available SPIs of Orange Pi 4A are SPI1 and SPI2.</p>
<p>[[File:Orange_Pi_4A-image152.png|575x191px]]</p></li>
<li><p>The corresponding pins of SPI1 and SPI2 on 40pin are shown in the following table</p></li></ol>
{| class="wikitable"
|-
|
| style="text-align: left;"| '''SPI1 corresponds to 40pin'''
| style="text-align: left;"| '''SPI2 corresponds to 40pin'''
|-
| '''MOSI'''
| style="text-align: left;"| '''Pin 19'''
| style="text-align: left;"| '''Pin 15'''
|-
| '''MISO'''
| style="text-align: left;"| '''Pin 21'''
| style="text-align: left;"| '''Pin 29'''
|-
| '''CLK'''
| style="text-align: left;"| '''Pin 23'''
| style="text-align: left;"| '''Pin 13'''
|-
| '''CS0'''
| style="text-align: left;"| '''Pin 24'''
| style="text-align: left;"| '''Pin 11'''
|}
'''In Linux system, the SPI function in 40pin is disabled by default and needs to be enabled manually before it can be used.'''
'''Add the following red font configuration to /boot/extlinux/extlinux.conf, and then restart the Linux system to enable spi1 and spi2. Note that when opening multiple configurations at the same time, the following red font content needs to be separated by spaces and written in one line.'''
'''orangepi@orangepi4a:~$ sudo vim /boot/extlinux/extlinux.conf'''
label Orange Pi
kernel /boot/uImage
initrd /boot/uInitrd
fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb
append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles
'''FDTOVERLAYS /boot/dtb/allwinner/overlay/sun55i-t527-spi1-cs0-spidev.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-spi2-cs0-spidev.dtbo'''
<ol start="3" style="list-style-type: decimal;">
<li><p>Then check whether the device node of '''spidevx.x''' exists in the Linux system. If it exists, it means that the SPI configuration has taken effect.</p>
<p>orangepi@orangepi:~$ '''ls /dev/spidev*'''</p>
<p>/dev/spidev1.0 /dev/spidev2.0</p></li>
<li><p>Then you can use the '''spidev_test.py''' program in the 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 SPI channel number</p></li>
<li><p>'''--port''':Specify the SPI port number</p></li></ol>
</li>
<li><p>Do not short the mosi and miso pins of SPI. The output of running spidev_test.py is as follows. You can see that the data of TX and RX are inconsistent.</p>
<p>'''The x after the --channel and --port parameters needs to be replaced with the specific SPI channel number and SPI port number.'''</p>
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p></li></ol>
root@orangepi:~/wiringOP-Python/examples# '''python3 spidev_test.py \'''
'''--channel x --port x'''
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 the Dupont line to short the SPI's txd and rxd pins and run spidev_test.py. The output is as follows. You can see that the sent and received data are the same, indicating that the SPI loopback test is normal.</p>
<p>'''The x after the --channel and --port parameters needs to be replaced with the specific SPI channel number and SPI port number.'''</p>
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p></li></ol>
root@orangepi:~/wiringOP-Python/examples# '''python3 spidev_test.py \'''
'''--channel x --port x'''
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>
=== 40 pin I2C test ===
<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, the available i2c buses for Orange Pi 4A are i2c1, i2c4 and i2c5, a total of three i2c buses.</p>
<p>[[File:Orange_Pi_4A-image152.png|575x191px]]</p></li>
<li><p>The corresponding pins of the three groups of I2C buses in 40 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''I2CBus'''
| style="text-align: left;"| '''SDA corresponds to 40pin'''
| style="text-align: left;"| '''SCL corresponds to 40pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''I2C1'''
| style="text-align: left;"| '''Pin 12'''
| style="text-align: left;"| '''Pin 7'''
| style="text-align: left;"| '''sun55i-t527-i2c1'''
|-
| style="text-align: left;"| '''I2C4'''
| style="text-align: left;"| '''Pin 3'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''sun55i-t527-i2c4'''
|-
| style="text-align: left;"| '''I2C5'''
| style="text-align: left;"| '''Pin 27'''
| style="text-align: left;"| '''Pin 28'''
| style="text-align: left;"| '''sun55i-t527-i2c5'''
|}
'''In Linux system, the i2c function in 40pin is disabled by default and needs to be enabled manually before it can be used.'''
'''Add the following red font configuration to /boot/extlinux/extlinux.conf, and then restart the Linux system to enable i2c1, i2c4 and i2c5. Note that when opening multiple configurations at the same time, the following red font content needs to be separated by spaces and written in one line.'''
'''orangepi@orangepi4a:~$ sudo vim /boot/extlinux/extlinux.conf'''
label Orange Pi
kernel /boot/uImage
initrd /boot/uInitrd
fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb
append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles
'''FDTOVERLAYS /boot/dtb/allwinner/overlay/sun55i-t527-i2c1.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-i2c4.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-i2c5.dtbo'''
<ol start="3" style="list-style-type: decimal;">
<li><p>After starting the Linux system, first confirm that the i2c device node exists under /dev</p>
<p>orangepi@orangepi:~$ '''ls /dev/i2c-*'''</p>
<p>'''/dev/i2c-0 /dev/i2c-1 /dev/i2c-3 /dev/i2c-31 /dev/i2c-4 /dev/i2c-5 /dev/i2c-6'''</p></li>
<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 40 pin connector. Here we take the DS1307 RTC module as an example.</p>
<p>[[File:Orange_Pi_4A-image161.png|180x153px]]</p></li>
<li><p>Then use the '''i2cdetect -y''' command. If the address of the connected i2c device can be detected, it means that the i2c device is connected correctly</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 1''' #i2c1 Command</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 4''' #i2c4 Command</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 5''' #i2c5 Command</p></li></ol>
[[File:Orange_Pi_4A-image159.png|342x125px]]
<ol start="7" style="list-style-type: decimal;">
<li><p>Then you can run the '''ds1307.py''' test program in the '''examples''' to read the RTC time.</p>
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p>
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 ds1307.py --device \'''</p>
<p>'''"/dev/i2c-1"'''</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"></span>
=== 40 pin的UART test ===
<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, Orange Pi 4A has six uart buses: uart2, uart3, uart4, uart5, uart6 and uart7</p>
<p>[[File:Orange_Pi_4A-image152.png|575x191px]]</p></li>
<li><p>The corresponding pins of the six UART bus groups in the 40 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''UART Bus'''
| style="text-align: left;"| '''RX corresponds to 40pin'''
| style="text-align: left;"| '''TX corresponds to 40pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''UART2'''
| style="text-align: left;"| '''Pin 13'''
| style="text-align: left;"| '''Pin 11'''
| style="text-align: left;"| '''sun55i-t527-uart2'''
|-
| style="text-align: left;"| '''UART3'''
| style="text-align: left;"| '''Pin 33'''
| style="text-align: left;"| '''Pin 32'''
| style="text-align: left;"| '''sun55i-t527-uart3'''
|-
| style="text-align: left;"| '''UART4'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''Pin 3'''
| style="text-align: left;"| '''sun55i-t527-uart4'''
|-
| style="text-align: left;"| '''UART5'''
| style="text-align: left;"| '''Pin 23'''
| style="text-align: left;"| '''Pin 24'''
| style="text-align: left;"| '''sun55i-t527-uart5'''
|-
| style="text-align: left;"| '''UART6'''
| style="text-align: left;"| '''Pin 26'''
| style="text-align: left;"| '''Pin 22'''
| style="text-align: left;"| '''sun55i-t527-uart6'''
|-
| style="text-align: left;"| '''UART7'''
| style="text-align: left;"| '''Pin 10'''
| style="text-align: left;"| '''Pin 8'''
| style="text-align: left;"| '''sun55i-t527-uart7'''
|}
'''In Linux system, the UART function in 40pin is disabled by default and needs to be enabled manually before it can be used.'''
'''Add the following red font configuration to /boot/extlinux/extlinux.conf, and then restart the Linux system to open uart2, uart3, uart4, uart5, uart6 and uart7. Note that when opening multiple configurations at the same time, the following red font content needs to be separated by spaces and written in one line.'''
'''orangepi@orangepi4a:~$ sudo vim /boot/extlinux/extlinux.conf'''
label Orange Pi
kernel /boot/uImage
initrd /boot/uInitrd
fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb
append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles
'''FDTOVERLAYS /boot/dtb/allwinner/overlay/sun55i-t527-uart2.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart3.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart4.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart5.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart6.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart7.dtbo'''
<ol start="3" style="list-style-type: decimal;">
<li><p>After entering the Linux system, first confirm whether there is a uart device node under '''/dev'''</p>
<p>orangepi@orangepi:~$ '''ls /dev/ttyAS*'''</p>
<p>/dev/ttyAS0 /dev/ttyAS1 /dev/ttyAS2 /dev/ttyAS3 /dev/ttyAS4 /dev/ttyAS5 /dev/ttyAS6 /dev/ttyAS7</p></li>
<li><p>Then start testing the UART interface. First use the Dupont line to short-circuit the rx and tx of the UART interface to be tested</p></li>
<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 (ttyASX needs to be replaced with the corresponding uart node name, please do not copy it)</p>
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p>
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 serialTest.py --device /dev/ttyASX'''</p>
<p>Out: 0: -> 0</p>
<p>Out: 1: -> 1</p>
<p>Out: 2: -> 2</p>
<p>Out: 3: -> 3</p>
<p>Out: 4:^C</p>
<p>exit</p></li></ol>
<span id="hardware-watchdog-test"></span>
== Hardware watchdog test ==
The Linux system released by Orange Pi has the watchdog_test program pre-installed, which can be used for direct testing.
The method to run the watchdog_test program is as follows:
<ol style="list-style-type: lower-alpha;">
<li><p>The second parameter 10 represents the watchdog count time. If the watchdog 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 of keep alive to indicate that the dog was successfully fed.</p>
<p>orangepi@orangepi:~$ '''sudo watchdog_test 10'''</p>
<p>open success</p>
<p>options is 33152,identity is sunxi-wdt</p>
<p>put_usr return,if 0,success:0</p>
<p>The old reset time is: 16</p>
<p>return ENOTTY,if -1,success:0</p>
<p>return ENOTTY,if -1,success:0</p>
<p>put_user return,if 0,success:0</p>
<p>put_usr return,if 0,success:0</p>
<p>keep alive</p>
<p>keep alive</p>
<p>keep alive</p></li></ol>
<span id="check-the-chipid-of-t527-chip"></span>
== Check the chipid of T527 chip ==
The command to view the chipid of the T527 chip is as follows. The chipid of each chip is different, so the chipid can be used to distinguish multiple development boards.
orangepi@orangepi:~# '''cat /sys/class/sunxi_info/sys_info |grep sunxi_serial'''
sunxi_serial : 208d211475779d0c0000019000000000
<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 ===
'''If the Python version in the Ubuntu or Debian system software repository 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 package to compile and install the latest version of Python.'''
'''The following demonstrates compiling and installing 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 of the Python you want to install).'''
<ol style="list-style-type: decimal;">
<li><p>First install the dependency packages required 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 Python 3.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:~/Python-3.9.10$ '''./configure --enable-optimizations'''</p></li>
<li><p>Then compile and install Python 3.9. The compilation time takes about half an hour.</p>
<p>orangepi@orangepi:~/Python-3.9.10$ '''make -j4'''</p>
<p>orangepi@orangepi:~/Python-3.9.10$ '''sudo make altinstall'''</p></li>
<li><p>After installation, you can use the following command to view the version number of Python just installed</p>
<p>orangepi@orangepi:~/Python-3.9.10$ '''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-change-pip-source-in-python"></span>
=== How to change pip source in Python ===
'''The default source used by pip in Linux system is the official source of Python, but the speed of accessing the official source of Python in China is very slow, and the installation of Python packages often fails due to network problems. So when using pip to install Python libraries, please remember to change the pip source.'''
<ol style="list-style-type: decimal;">
<li><p>First install '''python3-pip'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y python3-pip'''</p></li>
<li><p>How to permanently change pip source under Linux</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First create a new '''~/.pip''' directory, then add the '''pip.conf''' configuration file and set the source of pip to Tsinghua source</p>
<p>orangepi@orangepi:~$ '''mkdir -p ~/.pip'''</p>
<p>orangepi@orangepi:~$ '''cat <<EOF > ~/.pip/pip.conf'''</p>
<p>'''[global]'''</p>
<p>'''timeout = 6000'''</p>
<p>'''index-url = https://pypi.tuna.tsinghua.edu.cn/simple'''</p>
<p>'''trusted-host = pypi.tuna.tsinghua.edu.cn'''</p>
<p>'''EOF'''</p></li>
<li><p>Then use pip3 to install the Python library quickly.</p></li></ol>
</li>
<li><p>How to temporarily change the pip source under Linux, where '''<packagename>''' needs to be replaced with the specific package name</p>
<p>orangepi@orangepi:~$ '''pip3 install <packagename> -i \'''</p>
<p>'''https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn'''</p></li></ol>
<span id="how-to-install-docker"></span>
== How to install Docker ==
The Linux image provided by Orange Pi has Docker pre-installed, but the Docker service is not enabled 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 you can run '''hello-world''', it means that 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 '''permission denied''' is prompted, add the current user to the docker user group so that the docker command can be run without sudo.
orangepi@orangepi:~$ '''sudo usermod -aG docker $USER'''
'''Note: You need to log out and log in again to take effect, or restart the system.'''
<span id="how-to-install-home-assistant"></span>
== How to install Home Assistant ==
'''Note that this article will only provide methods for installing Home Assistant in Ubuntu or Debian systems. For detailed usage of Home Assistant, please refer to the official documentation or corresponding books.'''
<span id="install-via-docker"></span>
=== Install via Docker ===
<ol style="list-style-type: decimal;">
<li><p>First, please install Docker and make sure it can run normally. For the installation steps of Docker, please refer to the instructions in the section [[#how-to-install-docker|'''How to install Docker''']].</p></li>
<li><p>Then you can search for Home Assistant's docker image</p>
<p>orangepi@orangepi:~$ '''docker search homeassistant'''</p></li>
<li><p>Then use the following command to download the Home Assistant docker image to your local computer. The image size is about 1GB and the download time will be longer. Please wait patiently for the download to complete.</p>
<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 that you just downloaded</p>
<p>orangepi@orangepi:~$ '''docker images homeassistant/home-assistant'''</p>
<p>REPOSITORY TAG IMAGE ID CREATED SIZE</p>
<p>homeassistant/home-assistant latest bfa0ab9e1cf5 2 months ago '''1.17GB'''</p></li>
<li><p>Now you can run the Home Assistant docker container</p>
<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 [IP address of the development board: 8123] in the browser to see the Home Assistant interface</p>
<p>'''It takes a while for the Home Assistant container to start. If the following interface does not display normally, please wait a few seconds and refresh it. If the following interface does not display normally after waiting for more than a minute, it means that 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 setup process.'''</p>
<p>[[File:Orange_Pi_4A-image162.png|576x209px]]</p></li>
<li><p>Then enter your '''name''', '''username''' and '''password''' and click '''Create Account'''</p>
<p>[[File:Orange_Pi_4A-image163.png|220x279px]]</p></li>
<li><p>Then follow the interface prompts to set according to your preferences, and then click Next</p>
<p>[[File:Orange_Pi_4A-image164.png|575x297px]]</p></li>
<li><p>Then click Next</p>
<p>[[File:Orange_Pi_4A-image165.png|576x185px]]</p></li>
<li><p>Then click Finish</p>
<p>[[File:Orange_Pi_4A-image166.png|576x117px]]</p></li>
<li><p>The main interface of Home Assistant is shown below.</p>
<p>[[File:Orange_Pi_4A-image167.png|574x294px]]</p></li>
<li><p>How to stop the Home Assistant container</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The command to view the docker container is as follows</p>
<p>orangepi@orangepi:~$ '''docker ps -a'''</p></li>
<li><p>The command to stop the Home Assistant container is as follows</p>
<p>orangepi@orangepi:~$ '''docker stop homeassistant'''</p></li>
<li><p>The command to delete the Home Assistant container is as follows</p>
<p>orangepi@orangepi:~$ '''docker rm homeassistant'''</p></li></ol>
</li></ol>
<span id="installation-via-python"></span>
=== Installation via Python ===
'''Before installation, please change the source of pip to the domestic source to speed up the installation of the Python package. For the configuration method, see the section [[#how-to-change-pip-source-in-python|How to change the pip source in Python]].'''
<ol style="list-style-type: decimal;">
<li><p>First install the dependency package</p>
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y python3 python3-dev python3-venv \'''</p>
<p>'''python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \'''</p>
<p>'''libopenjp2-7 libtiff5 libturbojpeg0-dev tzdata'''</p>
<p>'''If it is debian12, please use the following command:'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y python3 python3-dev python3-venv \'''</p>
<p>'''python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \'''</p>
<p>'''libopenjp2-7 libturbojpeg0-dev tzdata'''</p></li>
<li><p>Then you need to compile and install Python 3.9. For more information, please refer to the section on [[#how-to-compile-and-install-python-source-code|'''compiling and installing Python source code''']].</p>
<p>'''The default Python version of Ubuntu Jammy is Python 3.10, so there is no need to compile and install it.'''</p>
<p>'''The default Python version of Debian Bookworm is Python 3.11, so there is no need to compile and install it.'''</p></li>
<li><p>Then create a Python virtual environment</p>
<p>'''In Debian Bookworm, it is python3.11, so please remember to replace the corresponding commands.'''</p>
<p>orangepi@orangepi:~$ '''sudo mkdir /srv/homeassistant'''</p>
<p>orangepi@orangepi:~$ '''sudo chown orangepi:orangepi /srv/homeassistant'''</p>
<p>orangepi@orangepi:~$ '''cd /srv/homeassistant'''</p>
<p>orangepi@orangepi:/srv/homeassistant$ '''python3.9 -m venv .'''</p>
<p>orangepi@orangepi:/srv/homeassistant$ '''source bin/activate'''</p>
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$</p></li>
<li><p>Then install the required Python packages</p>
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''python3 -m pip install wheel'''</p></li>
<li><p>Then you can install Home Assistant Core</p>
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''pip3 install homeassistant'''</p></li>
<li><p>Then enter the following command to run Home Assistant Core</p>
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''hass'''</p></li>
<li><p>Then enter '''[IP address of the development board: 8123]''' in the browser to see the Home Assistant interface</p>
<p>'''When you run the hass command for the first time, it will download, install, and cache some necessary libraries and dependencies. This process may take several minutes. Note that you will not be able to see the Home Assistant interface in your browser at this time. Please wait for a while before refreshing.'''</p>
<p>[[File:Orange_Pi_4A-image168.png|576x203px]]</p></li></ol>
<span id="opencv-installation-method"></span>
== OpenCV installation method ==
<span id="install-opencv-using-apt"></span>
=== Install OpenCV using apt ===
<ol style="list-style-type: decimal;">
<li><p>The installation command is as follows</p>
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y libopencv-dev python3-opencv'''</p></li>
<li><p>Then use the following command to print the version number of OpenCV. The output is normal, indicating that OpenCV is installed successfully.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The version of OpenCV in Ubuntu 22.04 is as follows:</p>
<p>orangepi@orangepi:~$ '''python3 -c "import cv2; print(cv2.__version__)"'''</p>
<p>'''4.5.4'''</p></li>
<li><p>The version of OpenCV in Debian 12 is as follows:</p>
<p>orangepi@orangepi:~$ '''python3 -c "import cv2; print(cv2.__version__)"'''</p>
<p>'''4.6.0'''</p></li></ol>
</li></ol>
<span id="how-to-install-baota-linux-panel"></span>
== How to install Baota Linux Panel ==
'''Baota Linux Panel is a server management software that improves operation and maintenance efficiency. It supports more than 100 server management functions such as one-click LAMP/LNMP/cluster/monitoring/website/FTP/database/JAVA (excerpted from Baota official website)'''
<ol style="list-style-type: decimal;">
<li><p>First, you need to expand the size of the '''/tmp''' space. After setting, you need to '''restart the Linux system of the development board'''. The command is as follows:</p>
<p>orangepi@orangepi:~$ '''sudo sed -i 's/nosuid/&,size=2G/' /etc/fstab'''</p>
<p>orangepi@orangepi:~$ '''sudo reboot'''</p></li>
<li><p>After restarting, you can see that the size of the '''/tmp''' space has become 2G</p>
<p>orangepi@orangepi:~$ '''df -h | grep "/tmp"'''</p>
<p>tmpfs 2.0G 12K '''2.0G''' 1% /tmp</p></li>
<li><p>Then enter the following command in the Linux system to start the installation of the baota</p>
<p>orangepi@orangepi:~$ '''sudo install_bt_panel.sh'''</p></li>
<li><p>Then the Baota installation program will prompt whether to install '''Bt-Panel''' to the '''/www''' folder, just enter y</p>
<p>+----------------------------------------------------------------------</p>
<p>| Bt-WebPanel FOR CentOS/Ubuntu/Debian</p>
<p>+----------------------------------------------------------------------</p>
<p>| Copyright © 2015-2099 BT-SOFT(http://www.bt.cn) All rights reserved.</p>
<p>+----------------------------------------------------------------------</p>
<p>| The WebPanel URL will be http://SERVER_IP:8888 when installed.</p>
<p>+----------------------------------------------------------------------</p>
<p>Do you want to install Bt-Panel to the /www directory now?(y/n): '''y'''</p></li>
<li><p>Then all you have to do is wait patiently. When you see the following print information output by the terminal, it means that the pagoda has been installed. The entire installation process takes about 34 minutes, which may vary depending on the network speed.</p>
<p>[[File:Orange_Pi_4A-image169.png|576x233px]]</p></li>
<li><p>At this time, enter the '''panel address''' shown above in the browser to open the login interface of the Baota Linux panel, and then enter the '''username''' and '''password''' shown in the above figure in the corresponding position to log in to Baota</p>
<p>[[File:Orange_Pi_4A-image170.png|575x281px]]</p></li>
<li><p>After successfully logging into the pagoda, the following welcome interface will pop up. First, please read the user instructions in the middle and drag them to the bottom. Then you can select "I have agreed and read the User Agreement", and then click "Enter the Panel" to enter the baota.</p>
<p>[[File:Orange_Pi_4A-image171.png|575x317px]]</p></li>
<li><p>After entering the pagoda, you will be prompted to bind an account on the pagoda official website. If you do not have an account, you can go to the pagoda official website ('''https://www.bt.cn''') to register one.</p>
<p>[[File:Orange_Pi_4A-image172.png|576x300px]]</p></li>
<li><p>The final interface is shown in the figure below. You can intuitively see some status information of the development board Linux system, such as load status, CPU usage, memory usage, and storage space usage</p>
<p>[[File:Orange_Pi_4A-image173.png|575x306px]]</p></li>
<li><p>For more functions of the pagoda, please refer to the following information to explore it yourself</p>
<p>User Manual:[http://docs.bt.cn '''http://docs.bt.cn''']</p>
<p>Forum Address:[https://www.bt.cn/bbs '''https://www.bt.cn/bbs''']</p>
<p>GitHub Link:'''https://github.com/aaPanel/BaoTa'''</p></li></ol>
<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 Ubuntu 22.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 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 the '''Applications''' list</p>
<p>[[File:Orange_Pi_4A-image174.png|575x323px]]</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>
<div class="figure">
[[File:Orange_Pi_4A-image175.png|576x324px|Screenshot from 2024-09-27 06-29-42]]
</div></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 '''Ubuntu22.04''' is as follows</p>
<p>[[File:Orange_Pi_4A-image176.png|426x232px]]</p></li>
<li><p>The default version of QT Creator in '''Debian12''' is as follows</p>
<p>[[File:Orange_Pi_4A-image177.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'''->'''About Plugins...'''</p>
<p>[[File:Orange_Pi_4A-image178.png|576x163px]]</p></li>
<li><p>Then remove the check mark of '''ClangCodeModel'''</p>
<p>[[File:Orange_Pi_4A-image179.png|380x256px]]</p></li>
<li><p>'''After setting, you need to restart QT Creator'''</p></li>
<li><p>Then make sure that QT Creator uses the GCC compiler. If it defaults to Clang, change it to GCC</p>
<p>'''For Debian 12, please skip this step.'''</p>
<p>[[File:Orange_Pi_4A-image180.png|576x328px]]</p>
<p>[[File:Orange_Pi_4A-image181.png|575x325px]]</p></li></ol>
</li>
<li><p>Then you can open a sample code</p>
<p>[[File:Orange_Pi_4A-image182.png|576x326px]]</p></li>
<li><p>Clicking on the sample code will automatically open the corresponding documentation. Please read the instructions carefully.</p>
<p>[[File:Orange_Pi_4A-image183.png|575x238px]]</p></li>
<li><p>Then click Next '''Configure Project'''</p>
<p>[[File:Orange_Pi_4A-image184.png|549x308px]]</p></li>
<li><p>Then click the green triangle in the lower left corner to compile and run the sample code</p>
<p>[[File:Orange_Pi_4A-image185.png|546x292px]]</p></li>
<li><p>After waiting for a while, the interface shown in the figure below will pop up, which means that QT can compile and run normally</p>
<p>[[File:Orange_Pi_4A-image186.png|575x336px]]</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-2-humble-on-ubuntu-22.04"></span>
=== How to install ROS 2 Humble on Ubuntu 22.04 ===
<ol style="list-style-type: decimal;">
<li><p>Use the '''install_ros.sh''' script to install ros2</p>
<p>orangepi@orangepi:~$ '''install_ros.sh ros2'''</p></li>
<li><p>After the'''install_ros.sh''' script installs ros2, it will automatically run the'''ros2 -h''' command. If you can see the following print, it means that ros2 is installed successfully.</p>
<p>usage: ros2 [-h] Call `ros2 <command> -h` for more detailed usage. ...</p>
<p>ros2 is an extensible command-line tool for ROS 2.</p>
<p>optional arguments:</p>
<p>-h, --help show this help message and exit</p>
<p>Commands:</p>
<p>action Various action related sub-commands</p>
<p>bag Various rosbag related sub-commands</p>
<p>component Various component related sub-commands</p>
<p>daemon Various daemon related sub-commands</p>
<p>doctor Check ROS setup and other potential issues</p>
<p>interface Show information about ROS interfaces</p>
<p>launch Run a launch file</p>
<p>lifecycle Various lifecycle related sub-commands</p>
<p>multicast Various multicast related sub-commands</p>
<p>node Various node related sub-commands</p>
<p>param Various param related sub-commands</p>
<p>pkg Various package related sub-commands</p>
<p>run Run a package specific executable</p>
<p>security Various security related sub-commands</p>
<p>service Various service related sub-commands</p>
<p>topic Various topic related sub-commands</p>
<p>wtf Use `wtf` as alias to `doctor`</p>
<p>Call `ros2 <command> -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 that ROS 2 can run normally.</p>
<p>orangepi@orangepi:~$ '''test_ros.sh'''</p>
<p>[INFO] [1671174101.200091527] [talker]: Publishing: 'Hello World: 1'</p>
<p>[INFO] [1671174101.235661048] [listener]: I heard: [Hello World: 1]</p>
<p>[INFO] [1671174102.199572327] [talker]: Publishing: 'Hello World: 2'</p>
<p>[INFO] [1671174102.204196299] [listener]: I heard: [Hello World: 2]</p>
<p>[INFO] [1671174103.199580322] [talker]: Publishing: 'Hello World: 3'</p>
<p>[INFO] [1671174103.204019965] [listener]: I heard: [Hello World: 3]</p></li>
<li><p>Run the following command to open rviz2</p>
<p>orangepi@orangepi:~$ '''source /opt/ros/humble/setup.bash'''</p>
<p>orangepi@orangepi:~$ '''ros2 run rviz2 rviz2'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image187.png|576x324px|Screenshot from 2024-09-27 06-18-57]]
</div></li>
<li><p>Reference Documents</p>
<p>'''http://docs.ros.org/en/humble/index.html'''</p>
<p>[http://docs.ros.org/en/galactic/Tutorials.html '''http://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html''']</p></li></ol>
<span id="how-to-install-kernel-header-files"></span>
== How to install kernel header files ==
<ol style="list-style-type: decimal;">
<li><p>The Linux image released by OPi comes with a deb package of kernel header files by default, which is stored in '''/opt/'''</p>
<p>orangepi@orangepi:~$ '''ls /opt/linux-headers*'''</p>
<p>/opt/linux-headers-xxx-sun55iw3_x.x.x_arm64.deb</p></li>
<li><p>Use the following command to install the kernel header file deb package</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 files are located under '''/usr/src'''</p>
<p>orangepi@orangepi:~$ '''ls /usr/src'''</p>
<p>linux-headers-x.x.x</p></li>
<li><p>Then you can compile the source code of the hello kernel module that comes with the Linux image. The source code of the hello module is in '''/usr/src/hello'''. After entering this directory, use the make command to compile it.</p>
<p>orangepi@orangepi:~$ '''cd /usr/src/hello/'''</p>
<p>orangepi@orangepi:/usr/src/hello$ '''sudo make'''</p>
<p>make -C /lib/modules/5.15.147-sun55iw3/build M=/usr/src/hello modules</p>
<p>make[1]: Entering directory '/usr/src/linux-headers-5.15.147-sun55iw3'</p>
<p>CC [M] /usr/src/hello/hello.o</p>
<p>MODPOST /usr/src/hello/Module.symvers</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.15.147-sun55iw3'</p></li>
<li><p>After compilation, the '''hello.ko''' kernel module will be generated</p>
<p>orangepi@orangepi:/usr/src/hello$ '''ls *.ko'''</p>
<p>hello.ko</p></li>
<li><p>Use the '''insmod''' command to insert the '''hello.ko''' kernel module into the kernel</p>
<p>orangepi@orangepi:/usr/src/hello$ '''sudo insmod hello.ko'''</p></li>
<li><p>Then use the '''demsg''' command to view the output of the '''hello.ko''' kernel module. If you can see the following output, it means that the '''hello.ko''' kernel module is loaded correctly.</p>
<p>orangepi@orangepi:/usr/src/hello$ '''dmesg | grep "Hello"'''</p>
<p>[ 2871.893988] '''Hello Orange Pi -- init'''</p></li>
<li><p>Use the '''rmmod'''command to uninstall the '''hello.ko''' kernel module</p>
<p>orangepi@orangepi:/usr/src/hello$ '''sudo rmmod hello'''</p>
<p>orangepi@orangepi:/usr/src/hello$ '''dmesg | grep "Hello"'''</p>
<p>[ 2871.893988] Hello Orange Pi -- init</p>
<p>[ 3173.800892] '''Hello Orange Pi -- exit'''</p></li></ol>
<span id="how-to-use-the-10.1-inch-mipi-lcd-screen"></span>
== How to use the 10.1 inch MIPI LCD screen ==
<span id="inch-mipi-screen-assembly-method"></span>
=== 10.1 inch MIPI screen assembly method ===
<ol style="list-style-type: decimal;">
<li><p>First prepare the necessary accessories</p>
<ol style="list-style-type: lower-alpha;">
<li><p>10.1 inch MIPI LCD display + touch screen</p>
<p>[[File:Orange_Pi_4A-image188.png|288x222px]]</p></li>
<li><p>Screen adapter board + 31pin to 40pin cable</p>
<div class="figure">
[[File:Orange_Pi_4A-image189.png|191x165px|DD9A8F44-0D8F-4f06-9473-B539DEED850C]]
</div></li>
<li><p>30pin MIPI cable</p>
<div class="figure">
[[File:Orange_Pi_4A-image190.png|355x33px|C2164119-6EC3-49ae-9A95-BE323F51FAE1]]
</div></li>
<li><p>12pin touch screen cable</p>
<p>[[File:Orange_Pi_4A-image191.png|293x43px]]</p></li></ol>
</li>
<li><p>Connect the 12-pin touch screen cable, 31-pin to 40-pin cable, and 30-pin MIPI cable to the screen adapter board as shown below. Note that the blue insulation side of the touch screen cable should face down, and the insulation sides of the other two cables should face up. If connected incorrectly, it will cause no display or inability to touch.</p>
<p>[[File:Orange_Pi_4A-image192.png|487x120px]]</p></li>
<li><p>Place the adapter board with the connected cable on the MIPI LCD screen as shown below, and connect the MIPI LCD screen and the adapter board via a 31pin to 40pin cable.</p></li></ol>
[[File:Orange_Pi_4A-image193.png|286x421px]]
<ol start="4" style="list-style-type: decimal;">
<li><p>Then connect the touch screen and the adapter board through the 12-pin touch screen cable, paying attention to the direction of the insulating surface</p>
<p>[[File:Orange_Pi_4A-image194.png|204x130px]]</p></li>
<li><p>Finally, connect it to the LCD interface of the development board through the 30pin MIPI cable</p>
<p>[[File:Orange_Pi_4A-image195.png|268x178px]]</p></li></ol>
<span id="how-to-open-the-10.1-inch-mipi-lcd-screen-configuration"></span>
=== How to open the 10.1-inch MIPI LCD screen configuration ===
<ol style="list-style-type: decimal;">
<li><p>The Linux image does not have the mipi lcd screen configuration turned on by default. If you need to use the mipi lcd screen, you need to turn it on manually.</p></li>
<li><p>The interface of the mipi lcd screen on the development board is shown in the figure below</p>
<p>[[File:Orange_Pi_4A-image196.png|245x140px]]</p></li>
<li><p>The method to open the mipi lcd configuration is as follows</p>
<p>orangepi@orangepi:~$ '''sudo vim /boot/extlinux/extlinux.conf'''</p>
<p>label Orange Pi</p>
<p>kernel /boot/uImage</p>
<p>initrd /boot/uInitrd</p>
<p>fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb</p>
<p>append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles</p>
<p>'''FDTOVERLAYS /boot/dtb/allwinner/overlay/sun55i-t527-lcd.dtbo''' #Configuration that needs to be added</p></li>
<li><p>'''Then restart the OPi OS Arch system'''</p></li>
<li><p>After restarting, you can see the display of the LCD screen as shown below (the default is vertical screen):</p></li></ol>
[[File:Orange_Pi_4A-image197.png|259x379px]]
<span id="methods-for-rotating-display-and-touch-directions"></span>
=== Methods for rotating display and touch directions ===
<ol style="list-style-type: decimal;">
<li><p>First click on the area in the upper right corner of the desktop</p>
<p>[[File:Orange_Pi_4A-image198.png|211x137px]]</p></li>
<li><p>Then open Settings</p>
<p>[[File:Orange_Pi_4A-image199.png|215x167px]]</p></li>
<li><p>Then select'''Displays'''</p>
<p>[[File:Orange_Pi_4A-image200.png|344x251px]]</p></li>
<li><p>Then select the direction you want to rotate in '''Orientation''' of '''Displays'''</p>
<p>[[File:Orange_Pi_4A-image201.png|344x247px]]</p></li>
<li><p>Then select '''Apply'''</p>
<p>[[File:Orange_Pi_4A-image202.png|339x246px]]</p></li>
<li><p>Then you can see that the screen has been rotated. At this time, you need to select '''Keep Changes''' to finalize the rotation.</p>
<p>[[File:Orange_Pi_4A-image203.png|235x111px]]</p></li>
<li><p>The LCD screen will display the following after rotating 90 degrees:</p>
<p>[[File:Orange_Pi_4A-image204.png|338x232px]]</p></li>
<li><p>'''The touch function of the Linux system LCD screen will rotate with the rotation of the display direction, without any other settings'''</p></li></ol>
<span id="how-to-use-the-edp-screen"></span>
== How to use the eDP screen ==
<span id="assembly-method-of-edp-screen"></span>
=== Assembly method of eDP screen ===
<ol style="list-style-type: decimal;">
<li><p>Currently only a 15.6-inch eDP screen is compatible, and the accessories included are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>0.5 pitch 30pin single head same direction cable</p>
<div class="figure">
[[File:Orange_Pi_4A-image205.jpeg|200x197px|0006 (1)]]
</div></li>
<li><p>15.6-inch eDP display, resolution 1920x1080.</p>
<div class="figure">
[[File:Orange_Pi_4A-image206.jpeg|212x368px|0006 (2)]]
</div></li></ol>
</li>
<li><p>Connect the FPC end of the 30-pin single-head unidirectional cable to the eDP interface of the development board, and the other end to the eDP interface of the screen.</p>
<p>[[File:Orange_Pi_4A-image207.png|228x94px]]</p></li></ol>
<span id="how-to-open-edp-screen-configuration"></span>
=== How to open eDP screen configuration ===
'''Please note that the method described below is only applicable to adapted eDP screens. If the customer is using an unadapted screen, it will not light up according to the method below.'''
# The Linux image does not have the eDP screen configuration turned on by default. If you need to use the eDP screen, you need to turn it on manually.
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>First add the following configuration to '''/boot/extlinux/extlinux.conf'''</p>
<p>orangepi@orangepi:~$ '''sudo vim /boot/extlinux/extlinux.conf'''</p>
<p>label Orange Pi</p>
<p>kernel /boot/uImage</p>
<p>initrd /boot/uInitrd</p>
<p>fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb</p>
<p>append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles</p>
<p>'''FDTOVERLAYS /boot/dtb/allwinner/overlay/sun55i-t527-edp.dtbo''' #Configuration that needs to be added</p></li>
<li><p>Then restart the system</p>
<p>[orangepi@orangepi-pc ~]$ '''sudo reboot'''</p></li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li>After startup, you can see the eDP screen display as shown below:</li></ol>
[[File:Orange_Pi_4A-image208.png|397x240px]]
<span id="test-of-some-programming-languages-supported-by-linux-system"></span>
== Test of some programming languages supported by Linux system ==
<span id="debian-bookworm-system"></span>
=== Debian Bookworm System ===
<ol style="list-style-type: decimal;">
<li><p>Debian Bookworm is installed with the gcc compilation toolchain by default, which can compile C language programs directly in the Linux system of the development board</p>
<ol style="list-style-type: lower-alpha;">
<li><p>gcc version is as follows</p>
<p>orangepi@orangepi:~$ '''gcc --version'''</p>
<p>gcc (Debian 12.2.0-14) 12.2.0</p>
<p>Copyright (C) 2022 Free Software Foundation, Inc.</p>
<p>This is free software; see the source for copying conditions. There is NO</p>
<p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p></li>
<li><p>Write the '''hello_world.c''' program in C language</p>
<p>orangepi@orangepi:~$ '''vim hello_world.c'''</p>
<p>#include <stdio.h></p>
<p>int main(void)</p>
<p>{</p>
<p>printf("Hello World!\n");</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>Debian Bookworm has Python 3 installed by default</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The specific version of Python is as follows</p>
<p>orangepi@orangepi:~$ '''python3'''</p>
<p>Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux</p>
<p>Type "help", "copyright", "credits" or "license" for more information.</p>
<p>>>></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</p>
<p>orangepi@orangepi:~$ '''vim hello_world.py'''</p>
<p>print('Hello World!')</p></li>
<li><p>The result of running '''hello_world.py''' is as follows</p>
<p>orangepi@orangepi:~$ '''python3 hello_world.py'''</p>
<p>Hello World!</p></li></ol>
</li>
<li><p>Debian Bookworm does not install Java compilation tools and runtime 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>
<p>orangepi@orangepi:~$ '''sudo apt install -y openjdk-17-jdk'''</p></li>
<li><p>After installation, you can check the Java version</p>
<p>orangepi@orangepi:~$ '''java --version'''</p></li>
<li><p>Write a 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("Hello World!");</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>
=== 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 compile C language programs directly in the Linux system of the development board</p>
<ol style="list-style-type: lower-alpha;">
<li><p>gcc version is as follows</p>
<p>orangepi@orangepi:~$ '''gcc --version'''</p></li></ol>
</li></ol>
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.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.
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>Write the '''hello_world.c''' program in C language</p>
<p>orangepi@orangepi:~$ '''vim hello_world.c'''</p>
<p>#include <stdio.h></p>
<p>int main(void)</p>
<p>{</p>
<p>printf("Hello World!\n");</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>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li><p>Ubuntu Jammy has Python 3 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.12 (main, Jul 29 2024, 16:56:48) [GCC 11.4.0] on linux</p>
<p>Type "help", "copyright", "credits" or "license" for more information.</p>
<p>>>></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</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 runtime 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 a '''hello_world.java''' of Java version</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("Hello World!");</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="how-to-upload-files-to-the-linux-system-of-the-development-board"></span>
== How to upload files to the Linux system of the development board ==
<span id="how-to-upload-files-from-ubuntu-pc-to-the-linux-system-of-the-development-board"></span>
=== How to upload files from Ubuntu PC to the Linux system of the development board ===
<span id="how-to-upload-files-using-the-scp-command"></span>
==== How to upload files using the scp command ====
<ol style="list-style-type: decimal;">
<li><p>Use the scp command to upload files from the Ubuntu PC to the Linux system of the development board. The specific commands are as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''file_path:'''Need to be replaced with the path of the file to be uploaded</p></li>
<li><p>'''orangepi:'''The user name of the development board's Linux system can also be replaced with other names, such as root</p></li>
<li><p>'''192.168.xx.xx:''' It 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 Linux system of the development board 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 uses for scp. Please use the following command to view the man page</p></li></ol>
test@test:~$ '''man scp'''
<span id="how-to-upload-files-using-filezilla"></span>
==== How to upload files using FileZilla ====
<ol style="list-style-type: decimal;">
<li><p>First install filezilla in your Ubuntu PC</p>
<p>test@test:~$ '''sudo apt install -y filezilla'''</p></li>
<li><p>Then open filezilla using the following command</p>
<p>test@test:~$ '''filezilla'''</p></li>
<li><p>The interface after opening filezilla is as follows. At this time, the remote site on the right is empty.</p>
<div class="figure">
[[File:Orange_Pi_4A-image209.png|576x453px|截图 2022-12-03 19-04-40]]
</div></li>
<li><p>The method of connecting the development board is shown in the figure below</p></li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image210.png|575x128px|图片565]]
</div>
<ol start="5" style="list-style-type: decimal;">
<li><p>Then select '''Save Password''' and click '''OK'''</p>
<p>[[File:Orange_Pi_4A-image211.png|249x181px]]</p></li>
<li><p>Then select Always '''trust this host''' and click '''OK'''</p></li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image212.png|278x150px|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>
<div class="figure">
[[File:Orange_Pi_4A-image213.png|533x330px|IMG_256]]
</div>
<ol start="8" style="list-style-type: decimal;">
<li>Then select the path to upload to the development board on the right side of the filezilla software, select the file to be uploaded in the Ubuntu PC on the left side of the filezilla software, right-click the mouse, and then click the upload option to start uploading the file to the development board.</li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image214.png|529x414px|IMG_256]]
</div>
<ol start="9" style="list-style-type: decimal;">
<li><p>After uploading, you can check the uploaded files in the corresponding path of the development board Linux system.</p></li>
<li><p>The method of uploading a folder is the same as the method of uploading a file, so I will not go into details here.</p></li></ol>
<span id="how-to-upload-files-from-windows-pc-to-the-linux-system-of-the-development-board"></span>
=== How to upload files from Windows PC to the Linux system of the development board ===
<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:Orange_Pi_4A-image215.jpeg|576x208px|1720161972192]]
<div class="figure">
[[File:Orange_Pi_4A-image216.jpeg|576x415px|1720161983058]]
</div>
<ol start="2" style="list-style-type: decimal;">
<li><p>The downloaded installation package is as follows, then double-click to install directly</p>
<p>'''FileZilla_Server_1.5.1_win64-setup.exe'''</p></li></ol>
During the installation process, select '''Decline''' on the following installation interface, then select '''Next>'''
<div class="figure">
[[File:Orange_Pi_4A-image217.png|355x279px|IMG_256]]
</div>
<ol start="3" style="list-style-type: decimal;">
<li>The interface after opening filezilla is as follows. At this time, the remote site on the right is empty.</li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image218.png|451x357px|IMG_256]]
</div>
<ol start="4" style="list-style-type: decimal;">
<li>The method of connecting the development board is shown in the figure below:</li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image210.png|575x128px|图片565]]
</div>
<ol start="5" style="list-style-type: decimal;">
<li>Then select '''Save Password''' and click '''OK'''</li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image219.png|207x146px|IMG_256]]
</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:Orange_Pi_4A-image220.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>
<div class="figure">
[[File:Orange_Pi_4A-image221.jpeg|576x425px|图片3]]
</div>
<ol start="8" style="list-style-type: decimal;">
<li>Then select the path to be uploaded to the development board on the right side of the filezilla software, then select the file to be uploaded in the Windows PC on the left side of the filezilla software, then right-click the mouse, and then click the upload option to start uploading the file to the development board</li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image222.png|461x340px|IMG_256]]
</div>
<ol start="9" style="list-style-type: decimal;">
<li><p>After uploading, you can check the uploaded files in the corresponding path of the development board Linux system.</p></li>
<li><p>The method of uploading a folder is the same as the method of uploading a file, so I will not go into details here.</p></li></ol>
<span id="instructions-for-use-of-npu"></span>
== Instructions for use of NPU ==
<span id="board-environment-preparation"></span>
=== Board environment preparation ===
<ol style="list-style-type: decimal;">
<li><p>First, you need to install opencv and cmake on the development board.</p>
<p>orangepi@orangepi:~$ '''sudo apt update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt install libopencv-dev cmake'''</p></li>
<li><p>Then download the compressed package of the NPU sample program from the official Baidu Cloud.</p></li>
<li><p>Then upload the NPU sample program compressed package to the development board and decompress it.</p>
<p>orangepi@orangepi:~$ '''tar -xvf board-demo.tar.gz'''</p></li>
<li><p>After the compressed package is decompressed, the directory structure is as follows.</p>
<p>orangepi@orangepi:~$ '''cd board-demo/'''</p>
<p>orangepi@orangepi:~/board-demo$ '''ls'''</p>
<p>chineseocr common head_pose lenet libawnn_viplite libawutils mobilenet_v2_ssd_demo struct2depth struct2depth yolov5</p></li>
<li><p>Then you need to copy the NPU library to the system's /usr/lib directory, which is needed to run the sample program below.</p></li></ol>
orangepi@orangepi:~/board-demo$ '''sudo cp ./common/lib_linux_aarch64/T527/*.so /usr/lib'''
<span id="board-example-run"></span>
=== Board Example Run ===
<span id="run-the-mobilenet_v2_ssd-target-detection-example"></span>
==== Run the mobilenet_v2_ssd target detection example ====
<ol style="list-style-type: decimal;">
<li><p>First compile the mobilenet_v2_ssd target detection example</p>
<p>orangepi@orangepi:~/board-demo$ '''cd mobilenet_v2_ssd_demo'''</p>
<p>orangepi@orangepi:~/board-demo/mobilenet_v2_ssd_demo$ '''mkdir build'''</p>
<p>orangepi@orangepi:~/board-demo/mobilenet_v2_ssd_demo$ '''cd build'''</p>
<p>orangepi@orangepi:~/board-demo/mobilenet_v2_ssd_demo/build$ '''cmake ..'''</p>
<p>orangepi@orangepi:~/board-demo/mobilenet_v2_ssd_demo/build$ '''make'''</p></li>
<li><p>Then execute the following command to run the example.</p>
<p>orangepi@orangepi:/root/board-demo/mobilenet_v2_ssd_demo/build$ '''./mbv2-ssd-demo -b ../model/mbv2_ssd_x527.nb -i ../000012.jpg'''</p></li>
<li><p>The output information of normal program operation is as follows.</p>
<p>orangepi@orangepi:/root/board-demo/mobilenet_v2_ssd_demo/build$ '''./mbv2-ssd-demo -b ../model/mbv2_ssd_x527.nb -i ../000012.jpg'''</p>
<p>................….</p>
<p>get output finished.</p>
<p>mbv2_ssd_postprocess.cpp run.</p>
<p>car = 0.97705 at 162 94 179 x 170</p>
<p>postprocess time : 0.025 Sec</p>
<p>destory npu finished.</p>
<p>~NpuUint.</p></li>
<li><p>The output will be saved as ssd_out.png in the current directory</p>
<p>orangepi@orangepi4a:~/board-demo/mobilenet_v2_ssd_demo/build$ '''ls ssd_out.png'''</p>
<p>ssd_out.png</p>
<p>[[File:Orange_Pi_4A-image223.png|269x179px]]</p></li></ol>
<span id="run-the-yolov5-object-detection-example"></span>
==== Run the yolov5 object detection example ====
<ol style="list-style-type: decimal;">
<li><p>First compile the yolov5 example.</p>
<p>orangepi@orangepi:~/board-demo$ '''cd mobilenet_v2_ssd_demo'''</p>
<p>orangepi@orangepi:~/board-demo/yolov5$ '''mkdir build'''</p>
<p>orangepi@orangepi:~/board-demo/yolov5$ '''cd build'''</p>
<p>orangepi@orangepi:~/board-demo/yolov5/build$ '''cmake ..'''</p>
<p>orangepi@orangepi:~/board-demo/yolov5/build$ '''make'''</p></li>
<li><p>Then execute the following command to run the example.</p>
<p>orangepi@orangepi:~/board-demo/yolov5/build$ '''./yolov5 ../model/v2/yolov5.nb ../input_data/dog.jpg'''</p>
<p>./yolov5 nbg input</p>
<p>VIPLite driver software version 1.13.0.0-AW-2023-10-19</p>
<p>yolov5_preprocess.cpp run.</p>
<p>yolov5_postprocess.cpp run.</p>
<p>detection num: 3</p>
<p>16: 91%, [ 135, 218, 305, 553], dog</p>
<p>7: 69%, [ 473, 75, 689, 174], truck</p>
<p>1: 49%, [ 151, 121, 561, 431], bicycle</p></li>
<li><p>The output will be saved as result.png in the current directory</p>
<p>orangepi@orangepi4a:~/board-demo/yolov5/build$ '''ls result.png'''</p>
<p>result.png</p>
<div class="figure">
[[File:Orange_Pi_4A-image224.png|323x241px|1729679452175]]
</div></li></ol>
<span id="run-the-head_pose-human-posture-recognition-example"></span>
==== Run the head_pose human posture recognition example ====
<ol style="list-style-type: decimal;">
<li><p>First compile the head_pose example.</p>
<p>orangepi@orangepi:~/board-demo$ '''cd head_pose'''</p>
<p>orangepi@orangepi:~/board-demo/head_pose$ '''mkdir build'''</p>
<p>orangepi@orangepi:~/board-demo/head_pose$ '''cd build'''</p>
<p>orangepi@orangepi:~/board-demo/head_pose/build$ '''cmake ..'''</p>
<p>orangepi@orangepi:~/board-demo/head_pose/build$ '''make'''</p></li>
<li><p>Then execute the following command to run the example.</p>
<p>orangepi@orangepi:~/board-demo/head_pose/build$ '''./head_pose -b1 ../model/rfb_landm_face_320_320_sim_x527.nb -b2 ../model/head_pose_x527.nb -i ../input_data/000438.jpg'''</p></li>
<li><p>The output result will be saved to head_pose_result.jpg in the current directory.</p>
<p>orangepi@orangepi:~/board-demo/head_pose/build$ '''ls head_pose_result.jpg'''</p>
<p>head_pose_result.jpg</p>
<p>[[File:Orange_Pi_4A-image225.png|324x215px]]</p></li></ol>
<span id="run-the-resnet50-image-classification-example"></span>
==== Run the resnet50 image classification example ====
<ol style="list-style-type: decimal;">
<li><p>First compile the resnet50 example.</p>
<p>orangepi@orangepi:~/board-demo$ '''cd resnet50'''</p>
<p>orangepi@orangepi:~/board-demo/resnet50$ '''mkdir build'''</p>
<p>orangepi@orangepi:~/board-demo/resnet50$ '''cd build'''</p>
<p>orangepi@orangepi:~/board-demo/resnet50/build$ '''cmake ..'''</p>
<p>orangepi@orangepi:~/board-demo/resnet50/build$ '''make'''</p></li>
<li><p>Then execute the following command to run the example.</p>
<p>orangepi@orangepi:~/board-demo/resnet50/build$ '''./resnet50 ../model/v2/resnet50.nb ../input_data/dog_224_224.jpg'''</p></li>
<li><p>The output result information is as follows, which outputs the top 5 predicted by the model, among which the most likely category is collie</p>
<p>orangepi@orangepi:~/board-demo/resnet50/build$ '''./resnet50 ../model/v2/resnet50.nb ../input_data/dog_224_224.jpg'''</p>
<p>...</p>
<p>========== top5 ==========</p>
<p>class id: 231, prob: 15.432617, label: collie</p>
<p>class id: 230, prob: 13.103271, label: Shetland sheepdog, Shetland sheep dog, Shetland</p>
<p>class id: 169, prob: 12.617920, label: borzoi, Russian wolfhound</p>
<p>class id: 224, prob: 12.423828, label: groenendael</p>
<p>class id: 160, prob: 10.191406, label: Afghan hound, Afghan</p>
<p>class_postprocess success.</p></li></ol>
<span id="run-struct2depth-depth-detection-example"></span>
==== Run struct2depth depth detection example ====
<ol style="list-style-type: decimal;">
<li><p>First compile the struct2depth example.</p>
<p>orangepi@orangepi:~/board-demo$ '''cd struct2depth'''</p>
<p>orangepi@orangepi:~/board-demo/struct2depth$ '''mkdir build'''</p>
<p>orangepi@orangepi:~/board-demo/struct2depth$ '''cd build'''</p>
<p>orangepi@orangepi:~/board-demo/struct2depth/build$ '''cmake ..'''</p>
<p>orangepi@orangepi:~/board-demo/struct2depth/build$ '''make'''</p></li>
<li><p>Then execute the following command to run the example</p>
<p>orangepi@orangepi:~/board-demo/struct2depth/build$ '''./struct2depth -b ../model/v2/struct2depth.nb -i ../input_data/0015.jpg'''</p></li>
<li><p>The depth information of the model inference will be saved in jpg and txt files.</p>
<p>orangepi@orangepi:~/board-demo/struct2depth/build$ '''ls disp_* output_*'''</p>
<p>disp_color.jpg disp_show.jpg output_1.txt output_3.txt</p>
<p>disp_gray.jpg output_0.txt output_2.txt</p></li></ol>
<span id="run-chineseocr-text-recognition-example"></span>
==== Run ChineseOCR text recognition example ====
<ol style="list-style-type: decimal;">
<li><p>First compile the ChineseOCR example.</p>
<p>orangepi@orangepi:~/board-demo$ '''cd chineseocr'''</p>
<p>orangepi@orangepi:~/board-demo/chineseocr$ '''mkdir build'''</p>
<p>orangepi@orangepi:~/board-demo/chineseocr$ '''cd build'''</p>
<p>orangepi@orangepi:~/board-demo/chineseocr/build$ '''cmake ..'''</p>
<p>orangepi@orangepi:~/board-demo/chineseocr/build$ '''make'''</p></li>
<li><p>Then execute the following command to run the example.</p>
<p>orangepi@orangepi:~/board-demo/chineseocr/build$ '''./chineseocr -d ../model/v2/ -1 dbnet_1024 -2 angle_net -3 crnn_lite_lstm_256 -4 keys.txt -i ../input_data/1.jpg'''</p></li>
<li><p>The output result is as follows, and you can see that the text in the image has been recognized.</p>
<p>orangepi@orangepi:~/board-demo/chineseocr/build$ '''./chineseocr -d ../model/v2/ -1 dbnet_1024 -2 angle_net -3 crnn_lite_lstm_256 -4 keys.txt -i ../input_data/1.jpg'''</p>
<p>...</p>
<p>=====End detect=====</p>
<p>FullDetectTime(903.447417ms)</p>
<p>We at Allwinner Technology</p>
<p>AI</p>
<p>chip</p>
<p>take off12345666666 !</p>
<p>run finished.</p>
<p>~CrnnNet.</p>
<p>~AngleNet.</p>
<p>~DbNet.</p>
<p>~NpuUint.</p></li></ol>
<span id="how-to-burn-linux-image-to-emmc"></span>
== How to burn Linux image to eMMC ==
'''Note that the development board can be started through a TF card or eMMC, and the priority of the TF card is higher than that of the eMMC. In other words, if a TF card is inserted into the development board and there is a system in the TF card, the system in the TF card will be started by default, and the system in the eMMC will not be started.'''
<ol style="list-style-type: decimal;">
<li><p>Burning the Linux image to the eMMC requires the use of a TF card. First, burn the Linux image to the TF card, then start the development board and enter the Linux system</p></li>
<li><p>Then run the '''nand-sata-install''' script, remember to '''add sudo permissions'''.</p>
<p>orangepi@orangepi:~$ '''sudo nand-sata-install'''</p></li>
<li><p>Then select '''2 Boot from eMMC - system on eMMC'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image226.png|576x299px|选区_039]]
</div></li>
<li><p>Then a warning will pop up, the script will erase all data on the eMMC, select '''<Yes>''' to continue</p>
<div class="figure">
[[File:Orange_Pi_4A-image227.png|576x335px|选区_040]]
</div></li>
<li><p>You will then be prompted to select the type of file system. Five file systems are supported: ext2/3/4, f2fs, and btrfs.</p>
<p>[[File:Orange_Pi_4A-image228.png|575x190px]]</p></li>
<li><p>Then it will start to format the eMMC. After formatting the eMMC, it will start to burn the Linux image to the eMMC. [[File:Orange_Pi_4A-image229.png|576x174px]]</p></li>
<li><p>After burning, the following options will be prompted. You can select '''<Power off>''' to shut down directly</p>
<div class="figure">
[[File:Orange_Pi_4A-image230.png|575x141px|选区_044]]
</div></li>
<li><p>Then remove the TF card and power on again, the Linux system in the eMMC will start.</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>If you unplug the power supply directly while the Linux system is running, some data may be lost in the file system. It is recommended to use the '''poweroff''' command to shut down the Linux system of the development board before unplugging the power supply.</p>
<p>orangepi@orangepi:~$ '''sudo poweroff'''</p></li>
<li><p>In addition, the development board is equipped with a power button, and you can also '''short press''' the power button on the development board to shut down.</p>
<p>[[File:Orange_Pi_4A-image231.png|449x115px]]</p></li></ol>
'''Note that when you press the power button on the Linux desktop system, a confirmation box as shown in the figure below will pop up. You need to click the Power Off option before the system will shut down.'''
[[File:Orange_Pi_4A-image232.png|211x177px]]
<ol start="3" style="list-style-type: decimal;">
<li><p>After shutting down, long press the power button on the development board to turn it on.</p>
<p>[[File:Orange_Pi_4A-image231.png|449x115px]]</p></li>
<li><p>Use the reboot command to restart the Linux system in the development board</p>
<p>orangepi@orangepi:~$ '''sudo''' '''reboot'''</p></li></ol>
<span id="linux-sdkorangepi-build-usage-instructions"></span>
= Linux SDK——orangepi-build usage instructions =
<span id="compilation-system-requirements"></span>
== Compilation system requirements ==
Linux SDK, '''orangepi-build''', only supports running on X64 computers with Ubuntu 22.04 installed, so before downloading orangepi-build, please first make sure 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 current Ubuntu version 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 your computer is running Windows and does not have Ubuntu 22.04 installed, you can consider using '''VirtualBox''' or '''VMware''' to install an Ubuntu 22.04 virtual machine in Windows. But please note that you should not compile orangepi-build on a WSL virtual machine, because orangepi-build has not been tested in a WSL virtual machine, so you cannot ensure that orangepi-build can be used normally in WSL. In addition, please do not use orangepi-build in the Linux system of the development board. 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''']
After installing Ubuntu 22.04 on your computer or in a virtual machine, please first set the software source of Ubuntu 22.04 to Tsinghua source (or other domestic sources that you think are fast), otherwise it is easy to make mistakes when installing software later due to network reasons. The steps to replace Tsinghua source are as follows:
<ol style="list-style-type: lower-alpha;">
<li>To replace Tsinghua source, please refer to the instructions on this page</li></ol>
[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;">
<li><p>Note that the Ubuntu version needs to be switched to 22.04.</p>
<p>[[File:Orange_Pi_4A-image233.png|576x241px]]</p></li>
<li><p>The content of the '''/etc/apt/sources.list''' file that needs to be replaced is:</p>
<p>test@test:~$ '''sudo mv /etc/apt/sources.list cat /etc/apt/sources.list.bak'''</p>
<p>test@test:~$ '''sudo vim /etc/apt/sources.list'''</p>
<p>#The source mirror is commented out by default to increase the speed of apt update. You can uncomment it if necessary.</p>
<p>deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse</p>
<p># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse</p>
<p>deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse</p>
<p># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse</p>
<p>deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse</p>
<p># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse</p>
<p>deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse</p>
<p># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse</p>
<p># Pre-release software source, not recommended to enable</p>
<p># deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse</p>
<p># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse</p></li>
<li><p>After the replacement, you need to update the package information and ensure that there is no error</p>
<p>test@test:~$ '''sudo apt-get update'''</p></li>
<li><p>'''In addition, since the source code of the kernel and U-boot are stored on GitHub, it is very important to make sure that the computer can download the code from GitHub normally when compiling the image.'''</p></li></ol>
<span id="get-the-source-code-of-linux-sdk"></span>
== Get 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 code. Orangepi-build is modified based on the armbian build compilation system. Orangepi-build can be used to compile multiple versions of Linux images. 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 to use the T527 Soc development board, you need to download the next branch source code of orangepi-build. The above git clone command needs to specify the branch of orangepi-build source code as next.'''
<div class="figure">
[[File:Orange_Pi_4A-image234.jpeg|576x288px|微信图片_20241119194712]]
</div>
'''You do not need to enter the username and password of the GitHub account when downloading the orangepi-build code through the git clone command (the same applies to downloading other codes in this manual). If the Ubuntu PC prompts you to enter the username and password of the GitHub account after entering the git clone command, it is usually because the address of the orangepi-build warehouse after git clone is entered incorrectly. Please check the command spelling carefully for any errors, instead of thinking that we forgot to provide the username and password of the GitHub account here.'''
The u-boot and linux kernel versions currently used by the T527 series development board are as follows:
{| class="wikitable"
|-
| style="text-align: left;"| '''Branches'''
| style="text-align: left;"| '''u-boot Version'''
| style="text-align: left;"| '''Linux Kernel version'''
|-
| style="text-align: left;"| '''current'''
| style="text-align: left;"| '''u-boot v2018.05'''
| style="text-align: left;"| '''linux5.15'''
|}
'''The branch mentioned here is not the same as the branch of orangepi-build source code, please do not confuse them. This branch is mainly used to distinguish different kernel source code versions.'''
'''The Linux 5.15 BSP kernel currently provided by Allwinner is defined as the current branch.'''
orangepi-build After downloading, the following files and folders will be included:
<ol style="list-style-type: lower-alpha;">
<li><p>'''build.sh''': Compile the startup script</p></li>
<li><p>'''external''': Contains configuration files, specific scripts, and source code of some programs needed to compile the image.</p></li>
<li><p>'''LICENSE''': GPL 2 License File</p></li>
<li><p>'''README.md''': orangepi-build Documentation</p></li>
<li><p>'''scripts''': Generic script for compiling linux images</p>
<p>test@test:~/orangepi-build$ '''ls'''</p>
<p>'''build.sh external LICENSE README.md scripts'''</p>
<p>'''If you download the orangepi-build code from github, you may find that orangepi-build does not contain the source code of u-boot and linux kernel, nor the cross-compilation toolchain required to compile u-boot and linux kernel. This is normal because these things are stored in other separate github repositories or some servers (the addresses will be detailed below). orangepi-build will specify the addresses of u-boot, linux kernel and cross-compilation toolchain in the script and configuration file. When running orangepi-build, if it finds that these things are not available locally, it will automatically download them from the corresponding places.'''</p></li></ol>
<span id="download-the-cross-compilation-toolchain"></span>
=== Download the cross-compilation toolchain ===
When orangepi-build is run for the first time, it will automatically download the cross-compilation toolchain and put it in the '''toolchains''' folder. Each time you run the build.sh script of orangepi-build, it will check whether the cross-compilation toolchain in '''toolchains''' exists. If not, it will restart the download. If it exists, it will be used directly without repeated download.
<div class="figure">
[[File:Orange_Pi_4A-image235.png|575x278px|选区_396]]
</div>
The mirror website of the cross-compilation tool chain in China is the open source software mirror website of Tsinghua University:
[https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/ '''https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/''']
'''Toolchains''' After downloading, it will contain multiple versions of cross-compilation tool chains:
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 T527 Linux kernel source code is:
<ol style="list-style-type: lower-alpha;">
<li><p>linux5.15</p>
<p>'''gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu'''</p>
<p>The cross-compilation toolchain used to compile the T527 u-boot source code is:</p></li></ol>
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>v2018.05</p>
<p>'''gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi'''</p></li></ol>
<span id="explanation-of-the-complete-directory-structure-of-orangepi-build"></span>
=== Explanation of the complete directory structure of orangepi build ===
<ol style="list-style-type: decimal;">
<li><p>After downloading the orangepi build repository, it does not include the Linux kernel, U-boot source code, or cross compilation toolchain. The Linux kernel and U-boot source code are stored in separate Git repositories</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The git repository where the Linux kernel source code is stored is as follows. Please note to switch the branch of the Linux orangepi repository to</p>
<p>https://github.com/orangepi-xunlong/linux-orangepi/tree/'''orange-pi-5.15-sun55iw3'''</p></li>
<li><p>The git repository where the u-boot source code is stored is as follows. Please note to switch the branch of the u-boot orangepi repository to</p>
<p>https://github.com/orangepi-xunlong/u-boot-orangepi/tree/'''v2018.05-t527'''</p></li></ol>
</li>
<li><p>When Orangepi build is first run, it will download the cross compilation toolchain, u-boot, and Linux kernel source code. After successfully compiling the Linux image once, 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 configuration files required for compiling the image, scripts for specific functions, and source code for some programs. The rootfs compressed file cached during the image compilation process is also stored in the external file</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 deb packages such as u-boot and Linux, compilation logs, and compiled images</p></li>
<li><p>'''scripts''': General script for compiling Linux images</p></li>
<li><p>'''toolchains''': Store cross compilation toolchain</p></li>
<li><p>'''u-boot''': Store the source code of u-boot</p></li>
<li><p>'''userpatches''': Store the configuration files required for compiling scripts</p>
<p>test@test:~/orangepi-build$ '''ls'''</p>
<p>'''build.sh external kernel LICENSE output README.md scripts toolchains u-boot userpatches'''</p></li></ol>
</li></ol>
<span id="compiling-u-boot"></span>
== Compiling u-boot ==
<ol style="list-style-type: decimal;">
<li><p>Run the build.sh script, remember to grant sudo privileges</p>
<p>test@test:~/orangepi-build$ '''sudo ./build.sh'''</p></li>
<li><p>Select '''U-boot package''' and press Enter</p>
<div class="figure">
[[File:Orange_Pi_4A-image236.png|576x132px|选区_238]]
</div></li>
<li><p>Next, select the model of the development board</p>
<p>[[File:Orange_Pi_4A-image237.png|576x131px]]</p></li>
<li><p>Then it will start compiling u-boot, and some of the information prompted when compiling the current branch is as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Version of u-boot source code</p>
<p>[ o.k. ] Compiling u-boot [ '''v2018.05''' ]</p></li>
<li><p>Version of cross compilation toolchain</p>
<p>[ o.k. ] Compiler version [ '''aarch64-linux-gnu-gcc 11''' ]</p></li>
<li><p>The path of the compiled u-boot deb package</p>
<p>[ o.k. ] Target directory [ '''orangepi-build/output/debs/u-boot''' ]</p></li>
<li><p>The package name of the compiled u-boot deb package</p>
<p>[ o.k. ] File name [ '''linux-u-boot-current-orangepi4a_x.x.x_arm64.deb''' ]</p></li>
<li><p>Compilation time used</p>
<p>[ o.k. ] Runtime [ '''1 min''' ]</p></li>
<li><p>Repeat the command to compile u-boot, and use the following command to start compiling u-boot directly without selecting through the graphical interface</p>
<p>[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepi4a BRANCH=current BUILD_OPT=u-boot''' ]</p></li></ol>
</li>
<li><p>View the compiled u-boot deb package</p>
<p>test@test:~/orangepi-build$ '''ls output/debs/u-boot/'''</p>
<p>'''linux-u-boot-current-orangepi4a_x.x.x_arm64.deb'''</p></li>
<li><p>When the orangepi build compilation system compiles the U-boot source code, it first synchronizes the U-boot source code with the GitHub server's U-boot source code. 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 compile the U-boot completely before turning off this function, otherwise you will prompt that the U-boot source code cannot be found)'''. Otherwise, the modifications made will be restored. The method is as follows:</p>
<p>Set the IGNORE_UPDATES variable in <span class="mark">u'''serpatches/config-default.conf'''</span> to "yes".</p>
<p>test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''</p>
<p>......</p>
<p>IGNORE_UPDATES="'''yes'''"</p>
<p>......</p></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>
<ol style="list-style-type: lower-alpha;">
<li><p>Firstly, upload the compiled deb package of u-boot to the Linux system on the development board</p>
<p>test@test:~/orangepi-build$ '''cd output/debs/u-boot'''</p>
<p>test@test:~/orangepi_build/output/debs/u-boot$ '''scp \'''</p>
<p>'''linux-u-boot-current-orangepi4a_x.x.x_arm64.deb [mailto:root@192.168.1.xxx:/root root@192.168.1.xxx:/root]'''</p></li>
<li><p>Reinstall the newly uploaded deb package for u-boot</p>
<p>orangepi@orangepi:~$ '''sudo dpkg -i''' '''linux-u-boot-current-orangepi4a_x.x.x_arm64.deb'''</p></li>
<li><p>Then run the nand sata install script</p>
<p>orangepi@orangepi:~$ '''sudo nand-sata-install'''</p></li>
<li><p>Then select '''5 Install/Update the bootloader on SD/eMMC'''</p>
<p>[[File:Orange_Pi_4A-image238.png|320x174px]]</p></li>
<li><p>After pressing the enter key, a warning will first pop up</p>
<p>[[File:Orange_Pi_4A-image239.png|314x170px]]</p></li>
<li><p>Pressing the enter key again will start updating u-boot, and after the update is complete, the following information will be displayed</p>
<p>[[File:Orange_Pi_4A-image240.png|292x164px]]</p></li>
<li><p>Then you can restart the development board to test whether the u-boot modifications have taken effect</p></li></ol>
</li></ol>
<span id="compiling-linux-kernel"></span>
== Compiling Linux Kernel ==
<ol style="list-style-type: decimal;">
<li><p>Run the '''build.sh''' script, remember to grant sudo privileges</p>
<p>test@test:~/orangepi-build$ '''sudo ./build.sh'''</p></li>
<li><p>Select '''Kernel package''' and press Enter</p>
<div class="figure">
[[File:Orange_Pi_4A-image241.png|575x116px|选区_240]]
</div></li>
<li><p>Then it will prompt whether the kernel configuration interface needs to be displayed. If the kernel configuration does not need to be modified, select the first one. If the kernel configuration needs to be modified, select the second one</p>
<p>[[File:Orange_Pi_4A-image242.png|576x87px]]</p></li>
<li><p>Next, select the model of the development board</p>
<p>[[File:Orange_Pi_4A-image237.png|576x131px]]</p></li>
<li><p>If step 3) selects the option to display the kernel configuration menu (second option), a kernel configuration interface opened through '''make menuconfig''' will pop up. At this time, you can directly modify the kernel configuration, save and exit after modification, and the kernel source code will be compiled after exit.</p>
<p>[[File:Orange_Pi_4A-image243.png|575x357px]]</p></li></ol>
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>If there is no need to modify the configuration options of the kernel, passing '''KERNEL_CONFIGURE=no''' when running the build.sh script can temporarily block the pop-up kernel configuration interface</p>
<p>test@test:~/orangepi-build$ '''sudo ./build.sh KERNEL_CONFIGURE=no'''</p></li>
<li><p>You can also set '''KERNEL_CONFIGURE=no''' in the orangepi-build/userpatches/config-default.conf default.exe configuration file to permanently disable this feature</p></li>
<li><p>If the following error appears when compiling the kernel, it is due to the small terminal interface of Ubuntu PC, which causes the make menuconfig interface to not display. Please set the terminal of Ubuntu PC to its maximum size and run the build.sh script again</p>
<p>[[File:Orange_Pi_4A-image244.png|574x234px]]</p></li></ol>
<!-- -->
<ol start="6" style="list-style-type: decimal;">
<li><p>The following is a partial explanation of the information prompted when compiling the current branch kernel source code:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Version of Linux kernel source code</p>
<p>[ o.k. ] Compiling current kernel [ '''5.15.147''' ]</p></li>
<li><p>The version of the cross compilation toolchain used</p>
<p>[ o.k. ] Compiler version [ '''aarch64-linux-gnu-gcc 11''' ]</p></li>
<li><p>The default configuration file used by the kernel and its storage path are as follows</p>
<p>[ o.k. ] Using kernel config file [ '''orangepi-build/external/config/kernel/linux-5.15-sun55iw3-current.config''' ]</p></li>
<li><p>The path of the compiled kernel related deb package</p>
<p>[ o.k. ] Target directory [ '''output/debs/''' ]</p></li>
<li><p>The package name of the compiled kernel image deb package</p>
<p>[ o.k. ] File name [ '''linux-image-current-sun55iw3_x.x.x_arm64.deb''' ]</p></li>
<li><p>Compilation time used</p>
<p>[ o.k. ] Runtime [ '''10 min''' ]</p></li>
<li><p>Finally, the compilation command for the kernel selected last time will be displayed. The following command can be used to start compiling the kernel source code without selecting it through the graphical interface</p>
<p>[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepi4a BRANCH=current BUILD_OPT=kernel KERNEL_CONFIGURE=no''' ]</p></li></ol>
</li>
<li><p>View the compiled kernel related deb packages</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''linux-dtb-current-sun55iw3_x.x.x_arm64.deb''' Contains dtb files used by the kernel</p></li>
<li><p>'''linux-headers-current-sun55iw3_x.x.x_arm64.deb''' Contains kernel header files</p></li>
<li><p>'''linux-image-current-sun55iw3_x.x.x_arm64.deb''' Contains kernel images and kernel modules</p>
<p>test@test:~/orangepi-build$ '''ls output/debs/linux-*'''</p>
<p>output/debs/linux-dtb-current-sun55iw3_x.x.x_arm64.deb</p>
<p>output/debs/linux-headers-current-sun55iw3_x.x.x_arm64.deb</p>
<p>output/debs/linux-image-current-sun55iw3_x.x.x_arm64.deb</p></li></ol>
</li>
<li><p>When the Orangepi build compilation system compiles the Linux kernel source code, it first synchronizes the Linux kernel source code with the GitHub server's Linux kernel source code. Therefore, if you want to modify the Linux kernel source code, you first need to turn off the source code update function '''(which requires a complete compilation of the Linux kernel source code before it can be turned off, otherwise it will prompt that the Linux kernel source code cannot be found)'''. Otherwise, the modifications made will be restored. The method is as follows:</p>
<p>Set the IGNORE_UPDATES variable in '''userpatches/config-default.conf''' to “yes”.</p>
<p>test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''</p>
<p>IGNORE_UPDATES="'''yes'''"</p></li>
<li><p>If the kernel has been modified, you can use the following methods to update the kernel and kernel modules of the development board linux system</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Upload the compiled deb package of the linux kernel to the linux system on the development board</p>
<p>test@test:~/orangepi-build$ '''cd output/debs'''</p>
<p>test@test:~/orangepi-build/output/debs$ '''scp \'''</p>
<p>'''linux-image-current-sun55iw3_x.x.x_arm64.deb root@192.168.1.xxx:/root'''</p></li>
<li><p>Install the new linux kernel deb package that you just uploaded</p>
<p>orangepi@orangepi:~$ '''sudo dpkg -i linux-image-current-sun55iw3_x.x.x_arm64.deb'''</p></li>
<li><p>Restart the development board and check whether the kernel changes have taken effect</p>
<p>orangepi@orangepi:~$ '''sudo''' '''reboot'''</p></li></ol>
</li></ol>
<span id="compile-rootfs"></span>
== Compile rootfs ==
<ol style="list-style-type: decimal;">
<li><p>Run the build.sh script and remember to add sudo permissions</p>
<p>test@test:~/orangepi-build$ '''sudo ./build.sh'''</p></li>
<li><p>Select '''Rootfs and all deb packages''',then press enter</p></li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image245.png|576x119px|选区_241]]
</div>
<ol start="3" style="list-style-type: decimal;">
<li><p>Then select the model of the development board</p>
<p>[[File:Orange_Pi_4A-image237.png|576x131px]]</p></li>
<li><p>Then select the type of rootfs</p>
<p>[[File:Orange_Pi_4A-image246.png|575x80px]]</p></li>
<li><p>Then select the type of image</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Image with console interface (server)''' Indicates the server version of the image, the volume is relatively small</p></li>
<li><p>'''Image with desktop environment''' It is a large image with a desktop</p>
<div class="figure">
[[File:Orange_Pi_4A-image247.png|576x75px|选区_245]]
</div></li></ol>
</li>
<li><p>If it is the image of the compile server version, you can also choose to compile the Standard version or Minimal version, the Minimal version of the pre-installed software will be much less than the Standard version '''(no special requirements, please do not choose the Minimal version, because many things are not pre-installed by default, some functions may not be used)'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image248.png|576x78px|选区_397]]
</div></li>
<li><p>If you compile the desktop version of the image also need to select the type of desktop environment, currently only maintain GNOME, so please choose GNOME type desktop</p>
<p>[[File:Orange_Pi_4A-image249.png|576x69px]]</p>
<p>[[File:Orange_Pi_4A-image250.png|576x74px]]</p>
<p>You can then select additional packages that need to be installed. Please press Enter to skip this.</p>
<p>[[File:Orange_Pi_4A-image251.png|575x264px]]</p></li>
<li><p>You will then start compiling the rootfs. Some of the information prompted during compilation is described below</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The type of rootfs</p>
<p>[ o.k. ] local not found [ Creating new rootfs cache for '''jammy''' ]</p></li>
<li><p>Directory for storing the generated rootfs package</p>
<p>[ o.k. ] Target directory [ '''orangepi-build/external/cache/rootfs''' ]</p></li>
<li><p>Name of the generated rootfs package</p>
<p>[ o.k. ] File name [ '''jammy-gnome-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4''' ]</p></li></ol>
</li>
<li><p>View the compiled rootfs compressed package</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''jammy-gnome-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4''' is rootfs zip, the meaning of each field name is</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''jammy''' indicates the type of linux distribution for rootfs</p></li>
<li><p>'''gnome''' indicates that rootfs is the type of the desktop version. If it is '''cli''', it indicates the type of the server version</p></li>
<li><p>'''arm64''' indicates the schema type of rootfs</p></li>
<li><p>'''25250ec7002de9e81a41de169f1f89721''' is generated by the package name rootfs to install all of the packages of the MD5 hash value, as long as no modification rootfs installation package list, then this value will not change, The compilation script uses this MD5 hash to determine if the rootfs needs to be recompiled</p></li></ol>
</li>
<li><p>'''jammy-gnome-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.list''' lists the package names of all packages installed by rootfs</p>
<p>test@test:~/orangepi-build$ '''ls external/cache/rootfs/'''</p>
<p>jammy-gnome-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4</p>
<p>jammy-gnome-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.current</p>
<p>jammy-gnome-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.list</p></li></ol>
</li>
<li><p>If the required rootfs already exists under '''external/cache/rootfs''', 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 the '''external/cache/rootfs''' to check whether there is a cached rootfs. If there is one, it will be used directly, which can save a lot of download and compilation time</p></li></ol>
<span id="compile-the-linux-image"></span>
== Compile the linux image ==
<ol style="list-style-type: decimal;">
<li><p>Run the '''build.sh''' script and remember to add sudo permissions</p>
<p>test@test:~/orangepi-build$ '''sudo ./build.sh'''</p></li>
<li><p>Select '''Full OS image for flashing''' and press Enter</p></li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image252.png|576x128px|选区_242]]
</div>
<ol start="3" style="list-style-type: decimal;">
<li><p>Then select the model of the development board</p>
<p>[[File:Orange_Pi_4A-image237.png|576x131px]]</p></li>
<li><p>Then select the type of rootfs</p>
<p>[[File:Orange_Pi_4A-image246.png|575x80px]]</p></li>
<li><p>Then select the type of image</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Image with console interface (server)''' Indicates the server version of the image, the volume is relatively small</p></li>
<li><p>'''Image with desktop environment''' It is a large image with a desktop</p>
<div class="figure">
[[File:Orange_Pi_4A-image247.png|576x75px|选区_245]]
</div></li></ol>
</li>
<li><p>If it is the image of the compile server version, you can also choose to compile the Standard version or Minimal version, the Minimal version of the pre-installed software will be much less than the Standard version '''(no special requirements, please do not choose the Minimal version, because many things are not pre-installed by default, some functions may not be used)'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image248.png|576x78px|选区_397]]
</div></li>
<li><p>If you compile the desktop version of the image also need to select the type of desktop environment, currently only maintain GNOME, so please choose GNOME type desktop</p>
<p>[[File:Orange_Pi_4A-image249.png|576x69px]]</p>
<p>[[File:Orange_Pi_4A-image250.png|576x74px]]</p>
<p>You can then select additional packages that need to be installed. Please press Enter to skip this.</p>
<p>[[File:Orange_Pi_4A-image251.png|575x264px]]</p></li>
<li><p>The linux image will then be compiled, the general process of compilation is as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Initialize the Ubuntu PC compilation environment and install the software packages required for the compilation process</p></li>
<li><p>Download the u-boot and linux kernel source code (if cached, update the code only)</p></li>
<li><p>Compile u-boot source code to generate the u-boot deb package</p></li>
<li><p>Compile linux source code and generate Linux-related deb packages</p></li>
<li><p>Create the deb package of the linux firmware</p></li>
<li><p>Create the deb package of the orangepi-config tool</p></li>
<li><p>Create a board-level deb package</p></li>
<li><p>If you are compiling the desktop version image, you will also make desktop related deb packages</p></li>
<li><p>Check whether the rootfs is cached. If no, create a new rootfs. If the rootFS is cached, decompress it and use it</p></li>
<li><p>Install the previously generated deb package into rootfs</p></li>
<li><p>Perform some specific Settings for different development boards and different types of images, such as preinstalling additional software packages and modifying system configurations</p></li>
<li><p>Then create an image file and format the partition. The default type is ext4</p></li>
<li><p>Copy the configured rootfs to the image partition</p></li>
<li><p>Then update initramfs</p></li>
<li><p>Run the dd command to write the bin file of the u-boot to the image</p></li></ol>
</li>
<li><p>The following information is displayed after the image is compiled</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Path for storing the generated image</p>
<p>[ o.k. ] Done building [ '''output/images/orangepi4a_x.x.x_debian_jammy_linux5.15.xx_gnome_desktop/orangepi4a_x.x.x_debian_jammy_linux5.15.xx_gnome_desktop.img''' ]</p></li>
<li><p>Compilation time</p></li></ol>
</li></ol>
'''[ o.k. ] Runtime [ 19 min ]'''
<ol start="3" style="list-style-type: lower-alpha;">
<li><p>Repeat the image compilation command. Run the following command to compile the image without using the GUI</p>
<p>[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepi4a BRANCH=current BUILD_OPT=image RELEASE=jammy BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=yes''' ]</p></li></ol>
<span id="android-13-operating-system-instructions"></span>
= Android 13 operating system instructions =
<span id="supported-android-versions"></span>
== Supported Android versions ==
{| class="wikitable"
|-
| style="text-align: center;"| Android version
| style="text-align: center;"| Kernel version
|-
| style="text-align: center;"| '''Android 13'''
| style="text-align: center;"| '''linux5.15'''
|}
<span id="android-13-function-adaptation"></span>
== Android 13 Function Adaptation ==
{| class="wikitable"
|-
| style="text-align: center;"| '''Function'''
| style="text-align: center;"| '''Android 13'''
|-
| style="text-align: center;"| '''HDMI video'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''HDMI Audio'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''USB2.0 x 4'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''TF card start'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''eMMC'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Identify NVME SSDS'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Gigabit network card'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''WIFI'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Bluetooth'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''RTC chip'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Headphone audio'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''LCD screen'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''EDP'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''CAM1'''
| style="text-align: center;"| '''NO'''
|-
| style="text-align: center;"| '''CAM2'''
| style="text-align: center;"| '''NO'''
|-
| style="text-align: center;"| '''LED light'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin GPIO'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin I2C'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin SPI'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin UART'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin PWM'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Temperature sensor'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Mali GPU'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Video codec'''
| style="text-align: center;"| '''OK'''
|}
<span id="usage-of-adb"></span>
== Usage of ADB ==
<span id="usb-otg-mode-switching-method"></span>
=== USB OTG mode switching method ===
'''The development board has four USB ports, of which the USB port marked in the red box below can support both Host mode and Device mode, and the other three USB ports only support Host mode.'''
[[File:Orange_Pi_4A-image253.png|258x214px]]
'''The USB OTG interface is in Host mode by default and can be used to connect USB devices such as mouse and keyboard. If you want to use ADB, you need to manually switch to Device mode.'''
<ol style="list-style-type: decimal;">
<li><p>First open Settings</p>
<p>[[File:Orange_Pi_4A-image254.png|574x250px]]</p></li>
<li><p>Then find '''About tablet'''</p>
<p>[[File:Orange_Pi_4A-image255.png|575x315px]]</p></li>
<li><p>Then click the '''Build number''' option several times with your mouse until it appears. '''You are now a developer!''' Tips for</p>
<p>[[File:Orange_Pi_4A-image256.png|575x301px]]</p></li>
<li><p>Then return to the upper-level menu and select '''System'''</p>
<p>[[File:Orange_Pi_4A-image257.png|575x253px]]</p></li>
<li><p>Then select '''Developer options'''</p>
<p>[[File:Orange_Pi_4A-image258.png|575x279px]]</p></li>
<li><p>Finally, find the '''USB OTG Mode Switch''', '''turn on the switch to switch to Device mode, turn off the switch to switch to Host mode'''</p></li></ol>
[[File:Orange_Pi_4A-image259.png|576x197px]]
<span id="use-a-data-cable-to-connect-adb-to-debug"></span>
=== Use a data cable to connect adb to debug ===
<ol style="list-style-type: decimal;">
<li><p>First prepare a good quality USB 2.0 public to public data cable</p>
<div class="figure">
[[File:Orange_Pi_4A-image17.png|141x138px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]
</div></li>
<li><p>Install adb tool on Ubuntu PC</p>
<p>test@test:~$ '''sudo apt-get update'''</p>
<p>test@test:~$ '''sudo apt-get install -y adb'''</p></li>
<li><p>View the identified ADB device</p>
<p>test@test:~$ '''adb devices'''</p>
<p>List of devices attached</p>
<p>4c00146473c28651dd0 device</p></li>
<li><p>Then you can log in to the android system through adb shell on the Ubuntu PC</p></li></ol>
test@test:~$ '''adb shell'''
t527-demo:/ #
<span id="adb-debugging-using-a-network-connection"></span>
=== adb debugging using a network connection ===
'''Using network adb does not require a USB2.0 peer-to-peer data cable to connect the computer to the development board, but communicates over the network, so first make sure that the wired or wireless network of the development board is connected, and then obtain the IP address of the development board, which will be used later.'''
<ol style="list-style-type: decimal;">
<li><p>Ensure that the '''service.adb.tcp.port''' of the Android operating system is set to 5555</p>
<p>console:/ # '''getprop | grep "adb.tcp"'''</p>
<p>[service.adb.tcp.port]: [5555]</p></li>
<li><p>If '''service.adb.tcp.port''' is not set, you can use the following command in the serial port to set the port number of network adb</p></li></ol>
console:/ # '''setprop service.adb.tcp.port 5555'''
console:/ # '''stop adbd'''
console:/ # '''start adbd'''
<ol start="3" style="list-style-type: decimal;">
<li><p>Install adb tool on Ubuntu PC</p>
<p>test@test:~$ '''sudo apt-get update'''</p>
<p>test@test:~$ '''sudo apt-get install -y adb'''</p></li>
<li><p>Then connect network adb on Ubuntu PC</p>
<p>test@test:~$ '''adb connect 192.168.1.xxx:5555''' '''(Change it to the IP address of the development board)'''</p>
<p>* daemon not running; starting now at tcp:5037</p>
<p>* daemon started successfully</p>
<p>connected to 192.168.1.xxx:5555</p>
<p>test@test:~$ '''adb devices'''</p>
<p>List of devices attached</p>
<p>192.168.1.xxx:5555 device</p></li>
<li><p>Then you can log in to the android system through adb shell on the Ubuntu PC</p></li></ol>
test@test:~$ '''adb shell'''
t527-demo:/ #
<span id="hdmi-to-vga-display-test-1"></span>
== HDMI to VGA display test ==
<ol style="list-style-type: decimal;">
<li><p>The following accessories need to be prepared first</p>
<ol style="list-style-type: lower-alpha;">
<li><p>HDMI to VGA converter</p>
<p>[[File:Orange_Pi_4A-image131.png|155x104px]]</p></li>
<li><p>One VGA cable</p>
<p>[[File:Orange_Pi_4A-image132.png|148x133px]]</p></li>
<li><p>A monitor or TV that supports VGA port</p></li></ol>
</li>
<li><p>HDMI to VGA display test is shown below</p>
<p>[[File:Orange_Pi_4A-image260.png|575x332px]]</p>
<p>'''When using HDMI to VGA display, the development board and the Android system of the development board do not need to do any Settings, only the HDMI interface of the development board can be displayed normally. So if the test has problems, check the HDMI to VGA converter, VGA cable, and monitor for problems.'''</p></li></ol>
<span id="wi-fi-connection-method"></span>
== WI-FI connection method ==
<ol style="list-style-type: decimal;">
<li><p>First select '''Settings'''</p>
<p>[[File:Orange_Pi_4A-image254.png|574x250px]]</p></li>
<li><p>Then select '''Network & Internet'''</p>
<p>[[File:Orange_Pi_4A-image261.png|575x191px]]</p></li>
<li><p>Then select '''Internet'''</p>
<p>[[File:Orange_Pi_4A-image262.png|576x157px]]</p></li>
<li><p>Then open WI-FI</p>
<p>[[File:Orange_Pi_4A-image263.png|575x113px]]</p></li>
<li><p>After turning on WI-FI, you can see the search signal under '''Available networks'''</p>
<p>[[File:Orange_Pi_4A-image264.png|576x199px]]</p></li>
<li><p>Select the WI-FI you want to connect to, and the password input interface will pop up as shown in the following figure</p>
<p>[[File:Orange_Pi_4A-image265.png|574x165px]]</p></li>
<li><p>Then use the keyboard to enter the WI-FI password, and then use the '''mouse''' to click the Enter button in the virtual keyboard to start the WI-FI connection</p>
<p>[[File:Orange_Pi_4A-image266.png|576x179px]]</p></li>
<li><p>The display after the WI-FI connection is successful is as shown in the following figure</p>
<p>[[File:Orange_Pi_4A-image267.png|576x176px]]</p></li></ol>
<span id="how-to-use-wi-fi-hotspot"></span>
== How to use WI-FI hotspot ==
<ol style="list-style-type: decimal;">
<li><p>Ensure that the Ethernet port is connected to a network cable and can access the Internet properly</p></li>
<li><p>Then select '''Settings'''</p>
<p>[[File:Orange_Pi_4A-image254.png|574x250px]]</p></li>
<li><p>Then select '''Network & Internet'''</p>
<p>[[File:Orange_Pi_4A-image268.png|574x143px]]</p></li>
<li><p>Then select '''Hotspot & tethering'''</p>
<p>[[File:Orange_Pi_4A-image269.png|575x250px]]</p></li>
<li><p>Then select '''Wi-Fi hotspot'''</p>
<p>[[File:Orange_Pi_4A-image270.png|575x164px]]</p></li>
<li><p>Then open the '''Wi-Fi Hotspot''', you can also see the name and password of the generated Hotspot in the following figure, remember them, and need to use them when connecting to the hotspot (if you need to change the name and password of the Hotspot, you need to close the '''Wi-Fi Hotspot''' first, and then modify it)</p>
<p>[[File:Orange_Pi_4A-image271.png|575x245px]]</p></li>
<li><p>At this time, you can take out your mobile phone, if everything is normal, you can find the WIFI Hotspot with the same name ('''AndroidAP_4174''') shown below '''Hotspot name''' in the above picture in the WI-FI search list. Then you can tap AndroidAP_4174 to connect to the Hotspot, the password can be seen under '''Hotspot password''' in the image above</p>
<p>[[File:Orange_Pi_4A-image272.png|233x172px]]</p></li>
<li><p>After successful connection, it will be displayed as shown in the following figure (different mobile phone interfaces will be different, the specific interface is subject to the display of your mobile phone). At this time, you can open a web page on the phone to see whether the Internet can be accessed. If the web page can be opened normally, it indicates that the '''WI-FI Hotspot''' of the development board can be used normally</p>
<p>[[File:Orange_Pi_4A-image273.png|234x113px]]</p></li></ol>
<span id="method-to-view-ethernet-port-ip-address"></span>
== Method to view Ethernet port IP address ==
<ol style="list-style-type: decimal;">
<li><p>First, ensure that the gigabit network port of the development board is connected to a router or switch</p></li>
<li><p>First open '''Settings'''</p>
<p>[[File:Orange_Pi_4A-image254.png|574x250px]]</p></li>
<li><p>Then select '''Network & Internet'''</p>
<p>[[File:Orange_Pi_4A-image261.png|575x159px]]</p></li>
<li><p>Then select '''Ethernet'''</p>
<p>[[File:Orange_Pi_4A-image274.png|575x128px]]</p></li>
<li><p>Then select '''Ethernet settings'''</p>
<p>[[File:Orange_Pi_4A-image275.png|575x123px]]</p></li>
<li><p>Then you can see the IP address information of the wired network port of the development board</p>
<p>[[File:Orange_Pi_4A-image276.png|576x245px]]</p></li></ol>
<span id="bluetooth-connection-method"></span>
== Bluetooth connection method ==
<ol style="list-style-type: decimal;">
<li><p>First select '''Settings'''</p>
<p>[[File:Orange_Pi_4A-image254.png|574x250px]]</p></li>
<li><p>Then select '''Connected devices'''</p></li></ol>
[[File:Orange_Pi_4A-image277.png|357x161px]]
<ol start="3" style="list-style-type: decimal;">
<li><p>Then select '''Pair new device''' to start scanning the surrounding Bluetooth devices</p>
<p>[[File:Orange_Pi_4A-image278.png|355x165px]]</p></li>
<li><p>The searched Bluetooth device will be displayed under '''Available devices'''</p>
<p>[[File:Orange_Pi_4A-image279.png|350x296px]]</p></li>
<li><p>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</p>
<p>[[File:Orange_Pi_4A-image280.png|358x145px]]</p></li>
<li><p>The test here is the configuration process of the development board and Bluetooth of '''Android phones'''. At this time, the confirmation interface will pop up on the phone, and the pairing process will start after clicking the pairing button on the phone</p></li>
<li><p>After pairing, open '''Paired devices''' and you will see the paired Bluetooth devices</p>
<p>[[File:Orange_Pi_4A-image281.png|284x183px]]</p></li>
<li><p>At this time, you can send a picture to the development board using the Bluetooth of your phone. After sending, you can see the following prompt in the Android system of the development board, and then click '''<span class="mark">Incoming file</span>'''</p>
<p>[[File:Orange_Pi_4A-image282.png|574x163px]]</p></li>
<li><p>Then click '''Accept''' in the pop-up window to start receiving pictures sent by the phone</p>
<p>[[File:Orange_Pi_4A-image283.png|575x217px]]</p></li>
<li><p>The picture received by the Bluetooth of the Android system can be viewed by opening the '''Download''' directory of the file manager</p>
<p>[[File:Orange_Pi_4A-image284.png|575x238px]]</p></li></ol>
<span id="inch-mipi-screen-usage"></span>
== 10.1 inch MIPI screen usage ==
Make sure that the Android image you use is one of the following versions:
OrangePi4A_T527_Android13_lcd_v1.x.x.img
<ol style="list-style-type: decimal;">
<li><p>The screen needs to be assembled first, please refer to [[#how-to-use-the-10.1-inch-mipi-lcd-screen|the assembly method of 10.1 inch MIPI screen]]</p></li>
<li><p>The position of the interface of the mipi lcd screen on the development board is shown as follows:</p>
<p>[[File:Orange_Pi_4A-image196.png|230x132px]]</p></li>
<li><p>Connect the assembled screen to the LCD interface of the development board, pay attention to unplug the HDMI interface, connect the Type-C power supply to the board, and power on, after the system starts, you can see the screen displayed as follows ('''default is portrait screen''')</p></li></ol>
[[File:Orange_Pi_4A-image285.png|208x291px]]
<span id="how-to-use-edp-screen"></span>
== How to use eDP screen ==
'''eDP screens are touch-free.'''
Make sure that the Android image you use is one of the following versions:
OrangePi4A_T527_Android13_v1.x.x.img
<ol start="3" style="list-style-type: decimal;">
<li><p>Currently only one 15.6-inch eDP screen is available, including the following accessories:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>0.5 Spaced 30-pin single-head coaxial cables</p>
<div class="figure">
[[File:Orange_Pi_4A-image205.jpeg|200x197px|0006 (1)]]
</div></li>
<li><p>15.6-inch eDP display, resolution is 1920x1080.</p>
<div class="figure">
[[File:Orange_Pi_4A-image206.jpeg|212x368px|0006 (2)]]
</div></li></ol>
</li>
<li><p>Connect the FPC end of the 30pin single-head codirectional cable to the eDP interface of the development board, and connect the other end to the eDP interface of the screen</p>
<p>[[File:Orange_Pi_4A-image207.png|199x91px]]</p></li>
<li><p>Then connect the Type-C power supply to the board and power it on. After the system is started, you can see the screen displayed as shown in the following figure</p>
<p>[[File:Orange_Pi_4A-image286.png|380x227px]]</p></li></ol>
<span id="how-to-use-usb-camera"></span>
== How to use USB camera ==
<ol style="list-style-type: decimal;">
<li><p>First, insert a USB (UVC protocol) camera into the USB interface of the development board</p></li>
<li><p>If the USB camera is properly identified, a video device node is generated under <span class="mark">/dev</span></p>
<p>console:/ # '''ls /dev/video0'''</p>
<p>/dev/video0</p></li>
<li><p>Then ensure that the ADB connection between the Ubuntu PC and the development board is normal. Please refer to the instructions in the section on [[#usage-of-adb|'''adb Usage''']]</p></li>
<li><p>Download the USB camera test APP from the '''<span class="mark">official tool</span>''' on the development board data download page</p>
<p>[[File:Orange_Pi_4A-image287.png|576x503px]]</p>
<p>[[File:Orange_Pi_4A-image288.png|575x145px]]</p></li>
<li><p>Then use adb command to install the USB camera test APP into the Android system, of course, you can also use the U disk copy for installation</p>
<p>test@test:~$ '''adb install usbcamera.apk'''</p></li>
<li><p>After installation, you can see the startup icon of USB camera on the Android APP interface</p>
<p>[[File:Orange_Pi_4A-image289.png|575x318px]]</p></li>
<li><p>Then double-click on the USB camera APP and you can see the output video of the USB camera</p></li></ol>
<span id="android-system-root-description"></span>
== Android system ROOT Description ==
'''<span class="mark">The Android system released by Orange Pi has been ROOT, you can use the following method to test.</span>'''
<ol style="list-style-type: decimal;">
<li><p>Download '''rootcheck.apk''' from the '''<span class="mark">official tool</span>''' on the development board data download page</p>
<p>[[File:Orange_Pi_4A-image290.png|575x518px]]</p>
<p>[[File:Orange_Pi_4A-image291.png|575x124px]]</p></li>
<li><p>Then ensure that the ADB connection between the Ubuntu PC and the development board is normal. Please refer to the instructions in the section on '''adb Usage'''</p></li>
<li><p>Then use adb command to install rootcheck.apk into the Android system, of course, you can also use the U disk copy for installation</p>
<p>test@test:~$ '''adb install rootcheck.apk'''</p></li>
<li><p>After installation, you can see the startup icon of the ROOT test tool on the Android APP interface</p>
<p>[[File:Orange_Pi_4A-image292.png|575x313px]]</p></li>
<li><p>After opening the '''<span class="mark">ROOT test tool</span>''' for the first time, the display interface is as shown in the following figure</p>
<p>[[File:Orange_Pi_4A-image293.png|576x126px]]</p></li>
<li><p>Then you can click '''CHECK NOW''' to start the ROOT status check of the Android system. After the check, the display is as follows, you can see that the Android system has obtained the ROOT permission</p>
<p>[[File:Orange_Pi_4A-image294.png|575x130px]]</p></li></ol>
<span id="pin-interface-gpio-uart-spi-test"></span>
== 40 pin interface GPIO, UART, SPI test ==
<span id="pin-gpio-port-test-method"></span>
=== 40 pin GPIO port test method ===
<ol style="list-style-type: decimal;">
<li><p>First open the wiringOP APP on your desktop</p>
<p>[[File:Orange_Pi_4A-image295.png|576x290px]]</p></li>
<li><p>Then click '''GPIO_TEST''' button to open the GPIO test interface</p>
<p>[[File:Orange_Pi_4A-image296.png|413x77px]]</p></li>
<li><p>The GPIO test interface is shown in the figure below. The two rows of '''CheckBox''' buttons on the left are one-to-one corresponding to the 40-pin pin. When '''CheckBox''' button is checked, the corresponding GPIO pin will be set to '''OUT'''mode and the pin level will be set to high. When unchecked, the GPIO pin level is set to low; When you click the '''GPIO READALL''' button on the right, you can get the wPi number, GPIO mode, and pin parity information. When the '''BLINK ALL GPIO''' button is clicked, all pins continuously switch between high and low levels</p>
<p>[[File:Orange_Pi_4A-image297.png|575x293px]]</p></li>
<li><p>Then click the '''GPIO READALL''' button, and the output information is as shown below:</p>
<p>[[File:Orange_Pi_4A-image298.png|575x291px]]</p></li>
<li><p>There are a total of 28 GPIO ports available in the 40 pin development board. Taking pin 7- corresponding to GPIO PB4- corresponding to wPi serial number 2- as an example, we will demonstrate how to set the high and low levels of GPIO ports. Firstly, click on the '''CheckBox''' button corresponding to pin 7. When the button is selected, pin 7 will be set to 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 that the high level has been successfully set</p>
<p>[[File:Orange_Pi_4A-image299.png|575x301px]]</p></li>
<li><p>Then click the '''GPIO READALL''' button, and you can see that the current mode of pin 7 is '''OUT''' and the pin level is high</p>
<p>[[File:Orange_Pi_4A-image300.png|575x288px]]</p></li>
<li><p>Click the '''CheckBox''' button in the following image again to uncheck the status. Pin 7 will be set to a low level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is '''0v''', it means that the low level has been successfully set</p>
<p>[[File:Orange_Pi_4A-image301.png|576x287px]]</p></li>
<li><p>Then click the '''GPIO READALL''' button, and you can see that the current mode of pin 7 is OUT and the pin level is low</p>
<p>[[File:Orange_Pi_4A-image302.png|575x290px]]</p></li></ol>
<span id="pin-uart-testing-method"></span>
=== 40 pin UART testing method ===
<ol style="list-style-type: decimal;">
<li><p>By default, '''UART2''' and '''UART7''' are enabled in Android, corresponding to device nodes'''/dev/ttyAS2''' and'''/dev/ttyAS7'''</p>
<p>t527-demo:/ $ '''ls /dev/ttyAS*'''</p>
<p>ttyAS0 ttyAS1 ttyAS2 ttyAS7</p></li>
<li><p>First, open the WiringoP app on the desktop</p>
<p>[[File:Orange_Pi_4A-image295.png|576x290px]]</p></li>
<li><p>Then click the '''UART_TEST''' button to open the UART test interface</p>
<p>[[File:Orange_Pi_4A-image303.png|505x94px]]</p></li>
<li><p>The serial port test interface of WiringOP is shown in the following figure</p></li></ol>
[[File:Orange_Pi_4A-image304.png|510x130px]]
<ol start="5" style="list-style-type: decimal;">
<li><p>Taking testing UART2 as an example, select the'''/dev/ttyAS2''' node in the selection box</p>
<p>[[File:Orange_Pi_4A-image305.png|507x133px]]</p></li>
<li><p>Enter the desired baud rate in the editing box, then click the '''OPEN''' button to open the '''/dev/ttyAS2''' node. After successful opening, the '''OPEN''' button becomes unselectable, and the '''CLOSE''' and '''SEND''' buttons become selectable</p></li></ol>
[[File:Orange_Pi_4A-image306.png|505x132px]]
<ol start="7" style="list-style-type: decimal;">
<li>Then use DuPont wire to short-circuit the rx and tx pins of UART 2</li></ol>
{| class="wikitable"
|-
|
| style="text-align: left;"| uart2
|-
| tx pin
| style="text-align: left;"| Corresponding to pin 11 of pin 40
|-
| rx pin
| style="text-align: left;"| Corresponding to pin 13 of pin 40
|}
<ol start="8" style="list-style-type: decimal;">
<li>Then you can enter a character in the send edit box below and click the '''SEND''' button to start sending</li></ol>
[[File:Orange_Pi_4A-image307.png|511x138px]]
<ol start="9" style="list-style-type: decimal;">
<li>If everything is normal, the received string will be displayed in the receiving box</li></ol>
[[File:Orange_Pi_4A-image308.png|516x136px]]
<span id="pin-spi-testing-method"></span>
=== 40 pin SPI testing method ===
<ol style="list-style-type: decimal;">
<li><p>The SPI that can be used in 40 pins is SPI1, and the corresponding device node is'''/dev/spidev1.0'''</p>
<p>[[File:Orange_Pi_4A-image295.png|576x290px]]</p></li>
<li><p>Here is a demonstration of testing the SPI1 interface using the '''w25q64''' module. First, connect the w25q64 module to the SPI1 interface</p></li></ol>
'''If there is no w25q64 module, it doesn't matter, because there is a SPIFlash connected to SPI0 on the development board, and the SPI0 configuration is also enabled by default in Android, so we can directly use the onboard SPIFlash for testing.'''
<ol start="3" style="list-style-type: decimal;">
<li><p>Then open the WiringoP app on the desktop</p></li>
<li><p>Then click the '''SPI_TEST''' button to open the SPI testing interface</p>
<p>[[File:Orange_Pi_4A-image309.png|518x96px]]</p></li>
<li><p>Then select the device node of SPI in the upper left corner. If testing the onboard SPIFlash directly, keep the default'''/dev/spidev0.0'''. If the '''w25q64''' module is connected to the 40 pin SPI1, select'''/dev/spidev1.0'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image310.jpeg|296x136px|微信图片_20241119194920]]
</div></li>
<li><p>Then click the '''OPEN''' button to initialize SPI</p></li></ol>
[[File:Orange_Pi_4A-image311.png|295x168px]]
<ol start="7" style="list-style-type: decimal;">
<li><p>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 clicking the '''TRANSFER''' button</p>
<p>[[File:Orange_Pi_4A-image312.png|294x169px]]</p></li>
<li><p>Finally, the APP will display the ID information of the read onboard SPI Flash</p></li></ol>
[[File:Orange_Pi_4A-image313.png|296x193px]]
<ol start="9" style="list-style-type: decimal;">
<li><p>If reading the w25q64 module connected to the 40 pin SPI1, the read ID information is shown in the following figure</p>
<p>[[File:Orange_Pi_4A-image314.png|302x201px]]</p></li>
<li><p>The MANUFACTURER ID of the w25q64 module is EFh, and the Device ID is 4017h, which corresponds to the values read above (h represents hexadecimal)</p>
<p>[[File:Orange_Pi_4A-image315.png|336x113px]]</p></li></ol>
<span id="pin-i2c-testing-method"></span>
=== 40 pin I2C testing method ===
<ol style="list-style-type: decimal;">
<li><p>In Android, i2c4 and i2c5 in pin 40 are enabled by default, corresponding to device nodes'''/dev/i2c-4''' and'''/dev/i2c-5''', respectively</p>
<p>console:/ # '''ls''' '''/dev/i2c-4 /dev/i2c-5'''</p>
<p>/dev/i2c-4 /dev/i2c-5</p></li>
<li><p>First, open the WiringoP app on the desktop</p>
<p>[[File:Orange_Pi_4A-image295.png|576x290px]]</p></li>
<li><p>Then click the '''I2C_TEST''' button to open the testing interface of i2c</p>
<p>[[File:Orange_Pi_4A-image316.png|506x110px]]</p></li>
<li><p>The i2c testing interface of WiringOP is shown in the following figure</p>
<p>[[File:Orange_Pi_4A-image317.png|353x159px]]</p></li>
<li><p>Taking testing i2C4 as an example, select the'''<span class="mark">/dev/i2c-4 node</span>''' in the selection box</p></li></ol>
[[File:Orange_Pi_4A-image318.png|273x195px]]
<ol start="6" style="list-style-type: decimal;">
<li><p>Then connect an I2C device to the 40 pin I2C4 pin, using the DS1307 RTC module as an example</p>
<p>[[File:Orange_Pi_4A-image161.png|121x103px]]</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''Pin of RTC module'''
| style="text-align: left;"| '''Development board 40 pin corresponding pins'''
|-
| style="text-align: left;"| '''5V'''
| style="text-align: left;"| '''Pin 2'''
|-
| style="text-align: left;"| '''GND'''
| style="text-align: left;"| '''Pin 6'''
|-
| style="text-align: left;"| '''SDA'''
| style="text-align: left;"| '''Pin 3'''
|-
| style="text-align: left;"| '''SCL'''
| style="text-align: left;"| '''Pin 5'''
|}
<ol start="7" style="list-style-type: decimal;">
<li><p>The i2c address of the ds1307 RTC module is 0x68. After connecting the cable, we can use the '''i2cdetect -y -r 4''' command in the serial port command line to check if we can scan the i2c address of the ds1307 RTC module. As shown in the figure below, if the address 0x68 can be seen, it indicates that the wiring of the ds1307 RTC module is correct.</p>
<p>console:/ # '''i2cdetect -y 4'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image319.png|467x199px|D16403AF-C244-45ed-81FE-308A42F1E840]]
</div></li>
<li><p>Then set the address of i2c to 0x68 in WirgOP, and click the '''OPEN''' button to open i2c4</p>
<p>[[File:Orange_Pi_4A-image320.png|360x194px]]</p></li>
<li><p>After clicking the '''OPEN''' button to open i2C4, the display is as follows:</p>
<p>[[File:Orange_Pi_4A-image321.png|366x216px]]</p></li>
<li><p>Then we will test writing a value to the register of the RTC module, such as writing 0x55 to address 0x1c</p>
<ol style="list-style-type: lower-alpha;">
<li><p>We first set the address of the register that needs to be written to 0x1c</p>
<p>[[File:Orange_Pi_4A-image322.png|366x217px]]</p></li>
<li><p>Then set the value to be written as 0x55</p>
<p>[[File:Orange_Pi_4A-image323.png|316x191px]]</p></li>
<li><p>Then click the '''WRITE BYTE''' button to perform the write action</p>
<p>[[File:Orange_Pi_4A-image324.png|322x193px]]</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-write test has passed</p>
<p>[[File:Orange_Pi_4A-image325.png|326x196px]]</p></li></ol>
<span id="appendix"></span>
= Appendix =
<span id="user-manual-update-history"></span>
== User Manual Update History ==
{| class="wikitable"
|-
| style="text-align: center;"| '''edition'''
| style="text-align: center;"| '''Date'''
| style="text-align: center;"| '''Update Explanation'''
|-
| style="text-align: center;"| v1.0
| style="text-align: center;"| 2024-11-14
| style="text-align: center;"| Initial version
|}
<span id="image-update-history"></span>
== Image update history ==
{| class="wikitable"
|-
| style="text-align: center;"| * *Date**
| style="text-align: center;"| '''Update Explanation'''
|-
| style="text-align: center;"| 202 4-11-14
| style="text-align: center;"| OrangePi4A_T527_Android13_v1.0.0.tar.gz
OrangePi4A_T527_Android13_lcd_v1.0.0.tar.gz
Orangepi4a_1.0.0_ubuntu_jammy_server_linux5.15.147.7z
Orangepi4a_1.0.0_debian_bookworm_server_linux5.15.147.7z
Or angepi4a_1.0.0_ubuntu_jammy_desktop_gnome_linux5.15.147.7z
Orang epi4a_1.0.0_debian_bookworm_desktop_gnome_linux5.15.147.7z
*Initial version
|}
'''User Manual'''
<div class="figure">
[[File:Orange_Pi_4A-image2.jpeg|575x419px|_MG_3225]]
</div>
<span id="basic-characteristics-of-orange-pi-4a"></span>
= Basic characteristics of Orange Pi 4A =
<span id="what-is-orange-pi-4a"></span>
== What is Orange Pi 4A ==
The Orange Pi 4A adopts the Allwinner T527 eight core Cortex-A55+HiFI4 DSP+RISV-V multi-core heterogeneous industrial grade processor, supporting 2TOPS NPU to meet the needs of edge intelligent AI acceleration applications; Supports 2GB/4GB LPDDR4/4X and provides H.265 4K@60fps And H.264 4K@60fps Video decoding, H.264 4K@25fps code; Rich interfaces, including commonly used functional interfaces such as Gigabit Ethernet, PCIe 2.0, USB 2.0, MIPI-CSI, MIPI-DSI, 40Pin expansion interface, etc. Supports operating systems such as Ubuntu, Debian, Android 13, etc.
Orange Pi 4A can provide a solid hardware foundation for the scenario landing of generative AI and artificial intelligence algorithms, and can be widely used in intelligent industrial control, intelligent business display, retail payment, intelligent education, commercial robots, vehicle terminals, visual assistant driving, edge computing, intelligent power distribution terminals, etc.
<span id="the-purpose-of-orange-pi-4a"></span>
== The purpose of Orange Pi 4A ==
We can use it to achieve:
* A small Linux desktop computer
* A small Linux network server
* Android tablet
* Android game consoles, etc
'''Of course, there are many other features as well. With a powerful ecosystem and various expansion accessories, Orange Pi can help users easily achieve delivery from creativity to prototype to mass production. It is an ideal creative platform for makers, dreamers, and hobbyists.'''
<span id="who-is-orange-pi-4a-designed-for"></span>
== Who is Orange Pi 4A designed for ==
Orange Pi development board is not only a consumer product, but also designed for anyone who wants to use technology for creative innovation. It is a simple, fun, and practical tool that you can use to create the world around you.
<span id="hardware-features-of-orange-pi-4a"></span>
== Hardware Features of Orange Pi 4A ==
{| class="wikitable"
|-
| style="text-align: center;"| '''Introduction to Hardware Features'''
| style="text-align: center;"|
|-
| style="text-align: center;"| '''Processor'''
| style="text-align: center;"| <span class="mark">T527</span>,8-core ARM CortexTM-A55@1.8GHz
HIFI4 Audio DSP@600MHz
RISC-V@200MHz
GPU:G57 MC1
VPU: H.265 4K@60fps Decoding, H.264 4K@60fps Decoding, H.264 4K@25fps code
<span class="mark">NPU:2TOPS</span>
|-
| style="text-align: center;"| '''Memory'''
| style="text-align: center;"| LPDDR4/4X:2GB/4GB optional
|-
| style="text-align: center;"| '''Storage'''
| style="text-align: center;"| EMMC module optional: 16GB/32GB/64GB/128GB optional
<span class="mark">SPI Flash:128Mb (default paste), 256Mb optional</span>
M.2 M-KEY Socket:PCIe2.0 NVMe SSD
uSD card slot:supports up to 128GB uSD card
|-
| style="text-align: center;"| '''Wi Fi+Bluetooth'''
| style="text-align: center;"| Wi Fi+Bluetooth two in one module
Wi-Fi5.0+BT 5.0,BLE
|-
| style="text-align: center;"| '''Ethernet'''
| style="text-align: center;"| <span class="mark">10/100/1000Mbps Ethernet</span>
|-
| style="text-align: center;"| '''Display'''
| style="text-align: center;"| 1x HDMI TX 2.0 interface up to 4K@60fps
1x 4-lane MIPI-DSI
1x eDP1.3
|-
| style="text-align: center;"| '''Camera'''
| style="text-align: center;"| 1x 2-lane MIPI-CSI camera interface
1x 4-lane MIPI-CSI camera interface
|-
| style="text-align: center;"| '''USB'''
| style="text-align: center;"| <span class="mark">1xUSB Type-A 2.0</span>
<span class="mark">3xUSB Type-A 2.0 HOS</span><span class="mark">T</span>
1xUSB 2.0 HOST reserved for customer expansion
|-
| style="text-align: center;"| '''ADC'''
| style="text-align: center;"| Reserved 4pin interface, capable of connecting 2 ADCs, with a maximum input of 1.8V
|-
| style="text-align: center;"| '''Audio frequency'''
| style="text-align: center;"| 3.5mm headphone jack audio input/output
|-
| style="text-align: center;"| '''Key'''
| style="text-align: center;"| 1* BOOT,1*RESET,1 *PWR ON
|-
| style="text-align: center;"| '''RTC'''
| style="text-align: center;"| 2Pin backup battery interface (Pitch=1.27mm)
|-
| style="text-align: center;"| '''40Pin'''
| style="text-align: center;"| 40Pin function extension interface, supporting the following interface types:
<span class="mark">GPIO、UART、I2C、SPI、PWM</span>
|-
| style="text-align: center;"| '''DEBUG'''
| style="text-align: center;"| <span class="mark">3Pin debugging serial port</span>
|-
| style="text-align: center;"| '''Power Supply'''
| style="text-align: center;"| <span class="mark">Type-C 5V 5A DCIN</span>
|-
| style="text-align: center;"| '''Supported OS'''
| style="text-align: center;"| Ubuntu、Debian、Android13, etc
|-
| style="text-align: center;"| '''Introduction to appearance specifications'''
| style="text-align: center;"|
|-
| style="text-align: center;"| '''PCB'''
| style="text-align: center;"| 89mm*56mm*1.6mm
|-
| style="text-align: center;"| '''Weight'''
| style="text-align: center;"| 52g
|}
<span id="top-and-bottom-views-of-range-pi-4a"></span>
== Top and Bottom Views of Range Pi 4A ==
'''Top level view:'''
[[File:Orange_Pi_4A-image3.png|439x269px]]
'''Bottom level view:'''
[[File:Orange_Pi_4A-image4.png|448x278px]]
<span id="interface-details-of-range-pi-4a"></span>
== Interface Details of Range Pi 4A ==
<div class="figure">
[[File:Orange_Pi_4A-image5.png|466x746px|1731934096557]]
</div>
[[File:Orange_Pi_4A-image6.png|575x251px]]
'''The diameter of the four positioning holes is 3.0mm.'''
<span id="introduction-to-using-the-development-board"></span>
= '''Introduction to using the development board''' =
<span id="prepare-the-necessary-accessories"></span>
== Prepare the necessary accessories ==
<ol style="list-style-type: decimal;">
<li><p>TF card, high-speed SanDisk card with a minimum capacity of 8GB and class 10 or above</p>
<p>[[File:Orange_Pi_4A-image7.png|124x96px]]</p></li>
<li><p>TF card reader, used for reading and writing TF cards</p>
<p>[[File:Orange_Pi_4A-image8.png|139x96px]]</p></li>
<li><p>HDMI interface display</p>
<p>[[File:Orange_Pi_4A-image9.png|313x205px]]</p></li>
<li><p>HDMI to HDMI cable, used to connect the development board to an HDMI monitor or TV for display</p>
<p>[[File:Orange_Pi_4A-image10.png|199x129px]]</p></li>
<li><p>10.1-inch MIPI screen, used to display the system interface of the development board (this screen includes adapter board and OPi5Plus/OPi5B/OPi5Pro/OPi5Max/OPi4A universal)</p>
<div class="figure">
[[File:Orange_Pi_4A-image11.jpeg|223x203px|IMG_7546]]
</div></li>
<li><p>Power adapter, Orange Pi 4A recommends using a 5V/5A Type-C power supply for power supply</p>
<p>[[File:Orange_Pi_4A-image12.png|196x152px]]</p>
<p>'''The Type-C power interface of the development board does not support PD negotiation function and only supports a fixed 5V voltage input.'''</p></li>
<li><p>USB interface mouse and keyboard, any standard USB interface mouse and keyboard can be used to control the Orange Pi development board</p>
<p>[[File:Orange_Pi_4A-image13.png|224x191px]]</p></li>
<li><p>USB camera</p>
<p>[[File:Orange_Pi_4A-image14.png|255x148px]]</p></li>
<li><p>100Mbps or 1G Ethernet cable, used to connect the development board to the Internet</p>
<p>[[File:Orange_Pi_4A-image15.png|143x112px]]</p></li>
<li><p>A 5V cooling fan, as shown in the figure below, has a dedicated 5V output interface on the development board for connecting to the cooling fan, with a spacing of '''2.54mm'''. The power interface of the cooling fan can be purchased according to this specification.</p>
<p>'''Note that once the development board is plugged in, the 5V pin can be used directly without any additional settings. Additionally, the voltage output from the 5V pin cannot be adjusted or turned off through software.'''</p>
<p>[[File:Orange_Pi_4A-image16.png|420x124px]]</p></li>
<li><p>USB 2.0 male to male data cable, used for adb debugging, burning images to eMMC and other functions</p>
<div class="figure">
[[File:Orange_Pi_4A-image17.png|158x155px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]
</div></li>
<li><p>When using the serial port debugging function, USB to TTL module and DuPont cable are required to connect the development board and computer</p>
<p>[[File:Orange_Pi_4A-image18.png|176x145px]] [[File:Orange_Pi_4A-image19.png|305x110px]]</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 above figure, other similar 3.3V USB to TTL modules are generally acceptable.'''</p></li>
<li><p>X64 computer with Ubuntu and Windows operating systems installed</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| 1
| style="text-align: left;"| Ubuntu22.04 PC
| style="text-align: left;"| Optional, used for compiling Android and Linux source code
|-
| style="text-align: left;"| 2
| style="text-align: left;"| Windows PC
| style="text-align: left;"| Used for burning Android and Linux images
|}
<span id="download-the-image-of-the-development-board-and-related-materials"></span>
== Download the image of the development board and related materials ==
# The download link for the Chinese version of the materials is
'''http://www.orangepi.cn/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-4A.html'''
<ol start="2" style="list-style-type: decimal;">
<li><p>The download link for the English version of the material is</p>
<p>'''http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-4A.html'''</p></li>
<li><p>The information mainly includes</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Linux source code''':saved on Github</p></li>
<li><p>'''Android''' '''image''':saved on Google Drive</p></li>
<li><p>'''Ubuntu''' '''image''':saved on Google Drive</p></li>
<li><p>'''Debian image''':saved on Google Drive</p></li>
<li><p>'''User manual and schematic diagram:'''saved on Google Drive</p></li>
<li><p>'''Official tools:'''saved on Google Drive. Mainly including the software required during the use of the development board</p></li></ol>
</li></ol>
<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 ==
'''Note that the Linux image referred to here specifically refers to Linux distribution images such as Debian or Ubuntu downloaded from the Orange Pi data download page.'''
<span id="method-of-burning-linux-images-using-balenaetcher"></span>
=== '''Method of burning Linux images using BalenaEtcher''' ===
# First prepare a TF card with a capacity of 16GB or more. The transmission speed of the TF card must be '''class 10''' or above. It is recommended to use a TF card of SanDisk and other brands
# Then use the card reader to insert the TF card into the computer
# Download the compressed file of the Linux operating system image that you want to burn from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi's download page'''], and then use decompression software to decompress it. In the decompressed file, the file ending with "'''.img'''" is the operating system image file, which is usually over 1GB in size
# Then download the Linux image burning software - '''balenaEtcher''', from the download link
[https://www.balena.io/etcher/ '''https://www.balena.io/etcher/''']
<ol start="5" style="list-style-type: decimal;">
<li><p>After entering the balenaEtcher download page, clicking the green download button will jump to the software download location</p>
<p>[[File:Orange_Pi_4A-image20.png|456x219px]]</p></li>
<li><p>Then you can choose to download the portable version of BalenaEtcher software. The portable version does not require installation and can be opened by double clicking</p>
<p>[[File:Orange_Pi_4A-image21.png|468x173px]]</p></li>
<li><p>If you are downloading a version of balenaEtcher that requires installation, please install it first before using it. If you download the portable version of balenaEtcher, simply double-click to open it. The interface of balenaEtcher after opening is shown in the following figure</p>
<p>[[File:Orange_Pi_4A-image22.png|335x211px]]</p></li></ol>
'''When opening balenaEtcher, if prompted with the following error:'''
[[File:Orange_Pi_4A-image23.png|206x162px]]
'''Please select balenaEtcher and right-click, then choose to run as administrator.'''
<div class="figure">
[[File:Orange_Pi_4A-image24.png|300x104px|图形用户界面, 文本, 应用程序 描述已自动生成]]
</div>
<ol start="8" style="list-style-type: decimal;">
<li><p>The specific steps to use balenaEtcher to burn the Linux image are aa follow</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First select the path of the Linux image file to burned</p></li>
<li><p>Then select the drive letter of the TF card</p></li>
<li><p>Finally, click Flash to start burning the Linux image to the TF card</p>
<div class="figure">
[[File:Orange_Pi_4A-image25.png|501x281px|03]]
</div></li></ol>
</li>
<li><p>The interface displayed during the process of burning a Linux image by balenaEtcher is shown in the following figure. In addition, the progress bar displaying purple indicates that the Linux image is being burned to the TF card</p>
<p>[[File:Orange_Pi_4A-image26.png|506x317px]]</p></li>
<li><p>After the Linux image is burned, balenaEtcher will also verify the image burned to the TF card by default to ensure that there are no problems during the burning process. As shown in the following figure, a green progress bar indicates that the image has been burned and balenaEtcher is verifying the burned image</p>
<p>[[File:Orange_Pi_4A-image27.png|519x325px]]</p></li>
<li><p>After successful burning, the display interface of balenaEtcher is shown in the following figure. If a green indicator icon is displayed, it indicates that the image burning is successful. At this time, you can exit balenaEtcher, then unplug the TF card and insert it into the TF card slot of the development board for use</p>
<div class="figure">
[[File:Orange_Pi_4A-image28.png|523x324px|04]]
</div></li></ol>
<span id="method-of-burning-linux-images-using-win32diskimager"></span>
=== '''Method of burning Linux images using Win32Diskimager''' ===
<ol style="list-style-type: decimal;">
<li><p>First prepare an 8GB or larger capacity TF card, TF card transmission speed must be '''class10''' or above, it is recommended to use Sandisk and other brands of TF card</p></li>
<li><p>Then use the card reader to insert the TF card into the computer</p></li>
<li><p>Then format the TF card</p>
<ol style="list-style-type: lower-alpha;">
<li>You can use '''SD Card Formatter''' to format TF cards. The download address is</li></ol>
</li></ol>
[https://www.sdcard.org/downloads/formatter/eula_windows/SDCardFormatterv5_WinEN.zip '''https://www.sdcard.org/downloads/formatter/eula_windows/SDCardFormatterv5_WinEN.zip''']
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>After downloading the software, decompress and install it. Then open the software</p></li>
<li><p>If only a TF card is inserted into the computer, the drive letter of the TF card will be displayed in the column of "'''Select card'''". 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</p>
<div class="figure">
[[File:Orange_Pi_4A-image29.png|209x228px|选区_199]]
</div></li>
<li><p>Then click "'''Format'''", a warning box will pop up before formatting, select "'''Yes (Y)'''" will start formatting</p></li></ol>
[[File:Orange_Pi_4A-image30.png|304x147px]]
<ol start="5" style="list-style-type: lower-alpha;">
<li><p>After formatting the TF card, the message as shown in the following figure will pop up. Click OK</p>
<p>[[File:Orange_Pi_4A-image31.png|186x149px]]</p></li></ol>
<!-- -->
<ol start="4" style="list-style-type: decimal;">
<li><p>Download the compressed Linux operating system image file you want to burn from [http://www.orangepi.org/html/serviceAndSupport/index.html '''the data download page of Orange Pi'''], and then use the decompression software to decompress it. Files ending with "'''.img''' "in the decompressed files are the image files of the operating system, and the size is generally more than 1GB</p></li>
<li><p>Burn Linux image to TF card using '''Win32Diskimager'''</p>
<ol style="list-style-type: lower-alpha;">
<li>The download page for Win32Diskimager is</li></ol>
</li></ol>
[http://sourceforge.net/projects/win32diskimager/files/Archive/ '''http://sourceforge.net/projects/win32diskimager/files/Archive/''']
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>After downloading, install it directly. The interface of '''Win32Diskimager''' is as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First select the path of the image</p></li>
<li><p>Then confirm that the drive letter of the TF card is consistent with that displayed in the "'''Device'''" column</p></li>
<li><p>Finally click "'''Write'''" to start burn</p>
<div class="figure">
[[File:Orange_Pi_4A-image32.png|297x206px|14]]
</div></li></ol>
</li>
<li><p>After the image writing is completed, click the "'''Exi'''t" button to exit, and then you can pull out the TF card and insert it into the development board to start</p></li></ol>
<span id="method-for-burning-linux-images-to-tf-cards-based-on-ubuntu-pc"></span>
== Method for burning Linux images to TF cards based on Ubuntu PC ==
'''Note that the Linux image referred to here specifically refers to Linux distribution images such as Debian or Ubuntu downloaded from the Orange Pi data download page, while Ubuntu PC refers to a personal computer with the Ubuntu system installed.'''
# Firstly, prepare a TF card with 8GB or larger capacity, and the transfer speed of the TF card must be '''class10''' or above. It is recommended to use TF cards from brands such as SanDisk
# Then use a card reader to insert the TF card into the computer
<!-- -->
# Download the balenaEtcher software from the following link:
[https://www.balena.io/etcher/ '''https://www.balena.io/etcher/''']
<ol start="2" style="list-style-type: decimal;">
<li><p>After entering the balenaEtcher download page, clicking the green download button will jump to the software download location</p>
<p>[[File:Orange_Pi_4A-image20.png|489x235px]]</p></li>
<li><p>Then choose to download the Linux version of the software</p>
<p>[[File:Orange_Pi_4A-image33.png|485x184px]]</p></li>
<li><p>Download the compressed file of the Linux operating system image that you want to burn from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi download page'''], and then use decompression software to decompress it. In the decompressed file, the file ending with "'''.img'''" is the operating system image file, which is usually over 1GB in size. The decompression command for the compressed file ending in 7z is as follows:</p>
<p>test@test:~$ '''7z x Orangepi4a_1.0.0_ubuntu_jammy_desktop_linux5.15.147.7z'''</p>
<p>test@test:~$ '''ls Orangepi4a_1.0.0_ubuntu_jammy_desktop_linux5.15.147.*'''</p>
<p>Orangepi4a_1.0.0_ubuntu_jammy_desktop_linux5.15.147.7z '''Orangepi4a_1.0.0_ubuntu_jammy_desktop_linux5.15.147.sha''' #Verification and file</p>
<p>'''Orangepi4a_1.0.0_ubuntu_jammy_desktop_linux5.15.147.img''' #Image file</p></li>
<li><p>After decompressing the image, you can first use the '''sha256sum -c *.sha''' command to calculate if the checksum is correct. If the prompt is '''successful''', it means that the downloaded image is correct and can be safely burned to the TF card. If the prompt is that the '''checksum does not match''', it means that the downloaded image has a problem. Please try downloading it again</p>
<p>test@test:~$ '''sha256sum -c *.sha'''</p>
<p>Orangepi4a_1.0.0_ubuntu_jammy_desktop_linux5.15.147.img: '''success'''</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 displayed after opening balenaEtcher is shown in the following figure</p>
<p>[[File:Orange_Pi_4A-image34.png|423x251px]]</p></li>
<li><p>The specific steps for burning a Linux image using balenaEtcher are as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First select the path of the Linux image file to burned</p></li>
<li><p>Then select the drive letter of the TF card</p></li>
<li><p>Finally, click Flash to start burning the Linux image to the TF card</p>
<div class="figure">
[[File:Orange_Pi_4A-image25.png|501x281px|03]]
</div></li></ol>
</li>
<li><p>The interface displayed during the process of burning a Linux image by balenaEtcher is shown in the following figure. In addition, the progress bar displaying purple indicates that the Linux image is being burned to the TF card</p>
<p>[[File:Orange_Pi_4A-image35.png|576x247px]]</p></li>
<li><p>After the Linux image is burned, balenaEtcher will also verify the image burned to the TF card by default to ensure that there are no problems during the burning process. As shown in the following figure, a green progress bar indicates that the image has been burned and balenaEtcher is verifying the burned image</p>
<p>[[File:Orange_Pi_4A-image36.png|576x252px]]</p></li>
<li><p>After successful burning, the display interface of balenaEtcher is shown in the following figure. If a green indicator icon is displayed, it indicates that the image burning is successful. At this time, you can exit balenaEtcher, then unplug the TF card and insert it into the TF card slot of the development board for use</p>
<p>[[File:Orange_Pi_4A-image37.png|576x340px]]</p></li></ol>
<span id="method-for-burning-linux-images-to-emmc"></span>
== Method for burning Linux images to eMMC ==
[[#method-for-burning-linux-images-to-emmc|See the method of burning Linux images to EMMC]]
<span id="method-of-burning-android-image-to-tf-card"></span>
== Method of burning Android image to TF card ==
'''The Android image of the development board can only be burned to a TF card using PhoenixCard software on the Windows platform, and the version of PhoenixCard software must be PhonixCard-4.2.8.'''
'''Please do not use software that burns 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 not possible to burn Android images to TF cards on Linux and Mac platforms.'''
<ol style="list-style-type: decimal;">
<li><p>Firstly, please ensure that the Windows system has installed '''Microsoft Visual C++ 2008 Redistrbutable - x86'''</p>
<p>[[File:Orange_Pi_4A-image38.png|449x293px]]</p></li>
<li><p>If '''Microsoft Visual C++ 2008 Redistrbutable - x86''' is not installed, formatting the TF card with '''PhoenixCard''' or burning the Android image will prompt the following error</p>
<div class="figure">
[[File:Orange_Pi_4A-image39.png|527x369px|NUQB$Q%(){1CV6M6WK4N`5J]]
</div></li>
<li><p>The installation package for '''Microsoft Visual C++ 2008 Redistrbutable - x86''' can be downloaded from the '''[http://www.orangepi.org/html/serviceAndSupport/index.html official tool]''' of Orange Pi 4A or from the [https://www.microsoft.com/zh-cn/download/details.aspx?id=26368 '''Microsoft official website''']</p>
<p>[[File:Orange_Pi_4A-image40.png|240x93px]] [[File:Orange_Pi_4A-image41.png|200x95px]]</p></li>
<li><p>Firstly, prepare a TF card with 8GB or larger capacity, and the transfer speed of the TF card must be '''class10''' or above. It is recommended to use TF cards from brands such as SanDisk</p></li>
<li><p>Then use a 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's download page''']. Please ensure that the version of the PhonenixCrad tool is '''PhonexCard-4.2.8. Do not use PhonixCard software below version 4.2.8 to burn the Android image''', as Android images burned by PhonixCard tools below this version may have problems</p>
<div class="figure">
[[File:Orange_Pi_4A-image42.jpeg|576x169px|微信图片_20241119192834]]
</div></li>
<li><p>Then use decompression software to decompress the downloaded Android image compressed file. In the decompressed file, the file ending with "'''.img'''" is the Android image file, with a size of 1GB or more. If you don't know how to decompress the compressed file of an Android image, you can install a '''360 compression software''' to decompress the image.</p>
<p>[[File:Orange_Pi_4A-image43.png|438x158px]]</p></li>
<li><p>Then use decompression software to extract '''PhonixCard4.2.8.zip'''. This software does not require installation, just find PhoenixCard in the extracted folder and open it</p>
<p>[[File:Orange_Pi_4A-image44.png|576x113px]]</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 it is not displayed, you can try unplugging the TF card or clicking the "'''Refresh Drive Letter'''" button in PhoenixCard</p></li></ol>
[[File:Orange_Pi_4A-image45.png|575x137px]]
<ol start="10" style="list-style-type: decimal;">
<li><p>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)</p>
<div class="figure">
[[File:Orange_Pi_4A-image46.jpeg|576x317px|微信图片_20241119192853]]
</div>
<p>'''If there is a problem with formatting, please try unplugging and unplugging the TF card before testing again. If the problem persists after unplugging and unplugging the TF card again, you can restart your Windows computer or switch to another computer and try again.'''</p></li>
<li><p>Then start writing the Android image to the TF card</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Firstly, select the path of the Android image in the "'''Firmware'''" column</p></li>
<li><p>Select "'''Startup Card'''" in the "'''Types of Cards to Make'''" section</p></li>
<li><p>Then click the "'''Burn Card'''" button to start burning</p>
<div class="figure">
[[File:Orange_Pi_4A-image47.jpeg|576x452px|微信图片_20241119192912]]
</div></li></ol>
</li>
<li><p>After burning, the display of PhoenixCard is shown in the following figure. Click the "'''Close'''" button to exit PhoenixCard, and then you can unplug the TF card from the computer and insert it into the development board to start it</p>
<p>[[File:Orange_Pi_4A-image48.png|575x452px]]</p>
<p>'''After burning the Android system, only one 128 MB partition can be seen on the TF card in Windows, as shown in the following figure (some computers may pop up more than twenty disk partitions, but can only open the 128 MB partition). Please note that this is normal and do not burn out the TF card. The reason for this is that the Android system has over twenty partitions, but most of them cannot be recognized properly in the Windows system. At this point, please feel free to unplug the TF card and insert it into the development board to start.'''</p>
<p>[[File:Orange_Pi_4A-image49.png|193x45px]]</p>
<p>'''After starting the Android system, use the following command to see these twenty partitions in the TF card:'''</p>
<p>[[File:Orange_Pi_4A-image50.png|391x116px]]</p>
<p>'''Using the df -h command, you can see that after burning the 32GB TF card to the Android system, there is still approximately 24GB of space available for use (not all of the twenty partitions will be mounted to the Android system, so focus on the visible partitions).'''</p>
<p>[[File:Orange_Pi_4A-image51.png|371x192px]]</p></li></ol>
<span id="method-for-burning-android-images-to-emmc"></span>
== Method for burning Android images to eMMC ==
'''The Android image of the development board can only be burned to eMMC using PhoenixCard software on the Windows platform, and the version of PhoenixCard software must be PhonixCard-4.2.8.'''
'''Please do not use software that burns 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 not possible to burn Android images to eMMC on Linux and Mac platforms.'''
<ol style="list-style-type: decimal;">
<li><p>The development board has reserved an expansion interface for the eMMC module. Before burning the system to eMMC, it is necessary to purchase an eMMC module that matches the eMMC interface of the development board. Then install the eMMC module onto the development board. The method of inserting the eMMC module into the development board is as follows:</p>
<p>[[File:Orange_Pi_4A-image52.png|115x84px]] [[File:Orange_Pi_4A-image53.png|120x87px]]</p>
<p>[[File:Orange_Pi_4A-image54.png|270x159px]]</p></li>
<li><p>Firstly, please note that this method requires the use of a TF card and is mainly divided into the following two steps</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, use PhoenixCard to burn the Android firmware onto the TF card as a production card</p></li>
<li><p>Then use a TF card to burn the Android firmware into eMMC</p></li></ol>
</li>
<li><p>Please ensure that the Windows system has installed '''Microsoft Visual C++ 2008 Redistrbutable - x86'''</p>
<p>[[File:Orange_Pi_4A-image38.png|449x293px]]</p></li>
<li><p>If '''Microsoft Visual C++ 2008 Redistrbutable - x86''' is not installed, formatting the TF card with PhoenixCard or burning the Android image will prompt the following error</p>
<div class="figure">
[[File:Orange_Pi_4A-image39.png|527x369px|NUQB$Q%(){1CV6M6WK4N`5J]]
</div></li>
<li><p>The installation package for '''Microsoft Visual C++ 2008 Redistrbutable - x86''' can be downloaded from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''official tool'''] of Orange Pi 4A or from the [https://www.microsoft.com/zh-cn/download/details.aspx?id=26368 '''Microsoft official website''']</p>
<p>[[File:Orange_Pi_4A-image40.png|240x93px]] [[File:Orange_Pi_4A-image41.png|200x95px]]</p></li>
<li><p>Then prepare an 8GB or larger capacity TF card, TF card transmission speed must be '''class10''' or above, it is recommended to use Sandisk and other brands of TF card</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 writing tool from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Data download page of Orange Pi''']. Please ensure that the version of the PhonenixCrad tool is '''PhonixCard-4.2.8. Do not use PhonixCard software later than 4.2.8 to burn Android images'''. Android images written by PhonixCard tools later than this version may have problems</p>
<div class="figure">
[[File:Orange_Pi_4A-image42.jpeg|576x169px|微信图片_20241119192834]]
</div></li>
<li><p>Then use the 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, the size of which is more than 1GB. If you do not know how to decompress the Android image package, you can install a [https://yasuo.360.cn/ '''360 compression software'''] to decompress the image.</p>
<p>[[File:Orange_Pi_4A-image43.png|438x158px]]</p></li>
<li><p>Then use the decompression software to decompress '''PhonixCard4.2.8.zip'''. The software does not need to be installed. Find PhoenixCard in the decompressed folder and open it</p>
<p>[[File:Orange_Pi_4A-image44.png|576x113px]]</p></li>
<li><p>打开PhoenixCard后,如After PhoenixCard is opened, if the TF card is recognized normally, the TF card's drive letter and capacity will be displayed in the middle list. '''Please make sure that the drive letter displayed is the same as that of the TF card you want to burn'''. If it is not displayed, try to remove and insert the TF card, or click "'''Refresh Drive Letter'''" in PhoenixCard</p></li></ol>
[[File:Orange_Pi_4A-image55.png|576x154px]]
<ol start="12" style="list-style-type: decimal;">
<li><p>After confirming the drive letter, format the TF card and click the "'''Restore Card'''" button in PhoenixCard. (If the "'''Restore Card'''" button is gray and cannot be pressed, click the "'''Refresh Drive Letter'''" button first.)</p>
<div class="figure">
[[File:Orange_Pi_4A-image46.jpeg|576x317px|微信图片_20241119192853]]
</div>
<p>'''If there is any problem with formatting, please try to remove and insert the TF card and test again. If there is still a problem after removing and inserting the TF card, restart the Window computer or change another computer to try again.'''</p></li>
<li><p>Then start writing the Android image to the TF card</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Firstly, select the path of the Android image in the "'''Firmware'''" column</p></li>
<li><p>Select "'''Mass Production Card'''" in the "'''Types of Card Production'''" section</p></li>
<li><p>Then click the "'''Burn Card'''" button to start burning</p>
<div class="figure">
[[File:Orange_Pi_4A-image47.jpeg|576x452px|微信图片_20241119192912]]
</div></li></ol>
</li>
<li><p>After burning, the display of PhoenixCard is shown in the following figure. Click the "'''Close'''" button to exit PhoenixCard</p>
<p>[[File:Orange_Pi_4A-image56.png|575x356px]]</p></li>
<li><p>Then insert the TF card into the development board. After powering on and starting the development board, the Android firmware in the TF card will be automatically burned to the eMMC of the development board. After the burning is completed, it will automatically shut down and the LED light on the development board will turn off</p></li>
<li><p>At this point, you can unplug the TF card and then power it back on, which will start the Android system in eMMC</p></li></ol>
<span id="launch-the-orange-pie-development-board"></span>
== Launch the Orange Pie development board ==
# Insert the TF card with the burned image into the TF card slot of the Orange Pie development board
# The development board has an HDMI interface, which can be connected to a TV or HDMI monitor through an HDMI to HDMI cable. If you purchase an LCD screen, you can also use the LCD screen to display the system interface of the development board.
# Connect a USB mouse and keyboard to control the Orange Pie development board
# The development board has an Ethernet port that can be plugged into a network cable for internet access
# Connect a '''high-quality''' power adapter with a 5V/5A (5V/4A is also acceptable) USB Type C interface
'''Remember not to insert a power adapter with a voltage output greater than 5V, as it may burn out the development board.'''
'''Many unstable phenomena during the power on startup process of the system are basically caused by power supply problems, so a reliable power adapter is very important. If you notice continuous restarts during the startup process, please replace the power supply or Type C data cable and try again.'''
<ol start="6" style="list-style-type: decimal;">
<li><p>Then turn on the power adapter switch. If everything is normal, the HDMI monitor will be able to see the system startup screen</p></li>
<li><p>If you want to view the system's output information by debugging the serial port, please connect the development board to the computer using a serial port cable. For the method of connecting the serial port, please refer to the section on [[#instructions-for-debugging-serial-ports|'''debugging the serial port usage''']]</p></li></ol>
<span id="instructions-for-debugging-serial-ports"></span>
== Instructions for Debugging Serial Ports ==
<span id="debugging-serial-port-connection-instructions"></span>
=== Debugging serial port connection instructions ===
<ol style="list-style-type: decimal;">
<li><p>First, you need to prepare a '''3.3v''' USB to TTL module, and then plug one end of the USB interface of the USB to TTL module into the USB interface of the computer</p>
<div class="figure">
[[File:Orange_Pi_4A-image57.jpeg|575x179px|微信图片_20241119193047]]
</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 following figure</p>
<p>[[File:Orange_Pi_4A-image58.png|497x125px]]</p></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 wires</p>
<ol style="list-style-type: lower-alpha;">
<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 development board</p></li>
<li><p>'''Connect the TX of the USB to TTL module to the RX''' of the development board</p></li></ol>
</li>
<li><p>The schematic diagram of connecting a USB to TTL module to a computer and Orange Pi development board is shown below</p>
<div class="figure">
[[File:Orange_Pi_4A-image59.jpeg|576x208px|微信图片_20241119193153]]
</div>
<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 randomly connect the TX and RX of the serial port first. If there is no output from the test serial port, then switch the order of TX and RX. This way, there will always be a correct order.'''</p></li></ol>
<span id="instructions-for-debugging-serial-ports-on-ubuntu-platform"></span>
=== Instructions for Debugging Serial Ports on Ubuntu Platform ===
'''There are many serial debugging software that can be used under Linux, such as Putty, Minicom, etc. Below is a demonstration of how to use Putty.'''
<ol style="list-style-type: decimal;">
<li><p>Firstly, insert the USB to TTL module into the USB interface of the Ubuntu computer. If the USB to TTL module is recognized as connected properly, the corresponding device node name can be seen in the '''/dev''' section of the Ubuntu PC. Remember this node name, which will be used later when setting up the serial port software</p>
<p>test@test:~$ '''ls /dev/ttyUSB*'''</p>
<p>'''/dev/ttyUSB0'''</p></li>
<li><p>Then use the following command to install Putty on Ubuntu PC</p>
<p>test@test:~$ '''sudo apt update'''</p>
<p>test@test:~$ '''sudo apt install -y putty'''</p></li>
<li><p>Then run putty, remember to '''add sudo privileges'''</p>
<p>test@test:~$ '''sudo putty'''</p></li>
<li><p>After executing the putty command, the following interface will pop up</p>
<p>[[File:Orange_Pi_4A-image60.png|332x290px]]</p></li>
<li><p>Firstly, select the settings interface for the serial port</p>
<div class="figure">
[[File:Orange_Pi_4A-image61.jpeg|337x297px|微信图片_20241119193301]]
</div></li>
<li><p>Then set the parameters of the serial port</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Set '''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 serial port)</p></li>
<li><p>Set '''Flow control''' to '''None'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image62.jpeg|398x352px|微信图片_20241119193320]]
</div></li></ol>
</li>
<li><p>After completing the settings on the serial port interface, return to the Session interface</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, select '''Connection type''' as '''Serial'''</p></li>
<li><p>Then click the '''Open''' button to connect to the serial port</p>
<div class="figure">
[[File:Orange_Pi_4A-image63.jpeg|376x333px|微信图片_20241119193326]]
</div></li></ol>
</li>
<li><p>Then start the development board and you can see the Log information output by the system from the opened serial port terminal</p>
<p>[[File:Orange_Pi_4A-image64.png|376x249px]]</p></li></ol>
<span id="instructions-for-debugging-serial-ports-on-windows-platform"></span>
=== Instructions for Debugging Serial Ports on Windows Platform ===
'''There are many serial debugging software that can be used under Windows, such as SecureCRT, MobaXterm, etc. Below is a demonstration of how to use MobaXterm. This software has a free version and can be used without purchasing a serial number.'''
<ol style="list-style-type: decimal;">
<li><p>下载MobaXterm</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The download link for MobaXterm is as follows</p>
<p>[https://mobaxterm.mobatek.net/ '''https://mobaxterm.mobatek.net/''']</p></li>
<li><p>After entering the MobaXterm download webpage, click '''GET XOBATERM NOW!'''</p>
<p>[[File:Orange_Pi_4A-image65.png|382x233px]]</p></li>
<li><p>Then choose to download the Home version</p>
<p>[[File:Orange_Pi_4A-image66.png|353x231px]]</p></li>
<li><p>Then select the Portable version, and after downloading, there is no need to install it. Simply open it and you can use it</p>
<div class="figure">
[[File:Orange_Pi_4A-image67.png|322x175px|选区_232]]
</div></li></ol>
</li>
<li><p>After downloading, use decompression software to extract the downloaded compressed file and obtain the executable software of MobaXterm. Then double-click to open it</p>
<p>[[File:Orange_Pi_4A-image68.png|576x83px]]</p></li>
<li><p>After opening the software, the steps to set up a serial port connection are as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Open the session settings interface</p></li>
<li><p>Select serial port type</p></li>
<li><p>Select the port number for the serial port (choose 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></li>
<li><p>Choose a baud rate of '''115200''' for the serial port</p></li>
<li><p>Finally, click the "'''OK'''" button to complete the setup</p></li></ol>
</li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image69.jpeg|576x292px|微信图片_20241119193339]]
</div>
<ol start="4" style="list-style-type: decimal;">
<li><p>After clicking the "'''OK'''" button, you will enter the interface below. At this time, you can start the development board and see the output information of the serial port</p>
<div class="figure">
[[File:Orange_Pi_4A-image70.jpeg|576x292px|微信图片_20241119193346]]
</div></li></ol>
<span id="instructions-for-powering-the-5v-pin-in-the-40-pin-interface-of-the-development-board"></span>
== Instructions for powering the 5V pin in the 40 pin interface of the development board ==
'''The recommended power supply method for the development board is to use a 5V/5A or 5V/4A Type C interface power cord plugged into the Type C power interface of the development board for power supply. If you need to use the 5V pin in the 40 pin interface to power the development board, please ensure that the power cord used can meet the power supply requirements of the development board. If there is unstable usage, please switch back to the Type C power supply.'''
<ol style="list-style-type: decimal;">
<li><p>Firstly, it is necessary to prepare a power cord as shown in the following diagram</p>
<div class="figure">
[[File:Orange_Pi_4A-image71.jpeg|323x232px|图片4]]
</div>
<p>'''The power cord shown in the picture can be purchased on Taobao, please search and purchase it yourself.'''</p></li>
<li><p>Use the 5V pin in the 40 pin interface to power the development board, and connect the power cord as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The USB A port of the power cord shown in the above figure needs to be plugged into a 5V/5A power adapter connector ('''it is not recommended to plug it into the USB port of the computer for power supply, as it may be unstable to use if there are too many peripherals connected to the development board''')</p></li>
<li><p>The red DuPont wire needs to be plugged into the 5V pin of the 40 pin interface on the development board</p></li>
<li><p>The black DuPont wire needs to be plugged into the GND pin of the 40 pin interface</p></li>
<li><p>The positions of the 5V pin and GND pin of the 40 pin interface in the development board are shown in the following figure. '''Remember not to connect them in reverse'''</p>
<p>[[File:Orange_Pi_4A-image72.png|456x110px]]</p></li></ol>
</li></ol>
<span id="instructions-for-using-debianubuntu-server-and-gnome-desktop-system"></span>
= Instructions for using Debian/Ubuntu Server and Gnome desktop system =
<span id="supported-linux-image-types-and-kernel-versions"></span>
== Supported Linux image types and kernel versions ==
{| class="wikitable"
|-
| style="text-align: center;"| '''Linux image type'''
| style="text-align: left;"| '''Kernel version'''
| style="text-align: center;"| '''Server version'''
| style="text-align: center;"| '''Desktop version'''
|-
| style="text-align: center;"| '''Ubuntu 22.04 - Jammy'''
| style="text-align: left;"| '''Linux5.15'''
| style="text-align: center;"| '''support'''
| style="text-align: center;"| '''support'''
|-
| style="text-align: center;"| '''Debian 12 - Bookworm'''
| style="text-align: left;"| '''Linux5.15'''
| style="text-align: center;"| '''support'''
| style="text-align: center;"| '''support'''
|}
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 following description, '''Ubuntu images and Debian images are generally referred to as Linux images'''.
<div class="figure">
[[File:Orange_Pi_4A-image73.png|291x171px|1732016137510]]
</div>
The naming convention for Linux images is:
'''Development board model _ version number _ Linux release type _ release code _ server or desktop _ kernel version'''
<ol style="list-style-type: lower-alpha;">
<li><p>'''Development board model:''' They are all '''Orangepi4a'''. The model names of different development boards are generally different. Before burning the image, please ensure that the model name of the selected image matches the development board.</p></li>
<li><p>'''Version number:''' For example, '''1.x.x''', this version number will increase with the update of the image function, and the last digit of the version number of the Linux image on the development board is even.</p></li>
<li><p>'''Types of Linux distributions:''' Currently supports '''Ubuntu''' and '''Debian'''. Due to Ubuntu's origin from Debian, there is generally not much difference in usage between the two systems. But there are still some differences in the default configuration and command usage of some software. In addition, Ubuntu and Debian each maintain their own supported software repositories, and there are also some differences in the supported installable software packages. These require personal experience to gain a deeper understanding. For more details, you can refer to the official documentation provided by Ubuntu and Debian.</p></li>
<li><p>'''Release code:''' Used to distinguish between different versions of specific Linux distributions such as Ubuntu or Debian. Among them, '''jammy''' is the Ubuntu distribution, referring to Ubuntu 22.04. The biggest difference between different versions is that many of the software in the software repository maintained by the new version of Ubuntu system are newer than those in the old version, such as Python and GCC compilation toolchains. '''bookworm''' is the specific version code for Debian, with '''bookworm''' representing Debian12.</p></li>
<li><p>'''Server or Desktop:''' Used to indicate whether the system has a desktop environment. If it is a '''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, and the system is mainly operated and controlled using the command line. If it is '''desktop_gnome''', it means that the system has the GNOME desktop environment installed by default. The image occupies a relatively large amount of storage space and resources, and can be operated through the interface with a monitor, mouse, and keyboard. Of course, the desktop version of the system can also be operated through the command line like the server version.</p></li>
<li><p>'''Kernel version:''' Used to represent the version number of the Linux kernel, currently supporting '''linux5.15'''.</p></li></ol>
<span id="linux-kernel-driver-adaptation-situation"></span>
== linux kernel driver adaptation situation ==
{| class="wikitable"
|-
| style="text-align: center;"| '''Function'''
| style="text-align: center;"| '''Linux5.15'''
|-
| style="text-align: center;"| '''HDMI video'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''HDMI audio'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''USB2.0 x 4'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''TF card startup'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''eMMC'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''NVME SSD recognition'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Gigabit Ethernet'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''WIFI'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Bluetooth'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''RTC chip'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Earphone audio'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''LCD screen'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''EDP'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''CAM1'''
| style="text-align: center;"| '''Kernel driver OK, 3A not tuned'''
|-
| style="text-align: center;"| '''CAM2'''
| style="text-align: center;"| '''Kernel driver OK, 3A not tuned'''
|-
| style="text-align: center;"| '''LED lamp'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin GPIO'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin I2C'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin SPI'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin UART'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin PWM'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Key'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Temperature sensor'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''hardware watchdog'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Mali GPU'''
| style="text-align: center;"| '''NO'''
|-
| style="text-align: center;"| '''Video Encoding and Decoding'''
| style="text-align: center;"| '''NO'''
|}
<span id="explanation-of-linux-command-format-in-this-manual"></span>
== Explanation of linux Command Format in This Manual ==
<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 boxes below</p>
<p>As shown below, the content in the yellow box represents the content that needs special attention, except for the commands inside.</p></li>
<li><p>Description of prompt types before commands</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The prompt in front of the command refers to the content in the red part of the box below, which is not part of Linux commands. 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>
<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>
<li><p>'''orangepi@orangepi:~$''' The prompt indicates that this command was entered in the '''linux system of the development board''', and the last '''$''' of the prompt indicates that the current user of the system is a regular user. When executing privileged commands, '''sudo''' needs to be added</p></li>
<li><p>'''root@orangepi:~#''' The prompt indicates that this command was entered in the '''linux system of the development board''', and 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</p></li>
<li><p>'''test@test:~$''' The prompt indicates that this command was entered on an Ubuntu PC or Ubuntu virtual machine, not on the Linux system of the development board. The '''$''' at the end of the prompt indicates that the current user of the system is a regular user. When executing privileged commands, '''sudo''' needs to be added</p></li>
<li><p>'''root@test:~#''' The prompt indicates that this command was entered on an Ubuntu PC or Ubuntu virtual machine, not on the Linux system of the development board. The '''#''' at the end of the prompt indicates that the current system user is the root user and can execute any command they want</p></li></ol>
</li>
<li><p>What are the commands that need to be entered?</p>
<ol style="list-style-type: lower-alpha;">
<li><p>As shown below, '''the bold black part represents''' the commands that need to be inputted, and the content below the commands is the output (some commands have output, while others may not). This part of the content does not need to be inputted</p>
<p>root@orangepi:~# '''cat /boot/orangepiEnv.txt'''</p>
<p>'''verbosity=7'''</p>
<p>bootlogo=false</p>
<p>'''console=serial'''</p></li>
<li><p>As shown below, some commands that cannot be written on one line will be moved to the next line, and any black and bold parts are commands that need to be entered. When these commands are inputted on a single line, the '\' at the end of each line needs to be removed, which is not part of the command. Also, different parts of the command have spaces, please don't miss them</p>
<p>orangepi@orangepi:~$ '''echo \'''</p>
<p>'''"deb [arch=$(dpkg --print-architecture) \'''</p>
<p>'''signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \'''</p>
<p>'''https://download.docker.com/linux/debian \'''</p>
<p>'''$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null'''</p></li></ol>
</li></ol>
<span id="linux-system-login-instructions"></span>
== linux system login instructions ==
<span id="linux-system-default-login-account-and-password"></span>
=== linux system default login account and password ===
{| class="wikitable"
|-
| style="text-align: left;"| '''account number'''
| style="text-align: left;"| '''password'''
|-
| style="text-align: left;"| '''root'''
| style="text-align: left;"| '''orangepi'''
|-
| style="text-align: left;"| '''orangepi'''
| style="text-align: left;"| '''orangepi'''
|}
'''Note that when entering the password, the specific content of the entered password will not be displayed on the screen. Please do not assume that there is any malfunction. After entering, simply press Enter.'''
'''When the password prompt is incorrect 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, do not suspect that the password is incorrect, but instead look for other reasons.'''
<span id="method-for-setting-up-automatic-login-for-linux-system-terminals"></span>
=== Method for setting up automatic login for linux system terminals ===
<ol style="list-style-type: decimal;">
<li><p>The linux system defaults to automatically logging into the terminal, and the default login username is '''orangepi'''</p>
<p>[[File:Orange_Pi_4A-image74.png|396x240px]]</p></li>
<li><p>The following command can be used to set the root user to automatically log in to the terminal</p>
<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>
<p>orangepi@orangepi:~$ '''sudo auto_login_cli.sh -d'''</p></li>
<li><p>The following command can be used to reset the automatic login of Orangepi users to the terminal</p>
<p>orangepi@orangepi:~$ '''sudo auto_login_cli.sh orangepi'''</p></li></ol>
<span id="linux-desktop-system-automatic-login-instructions"></span>
=== linux Desktop System Automatic Login Instructions ===
<ol style="list-style-type: decimal;">
<li><p>After the desktop version system starts, it will automatically log in to the desktop without entering a password</p>
<div class="figure">
[[File:Orange_Pi_4A-image75.png|576x324px|Screenshot from 2024-08-27 11-30-45]]
</div></li></ol>
<span id="linux-desktop-system-root-user-automatic-login-setting-method"></span>
=== Linux Desktop System Root User Automatic Login Setting Method ===
<ol style="list-style-type: decimal;">
<li><p>Execute the following command to set the desktop system to automatically log in as the root user</p>
<p>orangepi@orangepi:~$ '''sudo desktop_login.sh root'''</p></li>
<li><p>Then restart the system, and it will automatically log in to the desktop as the root user</p>
<div class="figure">
[[File:Orange_Pi_4A-image76.png|576x324px|Screenshot from 2024-08-27 11-31-55]]
</div></li>
<li><p>Execute the following command to reset the desktop system to use Orangepi for automatic user login</p>
<p>orangepi@orangepi:~$ '''sudo desktop_login.sh orangepi'''</p></li></ol>
<span id="how-to-disable-the-desktop-in-linux-desktop-system"></span>
=== How to disable the desktop in Linux desktop system ===
<ol style="list-style-type: decimal;">
<li><p>First enter the following command in the command line''', please remember to add sudo permissions'''</p>
<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>
<p>orangepi@orangepi:~$ '''sudo reboot'''</p></li>
<li><p>The command to reopen the desktop is as follows, '''please remember to add sudo permissions'''</p>
<p>orangepi@orangepi:~$ '''sudo systemctl start lightdm.service'''</p>
<p>orangepi@orangepi:~$ '''sudo systemctl enable lightdm.service'''</p></li></ol>
<span id="onboard-led-light-test-instructions"></span>
== Onboard LED light test instructions ==
<ol style="list-style-type: decimal;">
<li><p>There are three LED lights on the development board, one green light, one red light, and one PCIe indicator light. Their locations are shown in the figure below:</p></li>
<li><p>'''As long as the development board is powered on, the red LED light will be always on. This is controlled by hardware and cannot be turned off by software.'''</p></li>
<li><p>The green LED light will keep flashing after the kernel starts, which is controlled by software.</p></li>
<li><p>The PCIe indicator will flash when there is data transmission on the PCIe interface.</p></li>
<li><p>The method of setting the green light on and off and flashing is as follows:</p>
<p>'''Note: The following operations must be performed as the root user.'''</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First enter the green light settings directory</p>
<p>root@orangepi:~# '''cd /sys/class/leds/status_led'''</p></li>
<li><p>The command to set the green light to stop flashing is as follows</p>
<p>root@orangepi:/sys/class/leds/status_led# '''echo none > trigger'''</p></li>
<li><p>The command to set the green light to always be on is as follows</p>
<p>root@orangepi:/sys/class/leds/status_led# '''echo default-on > trigger'''</p></li>
<li><p>The command to set the green light to flash is as follows</p>
<p>root@orangepi:/sys/class/leds/status_led# '''echo heartbeat > trigger'''</p></li></ol>
</li></ol>
<span id="linux-system-rootfs-partition-capacity-operation-instructions-in-tf-card"></span>
== Linux system rootfs partition capacity operation instructions in TF card ==
<span id="the-capacity-of-the-rootfs-partition-in-the-tf-card-will-be-automatically-expanded-at-the-first-startup"></span>
=== The capacity of the rootfs partition in the TF card will be automatically expanded at the first startup ===
<ol style="list-style-type: decimal;">
<li><p>After burning the Linux image of the development board to the TF card, you can check the usage of the TF card capacity in the '''Ubuntu computer'''. The steps are as follows:</p>
<p>'''Note that not doing this step will not affect the automatic expansion of the Linux system on the development board. Here I just want to explain how to check the capacity of the TF card after burning the Linux image to the TF card.'''</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First install the gparted software in the Ubuntu computer</p>
<p>test@test:~$ '''sudo apt install -y gparted'''</p></li>
<li><p>Then open gparted</p>
<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>
<p>[[File:Orange_Pi_4A-image77.png|575x210px]]</p></li>
<li><p>The above picture 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) is actually only allocated 4.05GiB, leaving 10.79GiB unallocated</p></li></ol>
</li>
<li><p>Then you can insert the TF card with the Linux system burned into the development board to start it. When the TF card starts the Linux system for the first time, the '''orangepi-resize-filesystem.service''' systemd service will be used to call the '''orangepi-resize-filesystem''' script to automatically expand the rootfs partition''', so there is no need to expand it manually.'''</p></li>
<li><p>After logging into the system, you can use the '''df -h'''command to check the size of the 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>
orangepi@orangepi:~$ '''df -h'''
Filesystem Size Used Avail Use% Mounted on
udev 430M 0 430M 0% /dev
tmpfs 100M 5.6M 95M 6% /run
'''/dev/mmcblk0p1 15G 915M 14G 7% /'''
tmpfs 500M 0 500M 0% /dev/shm
<ol start="4" style="list-style-type: decimal;">
<li><p>After booting 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 to check the status of the TF card again. As shown in the figure below, the capacity of the rootfs partition (/dev/sdc1) has been expanded to 14.69GiB</p>
<p>[[File:Orange_Pi_4A-image78.png|575x211px]]</p></li></ol>
'''It should be noted that the Linux system has only one partition in ext4 format and does not use a separate BOOT partition to store kernel images and other files, so there is no problem of expanding the BOOT partition.'''
<span id="how-to-disable-automatic-expansion-of-rootfs-partition-capacity-in-tf-card"></span>
=== How to disable automatic expansion of rootfs partition capacity in TF card ===
<ol style="list-style-type: decimal;">
<li><p>First, burn the Linux image of the development board to the TF card in the Ubuntu computer (not available on Windows), '''then unplug and re-insert the TF card.'''</p></li>
<li><p>Then the Ubuntu computer will generally automatically mount the TF card partition. If the automatic mounting is normal, you can see the following output using the ls command</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>
<li><p>Then switch the current user to the root user in the Ubuntu computer</p>
<p>test@test:~$ '''sudo -i'''</p>
<p>[sudo] test 的密码:</p>
<p>root@test:~'''#'''</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>
<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/root# '''touch .no_rootfs_resize'''</p>
<p>root@test:/media/test/opi_root/root# '''ls .no_rootfs*'''</p>
<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, if it detects the '''.no_rootfs_resize''' file in the '''/root''' directory, it will no longer automatically expand the rootfs.</p></li>
<li><p>After disabling automatic expansion of rootfs, you can enter the Linux system and see that the total capacity of the rootfs partition is only 4GB (the image of the desktop version is tested here), which is much smaller than the actual capacity of the TF card, indicating that the automatic expansion of rootfs is successfully disabled.</p>
<p>orangepi@orangepi:~$ '''df -h'''</p>
<p>Filesystem Size Used Avail Use% Mounted on</p>
<p>udev 925M 0 925M 0% /dev</p>
<p>tmpfs 199M 3.2M 196M 2% /run</p>
<p>'''/dev/mmcblk0p1 4.0G 3.2G 686M 83% /'''</p></li>
<li><p>If you need to expand the capacity of the rootfs partition in the TF card, just execute the following command and restart the Linux system of the development board.</p></li></ol>
'''注意,请在root用户下执行下面的命令。'''
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 can see that the rootfs partition has been expanded to the actual capacity of the TF card.
root@orangepi:~# '''df -h'''
Filesystem Size Used Avail Use% Mounted on
udev 925M 0 925M 0% /dev
tmpfs 199M 3.2M 196M 2% /run
'''/dev/mmcblk0p1 15G 3.2G 12G 23% /'''
<span id="how-to-manually-expand-the-rootfs-partition-capacity-in-the-tf-card"></span>
=== How to manually expand the rootfs partition capacity in the TF card ===
'''If the total capacity of the TF card is large, such as 128GB, and you do not want the Linux system rootfs partition to use all the capacity of the TF card, but 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. Then you can use the content introduced in this section to manually expand the capacity of the rootfs partition in the TF.'''
<ol style="list-style-type: decimal;">
<li><p>First, burn the Linux image of the development board to the TF card in the Ubuntu computer (not available on Windows), '''then unplug and re-insert the TF card.'''</p></li>
<li><p>Then the Ubuntu computer will generally automatically mount the TF card partition. If the automatic mounting is normal, you can see the following output using the ls command</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>
<li><p>Then switch the current user to the root user in the Ubuntu computer</p>
<p>test@test:~$ '''sudo -i'''</p>
<p>[sudo] test 的密码:</p>
<p>root@test:~'''#'''</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>
<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/root# '''touch .no_rootfs_resize'''</p>
<p>root@test:/media/test/opi_root/root# '''ls .no_rootfs*'''</p>
<p>'''.no_rootfs_resize'''</p></li></ol>
<!-- -->
<ol start="5" style="list-style-type: decimal;">
<li><p>Then install the gparted software in the Ubuntu computer</p>
<p>test@test:~$ '''sudo apt install -y gparted'''</p></li>
<li><p>Then open gparted</p>
<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 figure below shows 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) is actually only allocated 4.05GiB, leaving 10.79GiB unallocated</p>
<p>[[File:Orange_Pi_4A-image77.png|575x210px]]</p></li>
<li><p>Then select the rootfs partition (/dev/sdc1)</p>
<p>[[File:Orange_Pi_4A-image79.png|575x211px]]</p></li>
<li><p>Click the right button of the mouse again to see the operation options shown in the figure below. If the TF card has been mounted, you need to Umount the rootfs partition of the TF card first.</p>
<p>[[File:Orange_Pi_4A-image80.png|436x298px]]</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>
<p>[[File:Orange_Pi_4A-image81.png|444x302px]]</p></li>
<li><p>After the '''Resize/Move''' option is turned on, the following setting interface will pop up</p>
<p>[[File:Orange_Pi_4A-image82.png|315x193px]]</p></li>
<li><p>Then you can directly drag the position shown in the figure below to set the capacity, or you can set the size of the rootfs partition by setting the number in '''New size(MiB)'''</p>
<p>[[File:Orange_Pi_4A-image83.png|320x191px]]</p></li>
<li><p>After setting the capacity, click '''Resize/Move''' in the lower right corner.</p>
<p>[[File:Orange_Pi_4A-image84.png|327x196px]]</p></li>
<li><p>After final confirmation, click the green '''√''' as shown below</p>
<p>[[File:Orange_Pi_4A-image85.png|392x270px]]</p></li>
<li><p>Then select '''Apply''' to officially start expanding the capacity of the rootfs partition</p>
<p>[[File:Orange_Pi_4A-image86.png|399x116px]]</p></li>
<li><p>After the expansion is completed, click '''Close'''.</p>
<p>[[File:Orange_Pi_4A-image87.png|399x172px]]</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 that the manual expansion is successful.</p>
<p>root@orangepi:~# '''df -h'''</p>
<p>Filesystem Size Used Avail Use% Mounted on</p>
<p>udev 925M 0 925M 0% /dev</p>
<p>tmpfs 199M 3.2M 196M 2% /run</p>
<p>'''/dev/mmcblk0p1 7.7G 3.2G 4.4G 42% /'''</p></li></ol>
<span id="how-to-reduce-the-capacity-of-the-rootfs-partition-in-the-tf-card"></span>
=== How to reduce the capacity of the rootfs partition in the 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.'''
<ol style="list-style-type: decimal;">
<li><p>First, insert the TF card you want to operate into the Ubuntu computer (not available on Windows)</p></li>
<li><p>Then install the gparted software in the Ubuntu computer</p>
<p>test@test:~$ '''sudo apt install -y gparted'''</p></li>
<li><p>Then open gparted</p>
<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>
<p>[[File:Orange_Pi_4A-image88.png|575x217px]]</p></li>
<li><p>Then select the rootfs partition (/dev/sdc1)</p>
<p>[[File:Orange_Pi_4A-image89.png|575x217px]]</p></li>
<li><p>Click the right button of the mouse again to see the operation options shown in the figure below. If the TF card has been mounted, you need to Umount the rootfs partition of the TF card first.</p>
<p>[[File:Orange_Pi_4A-image90.png|400x274px]]</p></li>
<li><p>Then select the rootfs partition again, right-click, and select '''Resize/Move''' to start setting the size of the rootfs partition</p>
<p>[[File:Orange_Pi_4A-image91.png|399x273px]]</p></li>
<li><p>After the '''Resize/Move''' option is turned on, the following setting interface will pop up</p>
<p>[[File:Orange_Pi_4A-image92.png|315x188px]]</p></li>
<li><p>Then you can directly drag the position shown in the figure below to set the capacity, or you can set the size of the rootfs partition by setting the number in '''New sieze(MiB)'''</p>
<p>[[File:Orange_Pi_4A-image83.png|318x190px]]</p></li>
<li><p>After setting the capacity, click '''Resize/Move''' in the lower right corner.</p>
<p>[[File:Orange_Pi_4A-image84.png|327x196px]]</p></li>
<li><p>After final confirmation, click '''the green √''' as shown below</p>
<p>[[File:Orange_Pi_4A-image85.png|392x270px]]</p></li>
<li><p>Then select '''Apply''' to officially start expanding the capacity of the rootfs partition</p>
<p>[[File:Orange_Pi_4A-image86.png|365x106px]]</p></li>
<li><p>After the expansion is completed, click '''Close'''.</p>
<p>[[File:Orange_Pi_4A-image87.png|379x164px]]</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 the same as the size set previously, it means that the capacity reduction is successful.</p>
<p>root@orangepi:~# '''df -h'''</p>
<p>Filesystem Size Used Avail Use% Mounted on</p>
<p>udev 925M 0 925M 0% /dev</p>
<p>tmpfs 199M 3.2M 196M 2% /run</p>
<p>'''/dev/mmcblk0p1 7.7G 3.2G 4.4G 42% /'''</p></li></ol>
<span id="network-connection-test"></span>
== Network connection test ==
<span id="ethernet-port-test"></span>
=== Ethernet port test ===
<ol style="list-style-type: decimal;">
<li><p>First, plug one end of the network cable into the Ethernet port of the development board, and the other end of the network cable into the router, and make sure the network is unobstructed.</p></li>
<li><p>After the system starts, the IP address will be automatically assigned to the Ethernet card through DHCP, '''and no other configuration is required'''</p></li>
<li><p>The command to check the IP address in the Linux system of the development board is as follows:</p>
<p>orangepi@orangepi:~$ '''ip a s eth0'''</p>
<p>2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000</p>
<p>link/ether 3a:3a:57:82:eb:1f brd ff:ff:ff:ff:ff:ff</p>
<p>inet '''192.168.2.163'''/24 brd 192.168.2.255 scope global dynamic noprefixroute eth0</p>
<p>valid_lft 42902sec preferred_lft 42902sec</p>
<p>inet6 fdcd:e671:36f4::a39/128 scope global dynamic noprefixroute</p>
<p>valid_lft 42904sec preferred_lft 42904sec</p>
<p>inet6 fdcd:e671:36f4:0:7b67:e74e:f0e1:849a/64 scope global temporary dynamic</p>
<p>valid_lft 604504sec preferred_lft 86095sec</p>
<p>inet6 fdcd:e671:36f4:0:d098:7f17:6cea:4de4/64 scope global mngtmpaddr noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p>
<p>inet6 fe80::cc72:d313:9846:a5e0/64 scope link noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p></li></ol>
'''There are three ways to check the IP address after the development board is started:'''
'''1. Connect an HDMI display, then log in to the system and use the ip a s eth0 command to view the IP address'''
'''2. Enter the ip a s eth0 command in the debug serial port terminal to view the IP address'''
'''3. If there is no debug serial port and no HDMI display, you can also view the IP address of the development board network port through the router's management interface. However, this method often causes some people to be unable to see the IP address of the development board normally. If you can't see it, the debugging method is as follows:'''
'''A) First check whether the Linux system has started normally. If the green light on the development board flashes, it is generally started normally. If only the red light is on, or neither the red light nor the green light is 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 (there are many problems with routers, such as the router cannot allocate IP addresses normally, or the IP address has been allocated normally but cannot be seen in the router);'''
'''D) If there is no router to replace, you can only connect an HDMI display or use the debug serial port to view the IP address.'''
'''It should also be noted that the development board DHCP automatically assigns IP addresses without any settings.'''
<ol start="4" style="list-style-type: decimal;">
<li><p>The command to test network connectivity is as follows. The '''ping''' command can be interrupted by pressing '''Ctrl+C'''</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>64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=1 ttl=56 time=6.74 ms</p>
<p>64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=2 ttl=56 time=6.80 ms</p>
<p>64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=3 ttl=56 time=6.26 ms</p>
<p>64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=4 ttl=56 time=7.27 ms</p>
<p>^C</p>
<p>--- www.a.shifen.com ping statistics ---</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>
<span id="wifi-connection-test"></span>
=== WIFI connection test ===
'''Please do not connect to WIFI by modifying the /etc/network/interfaces configuration file. This method may cause problems when connecting to the WIFI network.'''
<span id="server-version-image-connects-to-wifi-through-command"></span>
==== Server version image connects to WIFI through command ====
'''When the development board is not connected to Ethernet, not connected to HDMI display, and only connected to the serial port, it is recommended to use the command demonstrated in this section to connect to the WIFI network. Because nmtui can only display characters in some serial port software (such as minicom), it cannot display the graphical interface normally. Of course, if the development board is connected to Ethernet or HDMI display, you can also use the command demonstrated in this section to connect to the WIFI network.'''
Log in to the Linux system first. There are three ways to do this:
<ol style="list-style-type: lower-alpha;">
<li><p>If the development board is connected to the network cable, you can log in to the Linux system remotely through SSH</p></li>
<li><p>If the development board is connected to the debug serial port, you can use the serial terminal to log in to the Linux system</p></li>
<li><p>If the development board is connected to the HDMI display, you can log in to the Linux system through the HDMI display terminal</p></li></ol>
<!-- -->
<ol style="list-style-type: decimal;">
<li><p>First use the '''nmcli dev wifi''' command to scan the surrounding WIFI hotspots</p>
<p>orangepi@orangepi:~$ '''nmcli dev wifi'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image93.png|575x250px|选区_011]]
</div></li>
<li><p>Then use the '''nmcli''' command to connect to the scanned WIFI hotspot, where:</p>
<ol style="list-style-type: lower-alpha;">
<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 WIFI hotspot you want to connect to</p>
<p>orangepi@orangepi:~$ '''sudo nmcli dev wifi connect wifi_name password wifi_passwd'''</p>
<p>Device 'wlan0' successfully activated with 'cf937f88-ca1e-4411-bb50-61f402eef293'.</p></li></ol>
</li>
<li><p>Use the '''ip addr show wlan0''' command to view the IP address of the wifi</p>
<p>orangepi@orangepi:~$ '''ip a s wlan0'''</p>
<p>11: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> 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>inet '''192.168.1.11'''/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0</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>valid_lft 259192sec preferred_lft 172792sec</p>
<p>inet6 fe80::42f1:6019:a80e:4c31/64 scope link noprefixroute</p>
<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>
<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>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=1 ttl=52 time=43.5 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=2 ttl=52 time=41.3 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=3 ttl=52 time=44.9 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=4 ttl=52 time=45.6 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=5 ttl=52 time=48.8 ms</p>
<p>^C</p>
<p>--- www.orangepi.org ping statistics ---</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>
<span id="the-server-version-image-connects-to-wifi-through-a-graphical-method"></span>
==== The server version image connects to WIFI through a graphical method ====
# Log in to the Linux system first. There are three ways to do this:
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>If the development board is connected to the network cable, you can log in to the Linux system remotely through ssh</p></li>
<li><p>b. If the development board is connected to the debug serial port, you can use the serial terminal to log in to the Linux system (use MobaXterm as the serial software, and the graphical interface cannot be displayed using minicom)</p></li>
<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></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<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>
<li><p>Enter the nmtui command to open the interface as shown below</p>
<p>[[File:Orange_Pi_4A-image94.png|345x215px]]</p></li>
<li><p>Select '''Activate a connect''' and press Enter</p>
<p>[[File:Orange_Pi_4A-image95.png|349x216px]]</p></li>
<li><p>Then you can see all the searched WIFI hotspots</p>
<p>[[File:Orange_Pi_4A-image96.png|358x226px]]</p></li>
<li><p>Select the WIFI hotspot you want to connect to, then use the Tab key to position the cursor at '''Activate''' and press Enter.</p>
<p>[[File:Orange_Pi_4A-image97.png|357x226px]]</p></li>
<li><p>Then a dialog box for entering a password will pop up. Enter the corresponding password in '''Password''' and press Enter to start connecting to WIFI.</p>
<p>[[File:Orange_Pi_4A-image98.png|354x226px]]</p></li>
<li><p>After the WIFI connection is successful, a "*" will be displayed in front of the connected WIFI name</p>
<div class="figure">
[[File:Orange_Pi_4A-image99.jpeg|350x224px|微信图片_20241119193751]]
</div></li>
<li><p>You can view the IP address of the wifi through the'''ip a s wlan0''' command</p>
<p>orangepi@orangepi:~$ '''ip a s wlan0'''</p>
<p>11: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> 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>inet '''192.168.1.11'''/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0</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>valid_lft 259071sec preferred_lft 172671sec</p>
<p>inet6 fe80::42f1:6019:a80e:4c31/64 scope link noprefixroute</p>
<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>
<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>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=1 ttl=52 time=43.5 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=2 ttl=52 time=41.3 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=3 ttl=52 time=44.9 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=4 ttl=52 time=45.6 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=5 ttl=52 time=48.8 ms</p>
<p>^C</p>
<p>--- www.orangepi.org ping statistics ---</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>
<span id="testing-methods-for-desktop-images"></span>
==== Testing methods for desktop images ====
<ol style="list-style-type: decimal;">
<li><p>Click on the upper right corner of the desktop (please do not connect the network cable when testing WIFI)</p>
<p>[[File:Orange_Pi_4A-image100.png|289x201px]]</p></li>
<li><p>Select '''Wi-Fi Settings''' in the drop-down box that pops up.</p>
<p>[[File:Orange_Pi_4A-image101.png|338x172px]]</p></li>
<li><p>Then you can see the searched WIFI hotspots under '''Visible Networks'''</p>
<p>[[File:Orange_Pi_4A-image102.png|420x260px]]</p></li>
<li><p>Then click on the WIFI hotspot you want to connect to, and then enter the password to start connecting to WIFI</p>
<p>[[File:Orange_Pi_4A-image103.png|423x262px]]</p>
<p>[[File:Orange_Pi_4A-image104.png|421x258px]]</p>
<p>'''create_ap is a script that helps quickly create a WIFI hotspot on Linux. It supports bridge and NAT modes and can automatically combine hostapd, dnsmasq and iptables to complete the setting of WIFI hotspot, avoiding users from making complex configurations. The github address is as follows:'''</p></li></ol>
[https://github.com/oblique/create_ap '''https://github.com/oblique/create_ap''']
'''The Linux image released by Orange Pi has pre-installed 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:''' This parameter can be used to specify encryption method, frequency band of WIFI hotspot, bandwidth mode, network sharing method, etc. You can get the specific 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 be connected to the Internet, usually eth0
'''* access-point-name:''' hotspot name
'''* passphrase:''' hotspot password
<span id="create_ap-method-to-create-a-wifi-hotspot-in-nat-mode"></span>
==== create_ap method to create a WIFI hotspot in NAT mode ====
# Enter the following command to create a WIFI hotspot in NAT mode with the name '''orangepi''' and the password '''orangepi'''
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --no-virt'''
<ol start="2" style="list-style-type: decimal;">
<li><p>If the following information is output, it means that the WIFI hotspot is created successfully</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>PID: 26139</p>
<p>Network Manager found, set wlan0 as unmanaged device... DONE</p>
<p>Sharing Internet using method: nat</p>
<p>hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlan0.conf.TQkJtsz1/hostapd_ctrl</p>
<p>wlan0: interface state UNINITIALIZED->ENABLED</p>
<p>wlan0: AP-ENABLED</p>
<p>wlan0: STA ce:bd:9a:dd:a5:86 IEEE 802.11: associated</p>
<p>wlan0: AP-STA-CONNECTED ce:bd:9a:dd:a5:86</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: EAPOL-4WAY-HS-COMPLETED ce:bd:9a:dd:a5:86</p></li>
<li><p>Take out your phone and find the WIFI hotspot named '''orangepi''' created by the development board in the searched WIFI list. Then click '''orangepi''' to connect to the hotspot. The password is '''orangepi''' set above.</p>
<p>[[File:Orange_Pi_4A-image105.png|230x183px]]</p></li>
<li><p>The display after successful connection is as shown below</p>
<p>[[File:Orange_Pi_4A-image106.png|233x111px]]</p></li>
<li><p>In NAT mode, the wireless device connected to the development board hotspot requests an IP address from the development board's DHCP service, so there will be two different network segments. For example, the IP of the development board here is 192.168.1.X</p>
<p>orangepi@orangepi:~$ '''sudo ifconfig eth0'''</p>
<p>eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500</p>
<p>inet '''192.168.1.150''' netmask 255.255.255.0 broadcast 192.168.1.255</p>
<p>inet6 fe80::938f:8776:5783:afa2 prefixlen 64 scopeid 0x20<link></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 errors 0 dropped 50 overruns 0 frame 0</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>device interrupt 83</p>
<p>The DHCP service of the development board will assign an IP address of '''192.168.12.0/24''' to the device connected to the hotspot by default. At this time, click 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>[[File:Orange_Pi_4A-image106.png|271x129px]]</p>
<p>[[File:Orange_Pi_4A-image107.png|274x155px]]</p></li>
<li><p>If you want to specify a different network segment for the connected device, you can specify it through the -g parameter, such as using the -g parameter to specify the network segment of the access point AP as 192.168.2.1</p>
<p>orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi -g 192.168.2.1 --no-virt'''</p></li></ol>
At this time, after connecting to the hotspot through the mobile phone, click the connected WIFI hotspot '''orangepi''', and then you can see that the IP address of the mobile phone is '''192.168.2.X'''.
[[File:Orange_Pi_4A-image106.png|286x137px]]
[[File:Orange_Pi_4A-image108.png|302x174px]]
<ol start="7" style="list-style-type: decimal;">
<li>If you do not specify the '''--freq-band''' parameter, the default hotspot created is the 2.4G band. If you want to create a 5G band hotspot, you can specify it with the '''--freq-band 5''' parameter. The specific command is as follows</li></ol>
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --freq-band 5 --no-virt'''
<ol start="8" style="list-style-type: decimal;">
<li>If you need to hide the SSID, you can specify the '''--hidden''' parameter. The specific command is as follows</li></ol>
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --hidden --no-virt'''
At this time, the mobile phone cannot search for the WIFI hotspot. You need to manually specify the WIFI hotspot name and enter the password to connect to the WIFI hotspot.
[[File:Orange_Pi_4A-image109.png|237x198px]]
<span id="create_ap-method-to-create-a-wifi-hotspot-in-bridge-mode"></span>
==== create_ap method to create a WIFI hotspot in bridge mode ====
# Enter the following command to create a WIFI hotspot in bridge mode with the name '''orangepi''' and the password '''orangepi'''
orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --no-virt'''
<ol start="2" style="list-style-type: decimal;">
<li><p>If the following information is output, it means that the WIFI hotspot is created successfully</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>PID: 27707</p>
<p>Network Manager found, set wlan0 as unmanaged device... DONE</p>
<p>Sharing Internet using method: bridge</p>
<p>Create a bridge interface... br0 created.</p>
<p>hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlan0.conf.zAcFlYTx/hostapd_ctrl</p>
<p>wlan0: interface state UNINITIALIZED->ENABLED</p>
<p>wlan0: AP-ENABLED</p>
<p>wlan0: STA ce:bd:9a:dd:a5:86 IEEE 802.11: associated</p>
<p>wlan0: AP-STA-CONNECTED ce:bd:9a:dd:a5:86</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: EAPOL-4WAY-HS-COMPLETED ce:bd:9a:dd:a5:86</p></li>
<li><p>Take out your mobile phone and find the WIFI hotspot named '''orangepi''' created by the development board in the searched WIFI list. Then click '''orangepi''' to connect to the hotspot. The password is the '''orangepi''' set above.</p>
<p>[[File:Orange_Pi_4A-image105.png|265x211px]]</p></li>
<li><p>The display after successful connection is as shown below</p>
<p>[[File:Orange_Pi_4A-image106.png|273x130px]]</p></li>
<li><p>In bridge mode, the wireless device connected to the development board hotspot 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 address of the development board here is '''192.168.1.X'''</p>
<p>orangepi@orangepi:~$ '''sudo ifconfig eth0'''</p>
<p>eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500</p>
<p>inet '''192.168.1.150''' netmask 255.255.255.0 broadcast 192.168.1.255</p>
<p>inet6 fe80::938f:8776:5783:afa2 prefixlen 64 scopeid 0x20<link></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 errors 0 dropped 50 overruns 0 frame 0</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>device interrupt 83</p>
<p>The IP address of the device connected to the WIFI hotspot is also assigned by the main router, so the mobile phone and development board connected to the WIFI hotspot are in the same network segment. At this time, click the connected WIFI hotspot '''orangepi''', and then you can see that the IP address of the mobile phone is also '''192.168.1.X'''.</p>
<p>[[File:Orange_Pi_4A-image106.png|284x136px]]</p>
<p>[[File:Orange_Pi_4A-image110.png|282x159px]]</p></li>
<li><p>If you do not specify the '''--freq-band''' parameter, the default hotspot created is the 2.4G band. If you want to create a 5G band hotspot, you can specify it with the '''--freq-band 5''' parameter. The specific command is as follows</p></li></ol>
orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --freq-band 5 --no-virt'''
<ol start="7" style="list-style-type: decimal;">
<li>If you need to hide the SSID, you can specify the '''--hidden''' parameter. The specific command is as follows</li></ol>
orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --hidden --no-virt'''
At this time, the mobile phone cannot search for the WIFI hotspot. You need to manually specify the WIFI hotspot name and enter the password to connect to the WIFI hotspot.
[[File:Orange_Pi_4A-image109.png|228x191px]]
<span id="how-to-set-a-static-ip-address"></span>
=== How to set a static IP address ===
'''Please do not set a static IP address by modifying the /etc/network/interfaces configuration file.'''
<span id="using-nmtui-command-to-set-static-ip-address"></span>
==== Using nmtui command to set static IP address ====
<ol style="list-style-type: decimal;">
<li><p>First run the '''nmtui''' command</p>
<p>orangepi@orangepi:~$ '''sudo nmtui'''</p></li>
<li><p>Then select '''Edit a connection''' and press Enter</p>
<p>[[File:Orange_Pi_4A-image111.png|227x247px]]</p></li>
<li><p>Then select the network interface for which you want to set a static IP address. For example, to set a static IP address for an '''Ethernet'''interface, select '''Wired connection 1'''.</p>
<p>[[File:Orange_Pi_4A-image112.png|310x149px]]</p></li>
<li><p>Then select '''Edit''' using the '''Tab''' key and press Enter</p>
<p>[[File:Orange_Pi_4A-image113.png|316x144px]]</p></li>
<li><p>Then use the Tab key to move the cursor to the '''<Automatic>''' position shown in the figure below to configure IPv4</p>
<p>[[File:Orange_Pi_4A-image114.png|575x240px]]</p></li>
<li><p>Then press Enter, use the up and down arrow keys to select '''Manual''', and then press Enter to confirm.</p>
<p>[[File:Orange_Pi_4A-image115.png|576x237px]]</p></li>
<li><p>The display after selection is as shown below</p>
<p>[[File:Orange_Pi_4A-image116.png|575x240px]]</p></li>
<li><p>Then use the Tab key to move the cursor to '''<Show>'''</p>
<p>[[File:Orange_Pi_4A-image117.png|576x241px]]</p></li>
<li><p>Then press Enter, and the following setting interface will pop up.</p>
<p>[[File:Orange_Pi_4A-image118.png|575x450px]]</p></li>
<li><p>Then you can set the IP address, gateway and DNS server address as shown in the figure below (there are many other setting options, please explore them yourself). Please set them according to your specific needs. '''The values set in the figure below are just an example.'''</p>
<p>[[File:Orange_Pi_4A-image119.png|576x233px]]</p></li>
<li><p>After setting, move the cursor to '''<OK>''' in the lower right corner and press Enter to confirm.</p>
<p>[[File:Orange_Pi_4A-image120.png|576x116px]]</p></li>
<li><p>Then click '''<Back>''' to return to the previous selection interface</p>
<p>[[File:Orange_Pi_4A-image121.png|330x325px]]</p></li>
<li><p>Then select '''Activate a connection''', move the cursor to '''<OK>''', and press Enter</p>
<p>[[File:Orange_Pi_4A-image122.png|331x248px]]</p></li>
<li><p>Then select the network interface you want to set, such as '''Wired connection 1''', then move the cursor to '''<Deactivate>''', and press Enter to disable '''Wired connection 1'''</p>
<p>[[File:Orange_Pi_4A-image123.png|576x224px]]</p></li>
<li><p>Then please do not move the cursor, and press the Enter key to re-enable '''Wired connection 1''', so that the static IP address set previously will take effect.</p>
<p>[[File:Orange_Pi_4A-image124.png|576x224px]]</p></li>
<li><p>Then you can exit nmtui by pressing the '''<Back>''' and '''Quit''' buttons.</p>
<p>[[File:Orange_Pi_4A-image125.png|300x253px]] [[File:Orange_Pi_4A-image126.png|227x252px]]</p></li>
<li><p>Then use '''ip a s eth0''' to see that the IP address of the network port has become the static IP address set earlier.</p>
<p>orangepi@orangepi:~$ '''ip a s eth0'''</p>
<p>3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> 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>inet '''192.168.1.177'''/24 brd 192.168.1.255 scope global noprefixroute eth0</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>valid_lft 259149sec preferred_lft 172749sec</p>
<p>inet6 fe80::957d:bbbe:4928:3604/64 scope link noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p></li>
<li><p>Then you can test the network connectivity to check if the IP address is configured OK. The '''ping''' command can be interrupted by pressing '''Ctrl+C'''.</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>64 bytes from 192.168.1.47: icmp_seq=1 ttl=64 time=0.233 ms</p>
<p>64 bytes from 192.168.1.47: icmp_seq=2 ttl=64 time=0.263 ms</p>
<p>64 bytes from 192.168.1.47: icmp_seq=3 ttl=64 time=0.273 ms</p>
<p>64 bytes from 192.168.1.47: icmp_seq=4 ttl=64 time=0.269 ms</p>
<p>64 bytes from 192.168.1.47: icmp_seq=5 ttl=64 time=0.275 ms</p>
<p>^C</p>
<p>--- 192.168.1.47 ping statistics ---</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>
<span id="use-nmcli-command-to-set-static-ip-address"></span>
==== Use nmcli command to set static IP address ====
<ol style="list-style-type: decimal;">
<li><p>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.'''</p></li>
<li><p>Then use the '''nmcli con show''' command to view the name of the network device, as shown below</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''orangepi'''is the name of the WIFI network interface (the name may not be the same)</p></li>
<li><p>b.'''Wired connection 1''' is the name of the Ethernet interface</p>
<p>orangepi@orangepi:~$ '''nmcli con show'''</p>
<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>
</li>
<li><p>Then enter the following command, where</p>
<p>a. '''"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 (which can be obtained through the '''nmcli con show''' command)</p>
<p>b. The static IP address to be set after '''ipv4.addresses''' can be changed to the value you want to set</p>
<p>c.'''ipv4.gateway''' means the address of the gateway</p>
<p>orangepi@orangepi:~$ '''sudo nmcli con mod "Wired connection 1" \'''</p>
<p>'''ipv4.addresses "192.168.1.110" \'''</p>
<p>'''ipv4.gateway "192.168.1.1" \'''</p>
<p>'''ipv4.dns "8.8.8.8" \'''</p>
<p>'''ipv4.method "manual"'''</p></li>
<li><p>Then restart the Linux system</p>
<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>
<p>orangepi@orangepi:~$ '''ip addr show eth0'''</p>
<p>3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> 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>inet '''192.168.1.110'''/32 brd 192.168.1.110 scope global noprefixroute eth0</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>valid_lft 259183sec preferred_lft 172783sec</p>
<p>inet6 fe80::3312:861a:a589:d3c/64 scope link noprefixroute</p>
<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-when-it-starts-for-the-first-time"></span>
=== How to set up the Linux system to automatically connect to the network when it starts 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 a network cable that can access the Internet normally into the Ethernet port. After starting the Linux system, an IP address will be automatically assigned to the Ethernet port through DHCP. Then we can obtain the IP address of the Ethernet port through the HDMI screen, serial port or by checking the router background, and then we can remotely log in to the Linux system.'''
'''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 the IP address of the Ethernet port through ssh and connect to WIFI through commands, or connect to WIFI through commands in the HDMI screen or serial port.'''
'''However, 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 described 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 files in it.'''
'''If you want to modify it in Windows, you can use Paragon ExtFS for Windows. Since this software needs to be paid, and there is no similar free software that is easy to use, I will not demonstrate it here.'''
'''In addition, if you have any problems using Paragon ExtFS for Windows, please solve them yourself. We will not answer your questions.'''
<ol style="list-style-type: decimal;">
<li><p>First, burn the Linux image of the development board you want to use to the TF card, and then use the card reader to insert the TF card with the burned development board Linux image into the machine with the Linux system installed (such as a computer with Ubuntu system installed, the following demonstration will take the Ubuntu computer as an example)</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 path where the Linux root file system in the TF card is mounted.</p>
<p>test@test:~$ '''df -h | grep "media"'''</p>
<p>/dev/sdd1 1.4G 1.2G 167M 88% '''/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>
<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>
<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 Linux system to automatically connect to a WIFI hotspot when it starts for the first time, or you can set a static IP address for the WIFI or Ethernet port.</p>
<p>test@test:/media/test/opi_root/boot$ '''sudo cp orangepi_first_run.txt.template orangepi_first_run.txt'''</p></li>
<li><p>Use the following command to open the orangepi_first_run.txt file, 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>
<li><p>Instructions for using variables in the orangepi_first_run.txt file</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The '''FR_general_delete_this_file_after_completion''' variable is used to set whether to delete the orangepi_first_run.txt file after the first startup. The default value is 1, which means deletion. If it is set to 0, orangepi_first_run.txt will be renamed to orangepi_first_run.txt.old after the first startup. Generally, keep the default value</p></li>
<li><p>The '''FR_net_change_defaults''' 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''' variable is used to control whether to enable the configuration of the Ethernet port. If you need to set a static IP address for the Ethernet port, please set it to 1</p></li>
<li><p>The '''FR_net_wifi_enabled''' variable is used to control whether to enable the WIFI configuration. If you need to set the development board to automatically connect to the WIFI hotspot, you must set it to 1. Also, please note that if this variable is set to 1, the Ethernet port setting will be invalid. In other words, the WIFI and Ethernet ports cannot be set at the same time (why, because there is no need...)</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 WIFI hotspot you want to connect to</p></li>
<li><p>'''FR_net_use_static''' variable is used to set whether to set a static IP address for the WIFI or Ethernet port</p></li>
<li><p>'''FR_net_static_ip''' 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''' variable is used to set the gateway. Please set it according to your actual situation.</p></li></ol>
</li>
<li><p>Here are some specific setting examples:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>For example, if you want the Linux system of the development board to automatically connect to the WIFI hotspot after the first startup, you can set it like this:</p>
<p>a) Set '''FR_net_change_defaults''' to '''1'''</p>
<p>b) Set '''FR_net_wifi_enabled''' to '''1'''</p>
<p>c) Set '''FR_net_wifi_ssid''' to the name of the WIFI hotspot you want to connect to</p>
<p>d) Set '''FR_net_wifi_key''' to the password of the WIFI hotspot you want to connect to</p></li>
<li><p>For example, if 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 remotely log in to the development board through SSH, without having to check the IP address of the development board through the router background), you can set it like this:</p>
<p>a) Set '''FR_net_change_defaults''' to '''1'''</p>
<p>b) Set '''FR_net_wifi_enabled''' to '''1'''</p>
<p>c) Set '''FR_net_wifi_ssid''' to the name of the WIFI hotspot you want to connect to</p>
<p>d) Set '''FR_net_wifi_key''' to the password of the WIFI hotspot you want to connect to</p>
<p>e) Set '''FR_net_use_static''' to '''1'''</p>
<p>f) Set '''FR_net_static_ip''' to the desired IP address</p>
<p>g) Set '''FR_net_static_gateway''' to the corresponding gateway address</p></li>
<li><p>For example, if you want the Linux system of the development board to automatically set the IP address of the Ethernet port to the desired static IP address after the first startup, you can set it like this:</p></li></ol>
</li></ol>
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>Set '''FR_net_change_defaults''' to '''1'''</p>
<p>b) Set '''FR_net_ethernet_enabled''' to '''1'''</p>
<p>c) Set '''FR_net_use_static''' to '''1'''</p>
<p>d) Set '''FR_net_static_ip''' to the desired IP address</p>
<p>e) Set '''FR_net_static_gateway''' to the corresponding gateway address</p></li></ol>
<!-- -->
<ol start="8" style="list-style-type: decimal;">
<li><p>After modifying the orangepi_first_run.txt file, you can exit the /boot directory of the Linux system of the development board in the TF card, then uninstall the TF card, and then you can insert the TF card into the development board to start it.</p></li>
<li><p>If you do not set a static IP address, you still need to check the IP address through the router background. If you set a static IP address, you can ping the static IP address set on the computer. If you can ping, it means that the system has started normally and the network has been set correctly. Then you can use the set IP address to remotely log in to the Linux system of the development board through ssh</p></li></ol>
'''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 you reset the orangepi_first_run.txt configuration file and restart the development board's Linux system, the configuration in orangepi_first_run.txt will not take effect again, because this configuration will only take effect at the first startup after burning the Linux system. Please pay special attention to this.'''
<span id="ssh-remote-login-development-board"></span>
== SSH remote login development board ==
'''By default, Linux systems enable SSH remote login and allow the root user to log in. Before logging in through SSH, you must first ensure that the Ethernet or WiFi network is connected, and then use the ip addr command or check the router to obtain the IP address of the development board.'''
<span id="ssh-remote-login-to-the-development-board-under-ubuntu"></span>
=== SSH remote login to the development board under Ubuntu ===
# Get the IP address of the development board
# 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)
orangepi@192.168.1.xx's password: (Enter the password here. The default password is orangepi)
'''Note that when you enter the password, the screen will not display the specific content of the password you entered. Please do not think that there is any malfunction. Just press Enter after entering it.'''
'''If the prompt refuses to connect, as long as you are using the image provided by Orange Pi, please do not doubt whether the password orangepi is wrong, but look for other reasons.'''
<ol start="3" style="list-style-type: decimal;">
<li><p>After successfully logging into the system, the display is as shown below</p>
<p>[[File:Orange_Pi_4A-image127.png|575x337px]]</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 the ping is successful, you can log in to the Linux system through the serial port or HDMI display and then enter the following command on the development board to try to connect:'''</p></li></ol>
root@orangepi:~# '''reset_ssh.sh'''
'''If it still doesn't work, please re-burn the system and try again.'''
<span id="ssh-remote-login-development-board-under-windows"></span>
=== SSH remote login development board under Windows ===
<ol style="list-style-type: decimal;">
<li><p>First obtain the IP address of the development board</p></li>
<li><p>You can use MobaXterm to remotely log in to the development board under Windows. First, create a new ssh session</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Open '''Session'''</p>
<p>b. Then select '''SSH''' in '''Session Setting'''</p>
<p>c. Then enter the IP address of the development board in '''Remote host'''</p>
<p>d. Then enter the Linux '''system username''' root or '''orangepi''' in Specify username</p>
<p>e. Finally, click '''OK'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image128.png|575x292px|13]]
</div></li></ol>
</li>
<li><p>You will then be prompted to enter a password. The default password for both root and orangepi users is orangepi</p>
<p>'''Please note that when you enter the password, the specific content of the password will not be displayed on the screen. Please do not think that there is any malfunction. Just press Enter after entering it.'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image129.jpeg|576x157px|微信图片_20241119194022]]
</div></li>
<li><p>After successfully logging into the system, the display is as shown below</p>
<p>[[File:Orange_Pi_4A-image130.png|576x419px]]</p></li></ol>
<span id="hdmi-test"></span>
== HDMI test ==
<span id="hdmi-display-test"></span>
=== HDMI display test ===
<ol style="list-style-type: decimal;">
<li><p>HDMI to HDMI cable to connect Orange Pi development board and HDMI display</p>
<p>[[File:Orange_Pi_4A-image10.png|199x129px]]</p></li>
<li><p>After starting the Linux system, if the HDMI display has image output, it means that the HDMI interface is working properly</p></li></ol>
'''Note that although many laptops have HDMI interfaces, the HDMI interfaces of laptops generally only have output functions and do not have HDMI in functions, 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 the laptop, please first confirm that your laptop supports the HDMI in function.'''
'''When there is no display on HDMI, please first check whether the HDMI cable is plugged in tightly. After confirming that the connection is OK, you can try a different screen to see if there is any display.'''
<span id="hdmi-to-vga-display-test"></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><p>HDMI to VGA converter</p>
<p>[[File:Orange_Pi_4A-image131.png|155x104px]]</p></li>
<li><p>A VGA cable</p>
<p>[[File:Orange_Pi_4A-image132.png|148x133px]]</p></li>
<li><p>A monitor or TV that supports VGA interface</p></li></ol>
</li>
<li><p>HDMI to VGA display test is as follows</p>
<p>[[File:Orange_Pi_4A-image133.png|575x347px]]</p>
<p>'''When using HDMI to VGA display, the development board and the Linux system of the development board do not need to do any settings, as long as the HDMI interface of the development board can 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>
<span id="how-to-use-bluetooth"></span>
== How to use Bluetooth ==
<span id="testing-methods-for-desktop-images-1"></span>
=== Testing methods for desktop images ===
<ol style="list-style-type: decimal;">
<li><p>First click on the area in the upper right corner of the desktop</p>
<p>[[File:Orange_Pi_4A-image134.png|256x164px]]</p></li>
<li><p>Then open '''Bluetooth Settings'''</p>
<p>[[File:Orange_Pi_4A-image135.png|296x274px]]</p></li>
<li><p>Bluetooth is turned on by default, and the Bluetooth devices scanned nearby will be displayed under '''Devices'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image136.png|415x272px|Screenshot from 2024-09-10 10-27-08]]
</div></li>
<li><p>Then click on the device you want to connect to start pairing. After pairing starts, a pairing confirmation box will pop up. Select '''Confirm'''to confirm. At this time, you also need to confirm on the phone.</p>
<p>[[File:Orange_Pi_4A-image137.png|390x279px]]</p></li>
<li><p>After pairing with the phone, you can select the paired Bluetooth device and then select '''Send Files''' to start sending a file to the phone.</p>
<p>[[File:Orange_Pi_4A-image138.png|395x257px]]</p></li>
<li><p>Then select the file path to be sent, and click '''Select''' to start sending.</p>
<p>[[File:Orange_Pi_4A-image139.png|367x214px]]</p></li>
<li><p>The interface for sending files is shown below</p>
<p>[[File:Orange_Pi_4A-image140.png|374x173px]]</p></li></ol>
<span id="how-to-use-the-server-version-image"></span>
=== How to use the server version image ===
<ol style="list-style-type: decimal;">
<li><p>After entering the system, you can first use the '''hciconfig''' command to check whether there is a Bluetooth device node. If it exists, it means that Bluetooth initialization is normal</p>
<p>orangepi@orangepi:~$ '''sudo apt update && sudo apt install -y bluez'''</p>
<p>orangepi@orangepi:~$ '''hciconfig -a'''</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>UP RUNNING</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>Features: 0xbf 0xff 0x8d 0xfe 0xdb 0x3d 0x7b 0xc7</p>
<p>Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3</p>
<p>Link policy: RSWITCH SNIFF</p>
<p>Link mode: SLAVE ACCEPT</p>
<p>Name: 'orangepi'</p>
<p>Class: 0x3c0000</p>
<p>Service Classes: Rendering, Capturing, Object Transfer, Audio</p>
<p>Device Class: Miscellaneous,</p>
<p>HCI Version: 5.0 (0x9) Revision: 0x400</p>
<p>LMP Version: 5.0 (0x9) Subversion: 0x400</p>
<p>Manufacturer: Spreadtrum Communications Shanghai Ltd (492)</p></li>
<li><p>Use '''bluetoothctl''' to scan for Bluetooth devices</p>
<p>orangepi@orangepi:~$ '''sudo bluetoothctl'''</p>
<p>[NEW] Controller 10:11:12:13:14:15 orangepi4a [default]</p>
<p>Agent registered</p>
<p>[bluetooth]# '''power on # Enable controller'''</p>
<p>Changing power on succeeded</p>
<p>[bluetooth]# '''discoverable on #Set the controller to be discoverable'''</p>
<p>Changing discoverable on succeeded</p>
<p>[CHG] Controller 10:11:12:13:14:15 Discoverable: yes</p>
<p>[bluetooth]# '''pairable on #Set the controller to be pairable'''</p>
<p>Changing pairable on succeeded</p>
<p>[bluetooth]# '''scan on #Start scanning the surrounding Bluetooth devices'''</p>
<p>Discovery started</p>
<p>[CHG] Controller 10:11:12:13:14:15 Discovering: yes</p>
<p>[NEW] Device 76:60:79:29:B9:31 76-60-79-29-B9-31</p>
<p>[NEW] Device 9C:2E:A1:42:71:11 Mi phones</p>
<p>'''[NEW] Device DC:72:9B:4C:F4:CF orangepi'''</p>
<p>[bluetooth]# '''scan off #After scanning the Bluetooth device you want to connect to, you can close the scan and 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'''</p>
<p>Discovery stopped</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>
<li><p>After scanning the device you want to pair, you can pair it. Pairing requires the MAC address of the 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>[CHG] Device DC:72:9B:4C:F4:CF Connected: yes</p>
<p>Request confirmation</p>
<p>[leeb1m[agent] Confirm passkey 764475 (yes/no): '''yes''' '''#Enter yes here, and you will also need to confirm on your phone'''</p>
<p>[CHG] Device DC:72:9B:4C:F4:CF Modalias: bluetooth:v010Fp107Ed1436</p>
<p>[CHG] Device DC:72:9B:4C:F4:CF UUIDs: 0000046a-0000-1000-8000-00805f9b34fb</p>
<p>[CHG] Device DC:72:9B:4C:F4:CF ServicesResolved: yes</p>
<p>[CHG] Device DC:72:9B:4C:F4:CF Paired: yes</p>
<p>'''Pairing successful #Prompt that pairing is successful'''</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>
<li><p>After pairing is successful, the Bluetooth interface of the mobile phone is displayed as follows</p>
<p>[[File:Orange_Pi_4A-image141.png|189x167px]]</p></li>
<li><p>To connect to a Bluetooth device, you need to install the '''pulseaudio-module-bluetooth''' package and then start the '''pulseaudio''' service.</p>
<p>orangepi@orangepi:~$ '''sudo apt update'''</p>
<p>orangepi@orangepi:~$ '''sudo''' '''apt -y install pulseaudio-module-bluetooth'''</p>
<p>orangepi@orangepi:~$ '''pulseaudio --start'''</p></li>
<li><p>How to connect to Bluetooth devices</p>
<p>orangepi@orangepi:~$ '''sudo bluetoothctl'''</p>
<p>Agent registered</p>
<p>[bluetooth]# '''paired-devices #View the MAC address of the paired Bluetooth device'''</p>
<p>Device DC:72:9B:4C:F4:CF orangepi</p>
<p>[bluetooth]# '''connect DC:72:9B:4C:F4:CF #Use MAC address to connect to Bluetooth device'''</p>
<p>Attempting to connect to DC:72:9B:4C:F4:CF</p>
<p>[CHG] Device DC:72:9B:4C:F4:CF Connected: yes</p>
<p>Connection successful</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>'''[orangepi]# #This prompt indicates that the connection is successful'''</p></li>
<li><p>After connecting to the Bluetooth device, you can see the prompt that the audio for calls and media has been connected on the Bluetooth configuration interface of the Android phone.</p>
<div class="figure">
[[File:Orange_Pi_4A-image142.jpeg|223x232px|Screenshot_20201205_142413]]
</div></li></ol>
<span id="usb-interface-test"></span>
== USB interface test ==
'''The USB port can be connected to a USB hub to expand the number of USB ports.'''
<span id="test-by-connecting-usb-mouse-or-keyboard"></span>
=== Test by connecting USB mouse or keyboard ===
# Insert the USB keyboard into the USB port of the Orange Pi development board.
# Connect the Orange Pi development board to the HDMI display
# If the mouse or keyboard can operate the system normally, it means that the USB interface is working properly (the mouse can only be used in the desktop version of the system)
<span id="test-by-connecting-usb-storage-device"></span>
=== Test by connecting USB storage device ===
# First, insert the USB flash drive or USB mobile hard disk into the USB port of the Orange Pi development board.
# Execute the following command. If you can see the output of sdX, it means that the USB disk has been successfully recognized.
orangepi@orangepi:~$ '''cat /proc/partitions | grep "sd*"'''
major minor #blocks name
8 0 30044160 '''sda'''
8 1 30043119 '''sda1'''
<ol start="3" style="list-style-type: decimal;">
<li>Use the mount command to mount the USB drive to '''/mnt,''' and then you can view the files in the USB drive.</li></ol>
orangepi@orangepi:~$ '''sudo mount /dev/sda1 /mnt/'''
orangepi@orangepi:~$ '''ls /mnt/'''
test.txt
<ol start="4" style="list-style-type: decimal;">
<li>After mounting, you can use the '''df -h''' command to view the capacity usage and mount point of the USB drive.</li></ol>
orangepi@orangepi:~$ '''df -h | grep "sd"'''
/dev/sda1 29G 208K 29G 1% /mnt
<span id="usb-ethernet-card-test"></span>
=== USB Ethernet Card Test ===
# The USB Ethernet cards that '''have been tested''' and can be used are as follows. The RTL8153 USB Gigabit Ethernet card can be used normally when inserted into the USB 2.0 Host interface of the development board, but the speed cannot reach Gigabit. Please note this.
{| class="wikitable"
|-
| style="text-align: left;"| Serial number
| style="text-align: left;"| model
|-
| style="text-align: left;"| 1
| style="text-align: left;"| RTL8152B USB 100M LAN
|-
| style="text-align: left;"| 2
| style="text-align: left;"| RTL8153 USB Gigabit LAN
|}
<ol start="2" style="list-style-type: decimal;">
<li><p>First, insert the USB network card into the USB port 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 the following log information can be seen through the '''dmesg''' command, it means that the USB network card is recognized normally.</p>
<p>orangepi@orangepi:~$ '''dmesg | tail'''</p>
<p>[ 121.985016] usb 3-1: USB disconnect, device number 2</p>
<p>[ 126.873772] sunxi-ehci 5311000.ehci3-controller: ehci_irq: highspeed device connect</p>
<p>[ 127.094054] usb 3-1: new high-speed USB device number 3 using sunxi-ehci</p>
<p>[ 127.357472] usb 3-1: reset high-speed USB device number 3 using sunxi-ehci</p>
<p>[ 127.557960] r8152 3-1:1.0 eth1: v1.08.9</p>
<p>[ 127.602642] r8152 3-1:1.0 enx00e04c362017: renamed from eth1</p>
<p>[ 127.731874] 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.892583] IPv6: ADDRCONF(NETDEV_CHANGE): enx00e04c362017: link becomes ready</p></li>
<li><p>Then use the ifconfig command to see the device node of the USB network card and the automatically assigned IP address</p>
<p>orangepi@orangepi:~$ '''sudo ifconfig'''</p>
<p>'''eth1''': flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500</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<link></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 errors 0 dropped 125 overruns 0 frame 0</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>
<li><p>The command to test network connectivity is as follows</p>
<p>orangepi@orangepi:~$ '''ping www.baidu.com -I eth1'''</p>
<p>PING www.a.shifen.com (14.215.177.38) from 192.168.1.12 eth0: 56(84) bytes of data.</p>
<p>64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=1 ttl=56 time=6.74 ms</p>
<p>64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=2 ttl=56 time=6.80 ms</p>
<p>64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=3 ttl=56 time=6.26 ms</p>
<p>64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=4 ttl=56 time=7.27 ms</p>
<p>^C</p>
<p>--- www.a.shifen.com ping statistics ---</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>
<span id="usb-camera-test"></span>
=== USB camera test ===
<ol style="list-style-type: decimal;">
<li><p>First, insert the USB camera into the USB port 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>
<p>orangepi@orangepi:~$ '''lsmod'''</p>
<p>Module Size Used by</p>
<p>'''uvcvideo 106496 0'''</p></li>
<li><p>Through the v4l2-ctl command, you can see that the device node information of the USB camera is /dev/video0</p>
<p>orangepi@orangepi:~$ '''sudo apt update'''</p>
<p>orangepi@orangepi:~$ '''sudo''' '''apt install -y v4l-utils'''</p>
<p>orangepi@orangepi:~$ '''v4l2-ctl --list-devices'''</p>
<p>USB 2.0 Camera (usb-sunxi-ehci-1):</p>
<p>/dev/video0</p>
<p>'''Note that the l in v4l2 is a lowercase letter l, not the number 1.'''</p>
<p>'''In addition, the video number is not always video0, please refer to the actual one you see.'''</p></li>
<li><p>Use fswebcam to test the USB camera</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Install fswebcam</p>
<p>orangepi@orangepi:~$ '''sudo''' '''apt update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y fswebcam'''</p></li>
<li><p>After installing fswebcam, you can use the following command to take pictures</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The -d option is used to specify the device node of the USB camera</p></li>
<li><p>--no-banner is used to remove the watermark of the photo</p></li>
<li><p>The -r option is used to specify the resolution of the photo</p></li>
<li><p>-S option is used to set the number of frames to skip ahead</p></li>
<li><p>./image.jpg is used to set the name and path of the generated photo</p>
<p>orangepi@orangepi:~$ '''sudo''' '''fswebcam -d /dev/video0 \'''</p>
<p>'''--no-banner -r 1280x720 -S 5 ./image.jpg'''</p></li></ol>
</li>
<li><p>In the server version of Linux, after taking a photo, you can use the scp command to transfer the photo 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>
<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><p>Test USB camera using mjpg-streamer</p>
<ol style="list-style-type: lower-alpha;">
<li><p>download mjpg-streamer</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Github download address:</p>
<p>orangepi@orangepi:~$ '''git clone https://github.com/jacksonliam/mjpg-streamer'''</p></li>
<li><p>The mirror download address of Gitee is:</p>
<p>orangepi@orangepi:~$ '''git clone https://gitee.com/leeboby/mjpg-streamer'''</p></li></ol>
</li>
<li><p>Install dependent packages</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Ubuntu System</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y cmake libjpeg8-dev'''</p></li>
<li><p>DebianSystem</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y cmake libjpeg62-turbo-dev'''</p></li></ol>
</li>
<li><p>Compile and install mjpg-streamer</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$ '''sudo make install'''</p></li>
<li><p>Then enter the following command to start mjpg_streamer</p>
<p>'''Note that the video number is not always video0. Please refer to the actual video number.'''</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 "./input_uvc.so -d \'''</p>
<p>'''/dev/video0 -u -f 30" -o "./output_http.so -w ./www"'''</p></li>
<li><p>Then enter '''[IP address of the development board: 8080]''' in the browser of Ubuntu PC, Windows PC or mobile phone in the same LAN as the development board to see the video output by the camera.</p>
<div class="figure">
[[File:Orange_Pi_4A-image143.jpeg|576x279px|微信图片_20241119194131]]
</div></li></ol>
</li></ol>
<span id="audio-test"></span>
== Audio Test ==
<span id="how-to-play-audio-using-the-command-line"></span>
=== How to play audio using the command line ===
<span id="headphone-jack-audio-playback-test"></span>
==== Headphone jack audio playback test ====
<ol style="list-style-type: decimal;">
<li><p>First, plug the earphone into the earphone jack of the development board.</p>
<p>[[File:Orange_Pi_4A-image144.png|331x105px]]</p></li>
<li><p>Use the '''aplay -l''' command to view the sound card devices supported by the Linux system, where '''audiocodec''' is the sound card device required for headphone playback.</p>
<p>root@orangepi:~# '''aplay -l'''</p>
<p>**** List of PLAYBACK Hardware Devices ****</p>
<p>'''card 0: audiocodec [audiocodec], device 0: sunxi-snd-plat-aaudio-sunxi-snd-codec 7110000.codec-0 []'''</p>
<p>'''Subdevices: 1/1'''</p>
<p>'''Subdevice #0: subdevice #0'''</p>
<p>card 1: sndi2s1 [sndi2s1], device 0: sunxi-snd-plat-i2s-snd-soc-dummy-dai snd-soc-dummy-dai-0 []</p>
<p>Subdevices: 1/1</p>
<p>Subdevice #0: subdevice #0</p>
<p>card 2: sndhdmi [sndhdmi], device 0: sunxi-snd-plat-i2s-soc@3000000:hdmi_codec soc@3000000:hdmi_code []</p>
<p>Subdevices: 1/1</p>
<p>Subdevice #0: subdevice #0</p></li>
<li><p>Then use the '''aplay''' command to play the audio, and the headphones will be able to hear the sound</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>
'''If there is noise during the headphone test, please pull the headphones out a little instead of plugging them all the way in.'''
<span id="hdmi-audio-playback-test"></span>
==== HDMI audio playback test ====
<ol style="list-style-type: decimal;">
<li><p>First, use an 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>No additional settings are required for HDMI audio playback. Just use the '''aplay''' command to play it.</p>
<p>root@orangepi:~# '''aplay -D hw:2,0 /usr/share/sounds/alsa/audio.wav'''</p></li></ol>
<span id="testing-audio-methods-on-desktop-systems"></span>
=== Testing Audio Methods on Desktop Systems ===
# First open the file manager
[[File:Orange_Pi_4A-image145.png|259x190px]]
<ol start="2" style="list-style-type: decimal;">
<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>
<p>[[File:Orange_Pi_4A-image146.png|286x174px]]</p></li>
<li><p>Then select the audio.wav file, right-click and choose to open it with vlc to start playing</p>
<p>[[File:Orange_Pi_4A-image147.png|290x174px]]</p></li>
<li><p>How to switch between different audio devices such as HDMI playback and headphone playback</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First click on the area in the upper right corner</p>
<p>[[File:Orange_Pi_4A-image134.png|256x164px]]</p></li>
<li><p>Then select '''Settings'''</p>
<p>[[File:Orange_Pi_4A-image148.png|262x254px]]</p></li>
<li><p>Then find '''Sound'''</p>
<p>[[File:Orange_Pi_4A-image149.png|308x193px]]</p></li>
<li><p>Then select the audio device you want to play in the drop-down selection box of Output Device ('''select Audio Codec to output the sound from the headphones, select HDMI Audio to output the sound from HDMI''')</p>
<p>[[File:Orange_Pi_4A-image150.png|310x196px]]</p></li></ol>
</li></ol>
<span id="how-to-test-recording-using-commands"></span>
=== How to test recording using commands ===
<ol style="list-style-type: decimal;">
<li><p>The Orange Pi 4A development board does not have an onboard MIC, so you can only record audio through headphones with a MIC function. After plugging a headphone with a MIC function into the development board, run the following command to record an audio clip through the headphone:</p>
<p>orangepi@orangepi:~$ '''arecord -D hw:0,0 -d 5 -f S16_LE -t wav /tmp/test.wav'''</p></li></ol>
<span id="temperature-sensor"></span>
== Temperature sensor ==
T527 has a total of 6 temperature sensors. The command to check the temperature is as follows:
'''The displayed temperature value needs to be divided by 1000 to get the unit in Celsius.'''
<ol style="list-style-type: lower-alpha;">
<li>sensor0:CPUL 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></ol>
orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone0/type'''
'''cpul'''_thermal_zone
orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone0/temp'''
'''54925'''
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>sensor1:CPUB 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>
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone1/type'''</p>
<p>'''cpub'''_thermal_zone</p>
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone1/temp'''</p>
<p>'''54990'''</p></li>
<li><p>sensor2:The temperature sensor of the GPU. 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>
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone2/type'''</p>
<p>'''gpu'''_thermal_zone</p>
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone2/temp'''</p>
<p>'''55056'''</p></li>
<li><p>sensor3:NPU 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>
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone3/type'''</p>
<p>'''npu'''_thermal_zone</p>
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone3/temp'''</p>
<p>'''54686'''</p></li>
<li><p>sensor4: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></li></ol>
orangepi@orangepi:~# '''cat /sys/class/thermal/thermal_zone4/type'''
'''ddr'''_thermal_zone
orangepi@orangepi:~# '''cat /sys/class/thermal/thermal_zone4/temp'''
'''54925'''
<ol start="6" style="list-style-type: lower-alpha;">
<li>sensor5:The temperature sensor of axp2202, 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></ol>
orangepi@orangepi:~# '''cat /sys/class/thermal/thermal_zone5/type'''
'''axp2202-usb'''
orangepi@orangepi:~# '''cat /sys/class/thermal/thermal_zone5/temp'''
'''45600'''
<span id="pin-interface-pin-description"></span>
== 40 Pin Interface Pin Description ==
<ol style="list-style-type: decimal;">
<li><p>For the order of the 40-pin interface pins on the Orange Pi 4A development board, please refer to the silkscreen diagram on the development board.</p>
<div class="figure">
[[File:Orange_Pi_4A-image151.jpeg|459x149px|微信图片_20241119194148]]
</div></li>
<li><p>The functions of the 40 pin interface pins of the development board are shown in the following table</p>
<ol style="list-style-type: lower-alpha;">
<li>Below is the complete pin diagram of 40pin</li></ol>
</li></ol>
[[File:Orange_Pi_4A-image152.png|575x191px]]
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>The table below is a picture of the left half of the complete table above, which can be seen more clearly</p>
<p>[[File:Orange_Pi_4A-image153.png|576x375px]]</p></li>
<li><p>The table below is the right half of the complete table above, which can be seen more clearly</p></li></ol>
[[File:Orange_Pi_4A-image154.png|575x384px]]
<ol start="3" style="list-style-type: decimal;">
<li>There are '''28''' GPIO ports in the 40-pin interface, and the 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 pre-installed in the Linux image released by Orange Pi. Unless the wiringOP code is updated, you do not need to download, compile and install it again. You can 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 wiringOP has been pre-installed and can be used normally.'''
[[File:Orange_Pi_4A-image155.png|575x354px]]
<ol style="list-style-type: decimal;">
<li><p>Download the wiringOP code</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 be downloaded from the wiringOP next branch, so don’t miss the -b next parameter.'''</p>
<p>'''If you have problems downloading the code from GitHub, you can directly use the wiringOP source code that comes with the Linux image, which is stored in /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>Test the output of the gpio readall command as follows</p>
<p>[[File:Orange_Pi_4A-image155.png|575x354px]]</p></li></ol>
<span id="pin-interface-gpio-i2c-uart-spi-and-pwm-test"></span>
== 40pin interface GPIO, I2C, UART, SPI and PWM test ==
<span id="pin-gpio-port-test"></span>
=== 40pin GPIO port test ===
<ol style="list-style-type: decimal;">
<li><p>Below, we take pin 7, which corresponds to GPIO PB4, and wPi number 2 as an example to demonstrate how to set the high and low levels of the GPIO port.</p>
<p>[[File:Orange_Pi_4A-image156.png|575x119px]]</p></li>
<li><p>First set the GPIO port to output mode, where the third parameter needs to input the wPi number corresponding to the pin</p>
<p>orangepi@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 that the low level is set successfully</p>
<p>orangepi@orangepi:~/wiringOP$ '''gpio write 2 0'''</p>
<p>Using gpio readall, you can see that the value of pin 7 (V) has changed to 0</p>
<p>[[File:Orange_Pi_4A-image157.png|576x120px]]</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 that the high level is set successfully.</p>
<p>orangepi@orangepi:~/wiringOP$ '''gpio write 2 1'''</p>
<p>Using gpio readall, you can see that the value of pin 7 (V) has changed to 1</p>
<p>[[File:Orange_Pi_4A-image158.png|576x119px]]</p></li>
<li><p>The setting method of other pins is similar. Just change the serial number of wPi to the serial number corresponding to the pin.</p></li></ol>
<span id="how-to-set-pull-up-and-pull-down-resistors-on-pin-gpio"></span>
=== How to set pull-up and pull-down resistors on pin GPIO ===
<ol style="list-style-type: decimal;">
<li><p>Below, we take pin 7, which corresponds to GPIO PB4 and wPi number 2, as an example to demonstrate how to set the pull-up and pull-down resistors of the GPIO port.</p>
<p>[[File:Orange_Pi_4A-image156.png|575x119px]]</p></li>
<li><p>First, you need to set the GPIO port to input mode. The third parameter needs to enter the wPi number corresponding to the pin.</p>
<p>orangepi@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>orangepi@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>orangepi@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>orangepi@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>orangepi@orangepi:~/wiringOP$ '''gpio read 2'''</p>
<p>'''0'''</p></li></ol>
<span id="pin-spi-test"></span>
=== 40 Pin SPI Test ===
<ol style="list-style-type: decimal;">
<li><p>As shown in the figure below, the available SPIs of Orange Pi 4A are SPI1 and SPI2.</p>
<p>[[File:Orange_Pi_4A-image152.png|575x191px]]</p></li>
<li><p>The corresponding pins of SPI1 and SPI2 in 40 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
|
| style="text-align: left;"| '''SPI1 corresponds to 40pin'''
| style="text-align: left;"| '''SPI2 corresponds to 40pin'''
|-
| '''MOSI'''
| style="text-align: left;"| '''Pin 19'''
| style="text-align: left;"| '''Pin 15'''
|-
| '''MISO'''
| style="text-align: left;"| '''Pin 21'''
| style="text-align: left;"| '''Pin 29'''
|-
| '''CLK'''
| style="text-align: left;"| '''Pin 23'''
| style="text-align: left;"| '''Pin 13'''
|-
| '''CS0'''
| style="text-align: left;"| '''Pin 24'''
| style="text-align: left;"| '''Pin 11'''
|}
'''In Linux system, the SPI function in 40pin is disabled by default and needs to be enabled manually before it can be used.'''
'''Add the following red font configuration to /boot/extlinux/extlinux.conf, and then restart the Linux system to enable spi1 and spi2. Note that when opening multiple configurations at the same time, the following red font content needs to be separated by spaces and written in one line.'''
'''orangepi@orangepi4a:~$''' '''sudo vim /boot/extlinux/extlinux.conf'''
label Orange Pi
kernel /boot/uImage
initrd /boot/uInitrd
fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb
append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles
'''FDTOVERLAYS /boot/dtb/allwinner/overlay/sun55i-t527-spi1-cs0-spidev.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-spi2-cs0-spidev.dtbo'''
<ol start="3" style="list-style-type: decimal;">
<li><p>Then check whether the device node of '''spidevx.x''' exists in the Linux system. If it exists, it means that the SPI configuration has taken effect.</p>
<p>orangepi@orangepi:~$ '''ls /dev/spidev*'''</p>
<p>/dev/spidev1.0 /dev/spidev2.0</p></li>
<li><p>Do not short the mosi and miso pins of SPI1 or SPI2. The output 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>'''or'''</p>
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev2.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 the mosi and miso pins of SPI1 or SPI2 and run spidev_test. The output is as follows. You can see that the data sent and received are the same.</p>
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev1.0'''</p>
<p>'''or'''</p>
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev2.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>
=== 40 pin I2C test ===
<ol style="list-style-type: decimal;">
<li><p>As can be seen from the figure below, the available i2c buses for Orange Pi 4A are i2c1, i2c4 and i2c5, a total of three i2c buses.</p>
<p>[[File:Orange_Pi_4A-image152.png|575x191px]]</p></li>
<li><p>The corresponding pins of the three groups of I2C buses in 40 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''I2CBus'''
| style="text-align: left;"| '''SDA correspond 40pin'''
| style="text-align: left;"| '''SCL correspond 40pin'''
| style="text-align: left;"| '''Dtbo Corresponding configuration'''
|-
| style="text-align: left;"| '''I2C1'''
| style="text-align: left;"| '''Pin 12'''
| style="text-align: left;"| '''Pin 7'''
| style="text-align: left;"| '''sun55i-t527-i2c1'''
|-
| style="text-align: left;"| '''I2C4'''
| style="text-align: left;"| '''Pin 3'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''sun55i-t527-i2c4'''
|-
| style="text-align: left;"| '''I2C5'''
| style="text-align: left;"| '''Pin 27'''
| style="text-align: left;"| '''Pin 28'''
| style="text-align: left;"| '''sun55i-t527-i2c5'''
|}
'''In Linux system, the i2c function in 40pin is disabled by default and needs to be enabled manually before it can be used.'''
'''Add the following red font configuration to /boot/extlinux/extlinux.conf, and then restart the Linux system to enable i2c1, i2c4 and i2c5,Note that when opening multiple configurations at the same time, the contents in red font below need to be separated by spaces and written in one line.'''
'''orangepi@orangepi4a:~$ sudo vim /boot/extlinux/extlinux.conf'''
label Orange Pi
kernel /boot/uImage
initrd /boot/uInitrd
fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb
append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles
'''FDTOVERLAYS''' '''/boot/dtb/allwinner/overlay/sun55i-t527-i2c1.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-i2c4.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-i2c5.dtbo'''
<ol start="3" style="list-style-type: decimal;">
<li><p>After starting the Linux system, first confirm that the i2c device node exists under /dev</p>
<p>orangepi@orangepi:~$ '''ls /dev/i2c-*'''</p>
<p>'''/dev/i2c-0 /dev/i2c-1 /dev/i2c-3 /dev/i2c-31 /dev/i2c-4 /dev/i2c-5 /dev/i2c-6'''</p></li>
<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 40 pin connector</p>
<p>'''Please select the 5V and 3.3V pins according to the specific i2c device. Different i2c devices may require different voltage values.'''</p></li>
<li><p>Then use the '''i2cdetect -y''' command. If the address of the connected i2c device can be detected, it means that i2c can be used normally.</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 1''' #i2c1 command</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 4''' #i2c4 command</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 5''' #i2c5 command</p></li></ol>
[[File:Orange_Pi_4A-image159.png|342x125px]]
<span id="pinuart-test"></span>
=== 40 pinUART test ===
<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, Orange Pi 4A has six uart buses: uart2, uart3, uart4, uart5, uart6 and uart7.</p>
<p>[[File:Orange_Pi_4A-image152.png|575x191px]]</p></li>
<li><p>The corresponding pins of the six UART bus groups in the 40 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''UART Bus'''
| style="text-align: left;"| '''RX corresponds to 40pin'''
| style="text-align: left;"| '''TX corresponds to 40pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''UART2'''
| style="text-align: left;"| '''Pin 13'''
| style="text-align: left;"| '''Pin 11'''
| style="text-align: left;"| '''sun55i-t527-uart2'''
|-
| style="text-align: left;"| '''UART3'''
| style="text-align: left;"| '''Pin 33'''
| style="text-align: left;"| '''Pin 32'''
| style="text-align: left;"| '''sun55i-t527-uart3'''
|-
| style="text-align: left;"| '''UART4'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''Pin 3'''
| style="text-align: left;"| '''sun55i-t527-uart4'''
|-
| style="text-align: left;"| '''UART5'''
| style="text-align: left;"| '''Pin 23'''
| style="text-align: left;"| '''Pin 24'''
| style="text-align: left;"| '''sun55i-t527-uart5'''
|-
| style="text-align: left;"| '''UART6'''
| style="text-align: left;"| '''Pin 26'''
| style="text-align: left;"| '''Pin 22'''
| style="text-align: left;"| '''sun55i-t527-uart6'''
|-
| style="text-align: left;"| '''UART7'''
| style="text-align: left;"| '''Pin 10'''
| style="text-align: left;"| '''Pin 8'''
| style="text-align: left;"| '''sun55i-t527-uart7'''
|}
'''In Linux system, the UART function in 40pin is disabled by default and needs to be enabled manually before it can be used.'''
'''Add the following red font configuration to /boot/extlinux/extlinux.conf, and then restart the Linux system to open uart2, uart3, uart4, uart5, uart6 and uart7. Note that when opening multiple configurations at the same time, the following red font content needs to be separated by spaces and written in one line.'''
'''orangepi@orangepi4a:~$ sudo vim /boot/extlinux/extlinux.conf'''
label Orange Pi
kernel /boot/uImage
initrd /boot/uInitrd
fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb
append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles
'''FDTOVERLAYS /boot/dtb/allwinner/overlay/sun55i-t527-uart2.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart3.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart4.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart5.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart6.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart7.dtbo'''
<ol start="3" style="list-style-type: decimal;">
<li><p>After entering the Linux system, first confirm whether there is a uart device node under '''/dev'''</p>
<p>orangepi@orangepi:~$ '''ls /dev/ttyAS*'''</p>
<p>/dev/ttyAS0 /dev/ttyAS1 /dev/ttyAS2 /dev/ttyAS3 /dev/ttyAS4 /dev/ttyAS5 /dev/ttyAS6 /dev/ttyAS7</p></li>
<li><p>Then start testing the UART interface. First use the Dupont line to short-circuit the rx and tx of the UART interface to be tested.</p></li>
<li><p>Use the '''gpio serial''' command to test the loopback function of the serial port as shown below. If you can see the following print, it means that the serial port communication is normal (ttyASX needs to be replaced with the corresponding uart node name, please do not copy it)</p>
<p>orangepi@orangepi:~$ '''gpio serial /dev/ttyASX'''</p>
<p>Out: 0: -> 0</p>
<p>Out: 1: -> 1</p>
<p>Out: 2: -> 2</p>
<p>Out: 3: -> 3^C</p></li></ol>
<span id="how-to-test-pwm-using-sysclasspwm"></span>
=== How to test PWM using /sys/class/pwm/ ===
<ol style="list-style-type: decimal;">
<li><p>According to the table below, the Orange Pi 4A has 14 PWM channels available, including pwm1, pwm2, pwm4, pwm5, pwm6, pwm7, pwm8, pwm9, pwm10, pwm11, pwm12, pwm13, pwm14, and pwm15</p>
<p>[[File:Orange_Pi_4A-image152.png|575x191px]]</p></li>
<li><p>The corresponding pins of PWM in 40pin are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''PWM Bus'''
| style="text-align: left;"| '''Corresponding to 40pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''PWM0-1'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''sun55i-t527-pwm1'''
|-
| style="text-align: left;"| '''PWM0-2'''
| style="text-align: left;"| '''Pin 31'''
| style="text-align: left;"| '''sun55i-t527-pwm2'''
|-
| style="text-align: left;"| '''PWM0-4'''
| style="text-align: left;"| '''Pin 8'''
| style="text-align: left;"| '''sun55i-t527-pwm4'''
|-
| style="text-align: left;"| '''PWM0-5'''
| style="text-align: left;"| '''Pin 10'''
| style="text-align: left;"| '''sun55i-t527-pwm5'''
|-
| style="text-align: left;"| '''PWM0-6'''
| style="text-align: left;"| '''Pin 11'''
| style="text-align: left;"| '''sun55i-t527-pwm6'''
|-
| style="text-align: left;"| '''PWM0-7'''
| style="text-align: left;"| '''Pin 13'''
| style="text-align: left;"| '''sun55i-t527-pwm7'''
|-
| style="text-align: left;"| '''PWM0-8'''
| style="text-align: left;"| '''Pin 7'''
| style="text-align: left;"| '''sun55i-t527-pwm8'''
|-
| style="text-align: left;"| '''PWM0-9'''
| style="text-align: left;"| '''Pin 12'''
| style="text-align: left;"| '''sun55i-t527-pwm9'''
|-
| style="text-align: left;"| '''PWM0-10'''
| style="text-align: left;"| '''Pin 35'''
| style="text-align: left;"| '''sun55i-t527-pwm10'''
|-
| style="text-align: left;"| '''PWM0-11'''
| style="text-align: left;"| '''Pin 38'''
| style="text-align: left;"| '''sun55i-t527-pwm11'''
|-
| style="text-align: left;"| '''PWM0-12'''
| style="text-align: left;"| '''Pin 32'''
| style="text-align: left;"| '''sun55i-t527-pwm12'''
|-
| style="text-align: left;"| '''PWM0-13'''
| style="text-align: left;"| '''Pin 33'''
| style="text-align: left;"| '''sun55i-t527-pwm13'''
|-
| style="text-align: left;"| '''PWM0-14'''
| style="text-align: left;"| '''Pin 16'''
| style="text-align: left;"| '''sun55i-t527-pwm14'''
|-
| style="text-align: left;"| '''PWM0-15'''
| style="text-align: left;"| '''Pin 18'''
| style="text-align: left;"| '''sun55i-t527-pwm15'''
|}
'''In Linux system, the PWM function in 40pin is disabled by default and needs to be enabled manually before it can be used.'''
'''Add the following configuration in red font to /boot/extlinux/extlinux.conf, and then restart the Linux system to turn on pwm1, pwm2, pwm4, pwm5, pwm6, pwm7, pwm8, pwm9, pwm10, pwm11, pwm12, pwm13, pwm14 and pwm15. If you only need to turn on one, just fill in one.'''
'''orangepi@orangepi4a:~$ sudo vim /boot/extlinux/extlinux.conf'''
label Orange Pi
kernel /boot/uImage
initrd /boot/uInitrd
fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb
append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles
'''FDTOVERLAYS /boot/dtb/allwinner/overlay/sun55i-t527-pwm1.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm2.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm4.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm5.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm6.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm7.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm8.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm9.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm10.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm11.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm12.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm13.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm14.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-pwm15.dtbo'''
<ol start="3" style="list-style-type: decimal;">
<li><p>After restarting, you can start the PWM test</p>
<p>'''Please execute the following commands as the root user.'''</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Enter the following command in the command line to make pwm1 output a 50Hz square wave</p>
<p>root@orangepi:~# '''echo 1 > /sys/class/pwm/pwmchip0/export'''</p>
<p>root@orangepi:~# '''echo 20000000 > /sys/class/pwm/pwmchip0/pwm1/period'''</p>
<p>root@orangepi:~# '''echo 1000000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle'''</p>
<p>root@orangepi:~# '''echo 1 > /sys/class/pwm/pwmchip0/pwm1/enable'''</p></li>
<li><p>Enter the following command in the command line to make pwm2 output a 50Hz square wave</p></li></ol>
</li></ol>
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'''
<ol start="3" style="list-style-type: lower-alpha;">
<li>Enter the following command in the command line to make pwm4 output a 50Hz square wave</li></ol>
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'''
<ol start="4" style="list-style-type: lower-alpha;">
<li><p>Other PWM test methods are similar and will not be described here.</p>
<div class="figure">
[[File:Orange_Pi_4A-image160.jpeg|574x344px|69D96433378187B10005CDD2A52881B0]]
</div></li></ol>
<span id="installation-and-use-of-wiringop-python"></span>
== Installation and use of wiringOP-Python ==
'''wiringOP-Python is the Python version of wiringOP, which is used to operate the GPIO, I2C, SPI, UART and other hardware resources of the development board in Python programs.'''
'''Also note that all the commands below are performed under the root user.'''
<span id="installation-of-wiringop-python"></span>
=== Installation of wiringOP-Python ===
<ol style="list-style-type: decimal;">
<li><p>First install the dependency package</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 that there are no errors during the download process due to network problems.'''
If you have problems downloading the code from GitHub, you can directly use the wiringOP-Python source code that comes with the Linux image, which is stored in /'''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 > bindings.i'''</p>
<p>root@orangepi:~/wiringOP-Python# '''sudo python3 setup.py install'''</p></li>
<li><p>Then enter the following command. If help information is output, it means wiringOP-Python has been successfully installed. Press the '''q''' key to exit the help information interface.</p></li></ol>
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.
<ol start="5" style="list-style-type: decimal;">
<li><p>The steps to test whether wiringOP-Python is successfully installed in the python command line are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li>First use the python3 command to enter the python3 command line mode</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>
>>> '''import wiringpi;'''
<ol start="3" style="list-style-type: lower-alpha;">
<li>Finally, enter the following command to view the help information of wiringOP-Python. Press the '''q''' key to exit the help information interface.</li></ol>
>>> '''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)
|
>>>
<span id="pin-gpio-port-test-1"></span>
=== 40 pin GPIO port test ===
'''WiringOP-Python is the same as wiringOP. It 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, the correspondence between the board's wPi number and the physical pin can only be viewed through the gpio command in wiringOP.'''
[[File:Orange_Pi_4A-image155.png|575x354px]]
<ol style="list-style-type: decimal;">
<li><p>Below, we take pin 7, which corresponds to GPIO PB4 and wPi number 2, as an example to demonstrate how to set the high and low levels of the GPIO port.</p>
<p>[[File:Orange_Pi_4A-image156.png|575x119px]]</p></li>
<li><p>The steps for testing directly using commands are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, set the GPIO port to output mode. The first parameter of the '''pinMode''' function is the wPi number corresponding to the pin, and the second parameter is the GPIO mode.</p>
<p>root@orangepi:~/wiringOP-Python# '''python3 -c "import wiringpi; \'''</p>
<p>'''from wiringpi import GPIO; wiringpi.wiringPiSetup() ; \'''</p>
<p>'''wiringpi.pinMode(2, GPIO.OUTPUT) ; "'''</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 that the low level is set successfully.</p>
<p>root@orangepi:~/wiringOP-Python# '''python3 -c "import wiringpi; \'''</p>
<p>'''from wiringpi import GPIO; wiringpi.wiringPiSetup() ;\'''</p>
<p>'''wiringpi.digitalWrite(2, GPIO.LOW)"'''</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 that the high level is set successfully.</p>
<p>root@orangepi:~/wiringOP-Python# '''python3 -c "import wiringpi; \'''</p>
<p>'''from wiringpi import GPIO; wiringpi.wiringPiSetup() ;\'''</p>
<p>'''wiringpi.digitalWrite(2, GPIO.HIGH)"'''</p></li></ol>
</li>
<li><p>The steps for testing in the python3 command line are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First use the python3 command to enter the python3 command line mode</p>
<p>root@orangepi:~# '''python3'''</p></li>
<li><p>Then import the Python module of wiringPi</p>
<p>>>> '''import wiringpi'''</p>
<p>>>> '''from wiringpi import GPIO'''</p></li>
<li><p>Then set the GPIO port to output mode, where the first parameter of the '''pinMode''' function is the wPi number corresponding to the pin, and the second parameter is the GPIO mode</p>
<p>>>> '''wiringpi.wiringPiSetup()'''</p>
<p>0</p>
<p>>>> '''wiringpi.pinMode(2, GPIO.OUTPUT)'''</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 that the low level is set successfully.</p>
<p>>>> '''wiringpi.digitalWrite(2, GPIO.LOW)'''</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 that the high level is set successfully.</p>
<p>>>> '''wiringpi.digitalWrite(2, GPIO.HIGH)'''</p></li></ol>
</li>
<li><p>wiringOP-Python For setting the GPIO high and low levels in Python code, please 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 pins of the development board to change continuously.</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>
=== 40 pin SPI test ===
<ol style="list-style-type: decimal;">
<li><p>As shown in the figure below, the available SPIs of Orange Pi 4A are SPI1 and SPI2.</p>
<p>[[File:Orange_Pi_4A-image152.png|575x191px]]</p></li>
<li><p>The corresponding pins of SPI1 and SPI2 on 40pin are shown in the following table</p></li></ol>
{| class="wikitable"
|-
|
| style="text-align: left;"| '''SPI1 corresponds to 40pin'''
| style="text-align: left;"| '''SPI2 corresponds to 40pin'''
|-
| '''MOSI'''
| style="text-align: left;"| '''Pin 19'''
| style="text-align: left;"| '''Pin 15'''
|-
| '''MISO'''
| style="text-align: left;"| '''Pin 21'''
| style="text-align: left;"| '''Pin 29'''
|-
| '''CLK'''
| style="text-align: left;"| '''Pin 23'''
| style="text-align: left;"| '''Pin 13'''
|-
| '''CS0'''
| style="text-align: left;"| '''Pin 24'''
| style="text-align: left;"| '''Pin 11'''
|}
'''In Linux system, the SPI function in 40pin is disabled by default and needs to be enabled manually before it can be used.'''
'''Add the following red font configuration to /boot/extlinux/extlinux.conf, and then restart the Linux system to enable spi1 and spi2. Note that when opening multiple configurations at the same time, the following red font content needs to be separated by spaces and written in one line.'''
'''orangepi@orangepi4a:~$ sudo vim /boot/extlinux/extlinux.conf'''
label Orange Pi
kernel /boot/uImage
initrd /boot/uInitrd
fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb
append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles
'''FDTOVERLAYS /boot/dtb/allwinner/overlay/sun55i-t527-spi1-cs0-spidev.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-spi2-cs0-spidev.dtbo'''
<ol start="3" style="list-style-type: decimal;">
<li><p>Then check whether the device node of '''spidevx.x''' exists in the Linux system. If it exists, it means that the SPI configuration has taken effect.</p>
<p>orangepi@orangepi:~$ '''ls /dev/spidev*'''</p>
<p>/dev/spidev1.0 /dev/spidev2.0</p></li>
<li><p>Then you can use the '''spidev_test.py''' program in the 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 SPI channel number</p></li>
<li><p>'''--port''':Specify the SPI port number</p></li></ol>
</li>
<li><p>Do not short the mosi and miso pins of SPI. The output of running spidev_test.py is as follows. You can see that the data of TX and RX are inconsistent.</p>
<p>'''The x after the --channel and --port parameters needs to be replaced with the specific SPI channel number and SPI port number.'''</p>
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p></li></ol>
root@orangepi:~/wiringOP-Python/examples# '''python3 spidev_test.py \'''
'''--channel x --port x'''
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 the Dupont line to short the SPI's txd and rxd pins and run spidev_test.py. The output is as follows. You can see that the sent and received data are the same, indicating that the SPI loopback test is normal.</p>
<p>'''The x after the --channel and --port parameters needs to be replaced with the specific SPI channel number and SPI port number.'''</p>
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p></li></ol>
root@orangepi:~/wiringOP-Python/examples# '''python3 spidev_test.py \'''
'''--channel x --port x'''
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>
=== 40 pin I2C test ===
<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, the available i2c buses for Orange Pi 4A are i2c1, i2c4 and i2c5, a total of three i2c buses.</p>
<p>[[File:Orange_Pi_4A-image152.png|575x191px]]</p></li>
<li><p>The corresponding pins of the three groups of I2C buses in 40 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''I2CBus'''
| style="text-align: left;"| '''SDA corresponds to 40pin'''
| style="text-align: left;"| '''SCL corresponds to 40pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''I2C1'''
| style="text-align: left;"| '''Pin 12'''
| style="text-align: left;"| '''Pin 7'''
| style="text-align: left;"| '''sun55i-t527-i2c1'''
|-
| style="text-align: left;"| '''I2C4'''
| style="text-align: left;"| '''Pin 3'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''sun55i-t527-i2c4'''
|-
| style="text-align: left;"| '''I2C5'''
| style="text-align: left;"| '''Pin 27'''
| style="text-align: left;"| '''Pin 28'''
| style="text-align: left;"| '''sun55i-t527-i2c5'''
|}
'''In Linux system, the i2c function in 40pin is disabled by default and needs to be enabled manually before it can be used.'''
'''Add the following red font configuration to /boot/extlinux/extlinux.conf, and then restart the Linux system to enable i2c1, i2c4 and i2c5. Note that when opening multiple configurations at the same time, the following red font content needs to be separated by spaces and written in one line.'''
'''orangepi@orangepi4a:~$ sudo vim /boot/extlinux/extlinux.conf'''
label Orange Pi
kernel /boot/uImage
initrd /boot/uInitrd
fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb
append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles
'''FDTOVERLAYS /boot/dtb/allwinner/overlay/sun55i-t527-i2c1.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-i2c4.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-i2c5.dtbo'''
<ol start="3" style="list-style-type: decimal;">
<li><p>After starting the Linux system, first confirm that the i2c device node exists under /dev</p>
<p>orangepi@orangepi:~$ '''ls /dev/i2c-*'''</p>
<p>'''/dev/i2c-0 /dev/i2c-1 /dev/i2c-3 /dev/i2c-31 /dev/i2c-4 /dev/i2c-5 /dev/i2c-6'''</p></li>
<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 40 pin connector. Here we take the DS1307 RTC module as an example.</p>
<p>[[File:Orange_Pi_4A-image161.png|180x153px]]</p></li>
<li><p>Then use the '''i2cdetect -y''' command. If the address of the connected i2c device can be detected, it means that the i2c device is connected correctly</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 1''' #i2c1 Command</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 4''' #i2c4 Command</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 5''' #i2c5 Command</p></li></ol>
[[File:Orange_Pi_4A-image159.png|342x125px]]
<ol start="7" style="list-style-type: decimal;">
<li><p>Then you can run the '''ds1307.py''' test program in the '''examples''' to read the RTC time.</p>
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p>
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 ds1307.py --device \'''</p>
<p>'''"/dev/i2c-1"'''</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"></span>
=== 40 pin的UART test ===
<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, Orange Pi 4A has six uart buses: uart2, uart3, uart4, uart5, uart6 and uart7</p>
<p>[[File:Orange_Pi_4A-image152.png|575x191px]]</p></li>
<li><p>The corresponding pins of the six UART bus groups in the 40 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''UART Bus'''
| style="text-align: left;"| '''RX corresponds to 40pin'''
| style="text-align: left;"| '''TX corresponds to 40pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''UART2'''
| style="text-align: left;"| '''Pin 13'''
| style="text-align: left;"| '''Pin 11'''
| style="text-align: left;"| '''sun55i-t527-uart2'''
|-
| style="text-align: left;"| '''UART3'''
| style="text-align: left;"| '''Pin 33'''
| style="text-align: left;"| '''Pin 32'''
| style="text-align: left;"| '''sun55i-t527-uart3'''
|-
| style="text-align: left;"| '''UART4'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''Pin 3'''
| style="text-align: left;"| '''sun55i-t527-uart4'''
|-
| style="text-align: left;"| '''UART5'''
| style="text-align: left;"| '''Pin 23'''
| style="text-align: left;"| '''Pin 24'''
| style="text-align: left;"| '''sun55i-t527-uart5'''
|-
| style="text-align: left;"| '''UART6'''
| style="text-align: left;"| '''Pin 26'''
| style="text-align: left;"| '''Pin 22'''
| style="text-align: left;"| '''sun55i-t527-uart6'''
|-
| style="text-align: left;"| '''UART7'''
| style="text-align: left;"| '''Pin 10'''
| style="text-align: left;"| '''Pin 8'''
| style="text-align: left;"| '''sun55i-t527-uart7'''
|}
'''In Linux system, the UART function in 40pin is disabled by default and needs to be enabled manually before it can be used.'''
'''Add the following red font configuration to /boot/extlinux/extlinux.conf, and then restart the Linux system to open uart2, uart3, uart4, uart5, uart6 and uart7. Note that when opening multiple configurations at the same time, the following red font content needs to be separated by spaces and written in one line.'''
'''orangepi@orangepi4a:~$ sudo vim /boot/extlinux/extlinux.conf'''
label Orange Pi
kernel /boot/uImage
initrd /boot/uInitrd
fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb
append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles
'''FDTOVERLAYS /boot/dtb/allwinner/overlay/sun55i-t527-uart2.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart3.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart4.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart5.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart6.dtbo'''
'''/boot/dtb/allwinner/overlay/sun55i-t527-uart7.dtbo'''
<ol start="3" style="list-style-type: decimal;">
<li><p>After entering the Linux system, first confirm whether there is a uart device node under '''/dev'''</p>
<p>orangepi@orangepi:~$ '''ls /dev/ttyAS*'''</p>
<p>/dev/ttyAS0 /dev/ttyAS1 /dev/ttyAS2 /dev/ttyAS3 /dev/ttyAS4 /dev/ttyAS5 /dev/ttyAS6 /dev/ttyAS7</p></li>
<li><p>Then start testing the UART interface. First use the Dupont line to short-circuit the rx and tx of the UART interface to be tested</p></li>
<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 (ttyASX needs to be replaced with the corresponding uart node name, please do not copy it)</p>
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p>
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 serialTest.py --device /dev/ttyASX'''</p>
<p>Out: 0: -> 0</p>
<p>Out: 1: -> 1</p>
<p>Out: 2: -> 2</p>
<p>Out: 3: -> 3</p>
<p>Out: 4:^C</p>
<p>exit</p></li></ol>
<span id="hardware-watchdog-test"></span>
== Hardware watchdog test ==
The Linux system released by Orange Pi has the watchdog_test program pre-installed, which can be used for direct testing.
The method to run the watchdog_test program is as follows:
<ol style="list-style-type: lower-alpha;">
<li><p>The second parameter 10 represents the watchdog count time. If the watchdog 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 of keep alive to indicate that the dog was successfully fed.</p>
<p>orangepi@orangepi:~$ '''sudo watchdog_test 10'''</p>
<p>open success</p>
<p>options is 33152,identity is sunxi-wdt</p>
<p>put_usr return,if 0,success:0</p>
<p>The old reset time is: 16</p>
<p>return ENOTTY,if -1,success:0</p>
<p>return ENOTTY,if -1,success:0</p>
<p>put_user return,if 0,success:0</p>
<p>put_usr return,if 0,success:0</p>
<p>keep alive</p>
<p>keep alive</p>
<p>keep alive</p></li></ol>
<span id="check-the-chipid-of-t527-chip"></span>
== Check the chipid of T527 chip ==
The command to view the chipid of the T527 chip is as follows. The chipid of each chip is different, so the chipid can be used to distinguish multiple development boards.
orangepi@orangepi:~# '''cat /sys/class/sunxi_info/sys_info |grep sunxi_serial'''
sunxi_serial : 208d211475779d0c0000019000000000
<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 ===
'''If the Python version in the Ubuntu or Debian system software repository 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 package to compile and install the latest version of Python.'''
'''The following demonstrates compiling and installing 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 of the Python you want to install).'''
<ol style="list-style-type: decimal;">
<li><p>First install the dependency packages required 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 Python 3.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:~/Python-3.9.10$ '''./configure --enable-optimizations'''</p></li>
<li><p>Then compile and install Python 3.9. The compilation time takes about half an hour.</p>
<p>orangepi@orangepi:~/Python-3.9.10$ '''make -j4'''</p>
<p>orangepi@orangepi:~/Python-3.9.10$ '''sudo make altinstall'''</p></li>
<li><p>After installation, you can use the following command to view the version number of Python just installed</p>
<p>orangepi@orangepi:~/Python-3.9.10$ '''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-change-pip-source-in-python"></span>
=== How to change pip source in Python ===
'''The default source used by pip in Linux system is the official source of Python, but the speed of accessing the official source of Python in China is very slow, and the installation of Python packages often fails due to network problems. So when using pip to install Python libraries, please remember to change the pip source.'''
<ol style="list-style-type: decimal;">
<li><p>First install '''python3-pip'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y python3-pip'''</p></li>
<li><p>How to permanently change pip source under Linux</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First create a new '''~/.pip''' directory, then add the '''pip.conf''' configuration file and set the source of pip to Tsinghua source</p>
<p>orangepi@orangepi:~$ '''mkdir -p ~/.pip'''</p>
<p>orangepi@orangepi:~$ '''cat <<EOF > ~/.pip/pip.conf'''</p>
<p>'''[global]'''</p>
<p>'''timeout = 6000'''</p>
<p>'''index-url = https://pypi.tuna.tsinghua.edu.cn/simple'''</p>
<p>'''trusted-host = pypi.tuna.tsinghua.edu.cn'''</p>
<p>'''EOF'''</p></li>
<li><p>Then use pip3 to install the Python library quickly.</p></li></ol>
</li>
<li><p>How to temporarily change the pip source under Linux, where '''<packagename>''' needs to be replaced with the specific package name</p>
<p>orangepi@orangepi:~$ '''pip3 install <packagename> -i \'''</p>
<p>'''https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn'''</p></li></ol>
<span id="how-to-install-docker"></span>
== How to install Docker ==
The Linux image provided by Orange Pi has Docker pre-installed, but the Docker service is not enabled 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 you can run '''hello-world''', it means that 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 '''permission denied''' is prompted, add the current user to the docker user group so that the docker command can be run without sudo.
orangepi@orangepi:~$ '''sudo usermod -aG docker $USER'''
'''Note: You need to log out and log in again to take effect, or restart the system.'''
<span id="how-to-install-home-assistant"></span>
== How to install Home Assistant ==
'''Note that this article will only provide methods for installing Home Assistant in Ubuntu or Debian systems. For detailed usage of Home Assistant, please refer to the official documentation or corresponding books.'''
<span id="install-via-docker"></span>
=== Install via Docker ===
<ol style="list-style-type: decimal;">
<li><p>First, please install Docker and make sure it can run normally. For the installation steps of Docker, please refer to the instructions in the section [[#how-to-install-docker|'''How to install Docker''']].</p></li>
<li><p>Then you can search for Home Assistant's docker image</p>
<p>orangepi@orangepi:~$ '''docker search homeassistant'''</p></li>
<li><p>Then use the following command to download the Home Assistant docker image to your local computer. The image size is about 1GB and the download time will be longer. Please wait patiently for the download to complete.</p>
<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 that you just downloaded</p>
<p>orangepi@orangepi:~$ '''docker images homeassistant/home-assistant'''</p>
<p>REPOSITORY TAG IMAGE ID CREATED SIZE</p>
<p>homeassistant/home-assistant latest bfa0ab9e1cf5 2 months ago '''1.17GB'''</p></li>
<li><p>Now you can run the Home Assistant docker container</p>
<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 [IP address of the development board: 8123] in the browser to see the Home Assistant interface</p>
<p>'''It takes a while for the Home Assistant container to start. If the following interface does not display normally, please wait a few seconds and refresh it. If the following interface does not display normally after waiting for more than a minute, it means that 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 setup process.'''</p>
<p>[[File:Orange_Pi_4A-image162.png|576x209px]]</p></li>
<li><p>Then enter your '''name''', '''username''' and '''password''' and click '''Create Account'''</p>
<p>[[File:Orange_Pi_4A-image163.png|220x279px]]</p></li>
<li><p>Then follow the interface prompts to set according to your preferences, and then click Next</p>
<p>[[File:Orange_Pi_4A-image164.png|575x297px]]</p></li>
<li><p>Then click Next</p>
<p>[[File:Orange_Pi_4A-image165.png|576x185px]]</p></li>
<li><p>Then click Finish</p>
<p>[[File:Orange_Pi_4A-image166.png|576x117px]]</p></li>
<li><p>The main interface of Home Assistant is shown below.</p>
<p>[[File:Orange_Pi_4A-image167.png|574x294px]]</p></li>
<li><p>How to stop the Home Assistant container</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The command to view the docker container is as follows</p>
<p>orangepi@orangepi:~$ '''docker ps -a'''</p></li>
<li><p>The command to stop the Home Assistant container is as follows</p>
<p>orangepi@orangepi:~$ '''docker stop homeassistant'''</p></li>
<li><p>The command to delete the Home Assistant container is as follows</p>
<p>orangepi@orangepi:~$ '''docker rm homeassistant'''</p></li></ol>
</li></ol>
<span id="installation-via-python"></span>
=== Installation via Python ===
'''Before installation, please change the source of pip to the domestic source to speed up the installation of the Python package. For the configuration method, see the section [[#how-to-change-pip-source-in-python|How to change the pip source in Python]].'''
<ol style="list-style-type: decimal;">
<li><p>First install the dependency package</p>
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y python3 python3-dev python3-venv \'''</p>
<p>'''python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \'''</p>
<p>'''libopenjp2-7 libtiff5 libturbojpeg0-dev tzdata'''</p>
<p>'''If it is debian12, please use the following command:'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y python3 python3-dev python3-venv \'''</p>
<p>'''python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \'''</p>
<p>'''libopenjp2-7 libturbojpeg0-dev tzdata'''</p></li>
<li><p>Then you need to compile and install Python 3.9. For more information, please refer to the section on [[#how-to-compile-and-install-python-source-code|'''compiling and installing Python source code''']].</p>
<p>'''The default Python version of Ubuntu Jammy is Python 3.10, so there is no need to compile and install it.'''</p>
<p>'''The default Python version of Debian Bookworm is Python 3.11, so there is no need to compile and install it.'''</p></li>
<li><p>Then create a Python virtual environment</p>
<p>'''In Debian Bookworm, it is python3.11, so please remember to replace the corresponding commands.'''</p>
<p>orangepi@orangepi:~$ '''sudo mkdir /srv/homeassistant'''</p>
<p>orangepi@orangepi:~$ '''sudo chown orangepi:orangepi /srv/homeassistant'''</p>
<p>orangepi@orangepi:~$ '''cd /srv/homeassistant'''</p>
<p>orangepi@orangepi:/srv/homeassistant$ '''python3.9 -m venv .'''</p>
<p>orangepi@orangepi:/srv/homeassistant$ '''source bin/activate'''</p>
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$</p></li>
<li><p>Then install the required Python packages</p>
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''python3 -m pip install wheel'''</p></li>
<li><p>Then you can install Home Assistant Core</p>
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''pip3 install homeassistant'''</p></li>
<li><p>Then enter the following command to run Home Assistant Core</p>
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''hass'''</p></li>
<li><p>Then enter '''[IP address of the development board: 8123]''' in the browser to see the Home Assistant interface</p>
<p>'''When you run the hass command for the first time, it will download, install, and cache some necessary libraries and dependencies. This process may take several minutes. Note that you will not be able to see the Home Assistant interface in your browser at this time. Please wait for a while before refreshing.'''</p>
<p>[[File:Orange_Pi_4A-image168.png|576x203px]]</p></li></ol>
<span id="opencv-installation-method"></span>
== OpenCV installation method ==
<span id="install-opencv-using-apt"></span>
=== Install OpenCV using apt ===
<ol style="list-style-type: decimal;">
<li><p>The installation command is as follows</p>
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y libopencv-dev python3-opencv'''</p></li>
<li><p>Then use the following command to print the version number of OpenCV. The output is normal, indicating that OpenCV is installed successfully.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The version of OpenCV in Ubuntu 22.04 is as follows:</p>
<p>orangepi@orangepi:~$ '''python3 -c "import cv2; print(cv2.__version__)"'''</p>
<p>'''4.5.4'''</p></li>
<li><p>The version of OpenCV in Debian 12 is as follows:</p>
<p>orangepi@orangepi:~$ '''python3 -c "import cv2; print(cv2.__version__)"'''</p>
<p>'''4.6.0'''</p></li></ol>
</li></ol>
<span id="how-to-install-baota-linux-panel"></span>
== How to install Baota Linux Panel ==
'''Baota Linux Panel is a server management software that improves operation and maintenance efficiency. It supports more than 100 server management functions such as one-click LAMP/LNMP/cluster/monitoring/website/FTP/database/JAVA (excerpted from Baota official website)'''
<ol style="list-style-type: decimal;">
<li><p>First, you need to expand the size of the '''/tmp''' space. After setting, you need to '''restart the Linux system of the development board'''. The command is as follows:</p>
<p>orangepi@orangepi:~$ '''sudo sed -i 's/nosuid/&,size=2G/' /etc/fstab'''</p>
<p>orangepi@orangepi:~$ '''sudo reboot'''</p></li>
<li><p>After restarting, you can see that the size of the '''/tmp''' space has become 2G</p>
<p>orangepi@orangepi:~$ '''df -h | grep "/tmp"'''</p>
<p>tmpfs 2.0G 12K '''2.0G''' 1% /tmp</p></li>
<li><p>Then enter the following command in the Linux system to start the installation of the baota</p>
<p>orangepi@orangepi:~$ '''sudo install_bt_panel.sh'''</p></li>
<li><p>Then the Baota installation program will prompt whether to install '''Bt-Panel''' to the '''/www''' folder, just enter y</p>
<p>+----------------------------------------------------------------------</p>
<p>| Bt-WebPanel FOR CentOS/Ubuntu/Debian</p>
<p>+----------------------------------------------------------------------</p>
<p>| Copyright © 2015-2099 BT-SOFT(http://www.bt.cn) All rights reserved.</p>
<p>+----------------------------------------------------------------------</p>
<p>| The WebPanel URL will be http://SERVER_IP:8888 when installed.</p>
<p>+----------------------------------------------------------------------</p>
<p>Do you want to install Bt-Panel to the /www directory now?(y/n): '''y'''</p></li>
<li><p>Then all you have to do is wait patiently. When you see the following print information output by the terminal, it means that the pagoda has been installed. The entire installation process takes about 34 minutes, which may vary depending on the network speed.</p>
<p>[[File:Orange_Pi_4A-image169.png|576x233px]]</p></li>
<li><p>At this time, enter the '''panel address''' shown above in the browser to open the login interface of the Baota Linux panel, and then enter the '''username''' and '''password''' shown in the above figure in the corresponding position to log in to Baota</p>
<p>[[File:Orange_Pi_4A-image170.png|575x281px]]</p></li>
<li><p>After successfully logging into the pagoda, the following welcome interface will pop up. First, please read the user instructions in the middle and drag them to the bottom. Then you can select "I have agreed and read the User Agreement", and then click "Enter the Panel" to enter the baota.</p>
<p>[[File:Orange_Pi_4A-image171.png|575x317px]]</p></li>
<li><p>After entering the pagoda, you will be prompted to bind an account on the pagoda official website. If you do not have an account, you can go to the pagoda official website ('''https://www.bt.cn''') to register one.</p>
<p>[[File:Orange_Pi_4A-image172.png|576x300px]]</p></li>
<li><p>The final interface is shown in the figure below. You can intuitively see some status information of the development board Linux system, such as load status, CPU usage, memory usage, and storage space usage</p>
<p>[[File:Orange_Pi_4A-image173.png|575x306px]]</p></li>
<li><p>For more functions of the pagoda, please refer to the following information to explore it yourself</p>
<p>User Manual:[http://docs.bt.cn '''http://docs.bt.cn''']</p>
<p>Forum Address:[https://www.bt.cn/bbs '''https://www.bt.cn/bbs''']</p>
<p>GitHub Link:'''https://github.com/aaPanel/BaoTa'''</p></li></ol>
<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 Ubuntu 22.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 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 the '''Applications''' list</p>
<p>[[File:Orange_Pi_4A-image174.png|575x323px]]</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>
<div class="figure">
[[File:Orange_Pi_4A-image175.png|576x324px|Screenshot from 2024-09-27 06-29-42]]
</div></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 '''Ubuntu22.04''' is as follows</p>
<p>[[File:Orange_Pi_4A-image176.png|426x232px]]</p></li>
<li><p>The default version of QT Creator in '''Debian12''' is as follows</p>
<p>[[File:Orange_Pi_4A-image177.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'''->'''About Plugins...'''</p>
<p>[[File:Orange_Pi_4A-image178.png|576x163px]]</p></li>
<li><p>Then remove the check mark of '''ClangCodeModel'''</p>
<p>[[File:Orange_Pi_4A-image179.png|380x256px]]</p></li>
<li><p>'''After setting, you need to restart QT Creator'''</p></li>
<li><p>Then make sure that QT Creator uses the GCC compiler. If it defaults to Clang, change it to GCC</p>
<p>'''For Debian 12, please skip this step.'''</p>
<p>[[File:Orange_Pi_4A-image180.png|576x328px]]</p>
<p>[[File:Orange_Pi_4A-image181.png|575x325px]]</p></li></ol>
</li>
<li><p>Then you can open a sample code</p>
<p>[[File:Orange_Pi_4A-image182.png|576x326px]]</p></li>
<li><p>Clicking on the sample code will automatically open the corresponding documentation. Please read the instructions carefully.</p>
<p>[[File:Orange_Pi_4A-image183.png|575x238px]]</p></li>
<li><p>Then click Next '''Configure Project'''</p>
<p>[[File:Orange_Pi_4A-image184.png|549x308px]]</p></li>
<li><p>Then click the green triangle in the lower left corner to compile and run the sample code</p>
<p>[[File:Orange_Pi_4A-image185.png|546x292px]]</p></li>
<li><p>After waiting for a while, the interface shown in the figure below will pop up, which means that QT can compile and run normally</p>
<p>[[File:Orange_Pi_4A-image186.png|575x336px]]</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-2-humble-on-ubuntu-22.04"></span>
=== How to install ROS 2 Humble on Ubuntu 22.04 ===
<ol style="list-style-type: decimal;">
<li><p>Use the '''install_ros.sh''' script to install ros2</p>
<p>orangepi@orangepi:~$ '''install_ros.sh ros2'''</p></li>
<li><p>After the'''install_ros.sh''' script installs ros2, it will automatically run the'''ros2 -h''' command. If you can see the following print, it means that ros2 is installed successfully.</p>
<p>usage: ros2 [-h] Call `ros2 <command> -h` for more detailed usage. ...</p>
<p>ros2 is an extensible command-line tool for ROS 2.</p>
<p>optional arguments:</p>
<p>-h, --help show this help message and exit</p>
<p>Commands:</p>
<p>action Various action related sub-commands</p>
<p>bag Various rosbag related sub-commands</p>
<p>component Various component related sub-commands</p>
<p>daemon Various daemon related sub-commands</p>
<p>doctor Check ROS setup and other potential issues</p>
<p>interface Show information about ROS interfaces</p>
<p>launch Run a launch file</p>
<p>lifecycle Various lifecycle related sub-commands</p>
<p>multicast Various multicast related sub-commands</p>
<p>node Various node related sub-commands</p>
<p>param Various param related sub-commands</p>
<p>pkg Various package related sub-commands</p>
<p>run Run a package specific executable</p>
<p>security Various security related sub-commands</p>
<p>service Various service related sub-commands</p>
<p>topic Various topic related sub-commands</p>
<p>wtf Use `wtf` as alias to `doctor`</p>
<p>Call `ros2 <command> -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 that ROS 2 can run normally.</p>
<p>orangepi@orangepi:~$ '''test_ros.sh'''</p>
<p>[INFO] [1671174101.200091527] [talker]: Publishing: 'Hello World: 1'</p>
<p>[INFO] [1671174101.235661048] [listener]: I heard: [Hello World: 1]</p>
<p>[INFO] [1671174102.199572327] [talker]: Publishing: 'Hello World: 2'</p>
<p>[INFO] [1671174102.204196299] [listener]: I heard: [Hello World: 2]</p>
<p>[INFO] [1671174103.199580322] [talker]: Publishing: 'Hello World: 3'</p>
<p>[INFO] [1671174103.204019965] [listener]: I heard: [Hello World: 3]</p></li>
<li><p>Run the following command to open rviz2</p>
<p>orangepi@orangepi:~$ '''source /opt/ros/humble/setup.bash'''</p>
<p>orangepi@orangepi:~$ '''ros2 run rviz2 rviz2'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image187.png|576x324px|Screenshot from 2024-09-27 06-18-57]]
</div></li>
<li><p>Reference Documents</p>
<p>'''http://docs.ros.org/en/humble/index.html'''</p>
<p>[http://docs.ros.org/en/galactic/Tutorials.html '''http://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html''']</p></li></ol>
<span id="how-to-install-kernel-header-files"></span>
== How to install kernel header files ==
<ol style="list-style-type: decimal;">
<li><p>The Linux image released by OPi comes with a deb package of kernel header files by default, which is stored in '''/opt/'''</p>
<p>orangepi@orangepi:~$ '''ls /opt/linux-headers*'''</p>
<p>/opt/linux-headers-xxx-sun55iw3_x.x.x_arm64.deb</p></li>
<li><p>Use the following command to install the kernel header file deb package</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 files are located under '''/usr/src'''</p>
<p>orangepi@orangepi:~$ '''ls /usr/src'''</p>
<p>linux-headers-x.x.x</p></li>
<li><p>Then you can compile the source code of the hello kernel module that comes with the Linux image. The source code of the hello module is in '''/usr/src/hello'''. After entering this directory, use the make command to compile it.</p>
<p>orangepi@orangepi:~$ '''cd /usr/src/hello/'''</p>
<p>orangepi@orangepi:/usr/src/hello$ '''sudo make'''</p>
<p>make -C /lib/modules/5.15.147-sun55iw3/build M=/usr/src/hello modules</p>
<p>make[1]: Entering directory '/usr/src/linux-headers-5.15.147-sun55iw3'</p>
<p>CC [M] /usr/src/hello/hello.o</p>
<p>MODPOST /usr/src/hello/Module.symvers</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.15.147-sun55iw3'</p></li>
<li><p>After compilation, the '''hello.ko''' kernel module will be generated</p>
<p>orangepi@orangepi:/usr/src/hello$ '''ls *.ko'''</p>
<p>hello.ko</p></li>
<li><p>Use the '''insmod''' command to insert the '''hello.ko''' kernel module into the kernel</p>
<p>orangepi@orangepi:/usr/src/hello$ '''sudo insmod hello.ko'''</p></li>
<li><p>Then use the '''demsg''' command to view the output of the '''hello.ko''' kernel module. If you can see the following output, it means that the '''hello.ko''' kernel module is loaded correctly.</p>
<p>orangepi@orangepi:/usr/src/hello$ '''dmesg | grep "Hello"'''</p>
<p>[ 2871.893988] '''Hello Orange Pi -- init'''</p></li>
<li><p>Use the '''rmmod'''command to uninstall the '''hello.ko''' kernel module</p>
<p>orangepi@orangepi:/usr/src/hello$ '''sudo rmmod hello'''</p>
<p>orangepi@orangepi:/usr/src/hello$ '''dmesg | grep "Hello"'''</p>
<p>[ 2871.893988] Hello Orange Pi -- init</p>
<p>[ 3173.800892] '''Hello Orange Pi -- exit'''</p></li></ol>
<span id="how-to-use-the-10.1-inch-mipi-lcd-screen"></span>
== How to use the 10.1 inch MIPI LCD screen ==
<span id="inch-mipi-screen-assembly-method"></span>
=== 10.1 inch MIPI screen assembly method ===
<ol style="list-style-type: decimal;">
<li><p>First prepare the necessary accessories</p>
<ol style="list-style-type: lower-alpha;">
<li><p>10.1 inch MIPI LCD display + touch screen</p>
<p>[[File:Orange_Pi_4A-image188.png|288x222px]]</p></li>
<li><p>Screen adapter board + 31pin to 40pin cable</p>
<div class="figure">
[[File:Orange_Pi_4A-image189.png|191x165px|DD9A8F44-0D8F-4f06-9473-B539DEED850C]]
</div></li>
<li><p>30pin MIPI cable</p>
<div class="figure">
[[File:Orange_Pi_4A-image190.png|355x33px|C2164119-6EC3-49ae-9A95-BE323F51FAE1]]
</div></li>
<li><p>12pin touch screen cable</p>
<p>[[File:Orange_Pi_4A-image191.png|293x43px]]</p></li></ol>
</li>
<li><p>Connect the 12-pin touch screen cable, 31-pin to 40-pin cable, and 30-pin MIPI cable to the screen adapter board as shown below. Note that the blue insulation side of the touch screen cable should face down, and the insulation sides of the other two cables should face up. If connected incorrectly, it will cause no display or inability to touch.</p>
<p>[[File:Orange_Pi_4A-image192.png|487x120px]]</p></li>
<li><p>Place the adapter board with the connected cable on the MIPI LCD screen as shown below, and connect the MIPI LCD screen and the adapter board via a 31pin to 40pin cable.</p></li></ol>
[[File:Orange_Pi_4A-image193.png|286x421px]]
<ol start="4" style="list-style-type: decimal;">
<li><p>Then connect the touch screen and the adapter board through the 12-pin touch screen cable, paying attention to the direction of the insulating surface</p>
<p>[[File:Orange_Pi_4A-image194.png|204x130px]]</p></li>
<li><p>Finally, connect it to the LCD interface of the development board through the 30pin MIPI cable</p>
<p>[[File:Orange_Pi_4A-image195.png|268x178px]]</p></li></ol>
<span id="how-to-open-the-10.1-inch-mipi-lcd-screen-configuration"></span>
=== How to open the 10.1-inch MIPI LCD screen configuration ===
<ol style="list-style-type: decimal;">
<li><p>The Linux image does not have the mipi lcd screen configuration turned on by default. If you need to use the mipi lcd screen, you need to turn it on manually.</p></li>
<li><p>The interface of the mipi lcd screen on the development board is shown in the figure below</p>
<p>[[File:Orange_Pi_4A-image196.png|245x140px]]</p></li>
<li><p>The method to open the mipi lcd configuration is as follows</p>
<p>orangepi@orangepi:~$ '''sudo vim /boot/extlinux/extlinux.conf'''</p>
<p>label Orange Pi</p>
<p>kernel /boot/uImage</p>
<p>initrd /boot/uInitrd</p>
<p>fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb</p>
<p>append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles</p>
<p>'''FDTOVERLAYS /boot/dtb/allwinner/overlay/sun55i-t527-lcd.dtbo''' #Configuration that needs to be added</p></li>
<li><p>'''Then restart the OPi OS Arch system'''</p></li>
<li><p>After restarting, you can see the display of the LCD screen as shown below (the default is vertical screen):</p></li></ol>
[[File:Orange_Pi_4A-image197.png|259x379px]]
<span id="methods-for-rotating-display-and-touch-directions"></span>
=== Methods for rotating display and touch directions ===
<ol style="list-style-type: decimal;">
<li><p>First click on the area in the upper right corner of the desktop</p>
<p>[[File:Orange_Pi_4A-image198.png|211x137px]]</p></li>
<li><p>Then open Settings</p>
<p>[[File:Orange_Pi_4A-image199.png|215x167px]]</p></li>
<li><p>Then select'''Displays'''</p>
<p>[[File:Orange_Pi_4A-image200.png|344x251px]]</p></li>
<li><p>Then select the direction you want to rotate in '''Orientation''' of '''Displays'''</p>
<p>[[File:Orange_Pi_4A-image201.png|344x247px]]</p></li>
<li><p>Then select '''Apply'''</p>
<p>[[File:Orange_Pi_4A-image202.png|339x246px]]</p></li>
<li><p>Then you can see that the screen has been rotated. At this time, you need to select '''Keep Changes''' to finalize the rotation.</p>
<p>[[File:Orange_Pi_4A-image203.png|235x111px]]</p></li>
<li><p>The LCD screen will display the following after rotating 90 degrees:</p>
<p>[[File:Orange_Pi_4A-image204.png|338x232px]]</p></li>
<li><p>'''The touch function of the Linux system LCD screen will rotate with the rotation of the display direction, without any other settings'''</p></li></ol>
<span id="how-to-use-the-edp-screen"></span>
== How to use the eDP screen ==
<span id="assembly-method-of-edp-screen"></span>
=== Assembly method of eDP screen ===
<ol style="list-style-type: decimal;">
<li><p>Currently only a 15.6-inch eDP screen is compatible, and the accessories included are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>0.5 pitch 30pin single head same direction cable</p>
<div class="figure">
[[File:Orange_Pi_4A-image205.jpeg|200x197px|0006 (1)]]
</div></li>
<li><p>15.6-inch eDP display, resolution 1920x1080.</p>
<div class="figure">
[[File:Orange_Pi_4A-image206.jpeg|212x368px|0006 (2)]]
</div></li></ol>
</li>
<li><p>Connect the FPC end of the 30-pin single-head unidirectional cable to the eDP interface of the development board, and the other end to the eDP interface of the screen.</p>
<p>[[File:Orange_Pi_4A-image207.png|228x94px]]</p></li></ol>
<span id="how-to-open-edp-screen-configuration"></span>
=== How to open eDP screen configuration ===
'''Please note that the method described below is only applicable to adapted eDP screens. If the customer is using an unadapted screen, it will not light up according to the method below.'''
# The Linux image does not have the eDP screen configuration turned on by default. If you need to use the eDP screen, you need to turn it on manually.
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>First add the following configuration to '''/boot/extlinux/extlinux.conf'''</p>
<p>orangepi@orangepi:~$ '''sudo vim /boot/extlinux/extlinux.conf'''</p>
<p>label Orange Pi</p>
<p>kernel /boot/uImage</p>
<p>initrd /boot/uInitrd</p>
<p>fdt /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb</p>
<p>append root=UUID=de4d1c86-fd02-41ab-ad5f-3c557d669f46 earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles</p>
<p>'''FDTOVERLAYS /boot/dtb/allwinner/overlay/sun55i-t527-edp.dtbo''' #Configuration that needs to be added</p></li>
<li><p>Then restart the system</p>
<p>[orangepi@orangepi-pc ~]$ '''sudo reboot'''</p></li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li>After startup, you can see the eDP screen display as shown below:</li></ol>
[[File:Orange_Pi_4A-image208.png|397x240px]]
<span id="test-of-some-programming-languages-supported-by-linux-system"></span>
== Test of some programming languages supported by Linux system ==
<span id="debian-bookworm-system"></span>
=== Debian Bookworm System ===
<ol style="list-style-type: decimal;">
<li><p>Debian Bookworm is installed with the gcc compilation toolchain by default, which can compile C language programs directly in the Linux system of the development board</p>
<ol style="list-style-type: lower-alpha;">
<li><p>gcc version is as follows</p>
<p>orangepi@orangepi:~$ '''gcc --version'''</p>
<p>gcc (Debian 12.2.0-14) 12.2.0</p>
<p>Copyright (C) 2022 Free Software Foundation, Inc.</p>
<p>This is free software; see the source for copying conditions. There is NO</p>
<p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p></li>
<li><p>Write the '''hello_world.c''' program in C language</p>
<p>orangepi@orangepi:~$ '''vim hello_world.c'''</p>
<p>#include <stdio.h></p>
<p>int main(void)</p>
<p>{</p>
<p>printf("Hello World!\n");</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>Debian Bookworm has Python 3 installed by default</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The specific version of Python is as follows</p>
<p>orangepi@orangepi:~$ '''python3'''</p>
<p>Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux</p>
<p>Type "help", "copyright", "credits" or "license" for more information.</p>
<p>>>></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</p>
<p>orangepi@orangepi:~$ '''vim hello_world.py'''</p>
<p>print('Hello World!')</p></li>
<li><p>The result of running '''hello_world.py''' is as follows</p>
<p>orangepi@orangepi:~$ '''python3 hello_world.py'''</p>
<p>Hello World!</p></li></ol>
</li>
<li><p>Debian Bookworm does not install Java compilation tools and runtime 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>
<p>orangepi@orangepi:~$ '''sudo apt install -y openjdk-17-jdk'''</p></li>
<li><p>After installation, you can check the Java version</p>
<p>orangepi@orangepi:~$ '''java --version'''</p></li>
<li><p>Write a 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("Hello World!");</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>
=== 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 compile C language programs directly in the Linux system of the development board</p>
<ol style="list-style-type: lower-alpha;">
<li><p>gcc version is as follows</p>
<p>orangepi@orangepi:~$ '''gcc --version'''</p></li></ol>
</li></ol>
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.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.
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>Write the '''hello_world.c''' program in C language</p>
<p>orangepi@orangepi:~$ '''vim hello_world.c'''</p>
<p>#include <stdio.h></p>
<p>int main(void)</p>
<p>{</p>
<p>printf("Hello World!\n");</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>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li><p>Ubuntu Jammy has Python 3 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.12 (main, Jul 29 2024, 16:56:48) [GCC 11.4.0] on linux</p>
<p>Type "help", "copyright", "credits" or "license" for more information.</p>
<p>>>></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</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 runtime 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 a '''hello_world.java''' of Java version</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("Hello World!");</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="how-to-upload-files-to-the-linux-system-of-the-development-board"></span>
== How to upload files to the Linux system of the development board ==
<span id="how-to-upload-files-from-ubuntu-pc-to-the-linux-system-of-the-development-board"></span>
=== How to upload files from Ubuntu PC to the Linux system of the development board ===
<span id="how-to-upload-files-using-the-scp-command"></span>
==== How to upload files using the scp command ====
<ol style="list-style-type: decimal;">
<li><p>Use the scp command to upload files from the Ubuntu PC to the Linux system of the development board. The specific commands are as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''file_path:'''Need to be replaced with the path of the file to be uploaded</p></li>
<li><p>'''orangepi:'''The user name of the development board's Linux system can also be replaced with other names, such as root</p></li>
<li><p>'''192.168.xx.xx:''' It 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 Linux system of the development board 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 uses for scp. Please use the following command to view the man page</p></li></ol>
test@test:~$ '''man scp'''
<span id="how-to-upload-files-using-filezilla"></span>
==== How to upload files using FileZilla ====
<ol style="list-style-type: decimal;">
<li><p>First install filezilla in your Ubuntu PC</p>
<p>test@test:~$ '''sudo apt install -y filezilla'''</p></li>
<li><p>Then open filezilla using the following command</p>
<p>test@test:~$ '''filezilla'''</p></li>
<li><p>The interface after opening filezilla is as follows. At this time, the remote site on the right is empty.</p>
<div class="figure">
[[File:Orange_Pi_4A-image209.png|576x453px|截图 2022-12-03 19-04-40]]
</div></li>
<li><p>The method of connecting the development board is shown in the figure below</p></li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image210.png|575x128px|图片565]]
</div>
<ol start="5" style="list-style-type: decimal;">
<li><p>Then select '''Save Password''' and click '''OK'''</p>
<p>[[File:Orange_Pi_4A-image211.png|249x181px]]</p></li>
<li><p>Then select Always '''trust this host''' and click '''OK'''</p></li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image212.png|278x150px|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>
<div class="figure">
[[File:Orange_Pi_4A-image213.png|533x330px|IMG_256]]
</div>
<ol start="8" style="list-style-type: decimal;">
<li>Then select the path to upload to the development board on the right side of the filezilla software, select the file to be uploaded in the Ubuntu PC on the left side of the filezilla software, right-click the mouse, and then click the upload option to start uploading the file to the development board.</li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image214.png|529x414px|IMG_256]]
</div>
<ol start="9" style="list-style-type: decimal;">
<li><p>After uploading, you can check the uploaded files in the corresponding path of the development board Linux system.</p></li>
<li><p>The method of uploading a folder is the same as the method of uploading a file, so I will not go into details here.</p></li></ol>
<span id="how-to-upload-files-from-windows-pc-to-the-linux-system-of-the-development-board"></span>
=== How to upload files from Windows PC to the Linux system of the development board ===
<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:Orange_Pi_4A-image215.jpeg|576x208px|1720161972192]]
<div class="figure">
[[File:Orange_Pi_4A-image216.jpeg|576x415px|1720161983058]]
</div>
<ol start="2" style="list-style-type: decimal;">
<li><p>The downloaded installation package is as follows, then double-click to install directly</p>
<p>'''FileZilla_Server_1.5.1_win64-setup.exe'''</p></li></ol>
During the installation process, select '''Decline''' on the following installation interface, then select '''Next>'''
<div class="figure">
[[File:Orange_Pi_4A-image217.png|355x279px|IMG_256]]
</div>
<ol start="3" style="list-style-type: decimal;">
<li>The interface after opening filezilla is as follows. At this time, the remote site on the right is empty.</li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image218.png|451x357px|IMG_256]]
</div>
<ol start="4" style="list-style-type: decimal;">
<li>The method of connecting the development board is shown in the figure below:</li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image210.png|575x128px|图片565]]
</div>
<ol start="5" style="list-style-type: decimal;">
<li>Then select '''Save Password''' and click '''OK'''</li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image219.png|207x146px|IMG_256]]
</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:Orange_Pi_4A-image220.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>
<div class="figure">
[[File:Orange_Pi_4A-image221.jpeg|576x425px|图片3]]
</div>
<ol start="8" style="list-style-type: decimal;">
<li>Then select the path to be uploaded to the development board on the right side of the filezilla software, then select the file to be uploaded in the Windows PC on the left side of the filezilla software, then right-click the mouse, and then click the upload option to start uploading the file to the development board</li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image222.png|461x340px|IMG_256]]
</div>
<ol start="9" style="list-style-type: decimal;">
<li><p>After uploading, you can check the uploaded files in the corresponding path of the development board Linux system.</p></li>
<li><p>The method of uploading a folder is the same as the method of uploading a file, so I will not go into details here.</p></li></ol>
<span id="instructions-for-use-of-npu"></span>
== Instructions for use of NPU ==
<span id="board-environment-preparation"></span>
=== Board environment preparation ===
<ol style="list-style-type: decimal;">
<li><p>First, you need to install opencv and cmake on the development board.</p>
<p>orangepi@orangepi:~$ '''sudo apt update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt install libopencv-dev cmake'''</p></li>
<li><p>Then download the compressed package of the NPU sample program from the official Baidu Cloud.</p></li>
<li><p>Then upload the NPU sample program compressed package to the development board and decompress it.</p>
<p>orangepi@orangepi:~$ '''tar -xvf board-demo.tar.gz'''</p></li>
<li><p>After the compressed package is decompressed, the directory structure is as follows.</p>
<p>orangepi@orangepi:~$ '''cd board-demo/'''</p>
<p>orangepi@orangepi:~/board-demo$ '''ls'''</p>
<p>chineseocr common head_pose lenet libawnn_viplite libawutils mobilenet_v2_ssd_demo struct2depth struct2depth yolov5</p></li>
<li><p>Then you need to copy the NPU library to the system's /usr/lib directory, which is needed to run the sample program below.</p></li></ol>
orangepi@orangepi:~/board-demo$ '''sudo cp ./common/lib_linux_aarch64/T527/*.so /usr/lib'''
<span id="board-example-run"></span>
=== Board Example Run ===
<span id="run-the-mobilenet_v2_ssd-target-detection-example"></span>
==== Run the mobilenet_v2_ssd target detection example ====
<ol style="list-style-type: decimal;">
<li><p>First compile the mobilenet_v2_ssd target detection example</p>
<p>orangepi@orangepi:~/board-demo$ '''cd mobilenet_v2_ssd_demo'''</p>
<p>orangepi@orangepi:~/board-demo/mobilenet_v2_ssd_demo$ '''mkdir build'''</p>
<p>orangepi@orangepi:~/board-demo/mobilenet_v2_ssd_demo$ '''cd build'''</p>
<p>orangepi@orangepi:~/board-demo/mobilenet_v2_ssd_demo/build$ '''cmake ..'''</p>
<p>orangepi@orangepi:~/board-demo/mobilenet_v2_ssd_demo/build$ '''make'''</p></li>
<li><p>Then execute the following command to run the example.</p>
<p>orangepi@orangepi:/root/board-demo/mobilenet_v2_ssd_demo/build$ '''./mbv2-ssd-demo -b ../model/mbv2_ssd_x527.nb -i ../000012.jpg'''</p></li>
<li><p>The output information of normal program operation is as follows.</p>
<p>orangepi@orangepi:/root/board-demo/mobilenet_v2_ssd_demo/build$ '''./mbv2-ssd-demo -b ../model/mbv2_ssd_x527.nb -i ../000012.jpg'''</p>
<p>................….</p>
<p>get output finished.</p>
<p>mbv2_ssd_postprocess.cpp run.</p>
<p>car = 0.97705 at 162 94 179 x 170</p>
<p>postprocess time : 0.025 Sec</p>
<p>destory npu finished.</p>
<p>~NpuUint.</p></li>
<li><p>The output will be saved as ssd_out.png in the current directory</p>
<p>orangepi@orangepi4a:~/board-demo/mobilenet_v2_ssd_demo/build$ '''ls ssd_out.png'''</p>
<p>ssd_out.png</p>
<p>[[File:Orange_Pi_4A-image223.png|269x179px]]</p></li></ol>
<span id="run-the-yolov5-object-detection-example"></span>
==== Run the yolov5 object detection example ====
<ol style="list-style-type: decimal;">
<li><p>First compile the yolov5 example.</p>
<p>orangepi@orangepi:~/board-demo$ '''cd mobilenet_v2_ssd_demo'''</p>
<p>orangepi@orangepi:~/board-demo/yolov5$ '''mkdir build'''</p>
<p>orangepi@orangepi:~/board-demo/yolov5$ '''cd build'''</p>
<p>orangepi@orangepi:~/board-demo/yolov5/build$ '''cmake ..'''</p>
<p>orangepi@orangepi:~/board-demo/yolov5/build$ '''make'''</p></li>
<li><p>Then execute the following command to run the example.</p>
<p>orangepi@orangepi:~/board-demo/yolov5/build$ '''./yolov5 ../model/v2/yolov5.nb ../input_data/dog.jpg'''</p>
<p>./yolov5 nbg input</p>
<p>VIPLite driver software version 1.13.0.0-AW-2023-10-19</p>
<p>yolov5_preprocess.cpp run.</p>
<p>yolov5_postprocess.cpp run.</p>
<p>detection num: 3</p>
<p>16: 91%, [ 135, 218, 305, 553], dog</p>
<p>7: 69%, [ 473, 75, 689, 174], truck</p>
<p>1: 49%, [ 151, 121, 561, 431], bicycle</p></li>
<li><p>The output will be saved as result.png in the current directory</p>
<p>orangepi@orangepi4a:~/board-demo/yolov5/build$ '''ls result.png'''</p>
<p>result.png</p>
<div class="figure">
[[File:Orange_Pi_4A-image224.png|323x241px|1729679452175]]
</div></li></ol>
<span id="run-the-head_pose-human-posture-recognition-example"></span>
==== Run the head_pose human posture recognition example ====
<ol style="list-style-type: decimal;">
<li><p>First compile the head_pose example.</p>
<p>orangepi@orangepi:~/board-demo$ '''cd head_pose'''</p>
<p>orangepi@orangepi:~/board-demo/head_pose$ '''mkdir build'''</p>
<p>orangepi@orangepi:~/board-demo/head_pose$ '''cd build'''</p>
<p>orangepi@orangepi:~/board-demo/head_pose/build$ '''cmake ..'''</p>
<p>orangepi@orangepi:~/board-demo/head_pose/build$ '''make'''</p></li>
<li><p>Then execute the following command to run the example.</p>
<p>orangepi@orangepi:~/board-demo/head_pose/build$ '''./head_pose -b1 ../model/rfb_landm_face_320_320_sim_x527.nb -b2 ../model/head_pose_x527.nb -i ../input_data/000438.jpg'''</p></li>
<li><p>The output result will be saved to head_pose_result.jpg in the current directory.</p>
<p>orangepi@orangepi:~/board-demo/head_pose/build$ '''ls head_pose_result.jpg'''</p>
<p>head_pose_result.jpg</p>
<p>[[File:Orange_Pi_4A-image225.png|324x215px]]</p></li></ol>
<span id="run-the-resnet50-image-classification-example"></span>
==== Run the resnet50 image classification example ====
<ol style="list-style-type: decimal;">
<li><p>First compile the resnet50 example.</p>
<p>orangepi@orangepi:~/board-demo$ '''cd resnet50'''</p>
<p>orangepi@orangepi:~/board-demo/resnet50$ '''mkdir build'''</p>
<p>orangepi@orangepi:~/board-demo/resnet50$ '''cd build'''</p>
<p>orangepi@orangepi:~/board-demo/resnet50/build$ '''cmake ..'''</p>
<p>orangepi@orangepi:~/board-demo/resnet50/build$ '''make'''</p></li>
<li><p>Then execute the following command to run the example.</p>
<p>orangepi@orangepi:~/board-demo/resnet50/build$ '''./resnet50 ../model/v2/resnet50.nb ../input_data/dog_224_224.jpg'''</p></li>
<li><p>The output result information is as follows, which outputs the top 5 predicted by the model, among which the most likely category is collie</p>
<p>orangepi@orangepi:~/board-demo/resnet50/build$ '''./resnet50 ../model/v2/resnet50.nb ../input_data/dog_224_224.jpg'''</p>
<p>...</p>
<p>========== top5 ==========</p>
<p>class id: 231, prob: 15.432617, label: collie</p>
<p>class id: 230, prob: 13.103271, label: Shetland sheepdog, Shetland sheep dog, Shetland</p>
<p>class id: 169, prob: 12.617920, label: borzoi, Russian wolfhound</p>
<p>class id: 224, prob: 12.423828, label: groenendael</p>
<p>class id: 160, prob: 10.191406, label: Afghan hound, Afghan</p>
<p>class_postprocess success.</p></li></ol>
<span id="run-struct2depth-depth-detection-example"></span>
==== Run struct2depth depth detection example ====
<ol style="list-style-type: decimal;">
<li><p>First compile the struct2depth example.</p>
<p>orangepi@orangepi:~/board-demo$ '''cd struct2depth'''</p>
<p>orangepi@orangepi:~/board-demo/struct2depth$ '''mkdir build'''</p>
<p>orangepi@orangepi:~/board-demo/struct2depth$ '''cd build'''</p>
<p>orangepi@orangepi:~/board-demo/struct2depth/build$ '''cmake ..'''</p>
<p>orangepi@orangepi:~/board-demo/struct2depth/build$ '''make'''</p></li>
<li><p>Then execute the following command to run the example</p>
<p>orangepi@orangepi:~/board-demo/struct2depth/build$ '''./struct2depth -b ../model/v2/struct2depth.nb -i ../input_data/0015.jpg'''</p></li>
<li><p>The depth information of the model inference will be saved in jpg and txt files.</p>
<p>orangepi@orangepi:~/board-demo/struct2depth/build$ '''ls disp_* output_*'''</p>
<p>disp_color.jpg disp_show.jpg output_1.txt output_3.txt</p>
<p>disp_gray.jpg output_0.txt output_2.txt</p></li></ol>
<span id="run-chineseocr-text-recognition-example"></span>
==== Run ChineseOCR text recognition example ====
<ol style="list-style-type: decimal;">
<li><p>First compile the ChineseOCR example.</p>
<p>orangepi@orangepi:~/board-demo$ '''cd chineseocr'''</p>
<p>orangepi@orangepi:~/board-demo/chineseocr$ '''mkdir build'''</p>
<p>orangepi@orangepi:~/board-demo/chineseocr$ '''cd build'''</p>
<p>orangepi@orangepi:~/board-demo/chineseocr/build$ '''cmake ..'''</p>
<p>orangepi@orangepi:~/board-demo/chineseocr/build$ '''make'''</p></li>
<li><p>Then execute the following command to run the example.</p>
<p>orangepi@orangepi:~/board-demo/chineseocr/build$ '''./chineseocr -d ../model/v2/ -1 dbnet_1024 -2 angle_net -3 crnn_lite_lstm_256 -4 keys.txt -i ../input_data/1.jpg'''</p></li>
<li><p>The output result is as follows, and you can see that the text in the image has been recognized.</p>
<p>orangepi@orangepi:~/board-demo/chineseocr/build$ '''./chineseocr -d ../model/v2/ -1 dbnet_1024 -2 angle_net -3 crnn_lite_lstm_256 -4 keys.txt -i ../input_data/1.jpg'''</p>
<p>...</p>
<p>=====End detect=====</p>
<p>FullDetectTime(903.447417ms)</p>
<p>We at Allwinner Technology</p>
<p>AI</p>
<p>chip</p>
<p>take off12345666666 !</p>
<p>run finished.</p>
<p>~CrnnNet.</p>
<p>~AngleNet.</p>
<p>~DbNet.</p>
<p>~NpuUint.</p></li></ol>
<span id="how-to-burn-linux-image-to-emmc"></span>
== How to burn Linux image to eMMC ==
'''Note that the development board can be started through a TF card or eMMC, and the priority of the TF card is higher than that of the eMMC. In other words, if a TF card is inserted into the development board and there is a system in the TF card, the system in the TF card will be started by default, and the system in the eMMC will not be started.'''
<ol style="list-style-type: decimal;">
<li><p>Burning the Linux image to the eMMC requires the use of a TF card. First, burn the Linux image to the TF card, then start the development board and enter the Linux system</p></li>
<li><p>Then run the '''nand-sata-install''' script, remember to '''add sudo permissions'''.</p>
<p>orangepi@orangepi:~$ '''sudo nand-sata-install'''</p></li>
<li><p>Then select '''2 Boot from eMMC - system on eMMC'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image226.png|576x299px|选区_039]]
</div></li>
<li><p>Then a warning will pop up, the script will erase all data on the eMMC, select '''<Yes>''' to continue</p>
<div class="figure">
[[File:Orange_Pi_4A-image227.png|576x335px|选区_040]]
</div></li>
<li><p>You will then be prompted to select the type of file system. Five file systems are supported: ext2/3/4, f2fs, and btrfs.</p>
<p>[[File:Orange_Pi_4A-image228.png|575x190px]]</p></li>
<li><p>Then it will start to format the eMMC. After formatting the eMMC, it will start to burn the Linux image to the eMMC. [[File:Orange_Pi_4A-image229.png|576x174px]]</p></li>
<li><p>After burning, the following options will be prompted. You can select '''<Power off>''' to shut down directly</p>
<div class="figure">
[[File:Orange_Pi_4A-image230.png|575x141px|选区_044]]
</div></li>
<li><p>Then remove the TF card and power on again, the Linux system in the eMMC will start.</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>If you unplug the power supply directly while the Linux system is running, some data may be lost in the file system. It is recommended to use the '''poweroff''' command to shut down the Linux system of the development board before unplugging the power supply.</p>
<p>orangepi@orangepi:~$ '''sudo poweroff'''</p></li>
<li><p>In addition, the development board is equipped with a power button, and you can also '''short press''' the power button on the development board to shut down.</p>
<p>[[File:Orange_Pi_4A-image231.png|449x115px]]</p></li></ol>
'''Note that when you press the power button on the Linux desktop system, a confirmation box as shown in the figure below will pop up. You need to click the Power Off option before the system will shut down.'''
[[File:Orange_Pi_4A-image232.png|211x177px]]
<ol start="3" style="list-style-type: decimal;">
<li><p>After shutting down, long press the power button on the development board to turn it on.</p>
<p>[[File:Orange_Pi_4A-image231.png|449x115px]]</p></li>
<li><p>Use the reboot command to restart the Linux system in the development board</p>
<p>orangepi@orangepi:~$ '''sudo''' '''reboot'''</p></li></ol>
<span id="linux-sdkorangepi-build-usage-instructions"></span>
= Linux SDK——orangepi-build usage instructions =
<span id="compilation-system-requirements"></span>
== Compilation system requirements ==
Linux SDK, '''orangepi-build''', only supports running on X64 computers with Ubuntu 22.04 installed, so before downloading orangepi-build, please first make sure 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 current Ubuntu version 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 your computer is running Windows and does not have Ubuntu 22.04 installed, you can consider using '''VirtualBox''' or '''VMware''' to install an Ubuntu 22.04 virtual machine in Windows. But please note that you should not compile orangepi-build on a WSL virtual machine, because orangepi-build has not been tested in a WSL virtual machine, so you cannot ensure that orangepi-build can be used normally in WSL. In addition, please do not use orangepi-build in the Linux system of the development board. 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''']
After installing Ubuntu 22.04 on your computer or in a virtual machine, please first set the software source of Ubuntu 22.04 to Tsinghua source (or other domestic sources that you think are fast), otherwise it is easy to make mistakes when installing software later due to network reasons. The steps to replace Tsinghua source are as follows:
<ol style="list-style-type: lower-alpha;">
<li>To replace Tsinghua source, please refer to the instructions on this page</li></ol>
[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;">
<li><p>Note that the Ubuntu version needs to be switched to 22.04.</p>
<p>[[File:Orange_Pi_4A-image233.png|576x241px]]</p></li>
<li><p>The content of the '''/etc/apt/sources.list''' file that needs to be replaced is:</p>
<p>test@test:~$ '''sudo mv /etc/apt/sources.list cat /etc/apt/sources.list.bak'''</p>
<p>test@test:~$ '''sudo vim /etc/apt/sources.list'''</p>
<p>#The source mirror is commented out by default to increase the speed of apt update. You can uncomment it if necessary.</p>
<p>deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse</p>
<p># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse</p>
<p>deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse</p>
<p># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse</p>
<p>deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse</p>
<p># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse</p>
<p>deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse</p>
<p># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse</p>
<p># Pre-release software source, not recommended to enable</p>
<p># deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse</p>
<p># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse</p></li>
<li><p>After the replacement, you need to update the package information and ensure that there is no error</p>
<p>test@test:~$ '''sudo apt-get update'''</p></li>
<li><p>'''In addition, since the source code of the kernel and U-boot are stored on GitHub, it is very important to make sure that the computer can download the code from GitHub normally when compiling the image.'''</p></li></ol>
<span id="get-the-source-code-of-linux-sdk"></span>
== Get 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 code. Orangepi-build is modified based on the armbian build compilation system. Orangepi-build can be used to compile multiple versions of Linux images. 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 to use the T527 Soc development board, you need to download the next branch source code of orangepi-build. The above git clone command needs to specify the branch of orangepi-build source code as next.'''
<div class="figure">
[[File:Orange_Pi_4A-image234.jpeg|576x288px|微信图片_20241119194712]]
</div>
'''You do not need to enter the username and password of the GitHub account when downloading the orangepi-build code through the git clone command (the same applies to downloading other codes in this manual). If the Ubuntu PC prompts you to enter the username and password of the GitHub account after entering the git clone command, it is usually because the address of the orangepi-build warehouse after git clone is entered incorrectly. Please check the command spelling carefully for any errors, instead of thinking that we forgot to provide the username and password of the GitHub account here.'''
The u-boot and linux kernel versions currently used by the T527 series development board are as follows:
{| class="wikitable"
|-
| style="text-align: left;"| '''Branches'''
| style="text-align: left;"| '''u-boot Version'''
| style="text-align: left;"| '''Linux Kernel version'''
|-
| style="text-align: left;"| '''current'''
| style="text-align: left;"| '''u-boot v2018.05'''
| style="text-align: left;"| '''linux5.15'''
|}
'''The branch mentioned here is not the same as the branch of orangepi-build source code, please do not confuse them. This branch is mainly used to distinguish different kernel source code versions.'''
'''The Linux 5.15 BSP kernel currently provided by Allwinner is defined as the current branch.'''
orangepi-build After downloading, the following files and folders will be included:
<ol style="list-style-type: lower-alpha;">
<li><p>'''build.sh''': Compile the startup script</p></li>
<li><p>'''external''': Contains configuration files, specific scripts, and source code of some programs needed to compile the image.</p></li>
<li><p>'''LICENSE''': GPL 2 License File</p></li>
<li><p>'''README.md''': orangepi-build Documentation</p></li>
<li><p>'''scripts''': Generic script for compiling linux images</p>
<p>test@test:~/orangepi-build$ '''ls'''</p>
<p>'''build.sh external LICENSE README.md scripts'''</p>
<p>'''If you download the orangepi-build code from github, you may find that orangepi-build does not contain the source code of u-boot and linux kernel, nor the cross-compilation toolchain required to compile u-boot and linux kernel. This is normal because these things are stored in other separate github repositories or some servers (the addresses will be detailed below). orangepi-build will specify the addresses of u-boot, linux kernel and cross-compilation toolchain in the script and configuration file. When running orangepi-build, if it finds that these things are not available locally, it will automatically download them from the corresponding places.'''</p></li></ol>
<span id="download-the-cross-compilation-toolchain"></span>
=== Download the cross-compilation toolchain ===
When orangepi-build is run for the first time, it will automatically download the cross-compilation toolchain and put it in the '''toolchains''' folder. Each time you run the build.sh script of orangepi-build, it will check whether the cross-compilation toolchain in '''toolchains''' exists. If not, it will restart the download. If it exists, it will be used directly without repeated download.
<div class="figure">
[[File:Orange_Pi_4A-image235.png|575x278px|选区_396]]
</div>
The mirror website of the cross-compilation tool chain in China is the open source software mirror website of Tsinghua University:
[https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/ '''https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/''']
'''Toolchains''' After downloading, it will contain multiple versions of cross-compilation tool chains:
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 T527 Linux kernel source code is:
<ol style="list-style-type: lower-alpha;">
<li><p>linux5.15</p>
<p>'''gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu'''</p>
<p>The cross-compilation toolchain used to compile the T527 u-boot source code is:</p></li></ol>
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>v2018.05</p>
<p>'''gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi'''</p></li></ol>
<span id="explanation-of-the-complete-directory-structure-of-orangepi-build"></span>
=== Explanation of the complete directory structure of orangepi build ===
<ol style="list-style-type: decimal;">
<li><p>After downloading the orangepi build repository, it does not include the Linux kernel, U-boot source code, or cross compilation toolchain. The Linux kernel and U-boot source code are stored in separate Git repositories</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The git repository where the Linux kernel source code is stored is as follows. Please note to switch the branch of the Linux orangepi repository to</p>
<p>https://github.com/orangepi-xunlong/linux-orangepi/tree/'''orange-pi-5.15-sun55iw3'''</p></li>
<li><p>The git repository where the u-boot source code is stored is as follows. Please note to switch the branch of the u-boot orangepi repository to</p>
<p>https://github.com/orangepi-xunlong/u-boot-orangepi/tree/'''v2018.05-t527'''</p></li></ol>
</li>
<li><p>When Orangepi build is first run, it will download the cross compilation toolchain, u-boot, and Linux kernel source code. After successfully compiling the Linux image once, 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 configuration files required for compiling the image, scripts for specific functions, and source code for some programs. The rootfs compressed file cached during the image compilation process is also stored in the external file</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 deb packages such as u-boot and Linux, compilation logs, and compiled images</p></li>
<li><p>'''scripts''': General script for compiling Linux images</p></li>
<li><p>'''toolchains''': Store cross compilation toolchain</p></li>
<li><p>'''u-boot''': Store the source code of u-boot</p></li>
<li><p>'''userpatches''': Store the configuration files required for compiling scripts</p>
<p>test@test:~/orangepi-build$ '''ls'''</p>
<p>'''build.sh external kernel LICENSE output README.md scripts toolchains u-boot userpatches'''</p></li></ol>
</li></ol>
<span id="compiling-u-boot"></span>
== Compiling u-boot ==
<ol style="list-style-type: decimal;">
<li><p>Run the build.sh script, remember to grant sudo privileges</p>
<p>test@test:~/orangepi-build$ '''sudo ./build.sh'''</p></li>
<li><p>Select '''U-boot package''' and press Enter</p>
<div class="figure">
[[File:Orange_Pi_4A-image236.png|576x132px|选区_238]]
</div></li>
<li><p>Next, select the model of the development board</p>
<p>[[File:Orange_Pi_4A-image237.png|576x131px]]</p></li>
<li><p>Then it will start compiling u-boot, and some of the information prompted when compiling the current branch is as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Version of u-boot source code</p>
<p>[ o.k. ] Compiling u-boot [ '''v2018.05''' ]</p></li>
<li><p>Version of cross compilation toolchain</p>
<p>[ o.k. ] Compiler version [ '''aarch64-linux-gnu-gcc 11''' ]</p></li>
<li><p>The path of the compiled u-boot deb package</p>
<p>[ o.k. ] Target directory [ '''orangepi-build/output/debs/u-boot''' ]</p></li>
<li><p>The package name of the compiled u-boot deb package</p>
<p>[ o.k. ] File name [ '''linux-u-boot-current-orangepi4a_x.x.x_arm64.deb''' ]</p></li>
<li><p>Compilation time used</p>
<p>[ o.k. ] Runtime [ '''1 min''' ]</p></li>
<li><p>Repeat the command to compile u-boot, and use the following command to start compiling u-boot directly without selecting through the graphical interface</p>
<p>[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepi4a BRANCH=current BUILD_OPT=u-boot''' ]</p></li></ol>
</li>
<li><p>View the compiled u-boot deb package</p>
<p>test@test:~/orangepi-build$ '''ls output/debs/u-boot/'''</p>
<p>'''linux-u-boot-current-orangepi4a_x.x.x_arm64.deb'''</p></li>
<li><p>When the orangepi build compilation system compiles the U-boot source code, it first synchronizes the U-boot source code with the GitHub server's U-boot source code. 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 compile the U-boot completely before turning off this function, otherwise you will prompt that the U-boot source code cannot be found)'''. Otherwise, the modifications made will be restored. The method is as follows:</p>
<p>Set the IGNORE_UPDATES variable in <span class="mark">u'''serpatches/config-default.conf'''</span> to "yes".</p>
<p>test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''</p>
<p>......</p>
<p>IGNORE_UPDATES="'''yes'''"</p>
<p>......</p></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>
<ol style="list-style-type: lower-alpha;">
<li><p>Firstly, upload the compiled deb package of u-boot to the Linux system on the development board</p>
<p>test@test:~/orangepi-build$ '''cd output/debs/u-boot'''</p>
<p>test@test:~/orangepi_build/output/debs/u-boot$ '''scp \'''</p>
<p>'''linux-u-boot-current-orangepi4a_x.x.x_arm64.deb [mailto:root@192.168.1.xxx:/root root@192.168.1.xxx:/root]'''</p></li>
<li><p>Reinstall the newly uploaded deb package for u-boot</p>
<p>orangepi@orangepi:~$ '''sudo dpkg -i''' '''linux-u-boot-current-orangepi4a_x.x.x_arm64.deb'''</p></li>
<li><p>Then run the nand sata install script</p>
<p>orangepi@orangepi:~$ '''sudo nand-sata-install'''</p></li>
<li><p>Then select '''5 Install/Update the bootloader on SD/eMMC'''</p>
<p>[[File:Orange_Pi_4A-image238.png|320x174px]]</p></li>
<li><p>After pressing the enter key, a warning will first pop up</p>
<p>[[File:Orange_Pi_4A-image239.png|314x170px]]</p></li>
<li><p>Pressing the enter key again will start updating u-boot, and after the update is complete, the following information will be displayed</p>
<p>[[File:Orange_Pi_4A-image240.png|292x164px]]</p></li>
<li><p>Then you can restart the development board to test whether the u-boot modifications have taken effect</p></li></ol>
</li></ol>
<span id="compiling-linux-kernel"></span>
== Compiling Linux Kernel ==
<ol style="list-style-type: decimal;">
<li><p>Run the '''build.sh''' script, remember to grant sudo privileges</p>
<p>test@test:~/orangepi-build$ '''sudo ./build.sh'''</p></li>
<li><p>Select '''Kernel package''' and press Enter</p>
<div class="figure">
[[File:Orange_Pi_4A-image241.png|575x116px|选区_240]]
</div></li>
<li><p>Then it will prompt whether the kernel configuration interface needs to be displayed. If the kernel configuration does not need to be modified, select the first one. If the kernel configuration needs to be modified, select the second one</p>
<p>[[File:Orange_Pi_4A-image242.png|576x87px]]</p></li>
<li><p>Next, select the model of the development board</p>
<p>[[File:Orange_Pi_4A-image237.png|576x131px]]</p></li>
<li><p>If step 3) selects the option to display the kernel configuration menu (second option), a kernel configuration interface opened through '''make menuconfig''' will pop up. At this time, you can directly modify the kernel configuration, save and exit after modification, and the kernel source code will be compiled after exit.</p>
<p>[[File:Orange_Pi_4A-image243.png|575x357px]]</p></li></ol>
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>If there is no need to modify the configuration options of the kernel, passing '''KERNEL_CONFIGURE=no''' when running the build.sh script can temporarily block the pop-up kernel configuration interface</p>
<p>test@test:~/orangepi-build$ '''sudo ./build.sh KERNEL_CONFIGURE=no'''</p></li>
<li><p>You can also set '''KERNEL_CONFIGURE=no''' in the orangepi-build/userpatches/config-default.conf default.exe configuration file to permanently disable this feature</p></li>
<li><p>If the following error appears when compiling the kernel, it is due to the small terminal interface of Ubuntu PC, which causes the make menuconfig interface to not display. Please set the terminal of Ubuntu PC to its maximum size and run the build.sh script again</p>
<p>[[File:Orange_Pi_4A-image244.png|574x234px]]</p></li></ol>
<!-- -->
<ol start="6" style="list-style-type: decimal;">
<li><p>The following is a partial explanation of the information prompted when compiling the current branch kernel source code:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Version of Linux kernel source code</p>
<p>[ o.k. ] Compiling current kernel [ '''5.15.147''' ]</p></li>
<li><p>The version of the cross compilation toolchain used</p>
<p>[ o.k. ] Compiler version [ '''aarch64-linux-gnu-gcc 11''' ]</p></li>
<li><p>The default configuration file used by the kernel and its storage path are as follows</p>
<p>[ o.k. ] Using kernel config file [ '''orangepi-build/external/config/kernel/linux-5.15-sun55iw3-current.config''' ]</p></li>
<li><p>The path of the compiled kernel related deb package</p>
<p>[ o.k. ] Target directory [ '''output/debs/''' ]</p></li>
<li><p>The package name of the compiled kernel image deb package</p>
<p>[ o.k. ] File name [ '''linux-image-current-sun55iw3_x.x.x_arm64.deb''' ]</p></li>
<li><p>Compilation time used</p>
<p>[ o.k. ] Runtime [ '''10 min''' ]</p></li>
<li><p>Finally, the compilation command for the kernel selected last time will be displayed. The following command can be used to start compiling the kernel source code without selecting it through the graphical interface</p>
<p>[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepi4a BRANCH=current BUILD_OPT=kernel KERNEL_CONFIGURE=no''' ]</p></li></ol>
</li>
<li><p>View the compiled kernel related deb packages</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''linux-dtb-current-sun55iw3_x.x.x_arm64.deb''' Contains dtb files used by the kernel</p></li>
<li><p>'''linux-headers-current-sun55iw3_x.x.x_arm64.deb''' Contains kernel header files</p></li>
<li><p>'''linux-image-current-sun55iw3_x.x.x_arm64.deb''' Contains kernel images and kernel modules</p>
<p>test@test:~/orangepi-build$ '''ls output/debs/linux-*'''</p>
<p>output/debs/linux-dtb-current-sun55iw3_x.x.x_arm64.deb</p>
<p>output/debs/linux-headers-current-sun55iw3_x.x.x_arm64.deb</p>
<p>output/debs/linux-image-current-sun55iw3_x.x.x_arm64.deb</p></li></ol>
</li>
<li><p>When the Orangepi build compilation system compiles the Linux kernel source code, it first synchronizes the Linux kernel source code with the GitHub server's Linux kernel source code. Therefore, if you want to modify the Linux kernel source code, you first need to turn off the source code update function '''(which requires a complete compilation of the Linux kernel source code before it can be turned off, otherwise it will prompt that the Linux kernel source code cannot be found)'''. Otherwise, the modifications made will be restored. The method is as follows:</p>
<p>Set the IGNORE_UPDATES variable in '''userpatches/config-default.conf''' to “yes”.</p>
<p>test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''</p>
<p>IGNORE_UPDATES="'''yes'''"</p></li>
<li><p>If the kernel has been modified, you can use the following methods to update the kernel and kernel modules of the development board linux system</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Upload the compiled deb package of the linux kernel to the linux system on the development board</p>
<p>test@test:~/orangepi-build$ '''cd output/debs'''</p>
<p>test@test:~/orangepi-build/output/debs$ '''scp \'''</p>
<p>'''linux-image-current-sun55iw3_x.x.x_arm64.deb root@192.168.1.xxx:/root'''</p></li>
<li><p>Install the new linux kernel deb package that you just uploaded</p>
<p>orangepi@orangepi:~$ '''sudo dpkg -i linux-image-current-sun55iw3_x.x.x_arm64.deb'''</p></li>
<li><p>Restart the development board and check whether the kernel changes have taken effect</p>
<p>orangepi@orangepi:~$ '''sudo''' '''reboot'''</p></li></ol>
</li></ol>
<span id="compile-rootfs"></span>
== Compile rootfs ==
<ol style="list-style-type: decimal;">
<li><p>Run the build.sh script and remember to add sudo permissions</p>
<p>test@test:~/orangepi-build$ '''sudo ./build.sh'''</p></li>
<li><p>Select '''Rootfs and all deb packages''',then press enter</p></li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image245.png|576x119px|选区_241]]
</div>
<ol start="3" style="list-style-type: decimal;">
<li><p>Then select the model of the development board</p>
<p>[[File:Orange_Pi_4A-image237.png|576x131px]]</p></li>
<li><p>Then select the type of rootfs</p>
<p>[[File:Orange_Pi_4A-image246.png|575x80px]]</p></li>
<li><p>Then select the type of image</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Image with console interface (server)''' Indicates the server version of the image, the volume is relatively small</p></li>
<li><p>'''Image with desktop environment''' It is a large image with a desktop</p>
<div class="figure">
[[File:Orange_Pi_4A-image247.png|576x75px|选区_245]]
</div></li></ol>
</li>
<li><p>If it is the image of the compile server version, you can also choose to compile the Standard version or Minimal version, the Minimal version of the pre-installed software will be much less than the Standard version '''(no special requirements, please do not choose the Minimal version, because many things are not pre-installed by default, some functions may not be used)'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image248.png|576x78px|选区_397]]
</div></li>
<li><p>If you compile the desktop version of the image also need to select the type of desktop environment, currently only maintain GNOME, so please choose GNOME type desktop</p>
<p>[[File:Orange_Pi_4A-image249.png|576x69px]]</p>
<p>[[File:Orange_Pi_4A-image250.png|576x74px]]</p>
<p>You can then select additional packages that need to be installed. Please press Enter to skip this.</p>
<p>[[File:Orange_Pi_4A-image251.png|575x264px]]</p></li>
<li><p>You will then start compiling the rootfs. Some of the information prompted during compilation is described below</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The type of rootfs</p>
<p>[ o.k. ] local not found [ Creating new rootfs cache for '''jammy''' ]</p></li>
<li><p>Directory for storing the generated rootfs package</p>
<p>[ o.k. ] Target directory [ '''orangepi-build/external/cache/rootfs''' ]</p></li>
<li><p>Name of the generated rootfs package</p>
<p>[ o.k. ] File name [ '''jammy-gnome-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4''' ]</p></li></ol>
</li>
<li><p>View the compiled rootfs compressed package</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''jammy-gnome-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4''' is rootfs zip, the meaning of each field name is</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''jammy''' indicates the type of linux distribution for rootfs</p></li>
<li><p>'''gnome''' indicates that rootfs is the type of the desktop version. If it is '''cli''', it indicates the type of the server version</p></li>
<li><p>'''arm64''' indicates the schema type of rootfs</p></li>
<li><p>'''25250ec7002de9e81a41de169f1f89721''' is generated by the package name rootfs to install all of the packages of the MD5 hash value, as long as no modification rootfs installation package list, then this value will not change, The compilation script uses this MD5 hash to determine if the rootfs needs to be recompiled</p></li></ol>
</li>
<li><p>'''jammy-gnome-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.list''' lists the package names of all packages installed by rootfs</p>
<p>test@test:~/orangepi-build$ '''ls external/cache/rootfs/'''</p>
<p>jammy-gnome-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4</p>
<p>jammy-gnome-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.current</p>
<p>jammy-gnome-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.list</p></li></ol>
</li>
<li><p>If the required rootfs already exists under '''external/cache/rootfs''', 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 the '''external/cache/rootfs''' to check whether there is a cached rootfs. If there is one, it will be used directly, which can save a lot of download and compilation time</p></li></ol>
<span id="compile-the-linux-image"></span>
== Compile the linux image ==
<ol style="list-style-type: decimal;">
<li><p>Run the '''build.sh''' script and remember to add sudo permissions</p>
<p>test@test:~/orangepi-build$ '''sudo ./build.sh'''</p></li>
<li><p>Select '''Full OS image for flashing''' and press Enter</p></li></ol>
<div class="figure">
[[File:Orange_Pi_4A-image252.png|576x128px|选区_242]]
</div>
<ol start="3" style="list-style-type: decimal;">
<li><p>Then select the model of the development board</p>
<p>[[File:Orange_Pi_4A-image237.png|576x131px]]</p></li>
<li><p>Then select the type of rootfs</p>
<p>[[File:Orange_Pi_4A-image246.png|575x80px]]</p></li>
<li><p>Then select the type of image</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Image with console interface (server)''' Indicates the server version of the image, the volume is relatively small</p></li>
<li><p>'''Image with desktop environment''' It is a large image with a desktop</p>
<div class="figure">
[[File:Orange_Pi_4A-image247.png|576x75px|选区_245]]
</div></li></ol>
</li>
<li><p>If it is the image of the compile server version, you can also choose to compile the Standard version or Minimal version, the Minimal version of the pre-installed software will be much less than the Standard version '''(no special requirements, please do not choose the Minimal version, because many things are not pre-installed by default, some functions may not be used)'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image248.png|576x78px|选区_397]]
</div></li>
<li><p>If you compile the desktop version of the image also need to select the type of desktop environment, currently only maintain GNOME, so please choose GNOME type desktop</p>
<p>[[File:Orange_Pi_4A-image249.png|576x69px]]</p>
<p>[[File:Orange_Pi_4A-image250.png|576x74px]]</p>
<p>You can then select additional packages that need to be installed. Please press Enter to skip this.</p>
<p>[[File:Orange_Pi_4A-image251.png|575x264px]]</p></li>
<li><p>The linux image will then be compiled, the general process of compilation is as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Initialize the Ubuntu PC compilation environment and install the software packages required for the compilation process</p></li>
<li><p>Download the u-boot and linux kernel source code (if cached, update the code only)</p></li>
<li><p>Compile u-boot source code to generate the u-boot deb package</p></li>
<li><p>Compile linux source code and generate Linux-related deb packages</p></li>
<li><p>Create the deb package of the linux firmware</p></li>
<li><p>Create the deb package of the orangepi-config tool</p></li>
<li><p>Create a board-level deb package</p></li>
<li><p>If you are compiling the desktop version image, you will also make desktop related deb packages</p></li>
<li><p>Check whether the rootfs is cached. If no, create a new rootfs. If the rootFS is cached, decompress it and use it</p></li>
<li><p>Install the previously generated deb package into rootfs</p></li>
<li><p>Perform some specific Settings for different development boards and different types of images, such as preinstalling additional software packages and modifying system configurations</p></li>
<li><p>Then create an image file and format the partition. The default type is ext4</p></li>
<li><p>Copy the configured rootfs to the image partition</p></li>
<li><p>Then update initramfs</p></li>
<li><p>Run the dd command to write the bin file of the u-boot to the image</p></li></ol>
</li>
<li><p>The following information is displayed after the image is compiled</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Path for storing the generated image</p>
<p>[ o.k. ] Done building [ '''output/images/orangepi4a_x.x.x_debian_jammy_linux5.15.xx_gnome_desktop/orangepi4a_x.x.x_debian_jammy_linux5.15.xx_gnome_desktop.img''' ]</p></li>
<li><p>Compilation time</p></li></ol>
</li></ol>
'''[ o.k. ] Runtime [ 19 min ]'''
<ol start="3" style="list-style-type: lower-alpha;">
<li><p>Repeat the image compilation command. Run the following command to compile the image without using the GUI</p>
<p>[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepi4a BRANCH=current BUILD_OPT=image RELEASE=jammy BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=yes''' ]</p></li></ol>
<span id="android-13-operating-system-instructions"></span>
= Android 13 operating system instructions =
<span id="supported-android-versions"></span>
== Supported Android versions ==
{| class="wikitable"
|-
| style="text-align: center;"| Android version
| style="text-align: center;"| Kernel version
|-
| style="text-align: center;"| '''Android 13'''
| style="text-align: center;"| '''linux5.15'''
|}
<span id="android-13-function-adaptation"></span>
== Android 13 Function Adaptation ==
{| class="wikitable"
|-
| style="text-align: center;"| '''Function'''
| style="text-align: center;"| '''Android 13'''
|-
| style="text-align: center;"| '''HDMI video'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''HDMI Audio'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''USB2.0 x 4'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''TF card start'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''eMMC'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Identify NVME SSDS'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Gigabit network card'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''WIFI'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Bluetooth'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''RTC chip'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Headphone audio'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''LCD screen'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''EDP'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''CAM1'''
| style="text-align: center;"| '''NO'''
|-
| style="text-align: center;"| '''CAM2'''
| style="text-align: center;"| '''NO'''
|-
| style="text-align: center;"| '''LED light'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin GPIO'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin I2C'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin SPI'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin UART'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''40 pin PWM'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Temperature sensor'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Mali GPU'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Video codec'''
| style="text-align: center;"| '''OK'''
|}
<span id="usage-of-adb"></span>
== Usage of ADB ==
<span id="usb-otg-mode-switching-method"></span>
=== USB OTG mode switching method ===
'''The development board has four USB ports, of which the USB port marked in the red box below can support both Host mode and Device mode, and the other three USB ports only support Host mode.'''
[[File:Orange_Pi_4A-image253.png|258x214px]]
'''The USB OTG interface is in Host mode by default and can be used to connect USB devices such as mouse and keyboard. If you want to use ADB, you need to manually switch to Device mode.'''
<ol style="list-style-type: decimal;">
<li><p>First open Settings</p>
<p>[[File:Orange_Pi_4A-image254.png|574x250px]]</p></li>
<li><p>Then find '''About tablet'''</p>
<p>[[File:Orange_Pi_4A-image255.png|575x315px]]</p></li>
<li><p>Then click the '''Build number''' option several times with your mouse until it appears. '''You are now a developer!''' Tips for</p>
<p>[[File:Orange_Pi_4A-image256.png|575x301px]]</p></li>
<li><p>Then return to the upper-level menu and select '''System'''</p>
<p>[[File:Orange_Pi_4A-image257.png|575x253px]]</p></li>
<li><p>Then select '''Developer options'''</p>
<p>[[File:Orange_Pi_4A-image258.png|575x279px]]</p></li>
<li><p>Finally, find the '''USB OTG Mode Switch''', '''turn on the switch to switch to Device mode, turn off the switch to switch to Host mode'''</p></li></ol>
[[File:Orange_Pi_4A-image259.png|576x197px]]
<span id="use-a-data-cable-to-connect-adb-to-debug"></span>
=== Use a data cable to connect adb to debug ===
<ol style="list-style-type: decimal;">
<li><p>First prepare a good quality USB 2.0 public to public data cable</p>
<div class="figure">
[[File:Orange_Pi_4A-image17.png|141x138px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]
</div></li>
<li><p>Install adb tool on Ubuntu PC</p>
<p>test@test:~$ '''sudo apt-get update'''</p>
<p>test@test:~$ '''sudo apt-get install -y adb'''</p></li>
<li><p>View the identified ADB device</p>
<p>test@test:~$ '''adb devices'''</p>
<p>List of devices attached</p>
<p>4c00146473c28651dd0 device</p></li>
<li><p>Then you can log in to the android system through adb shell on the Ubuntu PC</p></li></ol>
test@test:~$ '''adb shell'''
t527-demo:/ #
<span id="adb-debugging-using-a-network-connection"></span>
=== adb debugging using a network connection ===
'''Using network adb does not require a USB2.0 peer-to-peer data cable to connect the computer to the development board, but communicates over the network, so first make sure that the wired or wireless network of the development board is connected, and then obtain the IP address of the development board, which will be used later.'''
<ol style="list-style-type: decimal;">
<li><p>Ensure that the '''service.adb.tcp.port''' of the Android operating system is set to 5555</p>
<p>console:/ # '''getprop | grep "adb.tcp"'''</p>
<p>[service.adb.tcp.port]: [5555]</p></li>
<li><p>If '''service.adb.tcp.port''' is not set, you can use the following command in the serial port to set the port number of network adb</p></li></ol>
console:/ # '''setprop service.adb.tcp.port 5555'''
console:/ # '''stop adbd'''
console:/ # '''start adbd'''
<ol start="3" style="list-style-type: decimal;">
<li><p>Install adb tool on Ubuntu PC</p>
<p>test@test:~$ '''sudo apt-get update'''</p>
<p>test@test:~$ '''sudo apt-get install -y adb'''</p></li>
<li><p>Then connect network adb on Ubuntu PC</p>
<p>test@test:~$ '''adb connect 192.168.1.xxx:5555''' '''(Change it to the IP address of the development board)'''</p>
<p>* daemon not running; starting now at tcp:5037</p>
<p>* daemon started successfully</p>
<p>connected to 192.168.1.xxx:5555</p>
<p>test@test:~$ '''adb devices'''</p>
<p>List of devices attached</p>
<p>192.168.1.xxx:5555 device</p></li>
<li><p>Then you can log in to the android system through adb shell on the Ubuntu PC</p></li></ol>
test@test:~$ '''adb shell'''
t527-demo:/ #
<span id="hdmi-to-vga-display-test-1"></span>
== HDMI to VGA display test ==
<ol style="list-style-type: decimal;">
<li><p>The following accessories need to be prepared first</p>
<ol style="list-style-type: lower-alpha;">
<li><p>HDMI to VGA converter</p>
<p>[[File:Orange_Pi_4A-image131.png|155x104px]]</p></li>
<li><p>One VGA cable</p>
<p>[[File:Orange_Pi_4A-image132.png|148x133px]]</p></li>
<li><p>A monitor or TV that supports VGA port</p></li></ol>
</li>
<li><p>HDMI to VGA display test is shown below</p>
<p>[[File:Orange_Pi_4A-image260.png|575x332px]]</p>
<p>'''When using HDMI to VGA display, the development board and the Android system of the development board do not need to do any Settings, only the HDMI interface of the development board can be displayed normally. So if the test has problems, check the HDMI to VGA converter, VGA cable, and monitor for problems.'''</p></li></ol>
<span id="wi-fi-connection-method"></span>
== WI-FI connection method ==
<ol style="list-style-type: decimal;">
<li><p>First select '''Settings'''</p>
<p>[[File:Orange_Pi_4A-image254.png|574x250px]]</p></li>
<li><p>Then select '''Network & Internet'''</p>
<p>[[File:Orange_Pi_4A-image261.png|575x191px]]</p></li>
<li><p>Then select '''Internet'''</p>
<p>[[File:Orange_Pi_4A-image262.png|576x157px]]</p></li>
<li><p>Then open WI-FI</p>
<p>[[File:Orange_Pi_4A-image263.png|575x113px]]</p></li>
<li><p>After turning on WI-FI, you can see the search signal under '''Available networks'''</p>
<p>[[File:Orange_Pi_4A-image264.png|576x199px]]</p></li>
<li><p>Select the WI-FI you want to connect to, and the password input interface will pop up as shown in the following figure</p>
<p>[[File:Orange_Pi_4A-image265.png|574x165px]]</p></li>
<li><p>Then use the keyboard to enter the WI-FI password, and then use the '''mouse''' to click the Enter button in the virtual keyboard to start the WI-FI connection</p>
<p>[[File:Orange_Pi_4A-image266.png|576x179px]]</p></li>
<li><p>The display after the WI-FI connection is successful is as shown in the following figure</p>
<p>[[File:Orange_Pi_4A-image267.png|576x176px]]</p></li></ol>
<span id="how-to-use-wi-fi-hotspot"></span>
== How to use WI-FI hotspot ==
<ol style="list-style-type: decimal;">
<li><p>Ensure that the Ethernet port is connected to a network cable and can access the Internet properly</p></li>
<li><p>Then select '''Settings'''</p>
<p>[[File:Orange_Pi_4A-image254.png|574x250px]]</p></li>
<li><p>Then select '''Network & Internet'''</p>
<p>[[File:Orange_Pi_4A-image268.png|574x143px]]</p></li>
<li><p>Then select '''Hotspot & tethering'''</p>
<p>[[File:Orange_Pi_4A-image269.png|575x250px]]</p></li>
<li><p>Then select '''Wi-Fi hotspot'''</p>
<p>[[File:Orange_Pi_4A-image270.png|575x164px]]</p></li>
<li><p>Then open the '''Wi-Fi Hotspot''', you can also see the name and password of the generated Hotspot in the following figure, remember them, and need to use them when connecting to the hotspot (if you need to change the name and password of the Hotspot, you need to close the '''Wi-Fi Hotspot''' first, and then modify it)</p>
<p>[[File:Orange_Pi_4A-image271.png|575x245px]]</p></li>
<li><p>At this time, you can take out your mobile phone, if everything is normal, you can find the WIFI Hotspot with the same name ('''AndroidAP_4174''') shown below '''Hotspot name''' in the above picture in the WI-FI search list. Then you can tap AndroidAP_4174 to connect to the Hotspot, the password can be seen under '''Hotspot password''' in the image above</p>
<p>[[File:Orange_Pi_4A-image272.png|233x172px]]</p></li>
<li><p>After successful connection, it will be displayed as shown in the following figure (different mobile phone interfaces will be different, the specific interface is subject to the display of your mobile phone). At this time, you can open a web page on the phone to see whether the Internet can be accessed. If the web page can be opened normally, it indicates that the '''WI-FI Hotspot''' of the development board can be used normally</p>
<p>[[File:Orange_Pi_4A-image273.png|234x113px]]</p></li></ol>
<span id="method-to-view-ethernet-port-ip-address"></span>
== Method to view Ethernet port IP address ==
<ol style="list-style-type: decimal;">
<li><p>First, ensure that the gigabit network port of the development board is connected to a router or switch</p></li>
<li><p>First open '''Settings'''</p>
<p>[[File:Orange_Pi_4A-image254.png|574x250px]]</p></li>
<li><p>Then select '''Network & Internet'''</p>
<p>[[File:Orange_Pi_4A-image261.png|575x159px]]</p></li>
<li><p>Then select '''Ethernet'''</p>
<p>[[File:Orange_Pi_4A-image274.png|575x128px]]</p></li>
<li><p>Then select '''Ethernet settings'''</p>
<p>[[File:Orange_Pi_4A-image275.png|575x123px]]</p></li>
<li><p>Then you can see the IP address information of the wired network port of the development board</p>
<p>[[File:Orange_Pi_4A-image276.png|576x245px]]</p></li></ol>
<span id="bluetooth-connection-method"></span>
== Bluetooth connection method ==
<ol style="list-style-type: decimal;">
<li><p>First select '''Settings'''</p>
<p>[[File:Orange_Pi_4A-image254.png|574x250px]]</p></li>
<li><p>Then select '''Connected devices'''</p></li></ol>
[[File:Orange_Pi_4A-image277.png|357x161px]]
<ol start="3" style="list-style-type: decimal;">
<li><p>Then select '''Pair new device''' to start scanning the surrounding Bluetooth devices</p>
<p>[[File:Orange_Pi_4A-image278.png|355x165px]]</p></li>
<li><p>The searched Bluetooth device will be displayed under '''Available devices'''</p>
<p>[[File:Orange_Pi_4A-image279.png|350x296px]]</p></li>
<li><p>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</p>
<p>[[File:Orange_Pi_4A-image280.png|358x145px]]</p></li>
<li><p>The test here is the configuration process of the development board and Bluetooth of '''Android phones'''. At this time, the confirmation interface will pop up on the phone, and the pairing process will start after clicking the pairing button on the phone</p></li>
<li><p>After pairing, open '''Paired devices''' and you will see the paired Bluetooth devices</p>
<p>[[File:Orange_Pi_4A-image281.png|284x183px]]</p></li>
<li><p>At this time, you can send a picture to the development board using the Bluetooth of your phone. After sending, you can see the following prompt in the Android system of the development board, and then click '''<span class="mark">Incoming file</span>'''</p>
<p>[[File:Orange_Pi_4A-image282.png|574x163px]]</p></li>
<li><p>Then click '''Accept''' in the pop-up window to start receiving pictures sent by the phone</p>
<p>[[File:Orange_Pi_4A-image283.png|575x217px]]</p></li>
<li><p>The picture received by the Bluetooth of the Android system can be viewed by opening the '''Download''' directory of the file manager</p>
<p>[[File:Orange_Pi_4A-image284.png|575x238px]]</p></li></ol>
<span id="inch-mipi-screen-usage"></span>
== 10.1 inch MIPI screen usage ==
Make sure that the Android image you use is one of the following versions:
OrangePi4A_T527_Android13_lcd_v1.x.x.img
<ol style="list-style-type: decimal;">
<li><p>The screen needs to be assembled first, please refer to [[#how-to-use-the-10.1-inch-mipi-lcd-screen|the assembly method of 10.1 inch MIPI screen]]</p></li>
<li><p>The position of the interface of the mipi lcd screen on the development board is shown as follows:</p>
<p>[[File:Orange_Pi_4A-image196.png|230x132px]]</p></li>
<li><p>Connect the assembled screen to the LCD interface of the development board, pay attention to unplug the HDMI interface, connect the Type-C power supply to the board, and power on, after the system starts, you can see the screen displayed as follows ('''default is portrait screen''')</p></li></ol>
[[File:Orange_Pi_4A-image285.png|208x291px]]
<span id="how-to-use-edp-screen"></span>
== How to use eDP screen ==
'''eDP screens are touch-free.'''
Make sure that the Android image you use is one of the following versions:
OrangePi4A_T527_Android13_v1.x.x.img
<ol start="3" style="list-style-type: decimal;">
<li><p>Currently only one 15.6-inch eDP screen is available, including the following accessories:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>0.5 Spaced 30-pin single-head coaxial cables</p>
<div class="figure">
[[File:Orange_Pi_4A-image205.jpeg|200x197px|0006 (1)]]
</div></li>
<li><p>15.6-inch eDP display, resolution is 1920x1080.</p>
<div class="figure">
[[File:Orange_Pi_4A-image206.jpeg|212x368px|0006 (2)]]
</div></li></ol>
</li>
<li><p>Connect the FPC end of the 30pin single-head codirectional cable to the eDP interface of the development board, and connect the other end to the eDP interface of the screen</p>
<p>[[File:Orange_Pi_4A-image207.png|199x91px]]</p></li>
<li><p>Then connect the Type-C power supply to the board and power it on. After the system is started, you can see the screen displayed as shown in the following figure</p>
<p>[[File:Orange_Pi_4A-image286.png|380x227px]]</p></li></ol>
<span id="how-to-use-usb-camera"></span>
== How to use USB camera ==
<ol style="list-style-type: decimal;">
<li><p>First, insert a USB (UVC protocol) camera into the USB interface of the development board</p></li>
<li><p>If the USB camera is properly identified, a video device node is generated under <span class="mark">/dev</span></p>
<p>console:/ # '''ls /dev/video0'''</p>
<p>/dev/video0</p></li>
<li><p>Then ensure that the ADB connection between the Ubuntu PC and the development board is normal. Please refer to the instructions in the section on [[#usage-of-adb|'''adb Usage''']]</p></li>
<li><p>Download the USB camera test APP from the '''<span class="mark">official tool</span>''' on the development board data download page</p>
<p>[[File:Orange_Pi_4A-image287.png|576x503px]]</p>
<p>[[File:Orange_Pi_4A-image288.png|575x145px]]</p></li>
<li><p>Then use adb command to install the USB camera test APP into the Android system, of course, you can also use the U disk copy for installation</p>
<p>test@test:~$ '''adb install usbcamera.apk'''</p></li>
<li><p>After installation, you can see the startup icon of USB camera on the Android APP interface</p>
<p>[[File:Orange_Pi_4A-image289.png|575x318px]]</p></li>
<li><p>Then double-click on the USB camera APP and you can see the output video of the USB camera</p></li></ol>
<span id="android-system-root-description"></span>
== Android system ROOT Description ==
'''<span class="mark">The Android system released by Orange Pi has been ROOT, you can use the following method to test.</span>'''
<ol style="list-style-type: decimal;">
<li><p>Download '''rootcheck.apk''' from the '''<span class="mark">official tool</span>''' on the development board data download page</p>
<p>[[File:Orange_Pi_4A-image290.png|575x518px]]</p>
<p>[[File:Orange_Pi_4A-image291.png|575x124px]]</p></li>
<li><p>Then ensure that the ADB connection between the Ubuntu PC and the development board is normal. Please refer to the instructions in the section on '''adb Usage'''</p></li>
<li><p>Then use adb command to install rootcheck.apk into the Android system, of course, you can also use the U disk copy for installation</p>
<p>test@test:~$ '''adb install rootcheck.apk'''</p></li>
<li><p>After installation, you can see the startup icon of the ROOT test tool on the Android APP interface</p>
<p>[[File:Orange_Pi_4A-image292.png|575x313px]]</p></li>
<li><p>After opening the '''<span class="mark">ROOT test tool</span>''' for the first time, the display interface is as shown in the following figure</p>
<p>[[File:Orange_Pi_4A-image293.png|576x126px]]</p></li>
<li><p>Then you can click '''CHECK NOW''' to start the ROOT status check of the Android system. After the check, the display is as follows, you can see that the Android system has obtained the ROOT permission</p>
<p>[[File:Orange_Pi_4A-image294.png|575x130px]]</p></li></ol>
<span id="pin-interface-gpio-uart-spi-test"></span>
== 40 pin interface GPIO, UART, SPI test ==
<span id="pin-gpio-port-test-method"></span>
=== 40 pin GPIO port test method ===
<ol style="list-style-type: decimal;">
<li><p>First open the wiringOP APP on your desktop</p>
<p>[[File:Orange_Pi_4A-image295.png|576x290px]]</p></li>
<li><p>Then click '''GPIO_TEST''' button to open the GPIO test interface</p>
<p>[[File:Orange_Pi_4A-image296.png|413x77px]]</p></li>
<li><p>The GPIO test interface is shown in the figure below. The two rows of '''CheckBox''' buttons on the left are one-to-one corresponding to the 40-pin pin. When '''CheckBox''' button is checked, the corresponding GPIO pin will be set to '''OUT'''mode and the pin level will be set to high. When unchecked, the GPIO pin level is set to low; When you click the '''GPIO READALL''' button on the right, you can get the wPi number, GPIO mode, and pin parity information. When the '''BLINK ALL GPIO''' button is clicked, all pins continuously switch between high and low levels</p>
<p>[[File:Orange_Pi_4A-image297.png|575x293px]]</p></li>
<li><p>Then click the '''GPIO READALL''' button, and the output information is as shown below:</p>
<p>[[File:Orange_Pi_4A-image298.png|575x291px]]</p></li>
<li><p>There are a total of 28 GPIO ports available in the 40 pin development board. Taking pin 7- corresponding to GPIO PB4- corresponding to wPi serial number 2- as an example, we will demonstrate how to set the high and low levels of GPIO ports. Firstly, click on the '''CheckBox''' button corresponding to pin 7. When the button is selected, pin 7 will be set to 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 that the high level has been successfully set</p>
<p>[[File:Orange_Pi_4A-image299.png|575x301px]]</p></li>
<li><p>Then click the '''GPIO READALL''' button, and you can see that the current mode of pin 7 is '''OUT''' and the pin level is high</p>
<p>[[File:Orange_Pi_4A-image300.png|575x288px]]</p></li>
<li><p>Click the '''CheckBox''' button in the following image again to uncheck the status. Pin 7 will be set to a low level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is '''0v''', it means that the low level has been successfully set</p>
<p>[[File:Orange_Pi_4A-image301.png|576x287px]]</p></li>
<li><p>Then click the '''GPIO READALL''' button, and you can see that the current mode of pin 7 is OUT and the pin level is low</p>
<p>[[File:Orange_Pi_4A-image302.png|575x290px]]</p></li></ol>
<span id="pin-uart-testing-method"></span>
=== 40 pin UART testing method ===
<ol style="list-style-type: decimal;">
<li><p>By default, '''UART2''' and '''UART7''' are enabled in Android, corresponding to device nodes'''/dev/ttyAS2''' and'''/dev/ttyAS7'''</p>
<p>t527-demo:/ $ '''ls /dev/ttyAS*'''</p>
<p>ttyAS0 ttyAS1 ttyAS2 ttyAS7</p></li>
<li><p>First, open the WiringoP app on the desktop</p>
<p>[[File:Orange_Pi_4A-image295.png|576x290px]]</p></li>
<li><p>Then click the '''UART_TEST''' button to open the UART test interface</p>
<p>[[File:Orange_Pi_4A-image303.png|505x94px]]</p></li>
<li><p>The serial port test interface of WiringOP is shown in the following figure</p></li></ol>
[[File:Orange_Pi_4A-image304.png|510x130px]]
<ol start="5" style="list-style-type: decimal;">
<li><p>Taking testing UART2 as an example, select the'''/dev/ttyAS2''' node in the selection box</p>
<p>[[File:Orange_Pi_4A-image305.png|507x133px]]</p></li>
<li><p>Enter the desired baud rate in the editing box, then click the '''OPEN''' button to open the '''/dev/ttyAS2''' node. After successful opening, the '''OPEN''' button becomes unselectable, and the '''CLOSE''' and '''SEND''' buttons become selectable</p></li></ol>
[[File:Orange_Pi_4A-image306.png|505x132px]]
<ol start="7" style="list-style-type: decimal;">
<li>Then use DuPont wire to short-circuit the rx and tx pins of UART 2</li></ol>
{| class="wikitable"
|-
|
| style="text-align: left;"| uart2
|-
| tx pin
| style="text-align: left;"| Corresponding to pin 11 of pin 40
|-
| rx pin
| style="text-align: left;"| Corresponding to pin 13 of pin 40
|}
<ol start="8" style="list-style-type: decimal;">
<li>Then you can enter a character in the send edit box below and click the '''SEND''' button to start sending</li></ol>
[[File:Orange_Pi_4A-image307.png|511x138px]]
<ol start="9" style="list-style-type: decimal;">
<li>If everything is normal, the received string will be displayed in the receiving box</li></ol>
[[File:Orange_Pi_4A-image308.png|516x136px]]
<span id="pin-spi-testing-method"></span>
=== 40 pin SPI testing method ===
<ol style="list-style-type: decimal;">
<li><p>The SPI that can be used in 40 pins is SPI1, and the corresponding device node is'''/dev/spidev1.0'''</p>
<p>[[File:Orange_Pi_4A-image295.png|576x290px]]</p></li>
<li><p>Here is a demonstration of testing the SPI1 interface using the '''w25q64''' module. First, connect the w25q64 module to the SPI1 interface</p></li></ol>
'''If there is no w25q64 module, it doesn't matter, because there is a SPIFlash connected to SPI0 on the development board, and the SPI0 configuration is also enabled by default in Android, so we can directly use the onboard SPIFlash for testing.'''
<ol start="3" style="list-style-type: decimal;">
<li><p>Then open the WiringoP app on the desktop</p></li>
<li><p>Then click the '''SPI_TEST''' button to open the SPI testing interface</p>
<p>[[File:Orange_Pi_4A-image309.png|518x96px]]</p></li>
<li><p>Then select the device node of SPI in the upper left corner. If testing the onboard SPIFlash directly, keep the default'''/dev/spidev0.0'''. If the '''w25q64''' module is connected to the 40 pin SPI1, select'''/dev/spidev1.0'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image310.jpeg|296x136px|微信图片_20241119194920]]
</div></li>
<li><p>Then click the '''OPEN''' button to initialize SPI</p></li></ol>
[[File:Orange_Pi_4A-image311.png|295x168px]]
<ol start="7" style="list-style-type: decimal;">
<li><p>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 clicking the '''TRANSFER''' button</p>
<p>[[File:Orange_Pi_4A-image312.png|294x169px]]</p></li>
<li><p>Finally, the APP will display the ID information of the read onboard SPI Flash</p></li></ol>
[[File:Orange_Pi_4A-image313.png|296x193px]]
<ol start="9" style="list-style-type: decimal;">
<li><p>If reading the w25q64 module connected to the 40 pin SPI1, the read ID information is shown in the following figure</p>
<p>[[File:Orange_Pi_4A-image314.png|302x201px]]</p></li>
<li><p>The MANUFACTURER ID of the w25q64 module is EFh, and the Device ID is 4017h, which corresponds to the values read above (h represents hexadecimal)</p>
<p>[[File:Orange_Pi_4A-image315.png|336x113px]]</p></li></ol>
<span id="pin-i2c-testing-method"></span>
=== 40 pin I2C testing method ===
<ol style="list-style-type: decimal;">
<li><p>In Android, i2c4 and i2c5 in pin 40 are enabled by default, corresponding to device nodes'''/dev/i2c-4''' and'''/dev/i2c-5''', respectively</p>
<p>console:/ # '''ls''' '''/dev/i2c-4 /dev/i2c-5'''</p>
<p>/dev/i2c-4 /dev/i2c-5</p></li>
<li><p>First, open the WiringoP app on the desktop</p>
<p>[[File:Orange_Pi_4A-image295.png|576x290px]]</p></li>
<li><p>Then click the '''I2C_TEST''' button to open the testing interface of i2c</p>
<p>[[File:Orange_Pi_4A-image316.png|506x110px]]</p></li>
<li><p>The i2c testing interface of WiringOP is shown in the following figure</p>
<p>[[File:Orange_Pi_4A-image317.png|353x159px]]</p></li>
<li><p>Taking testing i2C4 as an example, select the'''<span class="mark">/dev/i2c-4 node</span>''' in the selection box</p></li></ol>
[[File:Orange_Pi_4A-image318.png|273x195px]]
<ol start="6" style="list-style-type: decimal;">
<li><p>Then connect an I2C device to the 40 pin I2C4 pin, using the DS1307 RTC module as an example</p>
<p>[[File:Orange_Pi_4A-image161.png|121x103px]]</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''Pin of RTC module'''
| style="text-align: left;"| '''Development board 40 pin corresponding pins'''
|-
| style="text-align: left;"| '''5V'''
| style="text-align: left;"| '''Pin 2'''
|-
| style="text-align: left;"| '''GND'''
| style="text-align: left;"| '''Pin 6'''
|-
| style="text-align: left;"| '''SDA'''
| style="text-align: left;"| '''Pin 3'''
|-
| style="text-align: left;"| '''SCL'''
| style="text-align: left;"| '''Pin 5'''
|}
<ol start="7" style="list-style-type: decimal;">
<li><p>The i2c address of the ds1307 RTC module is 0x68. After connecting the cable, we can use the '''i2cdetect -y -r 4''' command in the serial port command line to check if we can scan the i2c address of the ds1307 RTC module. As shown in the figure below, if the address 0x68 can be seen, it indicates that the wiring of the ds1307 RTC module is correct.</p>
<p>console:/ # '''i2cdetect -y 4'''</p>
<div class="figure">
[[File:Orange_Pi_4A-image319.png|467x199px|D16403AF-C244-45ed-81FE-308A42F1E840]]
</div></li>
<li><p>Then set the address of i2c to 0x68 in WirgOP, and click the '''OPEN''' button to open i2c4</p>
<p>[[File:Orange_Pi_4A-image320.png|360x194px]]</p></li>
<li><p>After clicking the '''OPEN''' button to open i2C4, the display is as follows:</p>
<p>[[File:Orange_Pi_4A-image321.png|366x216px]]</p></li>
<li><p>Then we will test writing a value to the register of the RTC module, such as writing 0x55 to address 0x1c</p>
<ol style="list-style-type: lower-alpha;">
<li><p>We first set the address of the register that needs to be written to 0x1c</p>
<p>[[File:Orange_Pi_4A-image322.png|366x217px]]</p></li>
<li><p>Then set the value to be written as 0x55</p>
<p>[[File:Orange_Pi_4A-image323.png|316x191px]]</p></li>
<li><p>Then click the '''WRITE BYTE''' button to perform the write action</p>
<p>[[File:Orange_Pi_4A-image324.png|322x193px]]</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-write test has passed</p>
<p>[[File:Orange_Pi_4A-image325.png|326x196px]]</p></li></ol>
<span id="appendix"></span>
= Appendix =
<span id="user-manual-update-history"></span>
== User Manual Update History ==
{| class="wikitable"
|-
| style="text-align: center;"| '''edition'''
| style="text-align: center;"| '''Date'''
| style="text-align: center;"| '''Update Explanation'''
|-
| style="text-align: center;"| v1.0
| style="text-align: center;"| 2024-11-14
| style="text-align: center;"| Initial version
|}
<span id="image-update-history"></span>
== Image update history ==
{| class="wikitable"
|-
| style="text-align: center;"| * *Date**
| style="text-align: center;"| '''Update Explanation'''
|-
| style="text-align: center;"| 202 4-11-14
| style="text-align: center;"| OrangePi4A_T527_Android13_v1.0.0.tar.gz
OrangePi4A_T527_Android13_lcd_v1.0.0.tar.gz
Orangepi4a_1.0.0_ubuntu_jammy_server_linux5.15.147.7z
Orangepi4a_1.0.0_debian_bookworm_server_linux5.15.147.7z
Or angepi4a_1.0.0_ubuntu_jammy_desktop_gnome_linux5.15.147.7z
Orang epi4a_1.0.0_debian_bookworm_desktop_gnome_linux5.15.147.7z
*Initial version
|}