8,367
edits
Changes
Created page with "'''Orange Pi RV2''' '''User Manual''' 558x405px <span id="basic-characteristics-of-orange-pi-rv2"></span> = Basic cha..."
'''Orange Pi RV2'''
'''User Manual'''
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image2.png|558x405px]]
<span id="basic-characteristics-of-orange-pi-rv2"></span>
= Basic characteristics of Orange Pi RV2 =
<span id="what-is-orange-pi-rv2"></span>
== What is Orange Pi RV2 ==
OrangePi RV2 is a cost-effective RISC-V development board that adopts a CPU integrated AI technology architecture and is equipped with an RISC-V eight core processor. It provides universal computing power with 2TOPS CPU integration and supports rapid deployment of AI model algorithms. Equipped with 2GB/4GB/8GB LPDDR4X, supporting eMMC modules (16GB/32GB/64GB/128GB optional), Wi Fi 5.0+BT 5.0, and BLE support.
OrangePi RV2 has a wide range of interfaces, including HDMI output, GPIO interface USB2.0, USB3.0, Gigabit Ethernet port, 3.5mm headphone jack, equipped with two M.2 M-Key slots (PCIe 2.0 2-Lane), supports installation of NVMe solid-state drives.
OrangePi RV2 is exquisite, small and powerful, and can be widely used in NAS, commercial electronic products, smart robots, smart home, industrial control, edge computing, etc. Supports the Ubuntu 24.04 operating system.
<span id="purpose-of-orange-pi-rv2"></span>
== Purpose of Orange Pi RV2 ==
We can use it to achieve:
* A Linux desktop computer.
* A Linux network server.
'''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="hardware-features-of-orange-pi-rv2"></span>
== Hardware Features of Orange Pi RV2 ==
{| class="wikitable"
|-
| style="text-align: center;"| '''Introduction to Hardware Features'''
| style="text-align: center;"|
|-
| style="text-align: center;"| Processor
| style="text-align: center;"| • 8 core 64 bit RISC-V processor
• 2 TOPS AI computing power
|-
| style="text-align: center;"| Video
| style="text-align: center;"| • 1 * HDMI 1.4, maximum support 1080 @ 60Hz
• 1 * MIPI DSI 4Lane
|-
| style="text-align: center;"| Memory
| style="text-align: center;"| 2GB/4GB/8GB(LPDDR4X)
|-
| style="text-align: center;"| Camera
| style="text-align: center;"| • 2 * MIPI CSI 4Lane
|-
| style="text-align: center;"| PMU
| style="text-align: center;"| P1
|-
| style="text-align: center;"| Onboard storage
| style="text-align: center;"| • eMMC socket, capable of connecting external eMMC modules
• 16MB QSPI Nor FLASH
• MicroSD (TF) Card Slot
• 2 * PCIe2.0 M.2 M-KEY (SSD) Slot
|-
| style="text-align: center;"| Ethernet
| style="text-align: center;"| 2 * Gigabit Ethernet port(YT8531C )
|-
| style="text-align: center;"| WIFI+BT
| style="text-align: center;"| • Onboard Wi Fi 5+BT 5.0/BLE module: AP6256
• Wi-Fi interface:SDIO3.0
• BT interface:UART/PCM
|-
| style="text-align: center;"| Audio
| style="text-align: center;"| • 3.5mm headphone jack audio input/output
• 1 * HDMI output
|-
| style="text-align: center;"| PCIe M.2 M-KEY
| style="text-align: center;"| • 2 * PCIe 2.0 x 2 lanes, used for connecting NVMe SSD solid state drives
|-
| style="text-align: center;"| USB interface
| style="text-align: center;"| • 1 * USB 2.0 supports Device or HOST mode
• 3 * USB3.0 HOST
|-
| style="text-align: center;"| 26pin extension pin
| style="text-align: center;"| Used for expanding UART, PWM, I2C, SPI, CAN, and GPIO interfaces
|-
| style="text-align: center;"| Debug UART
| style="text-align: center;"| 3 PIN debugging serial port
|-
| style="text-align: center;"| LED lamp
| style="text-align: center;"| 1 * Power light, 1 * Status light
|-
| style="text-align: center;"| Key
| style="text-align: center;"| 1 * BOOT button, 1 * power on/off button
|-
| style="text-align: center;"| Power supply
| style="text-align: center;"| Type-C interface power supply 5V/5A
|-
| style="text-align: center;"| Supported operating systems
| style="text-align: center;"| Operating systems such as Ubuntu 24.04
|-
| style="text-align: center;"| '''Introduction to appearance specifications'''
| style="text-align: center;"|
|-
| style="text-align: center;"| Product size
| style="text-align: center;"| 89mm*56mm
|-
| style="text-align: center;"| Weight
| style="text-align: center;"| 60g
|-
| style="text-align: center;"| [[File:convert%20ed\OrangePi_RV2_X%201_User%20Manual_v1.%200.1/media/image1.%20png]]{width=“0.255 55555555555554in” h eight=“0.27638888 88888889in”}range Pi™ is a registered trademark of Shenzhen Xunlong Software Co., Ltd.
| style="text-align: center;"|
|}
<span id="top-and-bottom-views-of-orange-pi-rv2"></span>
== Top and Bottom Views of Orange Pi RV2 ==
'''top view:'''
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image3.png|428x306px]]
'''Bottom level view:'''
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image4.png|431x296px]]
<span id="interface-details-diagram-of-orange-pi-rv2"></span>
== Interface details diagram of Orange Pi RV2 ==
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image5.png|405x758px]]
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image6.png|576x146px]]
'''The diameter of the four positioning holes is 2.7mm.'''
<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, a high-speed flash card with a minimum capacity of 16GB (recommended 32GB or above) and '''class10''' or above.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image7.png|124x96px]]</p></li>
<li><p>TF card reader, used to burn images onto TF cards.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image8.png|139x106px]]</p></li>
<li><p>HDMI interface display.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image9.png|313x205px]]</p></li>
<li><p>HDMI to HDMI connection cable, used to connect the development board to an HDMI monitor or TV for display.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_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 universal OPi5Plus/OPi5/OPi5Pro/OPi5Max/OPi5Ultra/OPiRV2).</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image11.jpeg|223x203px|IMG_7546]]
</div></li>
<li><p>For the Orange Pi RV2 power adapter, it is recommended to use a 5V/5A Type-C power supply.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_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>A USB interface mouse and keyboard, as long as it is a standard USB interface mouse and keyboard, can be used to control the Orange Pi development board.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image13.png|224x191px]]</p></li>
<li><p>USB camera.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image14.png|255x148px]]</p></li>
<li><p>A 5V cooling fan. As shown in the figure below, the development board is equipped with an interface for connecting a cooling fan, with the interface specification being a '''2pin 1.25mm''' pitch.</p>
<p>'''The fan on the development board can be adjusted for speed and on/off through PWM.'''</p></li>
<li><p>100Mbps or 1G Ethernet cable, used to connect the development board to the Internet.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image15.png|143x112px]]</p></li>
<li><p>USB 2.0 male to male data cable, used for burning images and using ADB functions.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image16.png|158x155px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]
</div></li>
<li><p>OV13850 camera with 13 million MIPI interface.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image17.png|197x111px]]</p></li>
<li><p>OV13855 camera with 13 million MIPI interface.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image18.png|184x109px]]</p></li>
<li><p>When using the serial port debugging function, a '''3.3V''' USB to TTL module and DuPont cable are required to connect the development board and computer.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image19.png|217x89px|G7U7JZX(V`L$`A6864]38$P]] [[File:OrangePi_RV2_X1_User Manual_v1.0.1_image20.png|305x110px]]</p></li>
<li><p>A personal 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 Linux source code
|-
| style="text-align: left;"| 2
| style="text-align: left;"| Windows PC
| style="text-align: left;"| Used for burning 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 material is:
'''http://www.orangepi.cn/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-RV2.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.online/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-RV2.html'''</p></li>
<li><p>The information mainly includes</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Linux source code''':Save on Github.</p></li>
<li><p>'''User manual and schematic diagram:'''Save on Baidu Cloud Drive and Google Cloud Drive.</p></li>
<li><p>'''Official tools:'''This mainly includes the software required during the use of the development board.</p></li>
<li><p>'''Ubuntu image''':Save on Baidu Cloud Drive and Google Cloud Drive.</p></li>
<li><p>'''OpenWRT image''':Save on Baidu Cloud Drive and Google Cloud Drive.</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, Ubuntu, OpenWRT, or OPi OS Arch downloaded from th'''e [http://www.orangepi.online/html/serviceAndSupport/index.html '''Orange Pi data download page'''.]
<span id="method-of-burning-linux-images-using-balenaetcher"></span>
=== '''Method of burning Linux images using BalenaEtcher''' ===
# Firstly, prepare a 16GB or larger TF card with a transfer speed of '''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 compressed file of the Linux operating system image that you want to burn from the [http://www.orangepi.online/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-RV2.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 2GB in size.
# Then download the Linux image burning software - '''balenaEtcher''', from the following download link:
[https://www.balena.io/etcher/ '''https://www.balena.io/etcher/''']
<ol start="5" style="list-style-type: decimal;">
<li>After entering the balenaEtcher download page, clicking the green download button will jump to the software download location.</li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image21.png|359x172px]]
<ol start="6" style="list-style-type: decimal;">
<li><p>Then you can choose to download the Portable version of balenaEtcher software, which does not require installation and can be used by double clicking.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image22.png|382x141px]]</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:OrangePi_RV2_X1_User Manual_v1.0.1_image23.png|369x233px]]</p></li></ol>
'''When opening balenaEtcher, if prompted with the following error:'''
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image24.png|209x164px]]
'''Please select balenaEtcher and right-click, then choose to run as administrator.择balenaEtcher'''
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image25.png|300x104px|图形用户界面, 文本, 应用程序 描述已自动生成]]
</div>
<ol start="8" style="list-style-type: decimal;">
<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>Firstly, select the path of the Linux image file to be burned.</p></li>
<li><p>Then select the drive letter of the TF card.。</p></li>
<li><p>Finally, clicking Flash will start burning the Linux image onto the TF card.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image26.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:OrangePi_RV2_X1_User Manual_v1.0.1_image27.png|428x268px]]</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:OrangePi_RV2_X1_User Manual_v1.0.1_image28.png|427x267px]]</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:OrangePi_RV2_X1_User Manual_v1.0.1_image29.png|523x324px|04]]
</div></li></ol>
<span id="method-for-burning-linux-images-to-tf-cards-based-on-ubuntu-pc于ubuntu-pc"></span>
== Method for burning Linux images to TF cards based on Ubuntu PC于Ubuntu PC ==
'''Note that the Linux image referred to here specifically refers to Linux distribution images such as Debian, Ubuntu, OpenWRT, or OPi OS Arch downloaded from the [http://www.orangepi.online/html/serviceAndSupport/index.html Orange Pi data download page]. Ubuntu PC refers to a personal computer with the Ubuntu system installed.'''
# Firstly, prepare a 16GB or larger TF card with a transfer speed of '''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="4" style="list-style-type: decimal;">
<li>After entering the balenaEtcher download page, clicking the green download button will jump to the software download location.</li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image21.png|434x208px]]
<ol start="5" style="list-style-type: decimal;">
<li><p>Then choose to download the Linux version of the software.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image30.png|430x163px]]</p></li>
<li><p>Download the compressed file of the Linux operating system image that you want to burn from the [http://www.orangepi.online/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 2GB in size.</p>
<p>The decompression command for the compressed file ending in 7z is as follows:</p>
<p>test@test:~$ '''7z x orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.7z'''</p>
<p>test@test:~$ '''ls orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.*'''</p>
<p>orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.7z orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.sha #Verification and file</p>
<p>orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.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 there is a problem with the downloaded image. Please try downloading it again.</p>
<p>test@test:~$ '''sha256sum -c *.sha'''</p>
<p>orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.img: OK</p></li>
<li><p>Then double-click '''balenaEtcher-1.5.109-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:OrangePi_RV2_X1_User Manual_v1.0.1_image31.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>Firstly, select the path of the Linux image file to be burned.</p></li>
<li><p>Then select the drive letter of the TF card.</p></li>
<li><p>Finally, clicking Flash will start burning the Linux image onto the TF card.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image26.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:OrangePi_RV2_X1_User Manual_v1.0.1_image32.png|429x184px]]</p></li></ol>
<!-- -->
<ol start="12" style="list-style-type: decimal;">
<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:OrangePi_RV2_X1_User Manual_v1.0.1_image33.png|436x190px]]</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:OrangePi_RV2_X1_User Manual_v1.0.1_image34.png|435x257px]]</p></li></ol>
<span id="method-for-burning-linux-images-to-emmc"></span>
== Method for burning Linux images to eMMC ==
'''Note that the development board can be launched through TF card or eMMC, with TF card having higher priority than eMMC. That is to say, if the development board is inserted with a TF card and there is a system in the TF card, the system in the TF card will be started by default instead of the system in eMMC.'''
<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:OrangePi_RV2_X1_User Manual_v1.0.1_image35.png|115x84px]] [[File:OrangePi_RV2_X1_User Manual_v1.0.1_image36.png|120x87px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image37.png|272x187px]]</p></li>
<li><p>Burning a Linux image to eMMC requires the use of a TF card, so the first step is to burn the Linux image onto the TF card, and then use the TF card to start the development board and enter the Linux system. The method of burning a Linux image to a TF card can be found in the two sections: [[#method-of-burning-linux-image-to-tf-card-based-on-windows-pc|'''the method of burning a Linux image to a TF card based on Windows PC''']] and [[#method-for-burning-linux-images-to-tf-cards-based-on-ubuntu-pc于ubuntu-pc|'''the method of burning a Linux image to a TF card based on Ubuntu PC''']].</p></li>
<li><p>Then run the '''nand-sata-install''' script, '''remember to add sudo privileges'''</p>
<p>orangepi@orangepi:~$ '''sudo nand-sata-install'''</p></li>
<li><p>Then select '''2 Boot from eMMC - sytem on eMMC'''</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image38.png|397x206px|选区_039]]
</div></li>
<li><p>Then a warning will pop up, and the script will erase all data on eMMC. Select '''<Yes>''' to continue</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image39.png|396x231px|选区_040]]
</div></li>
<li><p>Then it will prompt to select the type of file system, supporting five file systems: ext2/3/4, f2fs, and btrfs</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image40.png|395x152px|选区_041]][[File:OrangePi_RV2_X1_User Manual_v1.0.1_image41.png|400x155px|选区_042]]</p></li>
<li><p>Then it will start formatting eMMC, and after formatting eMMC, it will start burning Linux images into eMMC</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image42.png|401x127px|选区_043]]
</div></li>
<li><p>After burning, the following options will be prompted, you can choose '''<Power off>''' to shut down directly</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image43.png|409x100px|选区_044]]
</div></li>
<li><p>Then unplug the TF card and power it on again, and the linux system in eMMC will start up</p></li></ol>
<span id="method-for-burning-linux-images-to-spiflashnvme-ssd"></span>
== Method for burning Linux images to SPIFlash+NVMe SSD ==
<ol style="list-style-type: decimal;">
<li><p>Firstly, it is necessary to prepare an NVMe SSD solid state drive with a PCIe interface specification of PCIe2.0x2 for the M.2 slot on the development board.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image44.png|306x89px]]</p></li>
<li><p>Then insert the NVMe SSD into the M.2 PCIe interface of the development board (note that currently only the M.2 slot on the back supports booting) and secure it in place.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image45.png|268x190px]]</p></li>
<li><p>The position of SPI Flash on the development board is shown in the following figure, and no other settings are required before starting to burn.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image46.png|252x174px]]</p></li>
<li><p>Burning the image to SPIFlash+NVMe SSD requires the use of a TF card, so the first step is to burn the Linux image onto the TF card, and then use the TF card to boot the development board into the Linux system. The method of burning a Linux image to a TF card can be found in the two sections: [[#method-of-burning-linux-image-to-tf-card-based-on-windows-pc|'''the method of burning a Linux image to a TF card based on Windows PC''']] and [[#method-for-burning-linux-images-to-tf-cards-based-on-ubuntu-pc于ubuntu-pc|'''the method of burning a Linux image to a TF card based on Ubuntu PC''']].</p></li>
<li><p>After starting the Linux system with a TF card, you can burn the image to SPI Flash+NVMe SSD.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, create a partition for NVMe SSD.</p>
<p>orangepi@orangepi:~$ '''sudo parted /dev/nvme0n1 mklabel gpt mkpart primary \'''</p>
<p>'''ext4 8192s 100%'''</p></li>
<li><p>Then run '''nand-sata-install''', '''remember to add sudo privileges for regular users'''.</p>
<p>orangepi@orangepi:~$ '''sudo nand-sata-install'''</p></li>
<li><p>Then select '''4 Boot from SPI - system on SATA, USB or NVMe'''。</p></li></ol>
</li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image47.png|361x164px]]
<ol start="4" style="list-style-type: lower-alpha;">
<li>Then press enter to confirm</li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image48.png|354x119px|IMG_256]]
</div>
<ol start="5" style="list-style-type: lower-alpha;">
<li>Then select '''<Yes>'''。</li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image49.png|357x163px]]
<ol start="6" style="list-style-type: lower-alpha;">
<li>Then it will prompt to select the type of file system.</li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image50.png|359x119px|IMG_256]]
</div>
<ol start="7" style="list-style-type: lower-alpha;">
<li><p>Then it will start formatting the NVMe SSD, and after formatting is complete, it will start burning the system into the NVMe SSD.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image51.png|357x102px|IMG_256]]
</div></li>
<li><p>Then please be patient and wait for the burning to complete. After burning, you will be prompted whether to burn the bootloader to SPI Flash, and then select '''<Yes>'''. (If you do not want to replace the factory bootloader, you can also choose '''No'''.)</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image52.png|359x101px|IMG_256]]
</div>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image53.png|356x161px]]</p></li>
<li><p>After burning, the following options will be prompted, you can choose '''<Power off>'''to shut down directly</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image54.png|351x77px|IMG_256]]
</div></li></ol>
<span id="method-for-burning-linux-images-to-spiflashusb-storage-devices"></span>
== Method for burning Linux images to SPIFlash+USB storage devices ==
'''Note that the Linux image referred to here specifically refers to Linux distribution images such as Debian, Ubuntu, OpenWRT, or OPi OS Arch downloaded from the Orange Pi data download page.'''
# Firstly, it is necessary to prepare a USB storage device, such as a USB flash drive.
# Then please refer to the instructions in two sections: [[#method-of-burning-linux-image-to-tf-card-based-on-windows-pc|'''the method of burning Linux images to TF cards based on Windows PC''']] and [[#method-for-burning-linux-images-to-tf-cards-based-on-ubuntu-pc于ubuntu-pc|'''the method of burning Linux images to TF cards based on Ubuntu PC''']] to burn Linux images to USB storage devices. There is no difference between burning a Linux image to a USB storage device and burning a Linux image to a TF card (when the TF card is inserted into the card reader, the card reader is actually equivalent to a USB flash drive).
# Then insert the USB storage device that has burned the Linux system into the USB interface of the development board. '''Note that only the three blue USB 3.0 interfaces shown in the following figure support booting the Linux system, and the white USB 2.0 interface does not support it'''.
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image55.png|337x92px]]
<ol start="4" style="list-style-type: decimal;">
<li><p>The position of SPI Flash on the development board is shown in the following figure. SPI Flash will burn the program before leaving the factory. If it is not formatted by itself, the following burning steps can be skipped.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image46.png|333x230px]]</p></li>
<li><p>Burning the u-boot image to SPIFlash requires the use of a TF card, so the first step is to burn the Linux image onto the TF card, and then use the TF card to boot the development board into the Linux system. The method of burning a Linux image to a TF card can be found in the two sections: [[#method-of-burning-linux-image-to-tf-card-based-on-windows-pc|'''the method of burning a Linux image to a TF card based on Windows PC''']] and [[#method-for-burning-linux-images-to-tf-cards-based-on-ubuntu-pc于ubuntu-pc|'''the method of burning a Linux image to a TF card based on Ubuntu PC''']].</p></li>
<li><p>After starting the Linux system with a TF card, you can burn the u-boot image to SPI Flash.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, run '''nand-sata-install'''. '''Ordinary users should remember to grant sudo privileges'''.</p>
<p>orangepi@orangepi:~$ '''sudo nand-sata-install'''</p></li>
<li><p>Then select '''7 Install/Update ther bootloader on SPI Flash'''。</p></li></ol>
</li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image56.png|361x160px]]
<ol start="3" style="list-style-type: lower-alpha;">
<li>Then select '''<Yes>'''。</li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image57.png|356x179px|IMG_256]]
</div>
<ol start="4" style="list-style-type: lower-alpha;">
<li>Then please be patient and wait for the burning to complete. After the burning is completed, the following will be displayed (a ''''Done'''' will appear in the bottom left corner):</li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image58.png|358x149px|IMG_256]]
</div>
<ol start="7" style="list-style-type: decimal;">
<li><p>At this point, you can use the '''poweroff''' command to shut down. Then please unplug the TF card and press the power button briefly to start the linux system in the SPIFlash+USB storage device.</p></li>
<li><p>After starting the system in the USB storage device, use the '''df -h''' command to see the actual capacity of the USB storage device.</p>
<p>orangepi@orangepi:~$ '''df -h'''</p>
<p>Filesystem Size Used Avail Use% Mounted on</p>
<p>udev 3.8G 8.0K 3.8G 1% /dev</p>
<p>tmpfs 769M 588K 769M 1% /run</p>
<p>'''/dev/sda2 15G 1.6G 13G 11% /'''</p>
<p>tmpfs 3.8G 0 3.8G 0% /dev/shm</p>
<p>tmpfs 5.0M 4.0K 5.0M 1% /run/lock</p>
<p>/dev/zram2 3.7G 60K 3.5G 1% /tmp</p>
<p>'''/dev/sda1 256M 111M 146M 44% /boot'''</p>
<p>/dev/zram1 194M 9.0M 171M 5% /var/log</p>
<p>tmpfs 769M 0 769M 0% /run/user/1000</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. If the SPIFlash+NVMe SSD or eMMC module has already burned the image, there is no need to insert the TF card. Just make sure that the NVMe SSD or eMMC module is properly inserted into the 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/4A or 5V/5A 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.'''
'''The Type-C power interface does not support PD negotiation.'''
'''Also, please do not connect the USB port of the computer to power the development board.'''
<ol start="6" style="list-style-type: decimal;">
<li><p>Then turn on the power adapter switch. If everything is normal, the HDMI monitor or LCD screen 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 [[#how-to-use-the-debug-serial-port|'''debugging serial port usage''']].</p></li></ol>
<span id="how-to-use-the-debug-serial-port"></span>
== How to use the debug serial port ==
<span id="connection-instructions-for-debug-serial-port"></span>
=== Connection Instructions for Debug Serial Port ===
<ol style="list-style-type: decimal;">
<li><p>First, you need to prepare a 3.3V USB to TTL module, and then insert the USB interface of the USB to TTL module into the USB interface of the computer.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image59.png|576x115px|07]]
</div></li>
<li><p>The corresponding relationship between the debugging serial port GND, RXD and TXD pins of the development board is shown in the figure below:</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image60.png|356x127px]]</p></li>
<li><p>The GND, TXD and RXD pins of the USB to TTL module need to be connected to the debug serial port of the development board through DuPont cables.</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 the USB to TTL module to the computer and the Orange Pi development board is as follows:</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image61.png|524x189px|08]]
</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 connect the TX and RX of the serial port randomly. If there is no output in the test, then swap the order of TX and RX. In this way, there will always be one order that is correct.'''</p></li></ol>
<span id="how-to-use-the-debugging-serial-port-on-ubuntu-platform"></span>
=== How to use the debugging serial port on Ubuntu platform ===
'''There are many serial port debugging software that can be used under Linux, such as putty, minicom, etc. The following demonstrates how to use putty.'''
<ol style="list-style-type: decimal;">
<li><p>First, insert the USB to TTL module into the USB port of the Ubuntu computer. If the USB to TTL module is connected and recognized normally, you can see the corresponding device node name under '''/dev''' of the Ubuntu PC. Remember this node name, which will be used when setting up the serial port software later.</p>
<p>test@test:~$ '''ls /dev/ttyUSB*'''</p>
<p>/dev/ttyUSB0</p></li>
<li><p>Then install putty on your Ubuntu PC using the command below.</p>
<p>test@test:~$ '''sudo apt-get update'''</p>
<p>test@test:~$ '''sudo apt-get install -y putty'''</p></li>
<li><p>Then run putty and remember to '''add sudo permissions.'''</p>
<p>test@test:~$ '''sudo putty'''</p></li>
<li><p>After executing the putty command, the following interface will pop up.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image62.png|367x321px]]</p></li>
<li><p>First select the serial port settings interface.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image63.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'''(change to the corresponding node name, usually '''/dev/ttyUSB0''').</p></li>
<li><p>Set '''Speed(baud)''' to 115200 (the baud rate of the serial port).</p></li>
<li><p>Set '''Flow control''' to '''None'''.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image64.jpeg|398x352px|微信图片_20241119193320]]
</div></li></ol>
</li>
<li><p>After completing the settings on the serial port settings interface, return to the Session interface.</p>
<p>a. First select '''Connection type''' as Serial.</p>
<p>b. Then click the Open button to connect to the serial port.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image65.jpeg|376x333px|微信图片_20241119193326]]
</div></li>
<li><p>After starting the development board, you can see the log information output by the system from the opened serial port terminal.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image66.png|468x340px]]</p></li></ol>
<span id="how-to-use-the-debug-serial-port-on-windows-platform"></span>
=== How to use the debug serial port on Windows platform ===
'''There are many serial port debugging software that can be used under Windows, such as SecureCRT, MobaXterm, etc. The following demonstrates how to use MobaXterm. This software has a free version and can be used without purchasing a serial number.'''
<ol style="list-style-type: decimal;">
<li><p>Download MobaXterm.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Download MobaXterm from the following URL:</p>
<p>[https://mobaxterm.mobatek.net/ '''https://mobaxterm.mobatek.net''']</p></li>
<li><p>Go to the MobaXterm download page and click '''GET XOBATERM NOW!'''.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image67.png|576x334px]]</p></li>
<li><p>Then choose to download the Home version.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image68.png|353x231px]]</p></li>
<li><p>Then select the Portable version. After downloading, there is no need to install it. You can use it directly by opening it.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image69.png|575x259px]]</p></li></ol>
</li>
<li><p>After downloading, use decompression software to decompress the downloaded compressed package to get the executable software of MobaXterm, and then double-click to open it.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image70.png|576x81px]]</p></li>
<li><p>After opening the software, the steps to set up the serial port connection are as follows</p></li></ol>
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>Open the session settings interface.</p></li>
<li><p>Select the serial port type.</p></li>
<li><p>Select the serial port number (select the corresponding port number according to the actual situation). If you cannot see the port number, please use '''Driver Software t'''o scan and install the USB to TTL serial port chip driver.</p></li>
<li><p>Select the serial port baud rate as '''115200'''.</p></li>
<li><p>Finally, click the "'''OK'''" button to complete the settings.</p></li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image71.jpeg|576x292px|微信图片_20241119193339]]
</div>
<ol start="4" style="list-style-type: decimal;">
<li><p>Click the "'''OK'''" button to enter the following interface. Now start the development board and you can see the output information of the serial port.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image72.jpeg|576x292px|微信图片_20241119193346]]
</div></li></ol>
<span id="instructions-for-using-the-5v-pin-in-the-26pin-interface-of-the-development-board-to-supply-power"></span>
== Instructions for using the 5V pin in the 26pin interface of the development board to supply power ==
'''The power supply method we recommend for the development board is to use a 5V/5A 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 26pin interface to power the development board, please make sure that the power cord and power adapter used can meet the power supply requirements of the development board. If there is any unstable use, please switch back to Type-C power supply.'''
<ol style="list-style-type: decimal;">
<li><p>First, you need to prepare a power cord as shown in the figure below.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image73.jpeg|323x232px|图片4]]
</div>
<p>'''The power cord shown in the picture above can be purchased. Please search and purchase it by yourself.'''</p></li>
<li><p>Use the 5V pin in the 26-pin interface to power the development board. The connection method of the power line is as follows:</p></li></ol>
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>The USB A port of the power cable shown in the figure above needs to be plugged into the 5V/5A power adapter connector '''(please do not plug it into the USB port of the computer for power supply''').</p></li>
<li><p>The red DuPont cable needs to be plugged into the 5V pin of the 26-pin development board.</p></li>
<li><p>The black DuPont cable needs to be plugged into the GND pin of the 26-pin interface.</p></li>
<li><p>The positions of the 5V pin and GND pin of the 26-pin interface in the development board are shown in the figure below. '''Remember not to connect them in reverse'''.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image74.png|414x111px]]</p></li></ol>
<span id="ubuntu-server-and-gnome-desktop-system-instructions"></span>
= Ubuntu Server and Gnome Desktop System Instructions =
<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: center;"| '''Kernel version'''
| style="text-align: center;"| '''Server Edition'''
| style="text-align: center;"| '''Desktop version'''
|-
| style="text-align: center;"| '''Ubuntu 24.04 - Noble'''
| style="text-align: center;"| '''Linux6.6'''
| style="text-align: center;"| '''Support'''
| style="text-align: center;"| '''Support'''
|}
<span id="linux-6.6-system-compatibility"></span>
== Linux 6.6 system compatibility ==
{| class="wikitable"
|-
| style="text-align: center;"| '''Function'''
| style="text-align: center;"| '''Ubuntu24.04'''
|-
| style="text-align: center;"| '''USB2.0x1'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''USB3.0x3'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''M.2 M-Key slot x2'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''M.2 NVMe SSD boot'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''USB boot system'''
| 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;"| '''GPIO(26pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''UART(26pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''SPI(26pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''I2C(26pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''CAN(26pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''PWM(26pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''3pin debug serial port'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''TF card startup'''
| style="text-align: center;"| '''OK'''
|-
| 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;"| '''OV13850 Camera'''
| style="text-align: center;"| '''OK(Does not support 3A)'''
|-
| style="text-align: center;"| '''OV13855 Camera'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''LCD'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Gigabit Ethernet port x2'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Network port status light'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Headphone playback'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Headphone Recording'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''RTC'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''LED Light'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''GPU'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''VPU'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Power button'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Watchdog test'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Chromium hard decoding video'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''MPV hard decoding video playback'''
| style="text-align: center;"| '''OK'''
|}
<span id="linux-command-format-description-in-this-manual"></span>
== Linux command format description in this manual ==
<ol style="list-style-type: decimal;">
<li><p>All commands in this manual that need to be entered in the Linux system will be framed with the following boxes.</p>
<p>As shown below, the contents in the yellow box indicate the contents that require special attention, except for the commands inside.</p></li>
<li><p>Description of the prompt type before the command.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The prompt before the command refers to the content in the red box below. This part is not part of the Linux command, so when entering a command in the Linux system, please do not enter the content in red font.</p>
<p>'''orangepi@orangepi:~$ sudo apt update'''</p>
<p>'''root@orangepi:~#''' '''vim /boot/boot.cmd'''</p>
<p>'''test@test:~$ ssh [mailto:[email protected] [email protected].]xxx'''</p>
<p>'''root@test:~# ls'''</p></li>
<li><p>'''orangepi@orangepi:~$''' The prompt indicates that this command is entered in the Linux system of the development board. The $ at the end of the prompt indicates that the current user of the system is a common user. When executing privileged commands, '''sudo''' is required.</p></li>
<li><p>'''root@orangepi:~#''' The prompt indicates that this command is entered in the Linux system of the development board. The # at the end of the prompt indicates that the current user of the system is the root user and can execute any command he wants.</p></li>
<li><p>'''test@test:~$''' The prompt indicates that this command is entered in an Ubuntu PC or Ubuntu virtual machine, not in the Linux system of the development board. The $ at the end of the prompt indicates that the current user of the system is a normal user. When executing privileged commands, you need to add '''sudo'''.</p></li>
<li><p>'''root@test:~#''' The prompt indicates that this command is entered in an Ubuntu PC or Ubuntu virtual machine, not in the Linux system of the development board. The # at the end of the prompt indicates that the current user of the system is the root user and can execute any command he wants.</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 is the command that needs to be entered, and the content below the command is the output (some commands have output, some may not). This part does not need to be entered.</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 cannot fit in one line and will be placed on the next line. The bold black parts are the commands that need to be entered. When these commands are entered on one line, the "\" at the end of each line needs to be removed, as it is not part of the command. In addition, there are spaces between different parts of the command, so please do not 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'''
| 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'''
|}
'''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.'''
'''If you get an error message when entering the password, or there is a problem with the ssh connection, please note that as long as you are using the Linux image provided by Orange Pi, do not doubt that the password above is incorrect, but look for other reasons.'''
<span id="how-to-set-up-automatic-login-for-linux-system-terminal"></span>
=== How to set up automatic login for Linux system terminal ===
<ol style="list-style-type: decimal;">
<li><p>The Linux system automatically logs in to the terminal by default, and the default login username is '''orangepi'''.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image75.png|362x180px]]</p></li>
<li><p>Use the following command to set the root user to automatically log in to the terminal.</p>
<p>orangepi@orangepi:~$ '''sudo auto_login_cli.sh root'''</p></li>
<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>Use the following command to set the orangepi user to automatically log in to the terminal again.</p>
<p>orangepi@orangepi:~$ '''sudo auto_login_cli.sh orangepi'''</p></li></ol>
<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 is started, it will automatically log in to the desktop without entering a password.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image76.png|576x324px|Screenshot from 2025-01-09 08-23-53]]
</div></li>
<li><p>Run the following command to prevent the desktop version of the system from automatically logging into the desktop.</p>
<p>orangepi@orangepi:~$ '''sudo sed -i '/^AutomaticLoginEnable/ s/^/#/' /etc/gdm3/custom.conf'''</p>
<p>orangepi@orangepi:~$ '''sudo sed -i '/^AutomaticLogin/ s/^/#/' /etc/gdm3/custom.conf'''</p></li>
<li><p>Then restart the system and a login dialog box will appear. You need to enter the password to enter the system.</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 gdm3.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 steps to reopen the desktop are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First enter the following command in the command line. '''Please remember to add sudo permissions.'''</p>
<p>orangepi@orangepi:~$ '''sudo systemctl start gdm3.service'''</p>
<p>orangepi@orangepi:~$ '''sudo systemctl enable gdm3.service'''</p></li>
<li><p>After making your selection, the monitor will display the desktop.</p></li></ol>
</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 two LED lights on the development board, one red and one green. Their locations are shown in the figure below:</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image77.jpeg|576x110px|0006-(3)]]
</div></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. The red LED light can be used to determine whether the power of the development board has been turned on normally.</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 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/sys-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/sys-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/sys-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/sys-led# '''echo heartbeat > trigger'''</p></li></ol>
</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>The development board has two Gigabit Ethernet ports. The test methods for these two ports are the same. First, insert one end of the network cable into the Ethernet port of the development board, and connect the other end of the network cable to 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 addr show'''</p>
<p>1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000</p>
<p>link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00</p>
<p>inet 127.0.0.1/8 scope host lo</p>
<p>valid_lft forever preferred_lft forever</p>
<p>inet6 ::1/128 scope host noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p>
<p>2: '''end0''': <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000</p>
<p>link/ether 00:e0:4c:68:00:13 brd ff:ff:ff:ff:ff:ff</p>
<p>inet '''192.168.2.241'''/24 brd 192.168.2.255 scope global dynamic noprefixroute end0</p>
<p>valid_lft 43186sec preferred_lft 43186sec</p>
<p>inet6 fdcd:e671:36f4::47c/128 scope global dynamic noprefixroute</p>
<p>valid_lft 43186sec preferred_lft 43186sec</p>
<p>inet6 fdcd:e671:36f4:0:5689:f699:84ec:d4cb/64 scope global temporary dynamic</p>
<p>valid_lft 604786sec preferred_lft 85811sec</p>
<p>inet6 fdcd:e671:36f4:0:52ab:6ce7:cfc7:9ecf/64 scope global mngtmpaddr noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p>
<p>inet6 fe80::f082:90bd:3fbd:dc01/64 scope link noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p>
<p>3: '''end1''': <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000</p>
<p>link/ether 00:e0:4c:68:00:14 brd ff:ff:ff:ff:ff:ff</p>
<p>inet '''192.168.2.242'''/24 brd 192.168.2.255 scope global dynamic noprefixroute end1</p>
<p>valid_lft 43179sec preferred_lft 43179sec</p>
<p>inet6 fdcd:e671:36f4::49e/128 scope global dynamic noprefixroute</p>
<p>valid_lft 43177sec preferred_lft 43177sec</p>
<p>inet6 fdcd:e671:36f4:0:da95:4c2f:806f:5617/64 scope global temporary dynamic</p>
<p>valid_lft 604777sec preferred_lft 85899sec</p>
<p>inet6 fdcd:e671:36f4:0:7d9:7510:ccc5:fac9/64 scope global mngtmpaddr noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p>
<p>inet6 fe80::db62:da89:a277:2ff0/64 scope link noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p>
<p>4: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state DORMANT group default</p>
<p>qlen 1000</p>
<p>link/ether 9c:b8:b4:38:c7:62 brd ff:ff:ff:ff:ff:ff</p>
<p>When using ifconfig to check the IP address, if the following message is displayed, it is because sudo is not added. The correct command is: '''sudo ifconfig'''.</p>
<p>orangepi@orangepi:~$ '''ifconfig'''</p>
<p>Command 'ifconfig' is available in the following places</p>
<p>* /sbin/ifconfig</p>
<p>* /usr/sbin/ifconfig</p>
<p>The command could not be located because '/sbin:/usr/sbin' is not included in the PATH environment variable.</p>
<p>This is most likely caused by the lack of administrative privileges associated with your user account.</p>
<p>ifconfig: command not found</p></li></ol>
'''There are three ways to check the IP address after the development board is started:'''
# '''Connect an HDMI display, then log in to the system and use the ip addr show command to view the IP address.'''
# '''Enter the ip addr show command in the debugging serial port terminal to view the IP address.'''
# '''3. If there is no debugging serial port and no HDMI display, you can also view the IP address of the development board's network port through the router's management interface. However, this method often fails to see the IP address of the development board. If you cannot see it, the debugging method is as follows:'''
<!-- -->
<ol style="list-style-type: upper-alpha;">
<li><p>'''First check whether the Linux system has started normally. If the three-color light on the development board is flashing, it is generally started normally. If only the red light is on, it means that the system has not started normally.'''</p></li>
<li><p>'''Check whether the network cable is plugged in tightly, or try another cable;'''</p></li>
<li><p>'''Try another router (I have encountered many router problems, such as the router cannot assign IP addresses normally, or the IP addresses have been assigned normally but cannot be seen in the router);'''</p></li>
<li><p>'''If there is no router to replace, you can only connect an HDMI monitor or use the debug serial port to view the IP address.'''</p>
<p>'''It should also be noted that the development board DHCP automatically assigns IP addresses without any settings.'''</p></li></ol>
<!-- -->
<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 the '''Ctrl+C''' shortcut key.</p>
<p>orangepi@orangepi:~$ '''ping www.baidu.com -I end0 #Test command for one of the network ports'''</p>
<p>orangepi@orangepi:~$ '''ping www.baidu.com -I end1 #Test command for another network port'''</p>
<p>PING www.a.shifen.com (183.2.172.42) from 192.168.2.241 end0: 56(84) bytes of data.</p>
<p>64 bytes from 183.2.172.42: icmp_seq=1 ttl=53 time=10.1 ms</p>
<p>64 bytes from 183.2.172.42: icmp_seq=2 ttl=53 time=10.0 ms</p>
<p>64 bytes from 183.2.172.42: icmp_seq=3 ttl=53 time=9.91 ms</p>
<p>^C</p>
<p>--- www.a.shifen.com ping statistics ---</p>
<p>3 packets transmitted, 3 received, 0% packet loss, time 2002ms</p>
<p>rtt min/avg/max/mdev = 9.910/10.017/10.126/0.088 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:
<!-- -->
<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 start="2" 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:OrangePi_RV2_X1_User Manual_v1.0.1_image78.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 addr show 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.online -I wlan0'''</p>
<p>PING www.orangepi.online (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.online 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:
<!-- -->
<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 (use MobaXterm as the serial software, and minicom cannot display the graphical interface).</p></li>
<li><p>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:OrangePi_RV2_X1_User Manual_v1.0.1_image79.png|345x215px]]</p></li>
<li><p>Select '''Activate a connect''' and press Enter.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image80.png|349x216px]]</p></li>
<li><p>Then you can see all the searched WIFI hotspots.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image81.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:OrangePi_RV2_X1_User Manual_v1.0.1_image82.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:OrangePi_RV2_X1_User Manual_v1.0.1_image83.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:OrangePi_RV2_X1_User Manual_v1.0.1_image84.jpeg|350x224px|微信图片_20241119193751]]
</div></li>
<li><p>You can view the IP address of the wifi network through the '''ip addr show wlan0''' command.</p>
<p>orangepi@orangepi:~$ '''ip addr show wlan0'''</p>
<p>3: 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.online -I wlan0'''</p>
<p>PING www.orangepi.online (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.online 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>First, click on the upper right corner of the desktop (please do not connect the network cable when testing WIFI).</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image85.png|364x204px]]</p></li>
<li><p>Then click the Settings icon in the drop-down box that pops up.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image86.png|357x200px]]</p></li>
<li><p>Then you can see the searched WIFI hotspots under '''Visible Networks''' in the settings interface, and then click the WIFI hotspot you want to connect to.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image87.png|351x231px]]</p></li>
<li><p>Then enter the password of the WIFI hotspot and click '''Connect''' to start connecting to WIFI.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image88.png|351x218px]]</p></li>
<li><p>After connecting to WIFI, you can open the browser to check whether you can access the Internet. The browser entrance is shown in the figure below:</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image89.png|360x202px]]</p></li>
<li><p>If you can open other web pages after opening the browser, it means the WIFI connection is normal.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image90.png|575x253px]]</p></li></ol>
<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:OrangePi_RV2_X1_User Manual_v1.0.1_image91.png|314x313px]]</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''' or '''Wired connection 2'''.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image92.png|311x136px]]</p></li>
<li><p>Then select '''Edit''' using the '''Tab''' key and press Enter.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image93.png|312x123px|584E2342-D6A3-4568-90E5-F7A075BD2339]]
</div></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></li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image94.png|575x225px]]
<ol start="6" style="list-style-type: decimal;">
<li>Press Enter, use the up and down arrow keys to select '''Manual''', and then press Enter to confirm.</li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image95.png|575x225px]]
<ol start="7" style="list-style-type: decimal;">
<li><p>The display after selection is as shown below:</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image96.png|575x221px]]</p></li>
<li><p>Then use the Tab key to move the cursor to '''<Show>'''.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image97.png|576x221px]]</p></li>
<li><p>Then press Enter, and the following setting interface will pop up.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image98.png|575x293px]]</p></li>
<li><p>Then you can set the IP address (Addresses), gateway (Gateway) and DNS server address as shown in the figure below (there are many other setting options, please explore them yourself). '''Please set them according to your specific needs. The value set in the figure below is just an example'''.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image99.png|575x217px]]</p></li>
<li><p>After setting, move the cursor to '''<OK>''' in the lower right corner and press Enter to confirm.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image100.png|576x116px]]</p></li>
<li><p>Then click '''<Back>'''to return to the previous selection interface.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image101.png|244x216px]]</p></li>
<li><p>Then select '''Activate a connection''', move the cursor to '''<OK>''', and press Enter.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image102.png|331x248px]]</p></li>
<li><p>Then select the network interface you want to configure, such as '''Wired connection 2''', move the cursor to '''<Deactivate>''', and press Enter to disable '''Wired connection 2'''.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image103.png|576x170px]]</p></li>
<li><p>Then please do not move the cursor and press the Enter key to re-enable '''Wired connection 2''', so that the static IP address set previously will take effect.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image104.png|576x177px]]</p></li>
<li><p>Then you can exit '''nmtui''' using the '''<Back>''' and '''Quit''' buttons.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image105.png|246x193px]] [[File:OrangePi_RV2_X1_User Manual_v1.0.1_image106.png|200x190px]]</p></li>
<li><p>Then use '''p addr show end1''' to see that the IP address of the network port has become the static IP address set previously.</p>
<p>orangepi@orangepi:~$ '''ip addr show end1'''</p>
<p>3: end1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000</p>
<p>link/ether 00:e0:4c:68:00:14 brd ff:ff:ff:ff:ff:ff</p>
<p>inet '''192.168.2.2'''/24 brd 192.168.2.255 scope global noprefixroute end1</p>
<p>valid_lft forever preferred_lft forever</p>
<p>inet6 fdcd:e671:36f4::49e/128 scope global dynamic noprefixroute</p>
<p>valid_lft 42950sec preferred_lft 42950sec</p>
<p>inet6 fdcd:e671:36f4:0:2139:e484:d595:deda/64 scope global temporary dynamic</p>
<p>valid_lft 604550sec preferred_lft 85735sec</p>
<p>inet6 fdcd:e671:36f4:0:7d9:7510:ccc5:fac9/64 scope global mngtmpaddr noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p>
<p>inet6 fe80::db62:da89:a277:2ff0/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 whether the IP address is configured OK. The '''ping''' command can be interrupted by pressing the '''Ctrl+C''' shortcut key.</p>
<p>orangepi@orangepi:~$ '''ping www.baidu.com -I end1'''</p>
<p>PING www.a.shifen.com (183.2.172.42) from 192.168.2.2 end1: 56(84) bytes of data.</p>
<p>64 bytes from 183.2.172.42: icmp_seq=1 ttl=53 time=10.2 ms</p>
<p>64 bytes from 183.2.172.42: icmp_seq=2 ttl=53 time=9.89 ms</p>
<p>64 bytes from 183.2.172.42: icmp_seq=3 ttl=53 time=9.64 ms</p>
<p>^C</p>
<p>--- www.a.shifen.com ping statistics ---</p>
<p>3 packets transmitted, 3 received, 0% packet loss, time 2003ms</p>
<p>rtt min/avg/max/mdev = 9.640/9.915/10.219/0.237 ms</p></li></ol>
<span id="how-to-create-a-wifi-hotspot-through-create_ap"></span>
=== How to create a WIFI hotspot through create_ap ===
'''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:'''
[https://github.com/oblique/create_ap '''https://github.com/oblique/create_ap''']
'''If you are using the latest image, the create_ap script is pre-installed. 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 the encryption method, the frequency band of the WIFI hotspot, the bandwidth mode, the network sharing method, etc. You can get the options through create_ap -h'''
'''* wifi-interface:The name of the wireless network card'''
'''* interface-with-internet:The name of the network card that can connect to the Internet, usually eth0'''
'''* access-point-name:Hotspot Name'''
'''* passphrase:Hotspot password'''
<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 end0 orangepi orangepi'''
<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 end0 orangepi orangepi'''</p>
<p>Config dir: /tmp/create_ap.wlan0.conf.Ks6HobEw</p>
<p>PID: 5405</p>
<p>Network Manager found, set ap0 as unmanaged device... DONE</p>
<p>Creating a virtual WiFi interface... ap0 created.</p>
<p>Sharing Internet using method: nat</p>
<p>hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlan0.conf.Ks6HobEw/hostapd_ctrl</p>
<p>ap0: interface state UNINITIALIZED->ENABLED</p>
<p>ap0: AP-ENABLED</p></li>
<li><p>Now take out your mobile phone and find the WIFI hotspot named '''orangepi''' created by the development board in the searched WIFI list. Then you can click '''orangepi''' to connect to the hotspot. The password is the '''orangepi'''set above.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image107.png|230x183px]]</p></li>
<li><p>The display after successful connection is as shown below:</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image108.png|233x111px]]</p></li>
<li><p>In NAT mode, the wireless device connected to the development board's hotspot requests an IP address from the development board's DHCP service, so there will be two different network segments. For example, the IP of the development board here is 192.168.1.X.</p>
<p>orangepi@orangepi:~$ '''ifconfig end0'''</p>
<p>end0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500</p>
<p>inet '''192.168.1.241''' netmask 255.255.255.0 broadcast 192.168.2.255</p>
<p>inet6 fdcd:e671:36f4:0:abd1:3c87:332a:dd20 prefixlen 64 scopeid 0x0<global></p>
<p>inet6 fdcd:e671:36f4:0:52ab:6ce7:cfc7:9ecf prefixlen 64 scopeid 0x0<global></p>
<p>inet6 fe80::f082:90bd:3fbd:dc01 prefixlen 64 scopeid 0x20<link></p>
<p>inet6 fdcd:e671:36f4::47c prefixlen 128 scopeid 0x0<global></p>
<p>ether 00:e0:4c:68:00:13 txqueuelen 1000 (Ethernet)</p>
<p>RX packets 17817 bytes 22181411 (22.1 MB)</p>
<p>RX errors 0 dropped 0 overruns 0 frame 0</p>
<p>TX packets 13179 bytes 2475256 (2.4 MB)</p>
<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p>
<p>device interrupt 78 base 0xd000</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:OrangePi_RV2_X1_User Manual_v1.0.1_image108.png|271x129px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image109.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 enP3p49s0 orangepi orangepi -g 192.168.2.1'''</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:OrangePi_RV2_X1_User Manual_v1.0.1_image108.png|286x137px]]
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image110.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 end0 orangepi orangepi --freq-band 5'''
<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 end0 orangepi orangepi --hidden'''
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:OrangePi_RV2_X1_User Manual_v1.0.1_image111.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 end0 orangepi orangepi'''
<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 end0 orangepi orangepi'''</p>
<p>[sudo] password for orangepi:</p>
<p>Config dir: /tmp/create_ap.wlan0.conf.fg9U5Xgt</p>
<p>PID: 3141</p>
<p>Network Manager found, set ap0 as unmanaged device... DONE</p>
<p>Creating a virtual WiFi interface... ap0 created.</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.fg9U5Xgt/hostapd_ctrl</p>
<p>ap0: interface state UNINITIALIZED->ENABLED</p>
<p>ap0: AP-ENABLED</p></li>
<li><p>Now take out your mobile phone and find the WIFI hotspot named '''orangepi''' created by the development board in the searched WIFI list. Then you can click '''orangepi''' to connect to the hotspot. The password is the '''orangepi''' set above.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image107.png|265x211px]]</p></li>
<li><p>The display after successful connection is as shown below:</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image108.png|273x130px]]</p></li>
<li><p>In bridge mode, the wireless device connected to the development board's 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 of the development board here is '''192.168.1.X'''.</p>
<p>orangepi@orangepi:~$ '''ifconfig end0'''</p>
<p>end0: 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:OrangePi_RV2_X1_User Manual_v1.0.1_image108.png|284x136px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image112.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 end0 orangepi orangepi --freq-band 5'''
<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 end0 orangepi orangepi --hidden'''
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:OrangePi_RV2_X1_User Manual_v1.0.1_image111.png|228x191px]]
<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:[email protected] [email protected].]xxx''' #Need to replace with the IP address of the development board
[email protected]'s password: #Enter the password here, the default password is orangepi
'''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>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image113.png|407x191px|IMG_256]]
</div>
<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 ===
# First, obtain the IP address of the development board.
# Under Windows, you can use MobaXterm to remotely log in to the development board. First, create a new ssh session.
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>Open '''Session'''.</p></li>
<li><p>Select '''SSH in Session Setting'''.</p></li>
<li><p>Enter the IP address of the development board in '''Remote host'''.</p></li>
<li><p>Enter the Linux user name '''root''' or '''orangepi''' in '''Specify username'''.</p></li>
<li><p>Click OK.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image114.png|575x292px|13]]
</div></li></ol>
<!-- -->
<ol start="3" style="list-style-type: decimal;">
<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></li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image115.jpeg|575x149px|0006-(1)]]
</div>
<ol start="4" style="list-style-type: decimal;">
<li>After successfully logging into the system, the display is as shown below:</li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image116.png|575x292px]]
<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 to the file to be uploaded.</p></li>
<li><p>'''orangepi:'''This is the user name of the Linux system of the development board. It 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 [email protected]:/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 [email protected]:/home/orangepi/'''</p></li>
<li><p>There are more uses for scp. Please use the following command to view the man manual.</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 command below.</p>
<p>test@test:~$ '''filezilla'''</p></li>
<li><p>The interface after opening filezilla is as shown below. At this time, the remote site on the right is empty.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image117.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:OrangePi_RV2_X1_User Manual_v1.0.1_image118.png|575x128px|图片565]]
</div>
<ol start="5" style="list-style-type: decimal;">
<li><p>Then select '''Save Password''' and click '''OK'''.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image119.png|249x181px]]</p></li>
<li><p>Then select '''Always trust this host''' and click '''OK'''.</p></li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image120.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:OrangePi_RV2_X1_User Manual_v1.0.1_image121.png|533x330px|IMG_256]]
</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, 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:OrangePi_RV2_X1_User Manual_v1.0.1_image122.png|529x414px|IMG_256]]
</div>
<ol start="9" style="list-style-type: decimal;">
<li><p>After uploading is complete, you can go to the corresponding path in the Linux system of the development board to view the uploaded files.</p></li>
<li><p>The method for uploading a folder is the same as that for 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:OrangePi_RV2_X1_User Manual_v1.0.1_image123.jpeg|576x208px|1720161972192]]
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image124.jpeg|576x415px|1720161983058]]
</div>
<ol start="2" style="list-style-type: decimal;">
<li><p>The downloaded installation package is as shown below, 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, and then select '''Next>'''.
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image125.png|319x251px|IMG_256]]
</div>
<ol start="3" style="list-style-type: decimal;">
<li>The interface after opening filezilla is as shown below. At this time, the remote site on the right is empty.</li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image126.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:OrangePi_RV2_X1_User Manual_v1.0.1_image118.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:OrangePi_RV2_X1_User Manual_v1.0.1_image127.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:OrangePi_RV2_X1_User Manual_v1.0.1_image128.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:OrangePi_RV2_X1_User Manual_v1.0.1_image129.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, 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:OrangePi_RV2_X1_User Manual_v1.0.1_image130.png|535x394px|IMG_256]]
</div>
<ol start="9" style="list-style-type: decimal;">
<li><p>After uploading is complete, you can go to the corresponding path in the Linux system of the development board to view the uploaded files.</p></li>
<li><p>The method for uploading a folder is the same as that for uploading a file, so I will not go into details here.</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>Use an HDMI to HDMI cable to connect the Orange Pi development board and the HDMI display.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image10.png|199x129px]]</p></li>
<li><p>After starting the Linux system, if the HDMI monitor has image output, it means that the HDMI interface is working properly.</p></li></ol>
'''Please note that although many laptops are equipped with 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 port of a laptop, please make sure 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-resolution-setting-method"></span>
=== HDMI resolution setting method ===
<ol style="list-style-type: decimal;">
<li><p>First click the upper right corner of the desktop, then click the settings icon to open the settings interface.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image85.png|364x204px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image86.png|357x200px]]</p></li>
<li><p>Then find '''Display''' in the settings interface to see the current resolution of the system.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image131.png|376x248px]]</p></li>
<li><p>Click the drop-down box of Resolution to see all the resolutions currently supported by the monitor.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image132.png|375x246px]]</p></li>
<li><p>Then select the resolution you want to set and click '''Apply.'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image133.png|372x246px]]</p></li>
<li><p>After the new resolution is set, select '''Keep Changes.'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image134.png|366x240px]]</p></li></ol>
<span id="how-to-use-bluetooth"></span>
== How to use Bluetooth ==
<span id="desktop-image-testing-method"></span>
=== Desktop image testing method ===
<ol style="list-style-type: decimal;">
<li><p>First click the upper right corner of the desktop, then click the settings icon to open the settings interface.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image85.png|364x204px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image86.png|357x200px]]</p></li>
<li><p>Then find '''Bluetooth''' in the settings interface. Under '''Devices,''' the Bluetooth devices scanned around will be displayed. Then select the Bluetooth device you want to connect to start pairing.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image135.png|384x252px]]</p></li>
<li><p>After pairing starts, a pairing confirmation box will pop up. Select '''Confirm'''. Confirmation is also required on the phone.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image136.png|332x217px]]</p></li></ol>
<!-- -->
<ol start="7" style="list-style-type: decimal;">
<li><p>After pairing with the phone, you can click on the paired Bluetooth device and select '''Send a File''' to start sending a picture to the phone.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image137.png|346x227px]][[File:OrangePi_RV2_X1_User Manual_v1.0.1_image138.png|348x240px]]</p></li>
<li><p>The interface for sending pictures is as follows:</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image139.png|360x216px]]</p></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="connect-a-usb-mouse-or-keyboard-to-test"></span>
=== Connect a USB mouse or keyboard to test ===
# Plug the USB keyboard into the USB port of the Orange Pi development board.
# Connecting Orange Pi to 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 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-camera-test"></span>
=== USB camera test ===
<ol style="list-style-type: decimal;">
<li><p>First, you need to prepare a USB camera that supports UVC protocol as shown in the figure below or similar, and then insert the USB camera into the USB port of the Orange Pi development board.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image14.png|259x150px]]</p></li>
<li><p>Through the v4l2-ctl command, you can see that the device node information of the USB camera is '''/dev/video20'''</p>
<p>orangepi@orangepi:~$ '''v4l2-ctl --list-devices | grep -A 3 "Q8 HD Webcam"'''</p>
<p>Q8 HD Webcam: Q8 HD Webcam ('''usb'''-fc880000.usb-1):</p>
<p>'''/dev/video20'''</p>
<p>/dev/video21</p>
<p>/dev/media1</p>
<p>'''Note that the l in v4l2 is a lowercase letter l, not the number 1.'''</p>
<p>'''In addition, the serial number of the video is not always video20, please refer to the actual one you see.'''</p></li>
<li><p>How to use fswebcam to test 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>-d Option 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>The -S option is used to set the number of previous frames to skip</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 the 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:[email protected]:/home/test [email protected]:/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></ol>
<span id="audio-test"></span>
== Audio Test ==
<span id="testing-audio-methods-on-desktop-systems"></span>
=== Testing Audio Methods on Desktop Systems ===
<ol style="list-style-type: decimal;">
<li><p>First open the file manager.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image140.png|324x182px]]</p></li>
<li><p>Then find the file below (if there is no audio file in the system, you can upload an audio file to the system yourself).</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image141.png|322x202px]]</p></li>
<li><p>Then select the audio.wav file, right-click and choose to open with mpv to start playing.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image142.png|323x200px]]</p></li>
<li><p>A method for switching 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 upper right corner, then click on the settings icon to open the settings interface.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image85.png|390x219px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image86.png|388x218px]]</p></li>
<li><p>Then find the '''Sound''' settings.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image143.png|385x256px]]</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:OrangePi_RV2_X1_User Manual_v1.0.1_image144.png|383x253px]]</p></li></ol>
</li></ol>
<span id="how-to-play-audio-using-commands"></span>
=== How to play audio using commands ===
<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:OrangePi_RV2_X1_User Manual_v1.0.1_image145.png|274x190px]]</p></li>
<li><p>Then you can use the '''aplay -l''' command to view the sound card devices supported by the Linux system. From the output below, we can see that '''card 1''' is the es8388 sound card device, which is the sound card device of the headset.</p>
<p>orangepi@orangepi:~$ '''aplay -l'''</p>
<p>**** List of PLAYBACK Hardware Devices ****</p>
<p>card 0: sndhdmi [snd-hdmi], device 0: SSPA2-dummy_codec dummy_codec-0 []</p>
<p>Subdevices: 1/1</p>
<p>Subdevice #0: subdevice #0</p>
<p>'''card 1: sndes8323 [snd-es8323], device 0: i2s-dai0-ES8323 HiFi ES8323 HiFi-0 []'''</p>
<p>'''Subdevices: 1/1'''</p>
<p>'''Subdevice #0: subdevice #0'''</p></li>
<li><p>Then use the '''aplay''' command to play the audio file that comes with the system. If the headphones can hear the sound, it means that the hardware can be used normally.</p>
<p>orangepi@orangepi:~$ '''aplay -D hw:1,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>
<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>Then check the HDMI sound card serial number. From the output below, we can know that the HDMI sound card is '''card 0'''</p>
<p>orangepi@orangepi:~$ '''aplay -l'''</p>
<p>**** List of PLAYBACK Hardware Devices ****</p>
<p>'''card 0: sndhdmi [snd-hdmi], device 0: SSPA2-dummy_codec dummy_codec-0 []'''</p>
<p>'''Subdevices: 1/1'''</p>
<p>'''Subdevice #0: subdevice #0'''</p>
<p>......</p></li>
<li><p>Then use the '''aplay''' command to play the audio file that comes with the system. If the HDMI display or TV can hear the sound, it means that the hardware can be used normally.</p>
<p>orangepi@orangepi:~$ '''aplay -D hw:0,0 /usr/share/sounds/alsa/audio.wav'''</p></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 RV2 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:1,0 -d 5 -f cd -t wav /tmp/test.wav'''</p></li></ol>
<span id="temperature-sensor"></span>
== Temperature sensor ==
# The command to view the system temperature sensor is:
orangepi@orangepi:~$ '''sensors'''
cluster0_thermal-virtual-0
Adapter: Virtual device
temp1: +59.0°C
cluster1_thermal-virtual-0
Adapter: Virtual device
temp1: +60.0°C
<ol start="2" style="list-style-type: decimal;">
<li><p>The command to check the current temperature of the nvme ssd solid state drive is:</p>
<p>orangepi@orangepi:~$ '''sudo smartctl -a /dev/nvme0 | grep "Temperature:"'''</p>
<p>Temperature: '''40 Celsius'''</p></li></ol>
<span id="pin-interface-pin-description"></span>
== 26 Pin Interface Pin Description ==
<ol style="list-style-type: decimal;">
<li><p>Please refer to the following figure for the order of the 26-pin interface pins of the Orange Pi RV2 development board</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image146.jpeg|398x237px|0006-(2)]]
</div></li>
<li><p>The functions of the 26 pin interface pins of the Orange Pi RV2 development board are shown in the following table</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Below is the complete pin diagram of 26 pins</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image147.png|576x116px]]</p></li>
<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:OrangePi_RV2_X1_User Manual_v1.0.1_image148.png|576x231px]]</p></li>
<li><p>The table below is the right half of the complete table above, which can be seen more clearly</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image149.png|576x230px]]</p>
<p>'''In the table above, the base addresses of the corresponding registers are marked for pwm, which is useful for checking which pwmchip in''' '''/sys/class/pwm/''' '''corresponds to which pwm pin in the 26-pin header.'''</p></li></ol>
</li>
<li><p>There are a total of '''17''' GPIO ports in the 26-pin interface, and the voltage of all GPIO ports is '''3.3v'''</p></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/riscv64/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:OrangePi_RV2_X1_User Manual_v1.0.1_image150.png|576x249px]]
<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 Orange Pi RV2 needs to download the wiringOP next branch code, please do not 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:OrangePi_RV2_X1_User Manual_v1.0.1_image150.png|576x249px]]</p></li></ol>
<span id="pin-interface-gpio-i2c-uart-spi-can-and-pwm-test"></span>
== 26pin interface GPIO, I2C, UART, SPI, CAN and PWM test ==
<span id="pin-gpio-port-test"></span>
=== 26pin GPIO port test ===
'''The Linux system released by Orange Pi has a pre-installed blink_all_gpio program, which will set all 17 GPIO ports in the 26-pin to switch high and low levels continuously.'''
'''After running the blink_all_gpio program, when you use a multimeter to measure the voltage level of the GPIO port, you will find that the GPIO pin will switch between 0 and 3.3v. Using this program, we can test whether the GPIO port can work properly.'''
'''The way to run the blink_all_gpio program is as follows:'''
orangepi@orangepi:~$ '''sudo blink_all_gpio''' #Remember to add sudo permissions
[sudo] password for orangepi: #You need to enter your password here
<ol style="list-style-type: decimal;">
<li><p>There are '''17''' GPIO ports available in the 26-pin development board. The following example shows how to set the high and low levels of the GPIO port using pin 7, which corresponds to GPIO74 and wPi number 2.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image151.png|576x126px]]</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>root@orangepi:~/wiringOP# '''gpio mode 2 out'''</p></li>
<li><p>Then set the GPIO port to output a low level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 0v, it means that the low level is set successfully.</p>
<p>root@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:OrangePi_RV2_X1_User Manual_v1.0.1_image152.png|575x126px]]</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# '''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:OrangePi_RV2_X1_User Manual_v1.0.1_image153.png|575x125px]]</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-gpio-pins"></span>
=== How to set pull-up and pull-down resistors on GPIO pins ===
'''Note that only the following 8 GPIO pins of Orange Pi RV2 can be set to pull up and down normally. Other GPIO pins do not support the function of setting pull-up and pull-down resistors.'''
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image154.png|576x250px]]
<ol style="list-style-type: decimal;">
<li><p>Below, we take pin 8, which corresponds to GPIO 47 and wPi number 3, as an example to demonstrate how to set the pull-up and pull-down resistors of the GPIO port.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image155.png|575x125px]]</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>root@orangepi:~# '''gpio mode 3 in'''</p></li>
<li><p>After setting to input mode, execute the following command to set the GPIO port to pull-up mode</p>
<p>root@orangepi:~# '''gpio mode 3 up'''</p></li>
<li><p>Then enter the following command to read the level of the GPIO port. If the level is 1, it means that the pull-up mode is set successfully.</p>
<p>root@orangepi:~# '''gpio read 3'''</p>
<p>'''1'''</p></li>
<li><p>Then execute the following command to set the GPIO port to pull-down mode</p>
<p>root@orangepi:~# '''gpio mode 3 down'''</p></li>
<li><p>Then enter the following command to read the level of the GPIO port. If the level is 0, it means that the pull-down mode is set successfully.</p>
<p>root@orangepi:~# '''gpio read 3'''</p>
<p>'''0'''</p></li></ol>
<span id="pin-spi-test"></span>
=== 26pin SPI test ===
<ol style="list-style-type: decimal;">
<li><p>As shown in the figure below, the available spi for Orange Pi RV2 is spi3</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image156.png|575x117px]]</p></li>
<li><p>The corresponding pins of SPI3 in 26 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
|
| style="text-align: left;"| '''SPI3 corresponds to 26pin'''
|-
| '''MOSI'''
| style="text-align: left;"| '''Pin 19'''
|-
| '''MISO'''
| style="text-align: left;"| '''Pin 21'''
|-
| '''CLK'''
| style="text-align: left;"| '''Pin 23'''
|-
| '''CS0'''
| style="text-align: left;"| '''Pin 24'''
|-
| '''Dtbo''' '''Configuration'''
| style="text-align: left;"| '''spi3-cs0-spidev'''
|}
<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the SPI in 26 pins is closed by default and needs to be opened manually before use. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select '''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select and open the SPI3 configuration</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image159.png|370x65px]]</p></li>
<li><p>Then select '''<Save>''' to save</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|366x155px]]</p></li>
<li><p>Then select '''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|360x153px]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system to make the configuration take effect.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image162.png|332x146px]]</p></li></ol>
</li>
<li><p>After restarting, enter the system and check whether there is a device node of '''spidevx.x''' in the Linux system. If it exists, it means that SPI has been set up and can be used directly.</p>
<p>orangepi@orangepi:~$ '''ls /dev/spidev*'''</p>
<p>/dev/spidev3.0</p></li>
<li><p>Do not short the mosi and miso pins of SPI3. The output of running spidev_test is as follows. It can be seen that the data of TX and RX are inconsistent.</p>
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev3.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 SPI3 and run spidev_test again. 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/spidev3.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>
=== 26pin 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 RV2 are i2c3 and i2c4, a total of two i2c buses.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image156.png|575x117px]]</p></li>
<li><p>The corresponding pins of the two sets of I2C buses in 26 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
| '''I2C''' '''bus'''
| style="text-align: left;"| '''SDA corresponds to 26pin'''
| style="text-align: left;"| '''SCL corresponds to 26pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| '''I2C3'''
| style="text-align: left;"| '''Pin 10'''
| style="text-align: left;"| '''Pin 8'''
| style="text-align: left;"| '''i2c3'''
|-
| '''I2C4'''
| style="text-align: left;"| '''Pin 3'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''i2c4'''
|}
<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the I2C bus in 26 pins is closed by default and needs to be opened manually before it can be used. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config.''' Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select '''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select the I2C configuration you want to open</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image163.png|373x44px|IMG_256]]
</div></li>
<li><p>Then select '''<Save>''' to save</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|367x120px]]</p></li>
<li><p>Then select '''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|361x118px]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system for the configuration to take effect.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image162.png|323x142px]]</p></li></ol>
</li>
<li><p>After starting the Linux system, first confirm that there is a device node that needs to use I2C under '''/dev'''</p>
<p>orangepi@orangepi:~$ '''ls /dev/i2c-*'''</p></li>
<li><p>Then connect an i2c device to the i2c pin of the 26pin connector</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 -r 3''' #Command for i2c3</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y -r 4''' #Command for i2c4</p></li></ol>
<span id="pin-uart-test"></span>
=== 26pin UART test ===
<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, the available uarts for Orange Pi RV2 are uart5, uart8 and uart9, a total of three uart buses.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image156.png|575x117px]]</p></li>
<li><p>The corresponding pins of the three groups of UART buses in 26 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 26pin'''
| style="text-align: left;"| '''TX corresponds to 26pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''UART5'''
| style="text-align: left;"| '''Pin 11'''
| style="text-align: left;"| '''Pin 12'''
| style="text-align: left;"| '''uart5'''
|-
| style="text-align: left;"| '''UART8'''
| style="text-align: left;"| '''Pin 24'''
| style="text-align: left;"| '''Pin 23'''
| style="text-align: left;"| '''uart8'''
|-
| style="text-align: left;"| '''UART9'''
| style="text-align: left;"| '''Pin 13'''
| style="text-align: left;"| '''Pin 15'''
| style="text-align: left;"| '''uart9'''
|}
<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the UART in 26 pins is closed by default and needs to be opened manually. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select '''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select the UART configuration you want to open</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image164.png|355x47px]]</p></li>
<li><p>Then select '''<Save>''' to save</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|357x117px]]</p></li>
<li><p>Then select '''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|355x117px]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system for the configuration to take effect.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image162.png|320x141px]]</p></li></ol>
</li>
<li><p>After entering the Linux system, first confirm whether there is a device node corresponding to uart under '''/dev'''</p>
<p>orangepi@orangepi:~$ '''ls /dev/ttyS*'''</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 (ttySX needs to be replaced with the corresponding uart node name, please do not copy it)</p>
<p>orangepi@orangepi:~$ '''sudo gpio serial /dev/ttySX'''</p>
<p>Out: 0: -> 0</p>
<p>Out: 1: -> 1</p>
<p>Out: 2: -> 2</p>
<p>Out: 3: -> 3</p>
<p>Out: 4: -> 4</p>
<p>Out: 5: -> 5^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>As can be seen from the table below, Orange Pi RV2 has two PWM channels: pwm7 and pwm9.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image156.png|575x117px]]</p></li>
<li><p>The corresponding pins of PWM in 26 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''PWM Bus'''
| style="text-align: left;"| '''Correspond''' '''26pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''PWM7'''
| style="text-align: left;"| '''Pin 18'''
| style="text-align: left;"| '''pwm7'''
|-
| style="text-align: left;"| '''PWM9'''
| style="text-align: left;"| '''Pin 7'''
| style="text-align: left;"| '''pwm9'''
|}
<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, PWM in 26 pins is disabled by default and needs to be enabled manually. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select '''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select'''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select the '''PWM''' configuration you want to turn on.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image165.png|366x33px]]</p></li>
<li><p>Then select '''<Save>''' to save</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|357x117px]]</p></li>
<li><p>Then select '''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|355x117px]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system for the configuration to take effect</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image162.png|303x133px]]</p></li></ol>
</li>
<li><p>When a pwm is turned on, there will be an additional pwmchipX in '''/sys/class/pwm/''' (X is a specific number). For example, after turning on pwm9, the pwmchipX under '''/sys/class/pwm/''' will change from one to two.</p>
<p>orangepi@orangepi:~$ '''ls /sys/class/pwm/'''</p>
<p>pwmchip0 pwmchip1</p></li>
<li><p>Which pwmchip above corresponds to pwm9? Let's first check the output of the '''ls /sys/class/pwm/ -l''' command, as shown below:</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image166.png|613x45px|IMG_256]]
</div></li>
<li><p>Then from the table below, we can see that the base address of the pwm9 register is c0888a00. Looking at the output of the '''ls /sys/class/pwm/ -l''' command, we can see that pwmchip1 is linked to c0888a00.pwm, so the pwmchip corresponding to pwm9 is pwmchip1.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image167.png|456x183px]]</p></li>
<li><p>Then use the following command to make pwm9 output a 500Hz square wave (please switch to the root user first, then execute the following command)</p></li></ol>
root@orangepi:~# '''echo 0 > /sys/class/pwm/pwmchip1/export'''
root@orangepi:~# '''echo 200000 > /sys/class/pwm/pwmchip1/pwm0/period'''
root@orangepi:~# '''echo 100000 > /sys/class/pwm/pwmchip1/pwm0/duty_cycle'''
root@orangepi:~# '''echo 1 > /sys/class/pwm/pwmchip1/pwm0/enable'''
<ol start="8" style="list-style-type: decimal;">
<li>The pwm9 test method demonstrated above is similar to other pwm test methods.</li></ol>
<span id="can-test-method"></span>
=== CAN test method ===
<span id="how-to-open-can"></span>
==== How to open CAN ====
<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, the available CAN bus for Orange Pi RV2 is CAN0</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image156.png|575x117px]]</p></li>
<li><p>In Linux system, the CAN in 26 pins is closed by default and needs to be opened manually before it can be used. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select'''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select'''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select and open the configuration of can0</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image168.png|360x33px]]</p></li>
<li><p>Then select '''<Save>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|357x117px]]</p></li>
<li><p>Then select '''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|355x117px]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system for the configuration to take effect</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image162.png|283x125px]]</p></li></ol>
</li>
<li><p>After entering the Linux system, use the '''sudo''' '''ifconfig -a''' command. If you can see the CAN device, it means that CAN has been correctly opened.</p>
<p>orangepi@orangepi:~$ '''sudo ifconfig -a'''</p>
<p>can0: flags=128<NOARP> mtu 16</p>
<p>unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)</p>
<p>RX packets 0 bytes 0 (0.0 B)</p>
<p>RX errors 0 dropped 0 overruns 0 frame 0</p>
<p>TX packets 0 bytes 0 (0.0 B)</p>
<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p>
<p>device interrupt 91</p></li>
<li><p>The pin corresponding to 26pin of CAN0 is</p></li></ol>
{| class="wikitable"
|-
|
| style="text-align: left;"| '''CAN0'''
|-
| '''TX''' '''Pin'''
| style="text-align: left;"| '''Corresponding to pin 23'''
|-
| '''RX''' '''Pin'''
| style="text-align: left;"| '''Corresponding to pin 24'''
|}
<span id="test-sending-and-receiving-messages-using-canalyst-ii-analyzer"></span>
==== Test sending and receiving messages using CANalyst-II analyzer ====
<ol style="list-style-type: decimal;">
<li><p>The CANalyst-II analyzer used in the test is shown in the figure below</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image169.png|222x181px]]</p></li>
<li><p>CANalyst-II analyzer data download link</p>
<p>[https://www.zhcxgd.com/3.html '''https://www.zhcxgd.com/3.html''']</p></li>
<li><p>First, you need to install the USBCANToolSetup software</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image170.png|553x94px]]</p></li>
<li><p>The shortcut after USBCANToolSetup is installed is:</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image171.png|77x105px]]</p></li>
<li><p>You also need to install the USB driver</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image172.png|553x112px]]</p></li>
<li><p>The USB port of CANalyst-II analyzer needs to be connected to the USB port of the computer.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image173.png|137x121px]]</p></li>
<li><p>To test the CAN function, you also need to prepare a CAN transceiver as shown in the figure below. The main function of the CAN transceiver is to convert the TTL signal of the CAN controller into the differential signal of the CAN bus.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The 3.3V pin of the CAN transceiver needs to be connected to the 3.3V pin of the 26pin of the development board</p></li>
<li><p>The GND pin of the CAN transceiver needs to be connected to the GND pin of the 26pin of the development board</p></li>
<li><p>The CAN TX pin of the CAN transceiver needs to be connected to the TX pin of the CAN bus in the 26-pin of the development board</p></li>
<li><p>The CAN RX pin of the CAN transceiver needs to be connected to the RX pin of the CAN bus in the 26-pin of the development board</p></li>
<li><p>The CANH pin of the CAN transceiver needs to be connected to the H interface of the analyzer</p></li>
<li><p>The CANL pin of the CAN transceiver needs to be connected to the L interface of the analyzer</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image174.png|352x113px]]</p></li></ol>
</li>
<li><p>Then you can open the USB-CAN software</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image175.png|553x267px]]</p></li>
<li><p>Then click Start Device</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image176.png|553x238px]]</p></li>
<li><p>Then click OK</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image177.png|279x110px]]</p></li>
<li><p>Set the baud rate to 1000k bps</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image178.png|322x268px]]</p></li>
<li><p>After successfully opening, the USB-CAN software will display the serial number and other information</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image179.png|553x262px]]</p></li>
<li><p>Development board receives CAN message test</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, set the baud rate of the CAN bus to '''1000kbps''' in the Linux system of the development board</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 down'''</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 type can bitrate 1000000'''</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 up'''</p></li>
<li><p>Then run the '''candump can0''' command to prepare to receive messages.</p>
<p>orangepi@orangepi:~$ '''sudo candump can0'''</p></li>
<li><p>Then send a message to the development board in the USB-CAN software</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image180.png|553x188px]]</p></li>
<li><p>If the development board can receive the message sent by the analyzer, it means that the CAN bus can be used normally.</p>
<p>orangepi@orangepirv2:~$ '''sudo candump can0'''</p>
<p>'''can0 001 [8] 01 02 03 04 05 06 07 08'''</p></li></ol>
</li>
<li><p>Development board sends CAN message test</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, set the CAN baud rate to '''1000kbps''' in the Linux system</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 down'''</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 type can bitrate 1000000'''</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 up'''</p></li>
<li><p>Execute the '''cansend''' command in the development board to send a message</p>
<p>orangepi@orangepi:~$ '''sudo cansend can0 123#1122334455667788'''</p></li>
<li><p>If the USB-CAN software can receive the message sent by the development board, it means the communication is successful</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image181.png|575x449px|图片1]]
</div></li></ol>
</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 some of the following commands 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>
=== 26pin 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:OrangePi_RV2_X1_User Manual_v1.0.1_image150.png|576x249px]]
<ol style="list-style-type: decimal;">
<li><p>Below, we take pin 7, which corresponds to GPIO 74 and wPi number 2, as an example to demonstrate how to set the high and low levels of the GPIO port.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image151.png|576x126px]]</p></li>
<li><p>The steps for direct command testing 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 26 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>
=== 26pin SPI test ===
<ol style="list-style-type: decimal;">
<li><p>As shown in the figure below, the available spi for Orange Pi RV2 is spi3</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image156.png|575x117px]]</p></li>
<li><p>The corresponding pins of SPI3 in 26 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
|
| style="text-align: left;"| '''SPI3 corresponds to 26 pin'''
|-
| '''MOSI'''
| style="text-align: left;"| '''Pin''' '''19'''
|-
| '''MISO'''
| style="text-align: left;"| '''Pin''' '''21'''
|-
| '''CLK'''
| style="text-align: left;"| '''Pin''' '''23'''
|-
| '''CS0'''
| style="text-align: left;"| '''Pin''' '''24'''
|-
| '''Dtbo configuration'''
| style="text-align: left;"| '''spi3-cs0-spidev'''
|}
<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the SPI in 26 pins is closed by default and needs to be opened manually before use. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select'''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select'''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select and open the SPI3 configuration</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image159.png|370x65px]]</p></li>
<li><p>Then select '''<Save>''' to save</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|366x155px]]</p></li>
<li><p>Then select'''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|360x153px]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system for the configuration to take effect.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image162.png|332x146px]]</p></li></ol>
</li>
<li><p>After restarting, enter the system and check whether there is a device node of '''spidevx.x''' in the Linux system. If it exists, it means that SPI has been set up and can be used directly.</p>
<p>orangepi@orangepi:~$ '''ls /dev/spidev*'''</p>
<p>/dev/spidev3.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/spidev0.0
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="7" 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/spidev0.0
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>
=== 26pin 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 RV2 are i2c3 and i2c3, a total of two i2c buses</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image156.png|575x117px]]</p></li>
<li><p>The corresponding pins of the 4 groups of I2C buses in 26 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''I2C Bus'''
| style="text-align: left;"| '''SDA corresponds to 26pin'''
| style="text-align: left;"| '''SCL corresponds to 26pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''I2C3'''
| style="text-align: left;"| '''Pin 10'''
| style="text-align: left;"| '''Pin 8'''
| style="text-align: left;"| '''i2c3'''
|-
| style="text-align: left;"| '''I2C4'''
| style="text-align: left;"| '''Pin 3'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''i2c4'''
|}
<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the I2C bus in 26 pins is closed by default and needs to be opened manually before it can be used. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select'''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select'''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select the I2C configuration you want to open</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image163.png|373x44px|IMG_256]]
</div></li>
<li><p>Then select '''<Save>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|367x120px]]</p></li>
<li><p>Then select'''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|361x118px]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system for the configuration to take effect.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image162.png|323x142px]]</p></li></ol>
</li>
<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></li>
<li><p>Then connect an i2c device to the i2c pin of the 26pin connector. Here we take the ds1307 RTC module as an example.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image182.png|117x88px]]</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 -r 3''' #i2c3 commands</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y -r 4''' #i2c4 commands</p></li>
<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 /dev/i2c-3'''</p>
<p>Thu 2023-01-05 14:57:55</p>
<p>Thu 2023-01-05 14:57:56</p>
<p>Thu 2023-01-05 14:57:57</p>
<p>^C</p>
<p>exit</p></li></ol>
<span id="pin-uart-test-1"></span>
=== 26pin UART test ===
<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, the available uarts for Orange Pi RV2 are uart5, uart8 and uart9, a total of three uart buses.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image156.png|575x117px]]</p></li>
<li><p>The corresponding pins of the four UART buses in 26 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 26pin'''
| style="text-align: left;"| '''TX corresponds to 26pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''UART5'''
| style="text-align: left;"| '''Pin 11'''
| style="text-align: left;"| '''Pin 12'''
| style="text-align: left;"| '''uart5'''
|-
| style="text-align: left;"| '''UART8'''
| style="text-align: left;"| '''Pin 24'''
| style="text-align: left;"| '''Pin 23'''
| style="text-align: left;"| '''uart8'''
|-
| style="text-align: left;"| '''UART9'''
| style="text-align: left;"| '''Pin 13'''
| style="text-align: left;"| '''Pin 15'''
| style="text-align: left;"| '''uart9'''
|}
<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the UART in 26 pins is disabled by default and needs to be enabled manually. The detailed steps are as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select'''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select'''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select the UART configuration you want to open</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image164.png|355x47px]]</p></li>
<li><p>Then select'''<Save>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|357x117px]]</p></li>
<li><p>Then select'''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|355x117px]]</p></li>
<li><p>Then select <span class="mark"><Reboot></span> to restart the system for the configuration to take effect.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image162.png|320x141px]]</p></li></ol>
</li>
<li><p>After entering the Linux system, first confirm whether there is a device node corresponding to uart under '''/dev'''</p>
<p>orangepi@orangepi:~$ '''ls /dev/ttyS*'''</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 '''serialTest.py''' program in the examples 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.</p>
<p>'''The X in /dev/ttySX needs to be replaced with the serial number of the specific uart device node.'''</p>
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 serialTest.py --device /dev/ttySX'''</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 counting 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 32896,identity is X1 Watchdog</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="how-to-use-docker"></span>
== How to use Docker ==
<ol style="list-style-type: decimal;">
<li><p>The Linux image provided by Orange Pi has Docker pre-installed.</p></li>
<li><p>Then you can use the following command to test docker. If you can run hello-world, it means that docker can be used normally.</p>
<p>orangepi@orangepi:~$ '''sudo docker run hello-world'''</p>
<p>Unable to find image 'hello-world:latest' locally</p>
<p>latest: Pulling from library/hello-world</p>
<p>256ab8fe8778: Pull complete</p>
<p>Digest: sha256:7f0a9f93b4aa3022c3a4c147a449ef11e0941a1fd0bf4a8e6c9408b2600777c5</p>
<p>Status: Downloaded newer image for hello-world:latest</p>
<p>'''Hello from Docker!'''</p>
<p>'''This message shows that your installation appears to be working correctly.'''</p>
<p>.….</p></li></ol>
<span id="test-of-some-programming-languages-supported-by-linux-system"></span>
== Test of some programming languages supported by Linux system ==
<span id="ubuntu-noble-system"></span>
=== Ubuntu Noble 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>
<p>gcc (Ubuntu 13.3.0-6ubuntu2~24.04) '''13.3.0'''</p>
<p>Copyright (C) 2023 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>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.12.3''' (main, Nov 6 2024, 18:32:19) [GCC 13.2.0] on linux</p>
<p>Type "help", "copyright", "credits" or "license" for more information.</p>
<p>>>></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 Noble 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-21</p>
<p>orangepi@orangepi:~$ '''sudo apt install -y openjdk-21-jdk'''</p></li>
<li><p>After installation, you can check the Java version</p>
<p>orangepi@orangepi:~$ '''java --version'''</p>
<p>openjdk 21.0.6 2025-01-21</p>
<p>OpenJDK Runtime Environment (build 21.0.6+11-Ubuntu-1ubuntu124.04)</p>
<p>OpenJDK 64-Bit Server VM (build 21.0.6+11-Ubuntu-1ubuntu124.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-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>'''The names of the deb packages of kernel header files of different kernel versions may be different. Please refer to the actual ones you see.'''</p>
<p>orangepi@orangepi:~$ '''ls /opt/linux-headers*'''</p>
<p>/opt/linux-headers-current-ky_x.x.x_riscv64.deb</p></li>
<li><p>Use the following command to install the kernel header file deb package</p>
<p>'''The name of the kernel header file deb package needs to be replaced with the actual name, please do not copy it.'''</p>
<p>orangepi@orangepi:~$ '''sudo dpkg -i /opt/linux-headers-current-ky_1.x.x_riscv64.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-6.6.63-ky</p></li>
<li><p>Then you can write a hello kernel module to test the kernel header file</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, write the code for the hello kernel module as follows:</p>
<p>orangepi@orangepi:~$ '''vim hello.c'''</p>
<p>#include <linux/init.h></p>
<p>#include <linux/module.h></p>
<p>static int hello_init(void)</p>
<p>{</p>
<p>printk("Hello Orange Pi -- init\n");</p>
<p>return 0;</p>
<p>}</p>
<p>static void hello_exit(void)</p>
<p>{</p>
<p>printk("Hello Orange Pi -- exit\n");</p>
<p>return;</p>
<p>}</p>
<p>module_init(hello_init);</p>
<p>module_exit(hello_exit);</p>
<p>MODULE_LICENSE("GPL");</p></li>
<li><p>Then write the Makefile file to compile the hello kernel module as follows:</p>
<p>orangepi@orangepi:~$ '''vim Makefile'''</p>
<p>ifneq ($(KERNELRELEASE),)</p>
<p>obj-m:=hello.o</p>
<p>else</p>
<p>KDIR :=/lib/modules/$(shell uname -r)/build</p>
<p>PWD :=$(shell pwd)</p>
<p>all:</p>
<p>make -C $(KDIR) M=$(PWD) modules</p>
<p>clean:</p>
<p>rm -f *.ko *.o *.mod.o *.mod *.symvers *.cmd *.mod.c *.order</p>
<p>endif</p></li>
<li><p>Then use the make command to compile the hello kernel module. The output of the compilation process is as follows:</p>
<p>'''If there is a problem compiling the copied code here, you can directly use the source code pre-installed in the Linux system. The path of the hello source code is:''' '''/usr/src/hello.'''</p>
<p>orangepi@orangepi:~$ '''sudo make'''</p>
<p>make -C /lib/modules/6.6.63-ky/build M=/home/orangepi modules</p>
<p>make[1]: Entering directory '/usr/src/linux-headers-6.6.63-ky'</p>
<p>CC [M] /home/orangepi/hello.o</p>
<p>MODPOST /home/orangepi/Module.symvers</p>
<p>CC [M] /home/orangepi/hello.mod.o</p>
<p>LD [M] /home/orangepi/hello.ko</p>
<p>make[1]: Leaving directory '/usr/src/linux-headers-6.6.63-ky'</p></li>
<li><p>After compilation, the '''hello.ko''' kernel module will be generated</p>
<p>orangepi@orangepi:~$ '''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:~$ '''sudo insmod hello.ko'''</p></li>
<li><p>hen 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:~$ '''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:~$ '''sudo rmmod hello'''</p>
<p>orangepi@orangepi:~$ '''dmesg | grep "Hello"'''</p>
<p>[ 2871.893988] Hello Orange Pi -- init</p>
<p>[ 3173.800892] '''Hello Orange Pi -- exit'''</p></li></ol>
</li></ol>
<span id="how-to-use-2.10.1-inch-mipi-lcd-screen"></span>
== How to use 2.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:OrangePi_RV2_X1_User Manual_v1.0.1_image183.png|264x204px]]</p></li>
<li><p>Screen adapter board + 31pin to 26pin cable</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image184.png|170x147px|DD9A8F44-0D8F-4f06-9473-B539DEED850C]]
</div></li>
<li><p>30pin MIPI cable</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image185.png|487x45px|C2164119-6EC3-49ae-9A95-BE323F51FAE1]]
</div></li>
<li><p>12pin touch screen cable</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image186.png|296x43px]]</p></li></ol>
</li>
<li><p>Connect the 12-pin touch screen cable, 31-pin to 26-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:OrangePi_RV2_X1_User Manual_v1.0.1_image187.png|574x142px]]</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 26pin cable.</p></li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image188.png|253x372px]]
<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:OrangePi_RV2_X1_User Manual_v1.0.1_image189.png|159x101px]]</p></li>
<li><p>Finally, connect it to the LCD interface of the development board through the 30pin MIPI cable</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image190.png|300x198px]]</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 ===
# 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.
# The location of the interface of the mipi lcd screen on the development board is shown in the figure below:
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image191.png|286x193px]]
<ol start="3" style="list-style-type: decimal;">
<li><p>The steps to open the mipi lcd configuration are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select'''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select'''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the '''lcd''', and then use the '''spacebar''' to select</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image192.png|372x40px|IMG_256]]
</div></li>
<li><p>Then select'''<Save>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|367x120px]]</p></li>
<li><p>Then select'''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|355x117px]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system for the configuration to take effect.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image193.png|265x123px]]</p>
<p>'''The above configuration will eventually add''' '''overlays=lcd''' '''to''' '''/boot/orangepiEnv.txt''' '''You can check it after setting it. If this line does not exist, then there is a problem with the configuration.'''</p>
<p>'''If you find it troublesome to use orangepi-config, you can also use the vim editor to open''' '''/boot/orangepiEnv.txt''' '''and add the line''' '''overlays=lcd.'''</p>
<p>orangepi@orangepi:~$ '''cat /boot/orangepiEnv.txt | grep "lcd"'''</p>
<p>'''overlays=lcd #Example Configuration'''</p></li></ol>
</li>
<li><p>After startup, you can see the display of the LCD screen as shown below (the default is vertical screen):</p></li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image194.png|253x351px]]
<span id="how-to-rotate-the-display-direction-of-the-server-version-image"></span>
=== How to rotate the display direction of the server version image ===
<ol style="list-style-type: decimal;">
<li><p>Add '''extraargs=fbcon=rotate:direction to rotate''' in '''/boot/orangepiEnv.txt''' to set the display direction of the server version of Linux system. The number after '''fbcon=rotate''': can be set to:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>0: Normal screen (portrait by default)</p></li>
<li><p>1: Rotate 90 degrees clockwise</p></li>
<li><p>2: Flip 180 degrees</p></li>
<li><p>3: Rotate 270 degrees clockwise</p>
<p>orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''</p>
<p>'''extraargs=fbcon=rotate:3'''</p></li></ol>
</li>
<li><p>Then restart the Linux system and you will see that the direction of the LCD screen display has rotated</p></li></ol>
<span id="desktop-version-mirroring-rotation-display-and-touch-direction-method"></span>
=== Desktop version mirroring rotation display and touch direction method ===
<ol style="list-style-type: decimal;">
<li><p>First click on the upper right corner of the desktop, then click on the settings icon to open the settings interface</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image85.png|364x204px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image86.png|363x204px]]</p></li>
<li><p>Then find '''Display''' in the settings interface</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image195.png|332x174px]]</p></li>
<li><p>Then select the direction you want to rotate in '''Orientation'''</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Landscape''': No rotation</p></li>
<li><p>'''Portrait Left''': Rotate 90 degrees left</p></li>
<li><p>'''Landscape(flipped)''': Flip upside down, equivalent to rotating 180 degrees</p></li>
<li><p>'''Portrait Right''': Rotate right 90 degrees</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image196.png|315x253px]]</p></li></ol>
</li>
<li><p>Then click '''Apply'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image197.png|329x262px]]</p></li></ol>
<span id="test-methods-for-ov13850-and-ov13855-mipi-cameras"></span>
== Test methods for OV13850 and OV13855 MIPI cameras ==
Currently the development board supports two MIPI cameras, OV13850 and OV13855. The specific pictures are as follows:
<ol style="list-style-type: lower-alpha;">
<li><p>13MP OV13850 camera with MIPI interface</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image17.png|184x103px]]</p></li>
<li><p>13MP OV13855 camera with MIPI interface</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image18.png|173x102px]]</p>
<p>The adapter board and FPC cable used by OV13850 and OV13855 cameras are the same, but the two cameras are connected to the adapter board in different positions. The FPC cable is shown in the figure below. Please note that the FPC cable has a direction. The end marked with '''TO MB''' needs to be plugged into the camera interface of the development board, and the end marked with '''TO CAMERA''' needs to be plugged into the camera adapter board.</p></li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image198.png|343x72px]]
There are a total of 3 camera interfaces on the camera adapter board. Only one can be connected at a time, as shown in the following figure:
<ol style="list-style-type: lower-alpha;">
<li><p>'''Interface 1 is connected to the OV13850 camera'''</p></li>
<li><p>'''Interface 2 is connected to the OV13855 camera'''</p></li>
<li><p>Interface 3 is not used, just ignore it</p></li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image199.jpeg|288x172px|C:\Users\orangepi\Desktop\用户手册插图\Pi5 Plus\未标题-13.jpg未标题-13]]
</div>
There are 2 camera interfaces on the Orange Pi RV2 development board. The positions of CAM1 and CAM2 are shown in the figure below.:
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image200.png|296x209px]]
The method of inserting the camera into the Cam0 interface of the development board is as follows:
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image201.png|294x154px]]
The method of inserting the camera into the Cam1 interface of the development board is as follows::
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image202.png|306x156px]]
After connecting the camera to the development board, we can use the following method to test the camera:
<ol style="list-style-type: lower-alpha;">
<li><p>Then open a terminal in the desktop system and the command to open CAM1 is as follows</p>
<p>orangepi@orangepi:~$ '''gst-launch-1.0 kysrc location=/opt/camtest_sensor0_mode0.json ! waylandsink \'''</p>
<p>'''sync=0 render-rectangle="<0,0,1920,1080>"'''</p></li>
<li><p>Then open a terminal in the desktop system and the command to open CAM2 is as follows</p>
<p>orangepi@orangepi:~$ '''gst-launch-1.0 kysrc location=/opt/camtest_sensor2_mode0.json ! waylandsink \'''</p>
<p>'''sync=0 render-rectangle="<0,0,1920,1080>"'''</p></li></ol>
'''Note that if you are using an OV13850 camera, you need to modify the sensor_name of the json file to ov13850_spm. In addition, OV13850 does not currently support 3A.'''
'''In the above command, the json file used by CAM1 is camtest_sensor0_mode0.json, and the json file used by CAM2 is camtest_sensor2_mode0.json.'''
<ol start="3" style="list-style-type: lower-alpha;">
<li><p>Then you can see the camera preview</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image203.png|353x198px|Screenshot from 2025-01-09 08-25-51]]
</div></li></ol>
<span id="methods-for-running-large-models"></span>
== Methods for Running Large Models ==
<span id="model-support-list"></span>
=== Model Support List ===
{| class="wikitable"
|-
| style="text-align: center;"| Model name
| style="text-align: center;"| C++reasoning
|
| style="text-align: center;"| Python reasoning
|
|-
| style="text-align: center;"|
| style="text-align: center;"| Memory (G)
| Performance (TPS)
| style="text-align: center;"| Performance (TPS)
| Performance (TPS)
|-
| style="text-align: center;"| llama-cn-int4-1b
| style="text-align: center;"| 1.55
| 4.44
| style="text-align: center;"| 1.58
| 4.47
|-
| style="text-align: center;"| [https://huggingface.co/shenzhi-wang/Llama3-8B-Chinese-Chat '''llama3-int4-8b-blk64-fusion''']
| style="text-align: center;"| 4.70
| 1.22
| style="text-align: center;"| 4.64
| 1.36
|-
| style="text-align: center;"| [https://huggingface.co/openbmb/MiniCPM-S-1B-sft-llama-format '''minicpm-1b-int4-blk64-fusion''']
| style="text-align: center;"| 1.52
| 5.08
| style="text-align: center;"| 1.53
| 5.39
|-
| style="text-align: center;"| [https://huggingface.co/microsoft/Phi-3-mini-4k-instruct '''phi-3-mini-int4-3.8b''']
| style="text-align: center;"| 2.79
| 2.01
| style="text-align: center;"| 2.83
| 2.00
|-
| style="text-align: center;"| [https://huggingface.co/Qwen/Qwen2-1.5B-Instruct '''qwen2-int4-1.5b''']
| style="text-align: center;"| 1.74
| 4.19
| style="text-align: center;"| 1.76
| 4.09
|-
| style="text-align: center;"| [https://huggingface.co/Qwen/Qwen2-0.5B-Instruct '''qwen2-int4-0.5b''']
| style="text-align: center;"| 1.16
| 11.03
| style="text-align: center;"| 1.16
| 12.52
|}
Clicking on the model name will redirect you to the download link of the original model file. The performance data may have certain deviations based on different inputs and outputs, and the above results are for reference only. If the performance is significantly low, please check the parameters used during model construction.
<span id="environmental-preparation"></span>
=== Environmental Preparation ===
# A PC with Ubuntu 22.04 operating system installed.
'''Please try to use a PC with 32GB or more of memory, otherwise the model may fail due to insufficient memory during construction.'''
'''In this document, we demonstrate using the Ubuntu 22.04 (x64) operating system. Please test other versions of the operating system yourself.'''
<ol start="2" style="list-style-type: decimal;">
<li><p>An Orange Pi RV2 development board with Ubuntu 24.04 system installed.</p></li>
<li><p>Download the KY ORT toolkit from official sources.</p></li>
<li><p>Refer to the '''model support list''' and prepare the original model files that need to be built. We also provide the constructed model file in the official documentation.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image204.png|576x211px]]</p></li></ol>
<span id="model-construction-optional"></span>
=== Model Construction (optional) ===
If you want to perform model conversion yourself, you can use a model conversion tool to convert the large models provided on Huggingface or ModelScope into supported model formats for optimal adaptation. The following steps are all completed on Ubuntu PC. Taking the Qwen2.5-0.5B-Instruction model as an example, the specific steps are as follows:
<ol style="list-style-type: decimal;">
<li><p>Download the models listed in the reference '''model support list''' from Huggingface or ModelScope. Taking the Qwen2.5-0.5B-Instruction model as an example.</p>
<p>test@test:~$ '''sudo apt install -y git-lfs'''</p>
<p>test@test:~$ '''git clone https://www.modelscope.cn/Qwen/Qwen2.5-0.5B-Instruct.git'''</p></li>
<li><p>Extract the ky ort toolkit and install the relevant dependencies.</p>
<p>test@test:~$ '''tar zxf ky-ort.riscv64.1.2.2.tar.gz'''</p>
<p>test@test:~$ '''pip3 install -r ky-ort.riscv64.1.2.2/python/genai-builder/requirements.txt \'''</p>
<p>'''-i https://mirrors.huaweicloud.com/repository/pypi/simple'''</p></li>
<li><p>Execute the following command to build a model file suitable for Orange Pi RV2.</p>
<p>test@test:~$ '''cd ky-ort.riscv64.1.2.2/python/genai-builder'''</p>
<p>test@test:~/ky-ort.riscv64.1.2.2/python/genai-builder'''$ python3 builder.py \'''</p>
<p>'''-i /home/test/Qwen2.5-0.5B-Instruct/ -o /home/test/qwen2-int4-0.5b/ \'''</p>
<p>'''-p int4 -e cpu -c /home/test/tmp --extra_options int4_block_size=64 int4_accuracy_level=4'''</p>
<ol style="list-style-type: lower-alpha;">
<li><p>-i /home/test/Qwen2.5-0.5B-Instruct/:Original model path.</p></li>
<li><p>-o /home/test/qwen2-int4-0.5b/:Output model path.</p></li>
<li><p>-p int4:Set the output model accuracy to int4.</p></li>
<li><p>-e cpu:Built using CPU.</p></li>
<li><p>-c model_cache:Model cache path.</p></li>
<li><p>int4_block_size=64: Additional parameter, set the block size to 64 when using int4 quantization.</p></li>
<li><p>int4_accuracy_level=4: Additional parameters are set to quantize input A of MatMul to int8 and convert input B up to int8 for computation.</p></li>
<li><p>For other parameters, please use the "python3 builder. py -- help" command to query the relevant instructions.</p></li></ol>
</li>
<li><p>After the conversion is completed, enter the model save directory and confirm that the conversion is correct.</p>
<p>test@test:~/qwen2-int4-0.5b$ '''ls -lh'''</p>
<p>total 804M</p>
<p>-rw-r--r-- 1 test test 605 Jan 13 13:35 added_tokens.json</p>
<p>-rw-r--r-- 1 test test 1.5K Jan 13 13:35 genai_config.json</p>
<p>-rw-r--r-- 1 test test 1.6M Jan 13 13:35 merges.txt</p>
<p>-rw-r--r-- 1 test test 164K Jan 13 13:35 model.onnx</p>
<p>-rw-r--r-- 1 test test 793M Jan 13 13:35 model.onnx.data</p>
<p>-rw-r--r-- 1 test test 613 Jan 13 13:35 special_tokens_map.json</p>
<p>-rw-r--r-- 1 test test 6.8M Jan 13 13:35 tokenizer.json</p>
<p>-rw-r--r-- 1 test test 8.2K Jan 13 13:35 tokenizer_config.json</p>
<p>-rw-r--r-- 1 test test 2.7M Jan 13 13:35 vocab.json</p></li></ol>
<span id="model-reasoning"></span>
=== Model Reasoning ===
'''It is recommended to use a development board with 8GB of memory for testing. A development board with 2GB or 4GB of memory may not run the model due to insufficient memory.'''
<ol style="list-style-type: decimal;">
<li><p>Upload the model file constructed in the previous section or the model file downloaded from official sources to the development board Linux system according to the steps in the "Methods for Uploading Files" section. For example, we upload it to the "/home/orangepi/models" directory.</p></li>
<li><p>Upload the KY ORT toolkit to the development board Linux system according to the steps in the "Methods" section.</p></li>
<li><p>Use the following command to decompress the ky ort toolkit.</p>
<p>orangepi@orangepirv2:~$ '''tar zxf ky-ort.riscv64.1.2.2.tar.gz'''</p></li>
<li><p>Follow the steps below to compile the cpp demo.</p>
<p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2$ '''bash scripts/build_samples_riscv64.sh'''</p></li>
<li><p>After successful compilation, the following files can be found in the build/iscv64 directory:</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2$ '''ls build/riscv64/'''</p>
<p>'''chatllm_demo''' CMakeCache.txt CMakeFiles cmake_install.cmake imagenet_test</p>
<p>Makefile phi3v run_demo</p></li>
<li><p>Execute the following command to update Python dependencies:</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2$ '''cd python'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/python$ '''pip3 install ./onnxruntime_genai-0.4.0.dev1-cp312-cp312-linux_riscv64.whl ./ky_ort-1.2.2-cp312-cp312-linux_riscv64.whl --break-system-packages'''</p></li></ol>
<span id="llama-1b"></span>
==== Llama-1B ====
<ol style="list-style-type: decimal;">
<li><p>The C++inference command is as follows:</p>
<p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/build/riscv64/'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/build/riscv64$ '''./chatllm_demo ~/models/llama-cn-int4-1b/ llama3'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image205.png|576x95px]]</p></li>
<li><p>The Python inference command is as follows:</p>
<p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/samples'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/samples$ '''python3 llm_qa.py -m ~/models/llama-cn-int4-1b/ -l 128 -e llama3 -v -g'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image206.png|575x155px]]</p></li></ol>
<span id="llama3-8b"></span>
==== Llama3-8B ====
<ol style="list-style-type: decimal;">
<li><p>The C++inference command is as follows:</p>
<p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/build/riscv64/'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/build/riscv64$ '''./chatllm_demo ~/models/llama3-int4-8b-blk64-fusion/ llama3'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image207.png|576x211px]]</p></li>
<li><p>The Python inference command is as follows:</p>
<p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/samples'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/samples$ '''python3 llm_qa.py -m ~/models/llama3-int4-8b-blk64-fusion/ -l 128 -e llama3 -v -g'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image208.png|576x143px]]</p></li></ol>
<span id="minicpm-1b"></span>
==== Minicpm-1B ====
# The C++inference command is as follows:
<!-- -->
<ol style="list-style-type: decimal;">
<li><p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/build/riscv64/'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/build/riscv64$ '''./chatllm_demo ~/models/minicpm-1b-int4-blk64-fusion/ minicpm'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image209.png|576x205px]]</p></li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li>The Python inference command is as follows:</li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li><p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/samples'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/samples$ '''python3 llm_qa.py -m ~/models/minicpm-1b-int4-blk64-fusion/ -l 128 -e minicpm -v -g'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image210.png|575x141px]]</p></li></ol>
<span id="phi3-3.8b"></span>
==== Phi3-3.8B ====
# The C++inference command is as follows:
<!-- -->
<ol style="list-style-type: decimal;">
<li><p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/build/riscv64/'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/build/riscv64$ '''./chatllm_demo ~/models/phi-3-mini-int4-3.8b/ phi3'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image211.png|575x100px]]</p></li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li>The Python inference command is as follows:</li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li><p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/samples'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/samples$ '''python3 llm_qa.py -m ~/models/phi-3-mini-int4-3.8b/ -l 128 -e phi3 -v -g'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image212.png|575x122px]]</p></li></ol>
<span id="qwen2-1.5b"></span>
==== qwen2-1.5B ====
# The C++inference command is as follows:
<!-- -->
<ol start="3" style="list-style-type: decimal;">
<li><p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/build/riscv64/'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/build/riscv64$ '''./chatllm_demo ~/models/qwen2-int4-1.5b/ qwen2'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image213.png|575x178px]]</p></li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li>The Python inference command is as follows:</li></ol>
<!-- -->
<ol start="4" style="list-style-type: decimal;">
<li><p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/samples'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/samples$ '''python3 llm_qa.py -m ~/models/qwen2-int4-1.5b/ -l 128 -e qwen2 -v -g'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image214.png|575x138px]]</p></li></ol>
<span id="qwen2-0.5b"></span>
==== qwen2-0.5B ====
# The C++inference command is as follows:
<!-- -->
<ol style="list-style-type: decimal;">
<li><p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/build/riscv64/'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/build/riscv64$ '''./chatllm_demo ~/models/qwen2-int4-0.5b/ qwen2'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image215.png|576x137px]]</p></li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li>The Python inference command is as follows:</li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li><p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/samples'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/samples$ '''python3 llm_qa.py -m ~/models/qwen2-int4-0.5b/ -l 128 -e qwen2 -v -g'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image216.png|576x85px]]</p></li></ol>
<span id="use-of-deepseek"></span>
== Use of DeepSeek ==
<span id="installing-openwebui"></span>
=== Installing OpenWebUI ===
<ol style="list-style-type: decimal;">
<li><p>The installation command for openwebui is as follows.</p>
<p>orangepi@orangepirv2:~$ '''sudo apt install /opt/openwebui_0.0.1_riscv64.deb'''</p></li>
<li><p>Then click on the application icon shown in the figure below to open the OpenWebUI application.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image217.png|574x322px]]</p></li>
<li><p>The display interface of the OpenWebUI application is shown below, and registration is required before use.</p></li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image218.png|325x233px|D106B71A-8040-4db5-9628-D97C80B039F2]]
</div>
<span id="methods-for-shutting-down-and-restarting-the-development-board"></span>
== Methods for shutting down and restarting the development board ==
<ol style="list-style-type: decimal;">
<li><p>During the operation of the Linux system, if the Type-C power is directly unplugged and the power is cut off, it may cause the file system to lose some data or be damaged. Therefore, please use the '''poweroff''' command to shut down the Linux system of the development board before unplugging the power.</p>
<p>orangepi@orangepi:~$ '''sudo poweroff'''</p></li>
<li><p>In addition, the development board is equipped with power on/off buttons, and you can also '''short press''' the power on/off button on the development board to shut down.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image219.png|359x124px]]</p></li></ol>
'''Note that when the Linux desktop system presses the power on/off button, a confirmation box will pop up as shown in the figure below. You need to click the''' '''Power off''' '''option before shutting down.'''
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image220.png|285x210px]]
<ol start="3" style="list-style-type: decimal;">
<li><p>After shutting down, press the power button on the development board briefly to turn it on.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image219.png|359x124px]]</p></li>
<li><p>The command to restart the Linux system is:</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 ==
<ol style="list-style-type: decimal;">
<li><p>The Linux SDK, also known as '''orangepi-build''', supports running on computers with '''Ubuntu 22.04''' installed. Therefore, before downloading orangepi build, please make sure that the Ubuntu version installed on your computer is Ubuntu 22.04. The command to check the installed Ubuntu version on the computer is as follows. If the Release field does not display '''22.04''', it means that the current Ubuntu version used does not meet the requirements. Please replace the system before performing the following operations.</p>
<p>test@test:~$ '''lsb_release -a'''</p>
<p>No LSB modules are available.</p>
<p>Distributor ID: Ubuntu</p>
<p>Description: Ubuntu 22.04 LTS</p>
<p>Release: '''22.04'''</p>
<p>Codename: jammy</p></li>
<li><p>If the computer is installed with a Windows system and does not have Ubuntu 22.04 installed, you can consider using '''VirtualBox''' or '''VMware''' to install an Ubuntu 22.04 virtual machine on the Windows system. However, please note that do not compile orangepi build on a WSI virtual machine, as orangepi build has not been tested on a WSI virtual machine, so it cannot be guaranteed that orangepi build can be used properly in WSI.</p></li>
<li><p>The installation image download address for Ubuntu 22.04 '''amd64''' version is:</p>
<p>[https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04/ubuntu-22.04.3-desktop-amd64.iso '''https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04/ubuntu-22.04.3-desktop-amd64.iso''']</p>
<p>或者</p>
<p>[https://repo.huaweicloud.com/ubuntu-releases/22.04/ubuntu-22.04.3-desktop-amd64.iso '''https://repo.huaweicloud.com/ubuntu-releases/22.04/ubuntu-22.04.3-desktop-amd64.iso''']</p></li>
<li><p>After installing Ubuntu 22.04 on a computer or virtual machine, please first set the software source of Ubuntu 22.04 to Qinghua Source, otherwise errors may occur during software installation due to network issues</p>
<ol style="list-style-type: lower-alpha;">
<li>The method of replacing Tsinghua Source can refer to the instructions on this webpage</li></ol>
</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 Ubuntu version needs to be switched to 22.04</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image221.png|576x241px]]</p></li>
<li><p>The contents of the'''/etc/apt/sources.list''' file that needs to be replaced are</p>
<p>test@test:~$ '''sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak'''</p>
<p>test@test:~$ '''sudo vim /etc/apt/sources.list'''</p>
<p># By default, the source code image has been annotated to improve the speed of apt updates. If necessary, you can remove the annotation yourself</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 replacement, it is necessary to update the package information and ensure that there are no errors</p>
<p>test@test:~$ '''sudo apt update'''</p></li>
<li><p>'''In addition, since the kernel and U-boot source code are stored on GitHub, it is important to ensure that the computer can download the code from GitHub properly when compiling the image.'''</p></li></ol>
<span id="obtain-the-source-code-of-linux-sdk"></span>
== Obtain the source code of Linux SDK ==
<span id="download-orangepi-build-from-github"></span>
=== Download Orangepi build from GitHub ===
# The Linux SDK actually refers to the Orangepi build code, which is modified based on the armbian build compilation system. Using Orangepi build, multiple versions of Linux images can be compiled. First, download the code for orangepi build. The command is as follows:
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 the Orange Pi RV2 development board requires downloading the''' '''next''' '''branch source code of orangepi build. The git clone command above needs to specify the branch of orangepi build source code as next.'''
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image222.png|576x298px|图片6]]
</div>
'''Downloading the code for orangepi build through the git clone command does not require entering the username and password of the GitHub account (the same applies to downloading other code in this manual). If Ubuntu PC prompts for the username and password of the GitHub account after entering the git clone command, it is usually due to an incorrect input of the address of the orangepi build repository after git clone. Please carefully check the spelling of the command for errors, rather than thinking that we forgot to provide the username and password of the GitHub account here.'''
<ol start="2" style="list-style-type: decimal;">
<li>The u-boot and Linux kernel versions currently used on the development board are as follows</li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''Branch'''
| 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 22.10'''
| style="text-align: left;"| '''Linux6.6'''
|}
'''The branch mentioned here and the branch of orangepi build source code are not the same thing, please don't confuse them. This branch is mainly used to distinguish between different versions of kernel source code.'''
<ol start="3" style="list-style-type: decimal;">
<li><p>After downloading orangepi build, it will include the following files and folders</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 images, specific scripts, and source code for some programs, etc</p></li>
<li><p>'''LICENSE''': GPL 2 License File</p></li>
<li><p>'''README.md''': Orangepi build documentation</p></li>
<li><p>'''scripts''': General 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 code for Orangepi build from GitHub, you may find that the Orangepi build does not include the source code for u-boot and Linux kernel, nor does it require a cross compilation toolchain to compile u-boot and Linux kernel. This is normal because these things are stored in other separate GitHub repositories or on certain servers (the addresses will be detailed below). Orangepi build specifies the addresses of u-boot, Linux kernel, and cross compilation toolchain in the script and configuration files. 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>
</li></ol>
<span id="download-the-cross-compilation-toolchain"></span>
=== Download the cross compilation toolchain ===
'''The cross compilation toolchain will only be downloaded when using orangepi build to compile the image on an x64 computer. Compiling the Linux image of the development board in Ubuntu 22.04 will not download cross compilation toolchains, and orangepi build/toolchains will be an empty folder.'''
<ol style="list-style-type: decimal;">
<li><p>When Orangepi build runs for the first time, it automatically downloads the cross compilation toolchain and places it in the '''toolchains''' folder. After running the build.sh script of Orangepi build, it checks whether all the cross compilation toolchains in '''toolchains''' exist. If they do not exist, it will restart the download. If they do exist, it will be used directly without repeated downloads.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image223.png|575x278px|选区_396]]
</div></li>
<li><p>The mirror website of the cross compilation toolchain in China is the open source software mirror site of Tsinghua University</p>
<p>[https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/ '''https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/''']</p></li>
<li><p>After downloading '''toolchains''', multiple versions of cross compilation toolchains will be included, and the development board will only use two of them</p>
<p>test@test:~/orangepi-build$ '''ls toolchains/'''</p>
<p>gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu</p>
<p>gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf</p>
<p>gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu</p>
<p>gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf</p>
<p>gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi</p>
<p>gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf</p>
<p>gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu</p>
<p>gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi</p>
<p>gcc-linaro-aarch64-none-elf-4.8-2013.11_linux</p>
<p>gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux</p>
<p>gcc-linaro-arm-none-eabi-4.8-2014.04_linux</p></li>
<li><p>The cross compilation toolchain used to compile Linux kernel source code is</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Linux6.6</p>
<p>'''riscv64-unknown-linux-gnu-gcc'''</p></li></ol>
</li>
<li><p>The cross compilation toolchain used to compile the u-boot source code is</p>
<ol style="list-style-type: lower-alpha;">
<li><p>v2022.10</p>
<p>'''riscv64-unknown-linux-gnu-gcc'''</p></li></ol>
</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:</p>
<p>'''https://github.com/orangepi-xunlong/linux-orangepi/tree/orange-pi-6.6-ky'''</p></li>
<li><p>The git repository where the u-boot source code is stored is as follows:</p>
<p>'''https://github.com/orangepi-xunlong/u-boot-orangepi/tree/v2022.10-ky'''</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, and the folder named '''orange-pi-6.6-ky''' contains the kernel source code of the current branch of the Orange Pi RV2 development board. Please do not manually modify the name of the kernel source code folder. If modified, the compiled system will re download the kernel source code during runtime</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, and the folder named '''v2022.10-ky''' contains the u-boot source code of the current branch of the Orange Pi RV2 series development board. Please do not manually modify the name of the u-boot source code folder. If it is modified, the compilation system will re download the u-boot source code when running</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:OrangePi_RV2_X1_User Manual_v1.0.1_image224.png|576x132px|选区_238]]
</div></li>
<li><p>Next, select the model of the development board</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image225.png|576x220px|C9777014-7083-4156-8EA2-97572BDEBA99]]
</div></li>
<li><p>Then it will start compiling u-boot, and some of the information prompted during compilation is explained 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 [ '''v2022.10''' ]</p></li>
<li><p>Version of cross compilation toolchain</p>
<p>[ o.k. ] Compiler version [ '''riscv64-unknown-linux-gnu-gcc 13.2.1''' ]</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-orangepirv2_1.0.0_riscv64.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=orangepirv2 BRANCH=current BUILD_OPT=u-boot KERNEL_CONFIGURE=no''' ]</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-orangepirv2_1.0.0_riscv64.deb</p></li>
<li><p>The generated deb package of u-boot contains the following files</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Use the following command to decompress the deb package</p>
<p>test@test:~/orangepi-build$ '''cd output/debs/u-boot'''</p>
<p>test@test:~/orangepi_build/output/debs/u-boot$ $ '''dpkg -x''' \</p>
<p>'''linux-u-boot-current-orangepirv2_1.0.0_riscv64.deb . (Please note that there is a '.' at the end of the command)'''</p>
<p>test@test:~/orangepi_build/output/debs/u-boot$ '''ls'''</p>
<p>linux-u-boot-current-orangepirv2_1.0.0_riscv64.deb '''usr'''</p></li>
<li><p>The decompressed file is shown below</p>
<p>test@test:~/orangepi-build/output/debs/u-boot$ '''tree usr'''</p>
<p>usr</p>
<p>└── lib</p>
<p>├── linux-u-boot-current-orangepirv2_1.0.0_riscv64</p>
<p>│ ├── bootinfo_emmc.bin</p>
<p>│ ├── bootinfo_sd.bin</p>
<p>│ ├── bootinfo_spinor.bin</p>
<p>│ ├── FSBL.bin</p>
<p>│ ├── u-boot-env-default.bin</p>
<p>│ └── u-boot-opensbi.itb</p>
<p>└── u-boot</p>
<p>├── LICENSE</p>
<p>├── platform_install.sh</p>
<p>└── x1_defconfig</p>
<p>3 directories, 9 files</p></li></ol>
</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 u-boot source code on the GitHub server. Therefore, if you want to modify the u-boot source code, you first need to turn off the download and update function of the source code '''(you need to compile the u-boot completely before turning off this function, otherwise it will prompt that the u-boot source code cannot be found. If it is a compressed source code downloaded from Baidu Cloud Drive, there is no problem because the u-boot source code is already cached)'''. Otherwise, the modifications made will be restored. The method is as follows:</p>
<p>Set the IGNOREUPDATES variable to "yes" in userpatches/config-default.conf</p>
<p>test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''</p>
<p>IGNORE_UPDATES="'''yes'''"</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>Upload the compiled deb package of u-boot to the Linux system of 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-orangepirv2_1.0.0_riscv64.deb [mailto:[email protected]:/root [email protected]:/root]'''</p></li>
<li><p>Then log in to the development board and uninstall the deb package of the installed u-boot</p>
<p>root@orangepi:~# '''apt purge -y linux-u-boot-orangepirv2-current'''</p></li>
<li><p>Reinstall the newly uploaded deb package for u-boot</p>
<p>root@orangepi:~# '''dpkg -i''' '''linux-u-boot-current-orangepirv2_1.0.0_riscv64.deb'''</p></li>
<li><p>Then run the nand sata install script</p>
<p>root@orangepi:~# '''nand-sata-install'''</p></li>
<li><p>Then select '''5 Install/Update the bootloader on SD/eMM''' to update u-boot in TF card or '''7 Install/Update the bootloader on SPI Flash''' to update u-boot in SPI Flash</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image226.png|312x152px]]</p></li>
<li><p>After pressing the enter key, a warning will first pop up</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image227.png|309x168px]]</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:OrangePi_RV2_X1_User Manual_v1.0.1_image228.png|244x137px]]</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>
<li><p>Other useful information</p>
<ol style="list-style-type: lower-alpha;">
<li><p>In the U-boot 2022.10 source code, the defconfig configuration file used by the development board is</p></li>
<li><p>[[orangepi-build/u-boot/v2022.10-ky/configs/x1_defconfig|'''orangepi-build/u-boot/v2022.10-ky/configs/x1_defconfig''']]In the U-boot 2022.10 source code, the development board uses dts files as</p></li></ol>
</li></ol>
<span id="orangepi-buildu-bootv2022.10-kyarchriscvdtsx1_orangepi-rv2.dtscompiling-linux-kernel"></span>
== [[orangepi-build/u-boot/v2022.10-ky/arch/riscv/dts/x1_orangepi-rv2.dts|'''orangepi-build/u-boot/v2022.10-ky/arch/riscv/dts/x1_orangepi-rv2.dts'''<span id="_Toc4396" class="anchor"></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:OrangePi_RV2_X1_User Manual_v1.0.1_image229.png|575x116px|选区_240]]
</div></li>
<li><p>Next, select the model of the development board</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image225.png|576x220px|C9777014-7083-4156-8EA2-97572BDEBA99]]
</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:OrangePi_RV2_X1_User Manual_v1.0.1_image230.png|576x87px]]</p></li>
<li><p>If step 4) 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 then start compiling the kernel source code</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image231.png|575x400px]]</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''' 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:OrangePi_RV2_X1_User Manual_v1.0.1_image232.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 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 [ '''6.6.63''' ]</p></li>
<li><p>The version of the cross compilation toolchain used</p>
<p>[ o.k. ] Compiler version [ '''riscv64-unknown-linux-gnu-gcc 13.2.1''' ]</p></li>
<li><p>The default configuration file used by the kernel and the path where it is stored</p>
<p>[ o.k. ] Using kernel config file [ '''config/kernel/linux-ky-current.config''' ]</p></li>
<li><p>The path of the compiled kernel related deb package</p>
<p>[ o.k. ] Target directory [ '''orangepi-build/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-ky_1.0.0_riscv64.deb''' ]</p></li>
<li><p>Compilation time used</p>
<p>[ o.k. ] Runtime [ '''5 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=orangepirv2 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-ky_1.0.0_riscv64.deb''' Contains dtb files used by the kernel</p></li>
<li><p>'''linux-headers-current-ky_1.0.0_riscv64.deb''' Contains kernel header files</p></li>
<li><p>'''linux-image-current-ky_1.0.0_riscv64.deb''' Contains kernel images and kernel modules</p>
<p>test@test:~/orangepi-build$ '''ls output/debs/linux-*'''</p>
<p>output/debs/linux-dtb-current-ky_1.0.0_riscv64.deb output/debs/linux-image-current-ky_1.0.0_riscv64.deb</p>
<p>output/debs/linux-headers-current-ky_1.0.0_riscv64.deb</p></li></ol>
</li>
<li><p>The deb package of the generated Linux image contains the following files</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Use the following command to decompress the deb package</p>
<p>test@test:~/orangepi-build$ '''cd output/debs'''</p></li></ol>
</li></ol>
test@test:~/orangepi_build/output/debs$ '''mkdir test'''
test@test:~/orangepi_build/output/debs$ '''cp \'''
'''linux-image-current-ky_1.0.0_riscv64.deb test/'''
test@test:~/orangepi_build/output/debs$ '''cd test'''
test@test:~/orangepi_build/output/debs/test$ '''dpkg -x \'''
'''linux-image-current-ky_1.0.0_riscv64.deb .'''
test@test:~/orangepi_build/output/debs/test$ '''ls'''
'''boot etc lib''' linux-image-current-ky_1.0.0_riscv64.deb '''usr'''
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>The decompressed file is shown below</p>
<p>test@test:~/orangepi-build/output/debs/test$ '''tree -L 2'''</p>
<p>.</p>
<p>├── boot</p>
<p>│ ├── config-6.6.63-ky</p>
<p>│ ├── System.map-6.6.63-ky</p>
<p>│ └── vmlinuz-6.6.63-ky</p>
<p>├── etc</p>
<p>│ └── kernel</p>
<p>├── lib</p>
<p>│ └── modules</p>
<p>├── linux-image-current-ky_1.0.0_riscv64.deb</p>
<p>└── usr</p>
<p>├── lib</p>
<p>└── share</p></li></ol>
<!-- -->
<ol start="9" style="list-style-type: decimal;">
<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 '''(you need to compile the Linux kernel source code completely before turning off this function, otherwise it will prompt that the Linux kernel source code cannot be found. If it is a source code compressed package downloaded from Baidu Cloud Drive, there is no problem because the Linux source code is already cached)'''. Otherwise, the modifications made will be restored. The method is as follows:</p>
<p>Set the IGNOREUPDATES variable to "yes" in '''userpatches/config-default.conf'''</p>
<p>test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''</p>
<p>IGNORE_UPDATES="'''yes'''"</p></li>
<li><p>If modifications have been made to the kernel, the following method can be used to update the kernel and kernel modules of the Linux system on the development board</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-ky_1.0.0_riscv64.deb [email protected]:/root'''</p></li>
<li><p>Then log in to the development board and uninstall the deb package of the installed Linux kernel</p>
<p>root@orangepi:~# '''apt purge -y linux-image-current-ky'''</p></li>
<li><p>Reinstall the deb package of the new Linux kernel that was just uploaded</p>
<p>root@orangepi:~# '''dpkg -i linux-image-current-ky_1.0.0_riscv64.deb'''</p></li>
<li><p>Then restart the development board and check if the kernel related modifications have taken effect</p>
<p>root@orangepi:~# '''reboot'''</p></li></ol>
</li>
<li><p>Other useful information</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The storage location of the kernel configuration file is as follows. Please do not search for the kernel configuration file used by the development board in the kernel source code</p></li>
<li><p>[https://github.com/orangepi-xunlong/orangepi-build/blob/nextexternal/config/kernel/linux-ky-current.config '''orangepi-build/external/config/kernel/linux-ky-current.config''']The location of the dts file used by the development board is</p></li></ol>
</li></ol>
[https://github.com/orangepi-xunlong/linux-orangepi/blob/orange-pi-6.6-ky/arch/riscv/boot/dts/ky/x1_orangepi-rv2.dts '''orangepi-build/kernel/orange-pi-6.6-ky/arch/riscv/boot/dts/ky/x1_orangepi-rv2.dts''']
<span id="compile-rootfs"></span>
== Compile rootfs ==
<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 '''Rootfs and all deb packages''', then press enter</p></li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image233.png|576x119px|选区_241]]
</div>
<ol start="3" style="list-style-type: decimal;">
<li><p>Next, select the model of the development board</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image225.png|576x220px|C9777014-7083-4156-8EA2-97572BDEBA99]]
</div></li>
<li><p>Then select the type of rootfs</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image234.png|575x115px|01FA3326-5980-4962-B8BE-7FB68F6CA459]]
</div></li>
<li><p>Then select the type of image</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Image with console interface (server)''' Represents a server version image with a relatively small size</p></li>
<li><p>'''Image with desktop environment''' Represents a desktop image with a relatively large volume</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image235.png|576x75px|选区_245]]
</div></li></ol>
</li>
<li><p>If you are compiling the server version image, you can also choose to compile the Standard version or the Minimal version. The Minimal version comes with much less pre installed software than the Standard version '''(please do not choose the Minimal version unless you have special requirements, as many things are not pre installed by default and some features may not be available)'''</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image236.png|576x78px|选区_397]]
</div></li>
<li><p>If compiling the desktop version of the image, you also need to choose the type of desktop environment. Currently, Ubuntu Noble mainly maintains the Gnome desktop</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image237.png|576x84px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image238.png|576x74px]]</p>
<p>Then you can choose additional software packages that need to be installed. Please press the enter key here to skip directly.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image239.png|575x264px]]</p></li>
<li><p>Then it will start compiling rootfs, and some of the information prompted during compilation is as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Types of rootfs</p>
<p>[ o.k. ] local not found [ Creating new rootfs cache for '''noble''']</p></li>
<li><p>The storage path of the rootfs compressed file generated by compilation</p>
<p>[ o.k. ] Target directory [ '''external/cache/rootfs''' ]</p></li>
<li><p>The name of the rootfs compressed file generated by compilation</p>
<p>[ o.k. ] File name [ '''noble-gnome-riscv64.ef7fa533e64f5a838939560d81632155.tar.lz4''' ]</p></li>
<li><p>Compilation time used</p>
<p>[ o.k. ] Runtime [ '''13 min''' ]</p></li></ol>
</li>
<li><p>View the compiled rootfs compressed file</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''noble-gnome-riscv64.ef7fa533e64f5a838939560d81632155.tar.lz4''' is a compressed file of rootfs, and the meaning of each field in the name is</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''noble''' represents the type of Linux distribution of rootfs</p></li>
<li><p>'''gnome''' indicates that rootfs is a desktop version type, and if it is '''cli''', it indicates a server version type</p></li>
<li><p>'''riscv64''' represents the architecture type of rootfs</p></li>
<li><p>'''ef7fa533e64f5a838939560d81632155''' is an MD5 hash value generated from the package names of all software packages installed by rootfs. As long as the list of software packages installed by rootfs is not modified, this value will not change. The compilation script will use this MD5 hash value to determine whether rootfs needs to be recompiled</p></li></ol>
</li>
<li><p>'''noble-gnome-riscv64.ef7fa533e64f5a838939560d81632155.tar.lz4.list''' lists the package names of all the software packages installed by rootfs</p>
<p>test@test:~/orangepi-build$ '''ls external/cache/rootfs/'''</p>
<p>'''noble-gnome-riscv64.ef7fa533e64f5a838939560d81632155.tar.lz4'''</p>
<p>noble-gnome-riscv64.ef7fa533e64f5a838939560d81632155.tar.lz4.current</p>
<p>noble-gnome-riscv64.ef7fa533e64f5a838939560d81632155.tar.lz4.list</p></li></ol>
</li>
<li><p>If the required rootfs already exist in '''external/cache/rootfs''', compiling rootfs again will skip the compilation process and will not restart. When compiling the image, it will also search for available rootfs in '''external/cache/rootfs''', and if so, use them directly, which can save a lot of download and compilation time.</p></li></ol>
<span id="compiling-linux-images"></span>
== Compiling Linux Images ==
<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 '''Full OS image for flashing''' and press Enter</p></li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image240.png|576x128px|选区_242]]
</div>
<ol start="3" style="list-style-type: decimal;">
<li><p>Then select the model of the development board</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image225.png|576x220px|C9777014-7083-4156-8EA2-97572BDEBA99]]
</div></li>
<li><p>Then select the type of rootfs</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image234.png|575x115px|01FA3326-5980-4962-B8BE-7FB68F6CA459]]
</div></li>
<li><p>Then select the type of image</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Image with console interface (server)''' Represents a server version image with a relatively small size</p></li>
<li><p>'''Image with desktop environment''' Represents a desktop image with a relatively large volume</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image235.png|576x75px|选区_245]]
</div></li></ol>
</li>
<li><p>If you are compiling the server version image, you can also choose to compile the Standard version or the Minimal version. The Minimal version comes with much less pre installed software than the Standard version '''(please do not choose the Minimal version unless you have special requirements, as many things are not pre installed by default and some features may not be available)'''</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image236.png|569x77px|选区_397]]
</div></li>
<li><p>If compiling a desktop version image, you also need to choose the type of desktop environment. Currently, Ubuntu Noble mainly maintains two types of desktops Gnome.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image237.png|576x84px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image238.png|576x74px]]</p>
<p>Then you can choose additional software packages that need to be installed. Please press the enter key here to skip directly.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image239.png|575x264px]]</p></li>
<li><p>Then it will start compiling the Linux image, and the general process of compilation is as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Initialize the compilation environment of Ubuntu PC and install the necessary software packages for the compilation process</p></li>
<li><p>Download the source code for u-boot and Linux kernel (if cached, only update the code)</p></li>
<li><p>Compile the u-boot source code and generate the deb package for u-boot</p></li>
<li><p>Compile Linux source code and generate deb packages related to Linux</p></li>
<li><p>Creating a deb package for Linux firmware</p></li>
<li><p>Create a deb package for the orangepi config tool</p></li>
<li><p>Create deb packages that support board level support</p></li>
<li><p>If compiling the desktop version image, desktop related deb packages will also be created</p></li>
<li><p>Check if rootfs have been cached. If not, create a new rootfs. If cached, decompress and use it directly</p></li>
<li><p>Install the deb package generated earlier into rootfs</p></li>
<li><p>Make specific settings for different development boards and types of images, such as pre installing additional software packages, modifying system configurations, etc</p></li>
<li><p>Then create an image file and format the partition, with the default type being ext4</p></li>
<li><p>Copy the configured rootfs to the partition of the image again</p></li>
<li><p>Then update initramfs</p></li>
<li><p>Finally, write the bin file of u-boot to the image using the dd command</p></li></ol>
</li>
<li><p>After compiling the image, the following message will be prompted</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The storage path of the compiled image</p>
<p>[ o.k. ] Done building [ '''output/images/Orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63/Orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.img''' ]</p></li>
<li><p>Compilation time used</p></li></ol>
</li></ol>
'''[ o.k. ] Runtime [ 19 min ]'''
<ol style="list-style-type: lower-alpha;">
<li><p>The command to repeatedly compile the image can be used to start compiling the image without selecting through the graphical interface</p>
<p>[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepirv2 BRANCH=current BUILD_OPT=image RELEASE=noble BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=yes''' ]</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;"| '''Version'''
| style="text-align: center;"| '''Date'''
| style="text-align: center;"| '''Update Explanation'''
|-
| style="text-align: center;"| v1.0
| style="text-align: center;"| 2025-02-18
| 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;"| 2025-02-18
| style="text-align: center;"| Orange pirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.7z
Orangepirv2_1.0.0_ubuntu_noble_server_linux6.6.63.7z
* Initial version
|}
'''User Manual'''
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image2.png|558x405px]]
<span id="basic-characteristics-of-orange-pi-rv2"></span>
= Basic characteristics of Orange Pi RV2 =
<span id="what-is-orange-pi-rv2"></span>
== What is Orange Pi RV2 ==
OrangePi RV2 is a cost-effective RISC-V development board that adopts a CPU integrated AI technology architecture and is equipped with an RISC-V eight core processor. It provides universal computing power with 2TOPS CPU integration and supports rapid deployment of AI model algorithms. Equipped with 2GB/4GB/8GB LPDDR4X, supporting eMMC modules (16GB/32GB/64GB/128GB optional), Wi Fi 5.0+BT 5.0, and BLE support.
OrangePi RV2 has a wide range of interfaces, including HDMI output, GPIO interface USB2.0, USB3.0, Gigabit Ethernet port, 3.5mm headphone jack, equipped with two M.2 M-Key slots (PCIe 2.0 2-Lane), supports installation of NVMe solid-state drives.
OrangePi RV2 is exquisite, small and powerful, and can be widely used in NAS, commercial electronic products, smart robots, smart home, industrial control, edge computing, etc. Supports the Ubuntu 24.04 operating system.
<span id="purpose-of-orange-pi-rv2"></span>
== Purpose of Orange Pi RV2 ==
We can use it to achieve:
* A Linux desktop computer.
* A Linux network server.
'''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="hardware-features-of-orange-pi-rv2"></span>
== Hardware Features of Orange Pi RV2 ==
{| class="wikitable"
|-
| style="text-align: center;"| '''Introduction to Hardware Features'''
| style="text-align: center;"|
|-
| style="text-align: center;"| Processor
| style="text-align: center;"| • 8 core 64 bit RISC-V processor
• 2 TOPS AI computing power
|-
| style="text-align: center;"| Video
| style="text-align: center;"| • 1 * HDMI 1.4, maximum support 1080 @ 60Hz
• 1 * MIPI DSI 4Lane
|-
| style="text-align: center;"| Memory
| style="text-align: center;"| 2GB/4GB/8GB(LPDDR4X)
|-
| style="text-align: center;"| Camera
| style="text-align: center;"| • 2 * MIPI CSI 4Lane
|-
| style="text-align: center;"| PMU
| style="text-align: center;"| P1
|-
| style="text-align: center;"| Onboard storage
| style="text-align: center;"| • eMMC socket, capable of connecting external eMMC modules
• 16MB QSPI Nor FLASH
• MicroSD (TF) Card Slot
• 2 * PCIe2.0 M.2 M-KEY (SSD) Slot
|-
| style="text-align: center;"| Ethernet
| style="text-align: center;"| 2 * Gigabit Ethernet port(YT8531C )
|-
| style="text-align: center;"| WIFI+BT
| style="text-align: center;"| • Onboard Wi Fi 5+BT 5.0/BLE module: AP6256
• Wi-Fi interface:SDIO3.0
• BT interface:UART/PCM
|-
| style="text-align: center;"| Audio
| style="text-align: center;"| • 3.5mm headphone jack audio input/output
• 1 * HDMI output
|-
| style="text-align: center;"| PCIe M.2 M-KEY
| style="text-align: center;"| • 2 * PCIe 2.0 x 2 lanes, used for connecting NVMe SSD solid state drives
|-
| style="text-align: center;"| USB interface
| style="text-align: center;"| • 1 * USB 2.0 supports Device or HOST mode
• 3 * USB3.0 HOST
|-
| style="text-align: center;"| 26pin extension pin
| style="text-align: center;"| Used for expanding UART, PWM, I2C, SPI, CAN, and GPIO interfaces
|-
| style="text-align: center;"| Debug UART
| style="text-align: center;"| 3 PIN debugging serial port
|-
| style="text-align: center;"| LED lamp
| style="text-align: center;"| 1 * Power light, 1 * Status light
|-
| style="text-align: center;"| Key
| style="text-align: center;"| 1 * BOOT button, 1 * power on/off button
|-
| style="text-align: center;"| Power supply
| style="text-align: center;"| Type-C interface power supply 5V/5A
|-
| style="text-align: center;"| Supported operating systems
| style="text-align: center;"| Operating systems such as Ubuntu 24.04
|-
| style="text-align: center;"| '''Introduction to appearance specifications'''
| style="text-align: center;"|
|-
| style="text-align: center;"| Product size
| style="text-align: center;"| 89mm*56mm
|-
| style="text-align: center;"| Weight
| style="text-align: center;"| 60g
|-
| style="text-align: center;"| [[File:convert%20ed\OrangePi_RV2_X%201_User%20Manual_v1.%200.1/media/image1.%20png]]{width=“0.255 55555555555554in” h eight=“0.27638888 88888889in”}range Pi™ is a registered trademark of Shenzhen Xunlong Software Co., Ltd.
| style="text-align: center;"|
|}
<span id="top-and-bottom-views-of-orange-pi-rv2"></span>
== Top and Bottom Views of Orange Pi RV2 ==
'''top view:'''
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image3.png|428x306px]]
'''Bottom level view:'''
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image4.png|431x296px]]
<span id="interface-details-diagram-of-orange-pi-rv2"></span>
== Interface details diagram of Orange Pi RV2 ==
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image5.png|405x758px]]
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image6.png|576x146px]]
'''The diameter of the four positioning holes is 2.7mm.'''
<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, a high-speed flash card with a minimum capacity of 16GB (recommended 32GB or above) and '''class10''' or above.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image7.png|124x96px]]</p></li>
<li><p>TF card reader, used to burn images onto TF cards.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image8.png|139x106px]]</p></li>
<li><p>HDMI interface display.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image9.png|313x205px]]</p></li>
<li><p>HDMI to HDMI connection cable, used to connect the development board to an HDMI monitor or TV for display.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_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 universal OPi5Plus/OPi5/OPi5Pro/OPi5Max/OPi5Ultra/OPiRV2).</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image11.jpeg|223x203px|IMG_7546]]
</div></li>
<li><p>For the Orange Pi RV2 power adapter, it is recommended to use a 5V/5A Type-C power supply.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_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>A USB interface mouse and keyboard, as long as it is a standard USB interface mouse and keyboard, can be used to control the Orange Pi development board.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image13.png|224x191px]]</p></li>
<li><p>USB camera.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image14.png|255x148px]]</p></li>
<li><p>A 5V cooling fan. As shown in the figure below, the development board is equipped with an interface for connecting a cooling fan, with the interface specification being a '''2pin 1.25mm''' pitch.</p>
<p>'''The fan on the development board can be adjusted for speed and on/off through PWM.'''</p></li>
<li><p>100Mbps or 1G Ethernet cable, used to connect the development board to the Internet.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image15.png|143x112px]]</p></li>
<li><p>USB 2.0 male to male data cable, used for burning images and using ADB functions.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image16.png|158x155px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]
</div></li>
<li><p>OV13850 camera with 13 million MIPI interface.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image17.png|197x111px]]</p></li>
<li><p>OV13855 camera with 13 million MIPI interface.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image18.png|184x109px]]</p></li>
<li><p>When using the serial port debugging function, a '''3.3V''' USB to TTL module and DuPont cable are required to connect the development board and computer.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image19.png|217x89px|G7U7JZX(V`L$`A6864]38$P]] [[File:OrangePi_RV2_X1_User Manual_v1.0.1_image20.png|305x110px]]</p></li>
<li><p>A personal 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 Linux source code
|-
| style="text-align: left;"| 2
| style="text-align: left;"| Windows PC
| style="text-align: left;"| Used for burning 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 material is:
'''http://www.orangepi.cn/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-RV2.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.online/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-RV2.html'''</p></li>
<li><p>The information mainly includes</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Linux source code''':Save on Github.</p></li>
<li><p>'''User manual and schematic diagram:'''Save on Baidu Cloud Drive and Google Cloud Drive.</p></li>
<li><p>'''Official tools:'''This mainly includes the software required during the use of the development board.</p></li>
<li><p>'''Ubuntu image''':Save on Baidu Cloud Drive and Google Cloud Drive.</p></li>
<li><p>'''OpenWRT image''':Save on Baidu Cloud Drive and Google Cloud Drive.</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, Ubuntu, OpenWRT, or OPi OS Arch downloaded from th'''e [http://www.orangepi.online/html/serviceAndSupport/index.html '''Orange Pi data download page'''.]
<span id="method-of-burning-linux-images-using-balenaetcher"></span>
=== '''Method of burning Linux images using BalenaEtcher''' ===
# Firstly, prepare a 16GB or larger TF card with a transfer speed of '''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 compressed file of the Linux operating system image that you want to burn from the [http://www.orangepi.online/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-RV2.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 2GB in size.
# Then download the Linux image burning software - '''balenaEtcher''', from the following download link:
[https://www.balena.io/etcher/ '''https://www.balena.io/etcher/''']
<ol start="5" style="list-style-type: decimal;">
<li>After entering the balenaEtcher download page, clicking the green download button will jump to the software download location.</li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image21.png|359x172px]]
<ol start="6" style="list-style-type: decimal;">
<li><p>Then you can choose to download the Portable version of balenaEtcher software, which does not require installation and can be used by double clicking.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image22.png|382x141px]]</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:OrangePi_RV2_X1_User Manual_v1.0.1_image23.png|369x233px]]</p></li></ol>
'''When opening balenaEtcher, if prompted with the following error:'''
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image24.png|209x164px]]
'''Please select balenaEtcher and right-click, then choose to run as administrator.择balenaEtcher'''
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image25.png|300x104px|图形用户界面, 文本, 应用程序 描述已自动生成]]
</div>
<ol start="8" style="list-style-type: decimal;">
<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>Firstly, select the path of the Linux image file to be burned.</p></li>
<li><p>Then select the drive letter of the TF card.。</p></li>
<li><p>Finally, clicking Flash will start burning the Linux image onto the TF card.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image26.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:OrangePi_RV2_X1_User Manual_v1.0.1_image27.png|428x268px]]</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:OrangePi_RV2_X1_User Manual_v1.0.1_image28.png|427x267px]]</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:OrangePi_RV2_X1_User Manual_v1.0.1_image29.png|523x324px|04]]
</div></li></ol>
<span id="method-for-burning-linux-images-to-tf-cards-based-on-ubuntu-pc于ubuntu-pc"></span>
== Method for burning Linux images to TF cards based on Ubuntu PC于Ubuntu PC ==
'''Note that the Linux image referred to here specifically refers to Linux distribution images such as Debian, Ubuntu, OpenWRT, or OPi OS Arch downloaded from the [http://www.orangepi.online/html/serviceAndSupport/index.html Orange Pi data download page]. Ubuntu PC refers to a personal computer with the Ubuntu system installed.'''
# Firstly, prepare a 16GB or larger TF card with a transfer speed of '''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="4" style="list-style-type: decimal;">
<li>After entering the balenaEtcher download page, clicking the green download button will jump to the software download location.</li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image21.png|434x208px]]
<ol start="5" style="list-style-type: decimal;">
<li><p>Then choose to download the Linux version of the software.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image30.png|430x163px]]</p></li>
<li><p>Download the compressed file of the Linux operating system image that you want to burn from the [http://www.orangepi.online/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 2GB in size.</p>
<p>The decompression command for the compressed file ending in 7z is as follows:</p>
<p>test@test:~$ '''7z x orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.7z'''</p>
<p>test@test:~$ '''ls orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.*'''</p>
<p>orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.7z orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.sha #Verification and file</p>
<p>orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.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 there is a problem with the downloaded image. Please try downloading it again.</p>
<p>test@test:~$ '''sha256sum -c *.sha'''</p>
<p>orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.img: OK</p></li>
<li><p>Then double-click '''balenaEtcher-1.5.109-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:OrangePi_RV2_X1_User Manual_v1.0.1_image31.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>Firstly, select the path of the Linux image file to be burned.</p></li>
<li><p>Then select the drive letter of the TF card.</p></li>
<li><p>Finally, clicking Flash will start burning the Linux image onto the TF card.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image26.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:OrangePi_RV2_X1_User Manual_v1.0.1_image32.png|429x184px]]</p></li></ol>
<!-- -->
<ol start="12" style="list-style-type: decimal;">
<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:OrangePi_RV2_X1_User Manual_v1.0.1_image33.png|436x190px]]</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:OrangePi_RV2_X1_User Manual_v1.0.1_image34.png|435x257px]]</p></li></ol>
<span id="method-for-burning-linux-images-to-emmc"></span>
== Method for burning Linux images to eMMC ==
'''Note that the development board can be launched through TF card or eMMC, with TF card having higher priority than eMMC. That is to say, if the development board is inserted with a TF card and there is a system in the TF card, the system in the TF card will be started by default instead of the system in eMMC.'''
<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:OrangePi_RV2_X1_User Manual_v1.0.1_image35.png|115x84px]] [[File:OrangePi_RV2_X1_User Manual_v1.0.1_image36.png|120x87px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image37.png|272x187px]]</p></li>
<li><p>Burning a Linux image to eMMC requires the use of a TF card, so the first step is to burn the Linux image onto the TF card, and then use the TF card to start the development board and enter the Linux system. The method of burning a Linux image to a TF card can be found in the two sections: [[#method-of-burning-linux-image-to-tf-card-based-on-windows-pc|'''the method of burning a Linux image to a TF card based on Windows PC''']] and [[#method-for-burning-linux-images-to-tf-cards-based-on-ubuntu-pc于ubuntu-pc|'''the method of burning a Linux image to a TF card based on Ubuntu PC''']].</p></li>
<li><p>Then run the '''nand-sata-install''' script, '''remember to add sudo privileges'''</p>
<p>orangepi@orangepi:~$ '''sudo nand-sata-install'''</p></li>
<li><p>Then select '''2 Boot from eMMC - sytem on eMMC'''</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image38.png|397x206px|选区_039]]
</div></li>
<li><p>Then a warning will pop up, and the script will erase all data on eMMC. Select '''<Yes>''' to continue</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image39.png|396x231px|选区_040]]
</div></li>
<li><p>Then it will prompt to select the type of file system, supporting five file systems: ext2/3/4, f2fs, and btrfs</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image40.png|395x152px|选区_041]][[File:OrangePi_RV2_X1_User Manual_v1.0.1_image41.png|400x155px|选区_042]]</p></li>
<li><p>Then it will start formatting eMMC, and after formatting eMMC, it will start burning Linux images into eMMC</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image42.png|401x127px|选区_043]]
</div></li>
<li><p>After burning, the following options will be prompted, you can choose '''<Power off>''' to shut down directly</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image43.png|409x100px|选区_044]]
</div></li>
<li><p>Then unplug the TF card and power it on again, and the linux system in eMMC will start up</p></li></ol>
<span id="method-for-burning-linux-images-to-spiflashnvme-ssd"></span>
== Method for burning Linux images to SPIFlash+NVMe SSD ==
<ol style="list-style-type: decimal;">
<li><p>Firstly, it is necessary to prepare an NVMe SSD solid state drive with a PCIe interface specification of PCIe2.0x2 for the M.2 slot on the development board.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image44.png|306x89px]]</p></li>
<li><p>Then insert the NVMe SSD into the M.2 PCIe interface of the development board (note that currently only the M.2 slot on the back supports booting) and secure it in place.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image45.png|268x190px]]</p></li>
<li><p>The position of SPI Flash on the development board is shown in the following figure, and no other settings are required before starting to burn.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image46.png|252x174px]]</p></li>
<li><p>Burning the image to SPIFlash+NVMe SSD requires the use of a TF card, so the first step is to burn the Linux image onto the TF card, and then use the TF card to boot the development board into the Linux system. The method of burning a Linux image to a TF card can be found in the two sections: [[#method-of-burning-linux-image-to-tf-card-based-on-windows-pc|'''the method of burning a Linux image to a TF card based on Windows PC''']] and [[#method-for-burning-linux-images-to-tf-cards-based-on-ubuntu-pc于ubuntu-pc|'''the method of burning a Linux image to a TF card based on Ubuntu PC''']].</p></li>
<li><p>After starting the Linux system with a TF card, you can burn the image to SPI Flash+NVMe SSD.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, create a partition for NVMe SSD.</p>
<p>orangepi@orangepi:~$ '''sudo parted /dev/nvme0n1 mklabel gpt mkpart primary \'''</p>
<p>'''ext4 8192s 100%'''</p></li>
<li><p>Then run '''nand-sata-install''', '''remember to add sudo privileges for regular users'''.</p>
<p>orangepi@orangepi:~$ '''sudo nand-sata-install'''</p></li>
<li><p>Then select '''4 Boot from SPI - system on SATA, USB or NVMe'''。</p></li></ol>
</li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image47.png|361x164px]]
<ol start="4" style="list-style-type: lower-alpha;">
<li>Then press enter to confirm</li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image48.png|354x119px|IMG_256]]
</div>
<ol start="5" style="list-style-type: lower-alpha;">
<li>Then select '''<Yes>'''。</li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image49.png|357x163px]]
<ol start="6" style="list-style-type: lower-alpha;">
<li>Then it will prompt to select the type of file system.</li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image50.png|359x119px|IMG_256]]
</div>
<ol start="7" style="list-style-type: lower-alpha;">
<li><p>Then it will start formatting the NVMe SSD, and after formatting is complete, it will start burning the system into the NVMe SSD.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image51.png|357x102px|IMG_256]]
</div></li>
<li><p>Then please be patient and wait for the burning to complete. After burning, you will be prompted whether to burn the bootloader to SPI Flash, and then select '''<Yes>'''. (If you do not want to replace the factory bootloader, you can also choose '''No'''.)</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image52.png|359x101px|IMG_256]]
</div>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image53.png|356x161px]]</p></li>
<li><p>After burning, the following options will be prompted, you can choose '''<Power off>'''to shut down directly</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image54.png|351x77px|IMG_256]]
</div></li></ol>
<span id="method-for-burning-linux-images-to-spiflashusb-storage-devices"></span>
== Method for burning Linux images to SPIFlash+USB storage devices ==
'''Note that the Linux image referred to here specifically refers to Linux distribution images such as Debian, Ubuntu, OpenWRT, or OPi OS Arch downloaded from the Orange Pi data download page.'''
# Firstly, it is necessary to prepare a USB storage device, such as a USB flash drive.
# Then please refer to the instructions in two sections: [[#method-of-burning-linux-image-to-tf-card-based-on-windows-pc|'''the method of burning Linux images to TF cards based on Windows PC''']] and [[#method-for-burning-linux-images-to-tf-cards-based-on-ubuntu-pc于ubuntu-pc|'''the method of burning Linux images to TF cards based on Ubuntu PC''']] to burn Linux images to USB storage devices. There is no difference between burning a Linux image to a USB storage device and burning a Linux image to a TF card (when the TF card is inserted into the card reader, the card reader is actually equivalent to a USB flash drive).
# Then insert the USB storage device that has burned the Linux system into the USB interface of the development board. '''Note that only the three blue USB 3.0 interfaces shown in the following figure support booting the Linux system, and the white USB 2.0 interface does not support it'''.
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image55.png|337x92px]]
<ol start="4" style="list-style-type: decimal;">
<li><p>The position of SPI Flash on the development board is shown in the following figure. SPI Flash will burn the program before leaving the factory. If it is not formatted by itself, the following burning steps can be skipped.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image46.png|333x230px]]</p></li>
<li><p>Burning the u-boot image to SPIFlash requires the use of a TF card, so the first step is to burn the Linux image onto the TF card, and then use the TF card to boot the development board into the Linux system. The method of burning a Linux image to a TF card can be found in the two sections: [[#method-of-burning-linux-image-to-tf-card-based-on-windows-pc|'''the method of burning a Linux image to a TF card based on Windows PC''']] and [[#method-for-burning-linux-images-to-tf-cards-based-on-ubuntu-pc于ubuntu-pc|'''the method of burning a Linux image to a TF card based on Ubuntu PC''']].</p></li>
<li><p>After starting the Linux system with a TF card, you can burn the u-boot image to SPI Flash.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, run '''nand-sata-install'''. '''Ordinary users should remember to grant sudo privileges'''.</p>
<p>orangepi@orangepi:~$ '''sudo nand-sata-install'''</p></li>
<li><p>Then select '''7 Install/Update ther bootloader on SPI Flash'''。</p></li></ol>
</li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image56.png|361x160px]]
<ol start="3" style="list-style-type: lower-alpha;">
<li>Then select '''<Yes>'''。</li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image57.png|356x179px|IMG_256]]
</div>
<ol start="4" style="list-style-type: lower-alpha;">
<li>Then please be patient and wait for the burning to complete. After the burning is completed, the following will be displayed (a ''''Done'''' will appear in the bottom left corner):</li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image58.png|358x149px|IMG_256]]
</div>
<ol start="7" style="list-style-type: decimal;">
<li><p>At this point, you can use the '''poweroff''' command to shut down. Then please unplug the TF card and press the power button briefly to start the linux system in the SPIFlash+USB storage device.</p></li>
<li><p>After starting the system in the USB storage device, use the '''df -h''' command to see the actual capacity of the USB storage device.</p>
<p>orangepi@orangepi:~$ '''df -h'''</p>
<p>Filesystem Size Used Avail Use% Mounted on</p>
<p>udev 3.8G 8.0K 3.8G 1% /dev</p>
<p>tmpfs 769M 588K 769M 1% /run</p>
<p>'''/dev/sda2 15G 1.6G 13G 11% /'''</p>
<p>tmpfs 3.8G 0 3.8G 0% /dev/shm</p>
<p>tmpfs 5.0M 4.0K 5.0M 1% /run/lock</p>
<p>/dev/zram2 3.7G 60K 3.5G 1% /tmp</p>
<p>'''/dev/sda1 256M 111M 146M 44% /boot'''</p>
<p>/dev/zram1 194M 9.0M 171M 5% /var/log</p>
<p>tmpfs 769M 0 769M 0% /run/user/1000</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. If the SPIFlash+NVMe SSD or eMMC module has already burned the image, there is no need to insert the TF card. Just make sure that the NVMe SSD or eMMC module is properly inserted into the 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/4A or 5V/5A 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.'''
'''The Type-C power interface does not support PD negotiation.'''
'''Also, please do not connect the USB port of the computer to power the development board.'''
<ol start="6" style="list-style-type: decimal;">
<li><p>Then turn on the power adapter switch. If everything is normal, the HDMI monitor or LCD screen 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 [[#how-to-use-the-debug-serial-port|'''debugging serial port usage''']].</p></li></ol>
<span id="how-to-use-the-debug-serial-port"></span>
== How to use the debug serial port ==
<span id="connection-instructions-for-debug-serial-port"></span>
=== Connection Instructions for Debug Serial Port ===
<ol style="list-style-type: decimal;">
<li><p>First, you need to prepare a 3.3V USB to TTL module, and then insert the USB interface of the USB to TTL module into the USB interface of the computer.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image59.png|576x115px|07]]
</div></li>
<li><p>The corresponding relationship between the debugging serial port GND, RXD and TXD pins of the development board is shown in the figure below:</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image60.png|356x127px]]</p></li>
<li><p>The GND, TXD and RXD pins of the USB to TTL module need to be connected to the debug serial port of the development board through DuPont cables.</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 the USB to TTL module to the computer and the Orange Pi development board is as follows:</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image61.png|524x189px|08]]
</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 connect the TX and RX of the serial port randomly. If there is no output in the test, then swap the order of TX and RX. In this way, there will always be one order that is correct.'''</p></li></ol>
<span id="how-to-use-the-debugging-serial-port-on-ubuntu-platform"></span>
=== How to use the debugging serial port on Ubuntu platform ===
'''There are many serial port debugging software that can be used under Linux, such as putty, minicom, etc. The following demonstrates how to use putty.'''
<ol style="list-style-type: decimal;">
<li><p>First, insert the USB to TTL module into the USB port of the Ubuntu computer. If the USB to TTL module is connected and recognized normally, you can see the corresponding device node name under '''/dev''' of the Ubuntu PC. Remember this node name, which will be used when setting up the serial port software later.</p>
<p>test@test:~$ '''ls /dev/ttyUSB*'''</p>
<p>/dev/ttyUSB0</p></li>
<li><p>Then install putty on your Ubuntu PC using the command below.</p>
<p>test@test:~$ '''sudo apt-get update'''</p>
<p>test@test:~$ '''sudo apt-get install -y putty'''</p></li>
<li><p>Then run putty and remember to '''add sudo permissions.'''</p>
<p>test@test:~$ '''sudo putty'''</p></li>
<li><p>After executing the putty command, the following interface will pop up.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image62.png|367x321px]]</p></li>
<li><p>First select the serial port settings interface.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image63.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'''(change to the corresponding node name, usually '''/dev/ttyUSB0''').</p></li>
<li><p>Set '''Speed(baud)''' to 115200 (the baud rate of the serial port).</p></li>
<li><p>Set '''Flow control''' to '''None'''.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image64.jpeg|398x352px|微信图片_20241119193320]]
</div></li></ol>
</li>
<li><p>After completing the settings on the serial port settings interface, return to the Session interface.</p>
<p>a. First select '''Connection type''' as Serial.</p>
<p>b. Then click the Open button to connect to the serial port.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image65.jpeg|376x333px|微信图片_20241119193326]]
</div></li>
<li><p>After starting the development board, you can see the log information output by the system from the opened serial port terminal.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image66.png|468x340px]]</p></li></ol>
<span id="how-to-use-the-debug-serial-port-on-windows-platform"></span>
=== How to use the debug serial port on Windows platform ===
'''There are many serial port debugging software that can be used under Windows, such as SecureCRT, MobaXterm, etc. The following demonstrates how to use MobaXterm. This software has a free version and can be used without purchasing a serial number.'''
<ol style="list-style-type: decimal;">
<li><p>Download MobaXterm.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Download MobaXterm from the following URL:</p>
<p>[https://mobaxterm.mobatek.net/ '''https://mobaxterm.mobatek.net''']</p></li>
<li><p>Go to the MobaXterm download page and click '''GET XOBATERM NOW!'''.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image67.png|576x334px]]</p></li>
<li><p>Then choose to download the Home version.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image68.png|353x231px]]</p></li>
<li><p>Then select the Portable version. After downloading, there is no need to install it. You can use it directly by opening it.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image69.png|575x259px]]</p></li></ol>
</li>
<li><p>After downloading, use decompression software to decompress the downloaded compressed package to get the executable software of MobaXterm, and then double-click to open it.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image70.png|576x81px]]</p></li>
<li><p>After opening the software, the steps to set up the serial port connection are as follows</p></li></ol>
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>Open the session settings interface.</p></li>
<li><p>Select the serial port type.</p></li>
<li><p>Select the serial port number (select the corresponding port number according to the actual situation). If you cannot see the port number, please use '''Driver Software t'''o scan and install the USB to TTL serial port chip driver.</p></li>
<li><p>Select the serial port baud rate as '''115200'''.</p></li>
<li><p>Finally, click the "'''OK'''" button to complete the settings.</p></li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image71.jpeg|576x292px|微信图片_20241119193339]]
</div>
<ol start="4" style="list-style-type: decimal;">
<li><p>Click the "'''OK'''" button to enter the following interface. Now start the development board and you can see the output information of the serial port.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image72.jpeg|576x292px|微信图片_20241119193346]]
</div></li></ol>
<span id="instructions-for-using-the-5v-pin-in-the-26pin-interface-of-the-development-board-to-supply-power"></span>
== Instructions for using the 5V pin in the 26pin interface of the development board to supply power ==
'''The power supply method we recommend for the development board is to use a 5V/5A 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 26pin interface to power the development board, please make sure that the power cord and power adapter used can meet the power supply requirements of the development board. If there is any unstable use, please switch back to Type-C power supply.'''
<ol style="list-style-type: decimal;">
<li><p>First, you need to prepare a power cord as shown in the figure below.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image73.jpeg|323x232px|图片4]]
</div>
<p>'''The power cord shown in the picture above can be purchased. Please search and purchase it by yourself.'''</p></li>
<li><p>Use the 5V pin in the 26-pin interface to power the development board. The connection method of the power line is as follows:</p></li></ol>
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>The USB A port of the power cable shown in the figure above needs to be plugged into the 5V/5A power adapter connector '''(please do not plug it into the USB port of the computer for power supply''').</p></li>
<li><p>The red DuPont cable needs to be plugged into the 5V pin of the 26-pin development board.</p></li>
<li><p>The black DuPont cable needs to be plugged into the GND pin of the 26-pin interface.</p></li>
<li><p>The positions of the 5V pin and GND pin of the 26-pin interface in the development board are shown in the figure below. '''Remember not to connect them in reverse'''.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image74.png|414x111px]]</p></li></ol>
<span id="ubuntu-server-and-gnome-desktop-system-instructions"></span>
= Ubuntu Server and Gnome Desktop System Instructions =
<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: center;"| '''Kernel version'''
| style="text-align: center;"| '''Server Edition'''
| style="text-align: center;"| '''Desktop version'''
|-
| style="text-align: center;"| '''Ubuntu 24.04 - Noble'''
| style="text-align: center;"| '''Linux6.6'''
| style="text-align: center;"| '''Support'''
| style="text-align: center;"| '''Support'''
|}
<span id="linux-6.6-system-compatibility"></span>
== Linux 6.6 system compatibility ==
{| class="wikitable"
|-
| style="text-align: center;"| '''Function'''
| style="text-align: center;"| '''Ubuntu24.04'''
|-
| style="text-align: center;"| '''USB2.0x1'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''USB3.0x3'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''M.2 M-Key slot x2'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''M.2 NVMe SSD boot'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''USB boot system'''
| 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;"| '''GPIO(26pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''UART(26pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''SPI(26pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''I2C(26pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''CAN(26pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''PWM(26pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''3pin debug serial port'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''TF card startup'''
| style="text-align: center;"| '''OK'''
|-
| 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;"| '''OV13850 Camera'''
| style="text-align: center;"| '''OK(Does not support 3A)'''
|-
| style="text-align: center;"| '''OV13855 Camera'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''LCD'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Gigabit Ethernet port x2'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Network port status light'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Headphone playback'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Headphone Recording'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''RTC'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''LED Light'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''GPU'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''VPU'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Power button'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Watchdog test'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Chromium hard decoding video'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''MPV hard decoding video playback'''
| style="text-align: center;"| '''OK'''
|}
<span id="linux-command-format-description-in-this-manual"></span>
== Linux command format description in this manual ==
<ol style="list-style-type: decimal;">
<li><p>All commands in this manual that need to be entered in the Linux system will be framed with the following boxes.</p>
<p>As shown below, the contents in the yellow box indicate the contents that require special attention, except for the commands inside.</p></li>
<li><p>Description of the prompt type before the command.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The prompt before the command refers to the content in the red box below. This part is not part of the Linux command, so when entering a command in the Linux system, please do not enter the content in red font.</p>
<p>'''orangepi@orangepi:~$ sudo apt update'''</p>
<p>'''root@orangepi:~#''' '''vim /boot/boot.cmd'''</p>
<p>'''test@test:~$ ssh [mailto:[email protected] [email protected].]xxx'''</p>
<p>'''root@test:~# ls'''</p></li>
<li><p>'''orangepi@orangepi:~$''' The prompt indicates that this command is entered in the Linux system of the development board. The $ at the end of the prompt indicates that the current user of the system is a common user. When executing privileged commands, '''sudo''' is required.</p></li>
<li><p>'''root@orangepi:~#''' The prompt indicates that this command is entered in the Linux system of the development board. The # at the end of the prompt indicates that the current user of the system is the root user and can execute any command he wants.</p></li>
<li><p>'''test@test:~$''' The prompt indicates that this command is entered in an Ubuntu PC or Ubuntu virtual machine, not in the Linux system of the development board. The $ at the end of the prompt indicates that the current user of the system is a normal user. When executing privileged commands, you need to add '''sudo'''.</p></li>
<li><p>'''root@test:~#''' The prompt indicates that this command is entered in an Ubuntu PC or Ubuntu virtual machine, not in the Linux system of the development board. The # at the end of the prompt indicates that the current user of the system is the root user and can execute any command he wants.</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 is the command that needs to be entered, and the content below the command is the output (some commands have output, some may not). This part does not need to be entered.</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 cannot fit in one line and will be placed on the next line. The bold black parts are the commands that need to be entered. When these commands are entered on one line, the "\" at the end of each line needs to be removed, as it is not part of the command. In addition, there are spaces between different parts of the command, so please do not 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'''
| 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'''
|}
'''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.'''
'''If you get an error message when entering the password, or there is a problem with the ssh connection, please note that as long as you are using the Linux image provided by Orange Pi, do not doubt that the password above is incorrect, but look for other reasons.'''
<span id="how-to-set-up-automatic-login-for-linux-system-terminal"></span>
=== How to set up automatic login for Linux system terminal ===
<ol style="list-style-type: decimal;">
<li><p>The Linux system automatically logs in to the terminal by default, and the default login username is '''orangepi'''.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image75.png|362x180px]]</p></li>
<li><p>Use the following command to set the root user to automatically log in to the terminal.</p>
<p>orangepi@orangepi:~$ '''sudo auto_login_cli.sh root'''</p></li>
<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>Use the following command to set the orangepi user to automatically log in to the terminal again.</p>
<p>orangepi@orangepi:~$ '''sudo auto_login_cli.sh orangepi'''</p></li></ol>
<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 is started, it will automatically log in to the desktop without entering a password.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image76.png|576x324px|Screenshot from 2025-01-09 08-23-53]]
</div></li>
<li><p>Run the following command to prevent the desktop version of the system from automatically logging into the desktop.</p>
<p>orangepi@orangepi:~$ '''sudo sed -i '/^AutomaticLoginEnable/ s/^/#/' /etc/gdm3/custom.conf'''</p>
<p>orangepi@orangepi:~$ '''sudo sed -i '/^AutomaticLogin/ s/^/#/' /etc/gdm3/custom.conf'''</p></li>
<li><p>Then restart the system and a login dialog box will appear. You need to enter the password to enter the system.</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 gdm3.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 steps to reopen the desktop are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First enter the following command in the command line. '''Please remember to add sudo permissions.'''</p>
<p>orangepi@orangepi:~$ '''sudo systemctl start gdm3.service'''</p>
<p>orangepi@orangepi:~$ '''sudo systemctl enable gdm3.service'''</p></li>
<li><p>After making your selection, the monitor will display the desktop.</p></li></ol>
</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 two LED lights on the development board, one red and one green. Their locations are shown in the figure below:</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image77.jpeg|576x110px|0006-(3)]]
</div></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. The red LED light can be used to determine whether the power of the development board has been turned on normally.</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 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/sys-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/sys-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/sys-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/sys-led# '''echo heartbeat > trigger'''</p></li></ol>
</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>The development board has two Gigabit Ethernet ports. The test methods for these two ports are the same. First, insert one end of the network cable into the Ethernet port of the development board, and connect the other end of the network cable to 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 addr show'''</p>
<p>1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000</p>
<p>link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00</p>
<p>inet 127.0.0.1/8 scope host lo</p>
<p>valid_lft forever preferred_lft forever</p>
<p>inet6 ::1/128 scope host noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p>
<p>2: '''end0''': <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000</p>
<p>link/ether 00:e0:4c:68:00:13 brd ff:ff:ff:ff:ff:ff</p>
<p>inet '''192.168.2.241'''/24 brd 192.168.2.255 scope global dynamic noprefixroute end0</p>
<p>valid_lft 43186sec preferred_lft 43186sec</p>
<p>inet6 fdcd:e671:36f4::47c/128 scope global dynamic noprefixroute</p>
<p>valid_lft 43186sec preferred_lft 43186sec</p>
<p>inet6 fdcd:e671:36f4:0:5689:f699:84ec:d4cb/64 scope global temporary dynamic</p>
<p>valid_lft 604786sec preferred_lft 85811sec</p>
<p>inet6 fdcd:e671:36f4:0:52ab:6ce7:cfc7:9ecf/64 scope global mngtmpaddr noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p>
<p>inet6 fe80::f082:90bd:3fbd:dc01/64 scope link noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p>
<p>3: '''end1''': <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000</p>
<p>link/ether 00:e0:4c:68:00:14 brd ff:ff:ff:ff:ff:ff</p>
<p>inet '''192.168.2.242'''/24 brd 192.168.2.255 scope global dynamic noprefixroute end1</p>
<p>valid_lft 43179sec preferred_lft 43179sec</p>
<p>inet6 fdcd:e671:36f4::49e/128 scope global dynamic noprefixroute</p>
<p>valid_lft 43177sec preferred_lft 43177sec</p>
<p>inet6 fdcd:e671:36f4:0:da95:4c2f:806f:5617/64 scope global temporary dynamic</p>
<p>valid_lft 604777sec preferred_lft 85899sec</p>
<p>inet6 fdcd:e671:36f4:0:7d9:7510:ccc5:fac9/64 scope global mngtmpaddr noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p>
<p>inet6 fe80::db62:da89:a277:2ff0/64 scope link noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p>
<p>4: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state DORMANT group default</p>
<p>qlen 1000</p>
<p>link/ether 9c:b8:b4:38:c7:62 brd ff:ff:ff:ff:ff:ff</p>
<p>When using ifconfig to check the IP address, if the following message is displayed, it is because sudo is not added. The correct command is: '''sudo ifconfig'''.</p>
<p>orangepi@orangepi:~$ '''ifconfig'''</p>
<p>Command 'ifconfig' is available in the following places</p>
<p>* /sbin/ifconfig</p>
<p>* /usr/sbin/ifconfig</p>
<p>The command could not be located because '/sbin:/usr/sbin' is not included in the PATH environment variable.</p>
<p>This is most likely caused by the lack of administrative privileges associated with your user account.</p>
<p>ifconfig: command not found</p></li></ol>
'''There are three ways to check the IP address after the development board is started:'''
# '''Connect an HDMI display, then log in to the system and use the ip addr show command to view the IP address.'''
# '''Enter the ip addr show command in the debugging serial port terminal to view the IP address.'''
# '''3. If there is no debugging serial port and no HDMI display, you can also view the IP address of the development board's network port through the router's management interface. However, this method often fails to see the IP address of the development board. If you cannot see it, the debugging method is as follows:'''
<!-- -->
<ol style="list-style-type: upper-alpha;">
<li><p>'''First check whether the Linux system has started normally. If the three-color light on the development board is flashing, it is generally started normally. If only the red light is on, it means that the system has not started normally.'''</p></li>
<li><p>'''Check whether the network cable is plugged in tightly, or try another cable;'''</p></li>
<li><p>'''Try another router (I have encountered many router problems, such as the router cannot assign IP addresses normally, or the IP addresses have been assigned normally but cannot be seen in the router);'''</p></li>
<li><p>'''If there is no router to replace, you can only connect an HDMI monitor or use the debug serial port to view the IP address.'''</p>
<p>'''It should also be noted that the development board DHCP automatically assigns IP addresses without any settings.'''</p></li></ol>
<!-- -->
<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 the '''Ctrl+C''' shortcut key.</p>
<p>orangepi@orangepi:~$ '''ping www.baidu.com -I end0 #Test command for one of the network ports'''</p>
<p>orangepi@orangepi:~$ '''ping www.baidu.com -I end1 #Test command for another network port'''</p>
<p>PING www.a.shifen.com (183.2.172.42) from 192.168.2.241 end0: 56(84) bytes of data.</p>
<p>64 bytes from 183.2.172.42: icmp_seq=1 ttl=53 time=10.1 ms</p>
<p>64 bytes from 183.2.172.42: icmp_seq=2 ttl=53 time=10.0 ms</p>
<p>64 bytes from 183.2.172.42: icmp_seq=3 ttl=53 time=9.91 ms</p>
<p>^C</p>
<p>--- www.a.shifen.com ping statistics ---</p>
<p>3 packets transmitted, 3 received, 0% packet loss, time 2002ms</p>
<p>rtt min/avg/max/mdev = 9.910/10.017/10.126/0.088 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:
<!-- -->
<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 start="2" 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:OrangePi_RV2_X1_User Manual_v1.0.1_image78.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 addr show 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.online -I wlan0'''</p>
<p>PING www.orangepi.online (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.online 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:
<!-- -->
<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 (use MobaXterm as the serial software, and minicom cannot display the graphical interface).</p></li>
<li><p>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:OrangePi_RV2_X1_User Manual_v1.0.1_image79.png|345x215px]]</p></li>
<li><p>Select '''Activate a connect''' and press Enter.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image80.png|349x216px]]</p></li>
<li><p>Then you can see all the searched WIFI hotspots.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image81.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:OrangePi_RV2_X1_User Manual_v1.0.1_image82.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:OrangePi_RV2_X1_User Manual_v1.0.1_image83.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:OrangePi_RV2_X1_User Manual_v1.0.1_image84.jpeg|350x224px|微信图片_20241119193751]]
</div></li>
<li><p>You can view the IP address of the wifi network through the '''ip addr show wlan0''' command.</p>
<p>orangepi@orangepi:~$ '''ip addr show wlan0'''</p>
<p>3: 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.online -I wlan0'''</p>
<p>PING www.orangepi.online (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.online 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>First, click on the upper right corner of the desktop (please do not connect the network cable when testing WIFI).</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image85.png|364x204px]]</p></li>
<li><p>Then click the Settings icon in the drop-down box that pops up.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image86.png|357x200px]]</p></li>
<li><p>Then you can see the searched WIFI hotspots under '''Visible Networks''' in the settings interface, and then click the WIFI hotspot you want to connect to.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image87.png|351x231px]]</p></li>
<li><p>Then enter the password of the WIFI hotspot and click '''Connect''' to start connecting to WIFI.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image88.png|351x218px]]</p></li>
<li><p>After connecting to WIFI, you can open the browser to check whether you can access the Internet. The browser entrance is shown in the figure below:</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image89.png|360x202px]]</p></li>
<li><p>If you can open other web pages after opening the browser, it means the WIFI connection is normal.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image90.png|575x253px]]</p></li></ol>
<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:OrangePi_RV2_X1_User Manual_v1.0.1_image91.png|314x313px]]</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''' or '''Wired connection 2'''.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image92.png|311x136px]]</p></li>
<li><p>Then select '''Edit''' using the '''Tab''' key and press Enter.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image93.png|312x123px|584E2342-D6A3-4568-90E5-F7A075BD2339]]
</div></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></li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image94.png|575x225px]]
<ol start="6" style="list-style-type: decimal;">
<li>Press Enter, use the up and down arrow keys to select '''Manual''', and then press Enter to confirm.</li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image95.png|575x225px]]
<ol start="7" style="list-style-type: decimal;">
<li><p>The display after selection is as shown below:</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image96.png|575x221px]]</p></li>
<li><p>Then use the Tab key to move the cursor to '''<Show>'''.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image97.png|576x221px]]</p></li>
<li><p>Then press Enter, and the following setting interface will pop up.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image98.png|575x293px]]</p></li>
<li><p>Then you can set the IP address (Addresses), gateway (Gateway) and DNS server address as shown in the figure below (there are many other setting options, please explore them yourself). '''Please set them according to your specific needs. The value set in the figure below is just an example'''.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image99.png|575x217px]]</p></li>
<li><p>After setting, move the cursor to '''<OK>''' in the lower right corner and press Enter to confirm.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image100.png|576x116px]]</p></li>
<li><p>Then click '''<Back>'''to return to the previous selection interface.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image101.png|244x216px]]</p></li>
<li><p>Then select '''Activate a connection''', move the cursor to '''<OK>''', and press Enter.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image102.png|331x248px]]</p></li>
<li><p>Then select the network interface you want to configure, such as '''Wired connection 2''', move the cursor to '''<Deactivate>''', and press Enter to disable '''Wired connection 2'''.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image103.png|576x170px]]</p></li>
<li><p>Then please do not move the cursor and press the Enter key to re-enable '''Wired connection 2''', so that the static IP address set previously will take effect.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image104.png|576x177px]]</p></li>
<li><p>Then you can exit '''nmtui''' using the '''<Back>''' and '''Quit''' buttons.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image105.png|246x193px]] [[File:OrangePi_RV2_X1_User Manual_v1.0.1_image106.png|200x190px]]</p></li>
<li><p>Then use '''p addr show end1''' to see that the IP address of the network port has become the static IP address set previously.</p>
<p>orangepi@orangepi:~$ '''ip addr show end1'''</p>
<p>3: end1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000</p>
<p>link/ether 00:e0:4c:68:00:14 brd ff:ff:ff:ff:ff:ff</p>
<p>inet '''192.168.2.2'''/24 brd 192.168.2.255 scope global noprefixroute end1</p>
<p>valid_lft forever preferred_lft forever</p>
<p>inet6 fdcd:e671:36f4::49e/128 scope global dynamic noprefixroute</p>
<p>valid_lft 42950sec preferred_lft 42950sec</p>
<p>inet6 fdcd:e671:36f4:0:2139:e484:d595:deda/64 scope global temporary dynamic</p>
<p>valid_lft 604550sec preferred_lft 85735sec</p>
<p>inet6 fdcd:e671:36f4:0:7d9:7510:ccc5:fac9/64 scope global mngtmpaddr noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p>
<p>inet6 fe80::db62:da89:a277:2ff0/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 whether the IP address is configured OK. The '''ping''' command can be interrupted by pressing the '''Ctrl+C''' shortcut key.</p>
<p>orangepi@orangepi:~$ '''ping www.baidu.com -I end1'''</p>
<p>PING www.a.shifen.com (183.2.172.42) from 192.168.2.2 end1: 56(84) bytes of data.</p>
<p>64 bytes from 183.2.172.42: icmp_seq=1 ttl=53 time=10.2 ms</p>
<p>64 bytes from 183.2.172.42: icmp_seq=2 ttl=53 time=9.89 ms</p>
<p>64 bytes from 183.2.172.42: icmp_seq=3 ttl=53 time=9.64 ms</p>
<p>^C</p>
<p>--- www.a.shifen.com ping statistics ---</p>
<p>3 packets transmitted, 3 received, 0% packet loss, time 2003ms</p>
<p>rtt min/avg/max/mdev = 9.640/9.915/10.219/0.237 ms</p></li></ol>
<span id="how-to-create-a-wifi-hotspot-through-create_ap"></span>
=== How to create a WIFI hotspot through create_ap ===
'''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:'''
[https://github.com/oblique/create_ap '''https://github.com/oblique/create_ap''']
'''If you are using the latest image, the create_ap script is pre-installed. 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 the encryption method, the frequency band of the WIFI hotspot, the bandwidth mode, the network sharing method, etc. You can get the options through create_ap -h'''
'''* wifi-interface:The name of the wireless network card'''
'''* interface-with-internet:The name of the network card that can connect to the Internet, usually eth0'''
'''* access-point-name:Hotspot Name'''
'''* passphrase:Hotspot password'''
<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 end0 orangepi orangepi'''
<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 end0 orangepi orangepi'''</p>
<p>Config dir: /tmp/create_ap.wlan0.conf.Ks6HobEw</p>
<p>PID: 5405</p>
<p>Network Manager found, set ap0 as unmanaged device... DONE</p>
<p>Creating a virtual WiFi interface... ap0 created.</p>
<p>Sharing Internet using method: nat</p>
<p>hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlan0.conf.Ks6HobEw/hostapd_ctrl</p>
<p>ap0: interface state UNINITIALIZED->ENABLED</p>
<p>ap0: AP-ENABLED</p></li>
<li><p>Now take out your mobile phone and find the WIFI hotspot named '''orangepi''' created by the development board in the searched WIFI list. Then you can click '''orangepi''' to connect to the hotspot. The password is the '''orangepi'''set above.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image107.png|230x183px]]</p></li>
<li><p>The display after successful connection is as shown below:</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image108.png|233x111px]]</p></li>
<li><p>In NAT mode, the wireless device connected to the development board's hotspot requests an IP address from the development board's DHCP service, so there will be two different network segments. For example, the IP of the development board here is 192.168.1.X.</p>
<p>orangepi@orangepi:~$ '''ifconfig end0'''</p>
<p>end0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500</p>
<p>inet '''192.168.1.241''' netmask 255.255.255.0 broadcast 192.168.2.255</p>
<p>inet6 fdcd:e671:36f4:0:abd1:3c87:332a:dd20 prefixlen 64 scopeid 0x0<global></p>
<p>inet6 fdcd:e671:36f4:0:52ab:6ce7:cfc7:9ecf prefixlen 64 scopeid 0x0<global></p>
<p>inet6 fe80::f082:90bd:3fbd:dc01 prefixlen 64 scopeid 0x20<link></p>
<p>inet6 fdcd:e671:36f4::47c prefixlen 128 scopeid 0x0<global></p>
<p>ether 00:e0:4c:68:00:13 txqueuelen 1000 (Ethernet)</p>
<p>RX packets 17817 bytes 22181411 (22.1 MB)</p>
<p>RX errors 0 dropped 0 overruns 0 frame 0</p>
<p>TX packets 13179 bytes 2475256 (2.4 MB)</p>
<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p>
<p>device interrupt 78 base 0xd000</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:OrangePi_RV2_X1_User Manual_v1.0.1_image108.png|271x129px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image109.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 enP3p49s0 orangepi orangepi -g 192.168.2.1'''</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:OrangePi_RV2_X1_User Manual_v1.0.1_image108.png|286x137px]]
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image110.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 end0 orangepi orangepi --freq-band 5'''
<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 end0 orangepi orangepi --hidden'''
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:OrangePi_RV2_X1_User Manual_v1.0.1_image111.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 end0 orangepi orangepi'''
<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 end0 orangepi orangepi'''</p>
<p>[sudo] password for orangepi:</p>
<p>Config dir: /tmp/create_ap.wlan0.conf.fg9U5Xgt</p>
<p>PID: 3141</p>
<p>Network Manager found, set ap0 as unmanaged device... DONE</p>
<p>Creating a virtual WiFi interface... ap0 created.</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.fg9U5Xgt/hostapd_ctrl</p>
<p>ap0: interface state UNINITIALIZED->ENABLED</p>
<p>ap0: AP-ENABLED</p></li>
<li><p>Now take out your mobile phone and find the WIFI hotspot named '''orangepi''' created by the development board in the searched WIFI list. Then you can click '''orangepi''' to connect to the hotspot. The password is the '''orangepi''' set above.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image107.png|265x211px]]</p></li>
<li><p>The display after successful connection is as shown below:</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image108.png|273x130px]]</p></li>
<li><p>In bridge mode, the wireless device connected to the development board's 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 of the development board here is '''192.168.1.X'''.</p>
<p>orangepi@orangepi:~$ '''ifconfig end0'''</p>
<p>end0: 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:OrangePi_RV2_X1_User Manual_v1.0.1_image108.png|284x136px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image112.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 end0 orangepi orangepi --freq-band 5'''
<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 end0 orangepi orangepi --hidden'''
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:OrangePi_RV2_X1_User Manual_v1.0.1_image111.png|228x191px]]
<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:[email protected] [email protected].]xxx''' #Need to replace with the IP address of the development board
[email protected]'s password: #Enter the password here, the default password is orangepi
'''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>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image113.png|407x191px|IMG_256]]
</div>
<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 ===
# First, obtain the IP address of the development board.
# Under Windows, you can use MobaXterm to remotely log in to the development board. First, create a new ssh session.
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>Open '''Session'''.</p></li>
<li><p>Select '''SSH in Session Setting'''.</p></li>
<li><p>Enter the IP address of the development board in '''Remote host'''.</p></li>
<li><p>Enter the Linux user name '''root''' or '''orangepi''' in '''Specify username'''.</p></li>
<li><p>Click OK.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image114.png|575x292px|13]]
</div></li></ol>
<!-- -->
<ol start="3" style="list-style-type: decimal;">
<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></li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image115.jpeg|575x149px|0006-(1)]]
</div>
<ol start="4" style="list-style-type: decimal;">
<li>After successfully logging into the system, the display is as shown below:</li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image116.png|575x292px]]
<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 to the file to be uploaded.</p></li>
<li><p>'''orangepi:'''This is the user name of the Linux system of the development board. It 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 [email protected]:/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 [email protected]:/home/orangepi/'''</p></li>
<li><p>There are more uses for scp. Please use the following command to view the man manual.</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 command below.</p>
<p>test@test:~$ '''filezilla'''</p></li>
<li><p>The interface after opening filezilla is as shown below. At this time, the remote site on the right is empty.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image117.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:OrangePi_RV2_X1_User Manual_v1.0.1_image118.png|575x128px|图片565]]
</div>
<ol start="5" style="list-style-type: decimal;">
<li><p>Then select '''Save Password''' and click '''OK'''.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image119.png|249x181px]]</p></li>
<li><p>Then select '''Always trust this host''' and click '''OK'''.</p></li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image120.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:OrangePi_RV2_X1_User Manual_v1.0.1_image121.png|533x330px|IMG_256]]
</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, 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:OrangePi_RV2_X1_User Manual_v1.0.1_image122.png|529x414px|IMG_256]]
</div>
<ol start="9" style="list-style-type: decimal;">
<li><p>After uploading is complete, you can go to the corresponding path in the Linux system of the development board to view the uploaded files.</p></li>
<li><p>The method for uploading a folder is the same as that for 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:OrangePi_RV2_X1_User Manual_v1.0.1_image123.jpeg|576x208px|1720161972192]]
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image124.jpeg|576x415px|1720161983058]]
</div>
<ol start="2" style="list-style-type: decimal;">
<li><p>The downloaded installation package is as shown below, 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, and then select '''Next>'''.
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image125.png|319x251px|IMG_256]]
</div>
<ol start="3" style="list-style-type: decimal;">
<li>The interface after opening filezilla is as shown below. At this time, the remote site on the right is empty.</li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image126.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:OrangePi_RV2_X1_User Manual_v1.0.1_image118.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:OrangePi_RV2_X1_User Manual_v1.0.1_image127.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:OrangePi_RV2_X1_User Manual_v1.0.1_image128.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:OrangePi_RV2_X1_User Manual_v1.0.1_image129.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, 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:OrangePi_RV2_X1_User Manual_v1.0.1_image130.png|535x394px|IMG_256]]
</div>
<ol start="9" style="list-style-type: decimal;">
<li><p>After uploading is complete, you can go to the corresponding path in the Linux system of the development board to view the uploaded files.</p></li>
<li><p>The method for uploading a folder is the same as that for uploading a file, so I will not go into details here.</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>Use an HDMI to HDMI cable to connect the Orange Pi development board and the HDMI display.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image10.png|199x129px]]</p></li>
<li><p>After starting the Linux system, if the HDMI monitor has image output, it means that the HDMI interface is working properly.</p></li></ol>
'''Please note that although many laptops are equipped with 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 port of a laptop, please make sure 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-resolution-setting-method"></span>
=== HDMI resolution setting method ===
<ol style="list-style-type: decimal;">
<li><p>First click the upper right corner of the desktop, then click the settings icon to open the settings interface.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image85.png|364x204px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image86.png|357x200px]]</p></li>
<li><p>Then find '''Display''' in the settings interface to see the current resolution of the system.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image131.png|376x248px]]</p></li>
<li><p>Click the drop-down box of Resolution to see all the resolutions currently supported by the monitor.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image132.png|375x246px]]</p></li>
<li><p>Then select the resolution you want to set and click '''Apply.'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image133.png|372x246px]]</p></li>
<li><p>After the new resolution is set, select '''Keep Changes.'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image134.png|366x240px]]</p></li></ol>
<span id="how-to-use-bluetooth"></span>
== How to use Bluetooth ==
<span id="desktop-image-testing-method"></span>
=== Desktop image testing method ===
<ol style="list-style-type: decimal;">
<li><p>First click the upper right corner of the desktop, then click the settings icon to open the settings interface.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image85.png|364x204px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image86.png|357x200px]]</p></li>
<li><p>Then find '''Bluetooth''' in the settings interface. Under '''Devices,''' the Bluetooth devices scanned around will be displayed. Then select the Bluetooth device you want to connect to start pairing.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image135.png|384x252px]]</p></li>
<li><p>After pairing starts, a pairing confirmation box will pop up. Select '''Confirm'''. Confirmation is also required on the phone.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image136.png|332x217px]]</p></li></ol>
<!-- -->
<ol start="7" style="list-style-type: decimal;">
<li><p>After pairing with the phone, you can click on the paired Bluetooth device and select '''Send a File''' to start sending a picture to the phone.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image137.png|346x227px]][[File:OrangePi_RV2_X1_User Manual_v1.0.1_image138.png|348x240px]]</p></li>
<li><p>The interface for sending pictures is as follows:</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image139.png|360x216px]]</p></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="connect-a-usb-mouse-or-keyboard-to-test"></span>
=== Connect a USB mouse or keyboard to test ===
# Plug the USB keyboard into the USB port of the Orange Pi development board.
# Connecting Orange Pi to 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 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-camera-test"></span>
=== USB camera test ===
<ol style="list-style-type: decimal;">
<li><p>First, you need to prepare a USB camera that supports UVC protocol as shown in the figure below or similar, and then insert the USB camera into the USB port of the Orange Pi development board.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image14.png|259x150px]]</p></li>
<li><p>Through the v4l2-ctl command, you can see that the device node information of the USB camera is '''/dev/video20'''</p>
<p>orangepi@orangepi:~$ '''v4l2-ctl --list-devices | grep -A 3 "Q8 HD Webcam"'''</p>
<p>Q8 HD Webcam: Q8 HD Webcam ('''usb'''-fc880000.usb-1):</p>
<p>'''/dev/video20'''</p>
<p>/dev/video21</p>
<p>/dev/media1</p>
<p>'''Note that the l in v4l2 is a lowercase letter l, not the number 1.'''</p>
<p>'''In addition, the serial number of the video is not always video20, please refer to the actual one you see.'''</p></li>
<li><p>How to use fswebcam to test 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>-d Option 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>The -S option is used to set the number of previous frames to skip</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 the 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:[email protected]:/home/test [email protected]:/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></ol>
<span id="audio-test"></span>
== Audio Test ==
<span id="testing-audio-methods-on-desktop-systems"></span>
=== Testing Audio Methods on Desktop Systems ===
<ol style="list-style-type: decimal;">
<li><p>First open the file manager.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image140.png|324x182px]]</p></li>
<li><p>Then find the file below (if there is no audio file in the system, you can upload an audio file to the system yourself).</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image141.png|322x202px]]</p></li>
<li><p>Then select the audio.wav file, right-click and choose to open with mpv to start playing.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image142.png|323x200px]]</p></li>
<li><p>A method for switching 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 upper right corner, then click on the settings icon to open the settings interface.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image85.png|390x219px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image86.png|388x218px]]</p></li>
<li><p>Then find the '''Sound''' settings.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image143.png|385x256px]]</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:OrangePi_RV2_X1_User Manual_v1.0.1_image144.png|383x253px]]</p></li></ol>
</li></ol>
<span id="how-to-play-audio-using-commands"></span>
=== How to play audio using commands ===
<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:OrangePi_RV2_X1_User Manual_v1.0.1_image145.png|274x190px]]</p></li>
<li><p>Then you can use the '''aplay -l''' command to view the sound card devices supported by the Linux system. From the output below, we can see that '''card 1''' is the es8388 sound card device, which is the sound card device of the headset.</p>
<p>orangepi@orangepi:~$ '''aplay -l'''</p>
<p>**** List of PLAYBACK Hardware Devices ****</p>
<p>card 0: sndhdmi [snd-hdmi], device 0: SSPA2-dummy_codec dummy_codec-0 []</p>
<p>Subdevices: 1/1</p>
<p>Subdevice #0: subdevice #0</p>
<p>'''card 1: sndes8323 [snd-es8323], device 0: i2s-dai0-ES8323 HiFi ES8323 HiFi-0 []'''</p>
<p>'''Subdevices: 1/1'''</p>
<p>'''Subdevice #0: subdevice #0'''</p></li>
<li><p>Then use the '''aplay''' command to play the audio file that comes with the system. If the headphones can hear the sound, it means that the hardware can be used normally.</p>
<p>orangepi@orangepi:~$ '''aplay -D hw:1,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>
<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>Then check the HDMI sound card serial number. From the output below, we can know that the HDMI sound card is '''card 0'''</p>
<p>orangepi@orangepi:~$ '''aplay -l'''</p>
<p>**** List of PLAYBACK Hardware Devices ****</p>
<p>'''card 0: sndhdmi [snd-hdmi], device 0: SSPA2-dummy_codec dummy_codec-0 []'''</p>
<p>'''Subdevices: 1/1'''</p>
<p>'''Subdevice #0: subdevice #0'''</p>
<p>......</p></li>
<li><p>Then use the '''aplay''' command to play the audio file that comes with the system. If the HDMI display or TV can hear the sound, it means that the hardware can be used normally.</p>
<p>orangepi@orangepi:~$ '''aplay -D hw:0,0 /usr/share/sounds/alsa/audio.wav'''</p></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 RV2 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:1,0 -d 5 -f cd -t wav /tmp/test.wav'''</p></li></ol>
<span id="temperature-sensor"></span>
== Temperature sensor ==
# The command to view the system temperature sensor is:
orangepi@orangepi:~$ '''sensors'''
cluster0_thermal-virtual-0
Adapter: Virtual device
temp1: +59.0°C
cluster1_thermal-virtual-0
Adapter: Virtual device
temp1: +60.0°C
<ol start="2" style="list-style-type: decimal;">
<li><p>The command to check the current temperature of the nvme ssd solid state drive is:</p>
<p>orangepi@orangepi:~$ '''sudo smartctl -a /dev/nvme0 | grep "Temperature:"'''</p>
<p>Temperature: '''40 Celsius'''</p></li></ol>
<span id="pin-interface-pin-description"></span>
== 26 Pin Interface Pin Description ==
<ol style="list-style-type: decimal;">
<li><p>Please refer to the following figure for the order of the 26-pin interface pins of the Orange Pi RV2 development board</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image146.jpeg|398x237px|0006-(2)]]
</div></li>
<li><p>The functions of the 26 pin interface pins of the Orange Pi RV2 development board are shown in the following table</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Below is the complete pin diagram of 26 pins</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image147.png|576x116px]]</p></li>
<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:OrangePi_RV2_X1_User Manual_v1.0.1_image148.png|576x231px]]</p></li>
<li><p>The table below is the right half of the complete table above, which can be seen more clearly</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image149.png|576x230px]]</p>
<p>'''In the table above, the base addresses of the corresponding registers are marked for pwm, which is useful for checking which pwmchip in''' '''/sys/class/pwm/''' '''corresponds to which pwm pin in the 26-pin header.'''</p></li></ol>
</li>
<li><p>There are a total of '''17''' GPIO ports in the 26-pin interface, and the voltage of all GPIO ports is '''3.3v'''</p></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/riscv64/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:OrangePi_RV2_X1_User Manual_v1.0.1_image150.png|576x249px]]
<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 Orange Pi RV2 needs to download the wiringOP next branch code, please do not 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:OrangePi_RV2_X1_User Manual_v1.0.1_image150.png|576x249px]]</p></li></ol>
<span id="pin-interface-gpio-i2c-uart-spi-can-and-pwm-test"></span>
== 26pin interface GPIO, I2C, UART, SPI, CAN and PWM test ==
<span id="pin-gpio-port-test"></span>
=== 26pin GPIO port test ===
'''The Linux system released by Orange Pi has a pre-installed blink_all_gpio program, which will set all 17 GPIO ports in the 26-pin to switch high and low levels continuously.'''
'''After running the blink_all_gpio program, when you use a multimeter to measure the voltage level of the GPIO port, you will find that the GPIO pin will switch between 0 and 3.3v. Using this program, we can test whether the GPIO port can work properly.'''
'''The way to run the blink_all_gpio program is as follows:'''
orangepi@orangepi:~$ '''sudo blink_all_gpio''' #Remember to add sudo permissions
[sudo] password for orangepi: #You need to enter your password here
<ol style="list-style-type: decimal;">
<li><p>There are '''17''' GPIO ports available in the 26-pin development board. The following example shows how to set the high and low levels of the GPIO port using pin 7, which corresponds to GPIO74 and wPi number 2.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image151.png|576x126px]]</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>root@orangepi:~/wiringOP# '''gpio mode 2 out'''</p></li>
<li><p>Then set the GPIO port to output a low level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 0v, it means that the low level is set successfully.</p>
<p>root@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:OrangePi_RV2_X1_User Manual_v1.0.1_image152.png|575x126px]]</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# '''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:OrangePi_RV2_X1_User Manual_v1.0.1_image153.png|575x125px]]</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-gpio-pins"></span>
=== How to set pull-up and pull-down resistors on GPIO pins ===
'''Note that only the following 8 GPIO pins of Orange Pi RV2 can be set to pull up and down normally. Other GPIO pins do not support the function of setting pull-up and pull-down resistors.'''
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image154.png|576x250px]]
<ol style="list-style-type: decimal;">
<li><p>Below, we take pin 8, which corresponds to GPIO 47 and wPi number 3, as an example to demonstrate how to set the pull-up and pull-down resistors of the GPIO port.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image155.png|575x125px]]</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>root@orangepi:~# '''gpio mode 3 in'''</p></li>
<li><p>After setting to input mode, execute the following command to set the GPIO port to pull-up mode</p>
<p>root@orangepi:~# '''gpio mode 3 up'''</p></li>
<li><p>Then enter the following command to read the level of the GPIO port. If the level is 1, it means that the pull-up mode is set successfully.</p>
<p>root@orangepi:~# '''gpio read 3'''</p>
<p>'''1'''</p></li>
<li><p>Then execute the following command to set the GPIO port to pull-down mode</p>
<p>root@orangepi:~# '''gpio mode 3 down'''</p></li>
<li><p>Then enter the following command to read the level of the GPIO port. If the level is 0, it means that the pull-down mode is set successfully.</p>
<p>root@orangepi:~# '''gpio read 3'''</p>
<p>'''0'''</p></li></ol>
<span id="pin-spi-test"></span>
=== 26pin SPI test ===
<ol style="list-style-type: decimal;">
<li><p>As shown in the figure below, the available spi for Orange Pi RV2 is spi3</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image156.png|575x117px]]</p></li>
<li><p>The corresponding pins of SPI3 in 26 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
|
| style="text-align: left;"| '''SPI3 corresponds to 26pin'''
|-
| '''MOSI'''
| style="text-align: left;"| '''Pin 19'''
|-
| '''MISO'''
| style="text-align: left;"| '''Pin 21'''
|-
| '''CLK'''
| style="text-align: left;"| '''Pin 23'''
|-
| '''CS0'''
| style="text-align: left;"| '''Pin 24'''
|-
| '''Dtbo''' '''Configuration'''
| style="text-align: left;"| '''spi3-cs0-spidev'''
|}
<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the SPI in 26 pins is closed by default and needs to be opened manually before use. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select '''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select and open the SPI3 configuration</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image159.png|370x65px]]</p></li>
<li><p>Then select '''<Save>''' to save</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|366x155px]]</p></li>
<li><p>Then select '''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|360x153px]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system to make the configuration take effect.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image162.png|332x146px]]</p></li></ol>
</li>
<li><p>After restarting, enter the system and check whether there is a device node of '''spidevx.x''' in the Linux system. If it exists, it means that SPI has been set up and can be used directly.</p>
<p>orangepi@orangepi:~$ '''ls /dev/spidev*'''</p>
<p>/dev/spidev3.0</p></li>
<li><p>Do not short the mosi and miso pins of SPI3. The output of running spidev_test is as follows. It can be seen that the data of TX and RX are inconsistent.</p>
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev3.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 SPI3 and run spidev_test again. 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/spidev3.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>
=== 26pin 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 RV2 are i2c3 and i2c4, a total of two i2c buses.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image156.png|575x117px]]</p></li>
<li><p>The corresponding pins of the two sets of I2C buses in 26 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
| '''I2C''' '''bus'''
| style="text-align: left;"| '''SDA corresponds to 26pin'''
| style="text-align: left;"| '''SCL corresponds to 26pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| '''I2C3'''
| style="text-align: left;"| '''Pin 10'''
| style="text-align: left;"| '''Pin 8'''
| style="text-align: left;"| '''i2c3'''
|-
| '''I2C4'''
| style="text-align: left;"| '''Pin 3'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''i2c4'''
|}
<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the I2C bus in 26 pins is closed by default and needs to be opened manually before it can be used. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config.''' Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select '''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select the I2C configuration you want to open</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image163.png|373x44px|IMG_256]]
</div></li>
<li><p>Then select '''<Save>''' to save</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|367x120px]]</p></li>
<li><p>Then select '''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|361x118px]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system for the configuration to take effect.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image162.png|323x142px]]</p></li></ol>
</li>
<li><p>After starting the Linux system, first confirm that there is a device node that needs to use I2C under '''/dev'''</p>
<p>orangepi@orangepi:~$ '''ls /dev/i2c-*'''</p></li>
<li><p>Then connect an i2c device to the i2c pin of the 26pin connector</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 -r 3''' #Command for i2c3</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y -r 4''' #Command for i2c4</p></li></ol>
<span id="pin-uart-test"></span>
=== 26pin UART test ===
<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, the available uarts for Orange Pi RV2 are uart5, uart8 and uart9, a total of three uart buses.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image156.png|575x117px]]</p></li>
<li><p>The corresponding pins of the three groups of UART buses in 26 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 26pin'''
| style="text-align: left;"| '''TX corresponds to 26pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''UART5'''
| style="text-align: left;"| '''Pin 11'''
| style="text-align: left;"| '''Pin 12'''
| style="text-align: left;"| '''uart5'''
|-
| style="text-align: left;"| '''UART8'''
| style="text-align: left;"| '''Pin 24'''
| style="text-align: left;"| '''Pin 23'''
| style="text-align: left;"| '''uart8'''
|-
| style="text-align: left;"| '''UART9'''
| style="text-align: left;"| '''Pin 13'''
| style="text-align: left;"| '''Pin 15'''
| style="text-align: left;"| '''uart9'''
|}
<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the UART in 26 pins is closed by default and needs to be opened manually. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select '''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select the UART configuration you want to open</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image164.png|355x47px]]</p></li>
<li><p>Then select '''<Save>''' to save</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|357x117px]]</p></li>
<li><p>Then select '''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|355x117px]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system for the configuration to take effect.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image162.png|320x141px]]</p></li></ol>
</li>
<li><p>After entering the Linux system, first confirm whether there is a device node corresponding to uart under '''/dev'''</p>
<p>orangepi@orangepi:~$ '''ls /dev/ttyS*'''</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 (ttySX needs to be replaced with the corresponding uart node name, please do not copy it)</p>
<p>orangepi@orangepi:~$ '''sudo gpio serial /dev/ttySX'''</p>
<p>Out: 0: -> 0</p>
<p>Out: 1: -> 1</p>
<p>Out: 2: -> 2</p>
<p>Out: 3: -> 3</p>
<p>Out: 4: -> 4</p>
<p>Out: 5: -> 5^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>As can be seen from the table below, Orange Pi RV2 has two PWM channels: pwm7 and pwm9.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image156.png|575x117px]]</p></li>
<li><p>The corresponding pins of PWM in 26 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''PWM Bus'''
| style="text-align: left;"| '''Correspond''' '''26pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''PWM7'''
| style="text-align: left;"| '''Pin 18'''
| style="text-align: left;"| '''pwm7'''
|-
| style="text-align: left;"| '''PWM9'''
| style="text-align: left;"| '''Pin 7'''
| style="text-align: left;"| '''pwm9'''
|}
<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, PWM in 26 pins is disabled by default and needs to be enabled manually. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select '''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select'''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select the '''PWM''' configuration you want to turn on.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image165.png|366x33px]]</p></li>
<li><p>Then select '''<Save>''' to save</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|357x117px]]</p></li>
<li><p>Then select '''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|355x117px]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system for the configuration to take effect</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image162.png|303x133px]]</p></li></ol>
</li>
<li><p>When a pwm is turned on, there will be an additional pwmchipX in '''/sys/class/pwm/''' (X is a specific number). For example, after turning on pwm9, the pwmchipX under '''/sys/class/pwm/''' will change from one to two.</p>
<p>orangepi@orangepi:~$ '''ls /sys/class/pwm/'''</p>
<p>pwmchip0 pwmchip1</p></li>
<li><p>Which pwmchip above corresponds to pwm9? Let's first check the output of the '''ls /sys/class/pwm/ -l''' command, as shown below:</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image166.png|613x45px|IMG_256]]
</div></li>
<li><p>Then from the table below, we can see that the base address of the pwm9 register is c0888a00. Looking at the output of the '''ls /sys/class/pwm/ -l''' command, we can see that pwmchip1 is linked to c0888a00.pwm, so the pwmchip corresponding to pwm9 is pwmchip1.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image167.png|456x183px]]</p></li>
<li><p>Then use the following command to make pwm9 output a 500Hz square wave (please switch to the root user first, then execute the following command)</p></li></ol>
root@orangepi:~# '''echo 0 > /sys/class/pwm/pwmchip1/export'''
root@orangepi:~# '''echo 200000 > /sys/class/pwm/pwmchip1/pwm0/period'''
root@orangepi:~# '''echo 100000 > /sys/class/pwm/pwmchip1/pwm0/duty_cycle'''
root@orangepi:~# '''echo 1 > /sys/class/pwm/pwmchip1/pwm0/enable'''
<ol start="8" style="list-style-type: decimal;">
<li>The pwm9 test method demonstrated above is similar to other pwm test methods.</li></ol>
<span id="can-test-method"></span>
=== CAN test method ===
<span id="how-to-open-can"></span>
==== How to open CAN ====
<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, the available CAN bus for Orange Pi RV2 is CAN0</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image156.png|575x117px]]</p></li>
<li><p>In Linux system, the CAN in 26 pins is closed by default and needs to be opened manually before it can be used. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select'''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select'''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select and open the configuration of can0</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image168.png|360x33px]]</p></li>
<li><p>Then select '''<Save>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|357x117px]]</p></li>
<li><p>Then select '''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|355x117px]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system for the configuration to take effect</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image162.png|283x125px]]</p></li></ol>
</li>
<li><p>After entering the Linux system, use the '''sudo''' '''ifconfig -a''' command. If you can see the CAN device, it means that CAN has been correctly opened.</p>
<p>orangepi@orangepi:~$ '''sudo ifconfig -a'''</p>
<p>can0: flags=128<NOARP> mtu 16</p>
<p>unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)</p>
<p>RX packets 0 bytes 0 (0.0 B)</p>
<p>RX errors 0 dropped 0 overruns 0 frame 0</p>
<p>TX packets 0 bytes 0 (0.0 B)</p>
<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p>
<p>device interrupt 91</p></li>
<li><p>The pin corresponding to 26pin of CAN0 is</p></li></ol>
{| class="wikitable"
|-
|
| style="text-align: left;"| '''CAN0'''
|-
| '''TX''' '''Pin'''
| style="text-align: left;"| '''Corresponding to pin 23'''
|-
| '''RX''' '''Pin'''
| style="text-align: left;"| '''Corresponding to pin 24'''
|}
<span id="test-sending-and-receiving-messages-using-canalyst-ii-analyzer"></span>
==== Test sending and receiving messages using CANalyst-II analyzer ====
<ol style="list-style-type: decimal;">
<li><p>The CANalyst-II analyzer used in the test is shown in the figure below</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image169.png|222x181px]]</p></li>
<li><p>CANalyst-II analyzer data download link</p>
<p>[https://www.zhcxgd.com/3.html '''https://www.zhcxgd.com/3.html''']</p></li>
<li><p>First, you need to install the USBCANToolSetup software</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image170.png|553x94px]]</p></li>
<li><p>The shortcut after USBCANToolSetup is installed is:</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image171.png|77x105px]]</p></li>
<li><p>You also need to install the USB driver</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image172.png|553x112px]]</p></li>
<li><p>The USB port of CANalyst-II analyzer needs to be connected to the USB port of the computer.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image173.png|137x121px]]</p></li>
<li><p>To test the CAN function, you also need to prepare a CAN transceiver as shown in the figure below. The main function of the CAN transceiver is to convert the TTL signal of the CAN controller into the differential signal of the CAN bus.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The 3.3V pin of the CAN transceiver needs to be connected to the 3.3V pin of the 26pin of the development board</p></li>
<li><p>The GND pin of the CAN transceiver needs to be connected to the GND pin of the 26pin of the development board</p></li>
<li><p>The CAN TX pin of the CAN transceiver needs to be connected to the TX pin of the CAN bus in the 26-pin of the development board</p></li>
<li><p>The CAN RX pin of the CAN transceiver needs to be connected to the RX pin of the CAN bus in the 26-pin of the development board</p></li>
<li><p>The CANH pin of the CAN transceiver needs to be connected to the H interface of the analyzer</p></li>
<li><p>The CANL pin of the CAN transceiver needs to be connected to the L interface of the analyzer</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image174.png|352x113px]]</p></li></ol>
</li>
<li><p>Then you can open the USB-CAN software</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image175.png|553x267px]]</p></li>
<li><p>Then click Start Device</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image176.png|553x238px]]</p></li>
<li><p>Then click OK</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image177.png|279x110px]]</p></li>
<li><p>Set the baud rate to 1000k bps</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image178.png|322x268px]]</p></li>
<li><p>After successfully opening, the USB-CAN software will display the serial number and other information</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image179.png|553x262px]]</p></li>
<li><p>Development board receives CAN message test</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, set the baud rate of the CAN bus to '''1000kbps''' in the Linux system of the development board</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 down'''</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 type can bitrate 1000000'''</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 up'''</p></li>
<li><p>Then run the '''candump can0''' command to prepare to receive messages.</p>
<p>orangepi@orangepi:~$ '''sudo candump can0'''</p></li>
<li><p>Then send a message to the development board in the USB-CAN software</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image180.png|553x188px]]</p></li>
<li><p>If the development board can receive the message sent by the analyzer, it means that the CAN bus can be used normally.</p>
<p>orangepi@orangepirv2:~$ '''sudo candump can0'''</p>
<p>'''can0 001 [8] 01 02 03 04 05 06 07 08'''</p></li></ol>
</li>
<li><p>Development board sends CAN message test</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, set the CAN baud rate to '''1000kbps''' in the Linux system</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 down'''</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 type can bitrate 1000000'''</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 up'''</p></li>
<li><p>Execute the '''cansend''' command in the development board to send a message</p>
<p>orangepi@orangepi:~$ '''sudo cansend can0 123#1122334455667788'''</p></li>
<li><p>If the USB-CAN software can receive the message sent by the development board, it means the communication is successful</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image181.png|575x449px|图片1]]
</div></li></ol>
</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 some of the following commands 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>
=== 26pin 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:OrangePi_RV2_X1_User Manual_v1.0.1_image150.png|576x249px]]
<ol style="list-style-type: decimal;">
<li><p>Below, we take pin 7, which corresponds to GPIO 74 and wPi number 2, as an example to demonstrate how to set the high and low levels of the GPIO port.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image151.png|576x126px]]</p></li>
<li><p>The steps for direct command testing 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 26 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>
=== 26pin SPI test ===
<ol style="list-style-type: decimal;">
<li><p>As shown in the figure below, the available spi for Orange Pi RV2 is spi3</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image156.png|575x117px]]</p></li>
<li><p>The corresponding pins of SPI3 in 26 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
|
| style="text-align: left;"| '''SPI3 corresponds to 26 pin'''
|-
| '''MOSI'''
| style="text-align: left;"| '''Pin''' '''19'''
|-
| '''MISO'''
| style="text-align: left;"| '''Pin''' '''21'''
|-
| '''CLK'''
| style="text-align: left;"| '''Pin''' '''23'''
|-
| '''CS0'''
| style="text-align: left;"| '''Pin''' '''24'''
|-
| '''Dtbo configuration'''
| style="text-align: left;"| '''spi3-cs0-spidev'''
|}
<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the SPI in 26 pins is closed by default and needs to be opened manually before use. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select'''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select'''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select and open the SPI3 configuration</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image159.png|370x65px]]</p></li>
<li><p>Then select '''<Save>''' to save</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|366x155px]]</p></li>
<li><p>Then select'''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|360x153px]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system for the configuration to take effect.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image162.png|332x146px]]</p></li></ol>
</li>
<li><p>After restarting, enter the system and check whether there is a device node of '''spidevx.x''' in the Linux system. If it exists, it means that SPI has been set up and can be used directly.</p>
<p>orangepi@orangepi:~$ '''ls /dev/spidev*'''</p>
<p>/dev/spidev3.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/spidev0.0
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="7" 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/spidev0.0
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>
=== 26pin 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 RV2 are i2c3 and i2c3, a total of two i2c buses</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image156.png|575x117px]]</p></li>
<li><p>The corresponding pins of the 4 groups of I2C buses in 26 pins are shown in the following table.</p></li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''I2C Bus'''
| style="text-align: left;"| '''SDA corresponds to 26pin'''
| style="text-align: left;"| '''SCL corresponds to 26pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''I2C3'''
| style="text-align: left;"| '''Pin 10'''
| style="text-align: left;"| '''Pin 8'''
| style="text-align: left;"| '''i2c3'''
|-
| style="text-align: left;"| '''I2C4'''
| style="text-align: left;"| '''Pin 3'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''i2c4'''
|}
<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the I2C bus in 26 pins is closed by default and needs to be opened manually before it can be used. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select'''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select'''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select the I2C configuration you want to open</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image163.png|373x44px|IMG_256]]
</div></li>
<li><p>Then select '''<Save>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|367x120px]]</p></li>
<li><p>Then select'''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|361x118px]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system for the configuration to take effect.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image162.png|323x142px]]</p></li></ol>
</li>
<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></li>
<li><p>Then connect an i2c device to the i2c pin of the 26pin connector. Here we take the ds1307 RTC module as an example.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image182.png|117x88px]]</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 -r 3''' #i2c3 commands</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y -r 4''' #i2c4 commands</p></li>
<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 /dev/i2c-3'''</p>
<p>Thu 2023-01-05 14:57:55</p>
<p>Thu 2023-01-05 14:57:56</p>
<p>Thu 2023-01-05 14:57:57</p>
<p>^C</p>
<p>exit</p></li></ol>
<span id="pin-uart-test-1"></span>
=== 26pin UART test ===
<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, the available uarts for Orange Pi RV2 are uart5, uart8 and uart9, a total of three uart buses.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image156.png|575x117px]]</p></li>
<li><p>The corresponding pins of the four UART buses in 26 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 26pin'''
| style="text-align: left;"| '''TX corresponds to 26pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''UART5'''
| style="text-align: left;"| '''Pin 11'''
| style="text-align: left;"| '''Pin 12'''
| style="text-align: left;"| '''uart5'''
|-
| style="text-align: left;"| '''UART8'''
| style="text-align: left;"| '''Pin 24'''
| style="text-align: left;"| '''Pin 23'''
| style="text-align: left;"| '''uart8'''
|-
| style="text-align: left;"| '''UART9'''
| style="text-align: left;"| '''Pin 13'''
| style="text-align: left;"| '''Pin 15'''
| style="text-align: left;"| '''uart9'''
|}
<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the UART in 26 pins is disabled by default and needs to be enabled manually. The detailed steps are as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select'''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select'''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select the UART configuration you want to open</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image164.png|355x47px]]</p></li>
<li><p>Then select'''<Save>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|357x117px]]</p></li>
<li><p>Then select'''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|355x117px]]</p></li>
<li><p>Then select <span class="mark"><Reboot></span> to restart the system for the configuration to take effect.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image162.png|320x141px]]</p></li></ol>
</li>
<li><p>After entering the Linux system, first confirm whether there is a device node corresponding to uart under '''/dev'''</p>
<p>orangepi@orangepi:~$ '''ls /dev/ttyS*'''</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 '''serialTest.py''' program in the examples 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.</p>
<p>'''The X in /dev/ttySX needs to be replaced with the serial number of the specific uart device node.'''</p>
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 serialTest.py --device /dev/ttySX'''</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 counting 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 32896,identity is X1 Watchdog</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="how-to-use-docker"></span>
== How to use Docker ==
<ol style="list-style-type: decimal;">
<li><p>The Linux image provided by Orange Pi has Docker pre-installed.</p></li>
<li><p>Then you can use the following command to test docker. If you can run hello-world, it means that docker can be used normally.</p>
<p>orangepi@orangepi:~$ '''sudo docker run hello-world'''</p>
<p>Unable to find image 'hello-world:latest' locally</p>
<p>latest: Pulling from library/hello-world</p>
<p>256ab8fe8778: Pull complete</p>
<p>Digest: sha256:7f0a9f93b4aa3022c3a4c147a449ef11e0941a1fd0bf4a8e6c9408b2600777c5</p>
<p>Status: Downloaded newer image for hello-world:latest</p>
<p>'''Hello from Docker!'''</p>
<p>'''This message shows that your installation appears to be working correctly.'''</p>
<p>.….</p></li></ol>
<span id="test-of-some-programming-languages-supported-by-linux-system"></span>
== Test of some programming languages supported by Linux system ==
<span id="ubuntu-noble-system"></span>
=== Ubuntu Noble 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>
<p>gcc (Ubuntu 13.3.0-6ubuntu2~24.04) '''13.3.0'''</p>
<p>Copyright (C) 2023 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>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.12.3''' (main, Nov 6 2024, 18:32:19) [GCC 13.2.0] on linux</p>
<p>Type "help", "copyright", "credits" or "license" for more information.</p>
<p>>>></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 Noble 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-21</p>
<p>orangepi@orangepi:~$ '''sudo apt install -y openjdk-21-jdk'''</p></li>
<li><p>After installation, you can check the Java version</p>
<p>orangepi@orangepi:~$ '''java --version'''</p>
<p>openjdk 21.0.6 2025-01-21</p>
<p>OpenJDK Runtime Environment (build 21.0.6+11-Ubuntu-1ubuntu124.04)</p>
<p>OpenJDK 64-Bit Server VM (build 21.0.6+11-Ubuntu-1ubuntu124.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-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>'''The names of the deb packages of kernel header files of different kernel versions may be different. Please refer to the actual ones you see.'''</p>
<p>orangepi@orangepi:~$ '''ls /opt/linux-headers*'''</p>
<p>/opt/linux-headers-current-ky_x.x.x_riscv64.deb</p></li>
<li><p>Use the following command to install the kernel header file deb package</p>
<p>'''The name of the kernel header file deb package needs to be replaced with the actual name, please do not copy it.'''</p>
<p>orangepi@orangepi:~$ '''sudo dpkg -i /opt/linux-headers-current-ky_1.x.x_riscv64.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-6.6.63-ky</p></li>
<li><p>Then you can write a hello kernel module to test the kernel header file</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, write the code for the hello kernel module as follows:</p>
<p>orangepi@orangepi:~$ '''vim hello.c'''</p>
<p>#include <linux/init.h></p>
<p>#include <linux/module.h></p>
<p>static int hello_init(void)</p>
<p>{</p>
<p>printk("Hello Orange Pi -- init\n");</p>
<p>return 0;</p>
<p>}</p>
<p>static void hello_exit(void)</p>
<p>{</p>
<p>printk("Hello Orange Pi -- exit\n");</p>
<p>return;</p>
<p>}</p>
<p>module_init(hello_init);</p>
<p>module_exit(hello_exit);</p>
<p>MODULE_LICENSE("GPL");</p></li>
<li><p>Then write the Makefile file to compile the hello kernel module as follows:</p>
<p>orangepi@orangepi:~$ '''vim Makefile'''</p>
<p>ifneq ($(KERNELRELEASE),)</p>
<p>obj-m:=hello.o</p>
<p>else</p>
<p>KDIR :=/lib/modules/$(shell uname -r)/build</p>
<p>PWD :=$(shell pwd)</p>
<p>all:</p>
<p>make -C $(KDIR) M=$(PWD) modules</p>
<p>clean:</p>
<p>rm -f *.ko *.o *.mod.o *.mod *.symvers *.cmd *.mod.c *.order</p>
<p>endif</p></li>
<li><p>Then use the make command to compile the hello kernel module. The output of the compilation process is as follows:</p>
<p>'''If there is a problem compiling the copied code here, you can directly use the source code pre-installed in the Linux system. The path of the hello source code is:''' '''/usr/src/hello.'''</p>
<p>orangepi@orangepi:~$ '''sudo make'''</p>
<p>make -C /lib/modules/6.6.63-ky/build M=/home/orangepi modules</p>
<p>make[1]: Entering directory '/usr/src/linux-headers-6.6.63-ky'</p>
<p>CC [M] /home/orangepi/hello.o</p>
<p>MODPOST /home/orangepi/Module.symvers</p>
<p>CC [M] /home/orangepi/hello.mod.o</p>
<p>LD [M] /home/orangepi/hello.ko</p>
<p>make[1]: Leaving directory '/usr/src/linux-headers-6.6.63-ky'</p></li>
<li><p>After compilation, the '''hello.ko''' kernel module will be generated</p>
<p>orangepi@orangepi:~$ '''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:~$ '''sudo insmod hello.ko'''</p></li>
<li><p>hen 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:~$ '''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:~$ '''sudo rmmod hello'''</p>
<p>orangepi@orangepi:~$ '''dmesg | grep "Hello"'''</p>
<p>[ 2871.893988] Hello Orange Pi -- init</p>
<p>[ 3173.800892] '''Hello Orange Pi -- exit'''</p></li></ol>
</li></ol>
<span id="how-to-use-2.10.1-inch-mipi-lcd-screen"></span>
== How to use 2.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:OrangePi_RV2_X1_User Manual_v1.0.1_image183.png|264x204px]]</p></li>
<li><p>Screen adapter board + 31pin to 26pin cable</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image184.png|170x147px|DD9A8F44-0D8F-4f06-9473-B539DEED850C]]
</div></li>
<li><p>30pin MIPI cable</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image185.png|487x45px|C2164119-6EC3-49ae-9A95-BE323F51FAE1]]
</div></li>
<li><p>12pin touch screen cable</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image186.png|296x43px]]</p></li></ol>
</li>
<li><p>Connect the 12-pin touch screen cable, 31-pin to 26-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:OrangePi_RV2_X1_User Manual_v1.0.1_image187.png|574x142px]]</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 26pin cable.</p></li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image188.png|253x372px]]
<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:OrangePi_RV2_X1_User Manual_v1.0.1_image189.png|159x101px]]</p></li>
<li><p>Finally, connect it to the LCD interface of the development board through the 30pin MIPI cable</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image190.png|300x198px]]</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 ===
# 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.
# The location of the interface of the mipi lcd screen on the development board is shown in the figure below:
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image191.png|286x193px]]
<ol start="3" style="list-style-type: decimal;">
<li><p>The steps to open the mipi lcd configuration are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select'''System'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image157.png|410x190px]]</p></li>
<li><p>Then select'''Hardware'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image158.png|410x170px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the '''lcd''', and then use the '''spacebar''' to select</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image192.png|372x40px|IMG_256]]
</div></li>
<li><p>Then select'''<Save>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image160.png|367x120px]]</p></li>
<li><p>Then select'''<Back>'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image161.png|355x117px]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system for the configuration to take effect.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image193.png|265x123px]]</p>
<p>'''The above configuration will eventually add''' '''overlays=lcd''' '''to''' '''/boot/orangepiEnv.txt''' '''You can check it after setting it. If this line does not exist, then there is a problem with the configuration.'''</p>
<p>'''If you find it troublesome to use orangepi-config, you can also use the vim editor to open''' '''/boot/orangepiEnv.txt''' '''and add the line''' '''overlays=lcd.'''</p>
<p>orangepi@orangepi:~$ '''cat /boot/orangepiEnv.txt | grep "lcd"'''</p>
<p>'''overlays=lcd #Example Configuration'''</p></li></ol>
</li>
<li><p>After startup, you can see the display of the LCD screen as shown below (the default is vertical screen):</p></li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image194.png|253x351px]]
<span id="how-to-rotate-the-display-direction-of-the-server-version-image"></span>
=== How to rotate the display direction of the server version image ===
<ol style="list-style-type: decimal;">
<li><p>Add '''extraargs=fbcon=rotate:direction to rotate''' in '''/boot/orangepiEnv.txt''' to set the display direction of the server version of Linux system. The number after '''fbcon=rotate''': can be set to:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>0: Normal screen (portrait by default)</p></li>
<li><p>1: Rotate 90 degrees clockwise</p></li>
<li><p>2: Flip 180 degrees</p></li>
<li><p>3: Rotate 270 degrees clockwise</p>
<p>orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''</p>
<p>'''extraargs=fbcon=rotate:3'''</p></li></ol>
</li>
<li><p>Then restart the Linux system and you will see that the direction of the LCD screen display has rotated</p></li></ol>
<span id="desktop-version-mirroring-rotation-display-and-touch-direction-method"></span>
=== Desktop version mirroring rotation display and touch direction method ===
<ol style="list-style-type: decimal;">
<li><p>First click on the upper right corner of the desktop, then click on the settings icon to open the settings interface</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image85.png|364x204px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image86.png|363x204px]]</p></li>
<li><p>Then find '''Display''' in the settings interface</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image195.png|332x174px]]</p></li>
<li><p>Then select the direction you want to rotate in '''Orientation'''</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Landscape''': No rotation</p></li>
<li><p>'''Portrait Left''': Rotate 90 degrees left</p></li>
<li><p>'''Landscape(flipped)''': Flip upside down, equivalent to rotating 180 degrees</p></li>
<li><p>'''Portrait Right''': Rotate right 90 degrees</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image196.png|315x253px]]</p></li></ol>
</li>
<li><p>Then click '''Apply'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image197.png|329x262px]]</p></li></ol>
<span id="test-methods-for-ov13850-and-ov13855-mipi-cameras"></span>
== Test methods for OV13850 and OV13855 MIPI cameras ==
Currently the development board supports two MIPI cameras, OV13850 and OV13855. The specific pictures are as follows:
<ol style="list-style-type: lower-alpha;">
<li><p>13MP OV13850 camera with MIPI interface</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image17.png|184x103px]]</p></li>
<li><p>13MP OV13855 camera with MIPI interface</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image18.png|173x102px]]</p>
<p>The adapter board and FPC cable used by OV13850 and OV13855 cameras are the same, but the two cameras are connected to the adapter board in different positions. The FPC cable is shown in the figure below. Please note that the FPC cable has a direction. The end marked with '''TO MB''' needs to be plugged into the camera interface of the development board, and the end marked with '''TO CAMERA''' needs to be plugged into the camera adapter board.</p></li></ol>
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image198.png|343x72px]]
There are a total of 3 camera interfaces on the camera adapter board. Only one can be connected at a time, as shown in the following figure:
<ol style="list-style-type: lower-alpha;">
<li><p>'''Interface 1 is connected to the OV13850 camera'''</p></li>
<li><p>'''Interface 2 is connected to the OV13855 camera'''</p></li>
<li><p>Interface 3 is not used, just ignore it</p></li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image199.jpeg|288x172px|C:\Users\orangepi\Desktop\用户手册插图\Pi5 Plus\未标题-13.jpg未标题-13]]
</div>
There are 2 camera interfaces on the Orange Pi RV2 development board. The positions of CAM1 and CAM2 are shown in the figure below.:
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image200.png|296x209px]]
The method of inserting the camera into the Cam0 interface of the development board is as follows:
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image201.png|294x154px]]
The method of inserting the camera into the Cam1 interface of the development board is as follows::
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image202.png|306x156px]]
After connecting the camera to the development board, we can use the following method to test the camera:
<ol style="list-style-type: lower-alpha;">
<li><p>Then open a terminal in the desktop system and the command to open CAM1 is as follows</p>
<p>orangepi@orangepi:~$ '''gst-launch-1.0 kysrc location=/opt/camtest_sensor0_mode0.json ! waylandsink \'''</p>
<p>'''sync=0 render-rectangle="<0,0,1920,1080>"'''</p></li>
<li><p>Then open a terminal in the desktop system and the command to open CAM2 is as follows</p>
<p>orangepi@orangepi:~$ '''gst-launch-1.0 kysrc location=/opt/camtest_sensor2_mode0.json ! waylandsink \'''</p>
<p>'''sync=0 render-rectangle="<0,0,1920,1080>"'''</p></li></ol>
'''Note that if you are using an OV13850 camera, you need to modify the sensor_name of the json file to ov13850_spm. In addition, OV13850 does not currently support 3A.'''
'''In the above command, the json file used by CAM1 is camtest_sensor0_mode0.json, and the json file used by CAM2 is camtest_sensor2_mode0.json.'''
<ol start="3" style="list-style-type: lower-alpha;">
<li><p>Then you can see the camera preview</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image203.png|353x198px|Screenshot from 2025-01-09 08-25-51]]
</div></li></ol>
<span id="methods-for-running-large-models"></span>
== Methods for Running Large Models ==
<span id="model-support-list"></span>
=== Model Support List ===
{| class="wikitable"
|-
| style="text-align: center;"| Model name
| style="text-align: center;"| C++reasoning
|
| style="text-align: center;"| Python reasoning
|
|-
| style="text-align: center;"|
| style="text-align: center;"| Memory (G)
| Performance (TPS)
| style="text-align: center;"| Performance (TPS)
| Performance (TPS)
|-
| style="text-align: center;"| llama-cn-int4-1b
| style="text-align: center;"| 1.55
| 4.44
| style="text-align: center;"| 1.58
| 4.47
|-
| style="text-align: center;"| [https://huggingface.co/shenzhi-wang/Llama3-8B-Chinese-Chat '''llama3-int4-8b-blk64-fusion''']
| style="text-align: center;"| 4.70
| 1.22
| style="text-align: center;"| 4.64
| 1.36
|-
| style="text-align: center;"| [https://huggingface.co/openbmb/MiniCPM-S-1B-sft-llama-format '''minicpm-1b-int4-blk64-fusion''']
| style="text-align: center;"| 1.52
| 5.08
| style="text-align: center;"| 1.53
| 5.39
|-
| style="text-align: center;"| [https://huggingface.co/microsoft/Phi-3-mini-4k-instruct '''phi-3-mini-int4-3.8b''']
| style="text-align: center;"| 2.79
| 2.01
| style="text-align: center;"| 2.83
| 2.00
|-
| style="text-align: center;"| [https://huggingface.co/Qwen/Qwen2-1.5B-Instruct '''qwen2-int4-1.5b''']
| style="text-align: center;"| 1.74
| 4.19
| style="text-align: center;"| 1.76
| 4.09
|-
| style="text-align: center;"| [https://huggingface.co/Qwen/Qwen2-0.5B-Instruct '''qwen2-int4-0.5b''']
| style="text-align: center;"| 1.16
| 11.03
| style="text-align: center;"| 1.16
| 12.52
|}
Clicking on the model name will redirect you to the download link of the original model file. The performance data may have certain deviations based on different inputs and outputs, and the above results are for reference only. If the performance is significantly low, please check the parameters used during model construction.
<span id="environmental-preparation"></span>
=== Environmental Preparation ===
# A PC with Ubuntu 22.04 operating system installed.
'''Please try to use a PC with 32GB or more of memory, otherwise the model may fail due to insufficient memory during construction.'''
'''In this document, we demonstrate using the Ubuntu 22.04 (x64) operating system. Please test other versions of the operating system yourself.'''
<ol start="2" style="list-style-type: decimal;">
<li><p>An Orange Pi RV2 development board with Ubuntu 24.04 system installed.</p></li>
<li><p>Download the KY ORT toolkit from official sources.</p></li>
<li><p>Refer to the '''model support list''' and prepare the original model files that need to be built. We also provide the constructed model file in the official documentation.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image204.png|576x211px]]</p></li></ol>
<span id="model-construction-optional"></span>
=== Model Construction (optional) ===
If you want to perform model conversion yourself, you can use a model conversion tool to convert the large models provided on Huggingface or ModelScope into supported model formats for optimal adaptation. The following steps are all completed on Ubuntu PC. Taking the Qwen2.5-0.5B-Instruction model as an example, the specific steps are as follows:
<ol style="list-style-type: decimal;">
<li><p>Download the models listed in the reference '''model support list''' from Huggingface or ModelScope. Taking the Qwen2.5-0.5B-Instruction model as an example.</p>
<p>test@test:~$ '''sudo apt install -y git-lfs'''</p>
<p>test@test:~$ '''git clone https://www.modelscope.cn/Qwen/Qwen2.5-0.5B-Instruct.git'''</p></li>
<li><p>Extract the ky ort toolkit and install the relevant dependencies.</p>
<p>test@test:~$ '''tar zxf ky-ort.riscv64.1.2.2.tar.gz'''</p>
<p>test@test:~$ '''pip3 install -r ky-ort.riscv64.1.2.2/python/genai-builder/requirements.txt \'''</p>
<p>'''-i https://mirrors.huaweicloud.com/repository/pypi/simple'''</p></li>
<li><p>Execute the following command to build a model file suitable for Orange Pi RV2.</p>
<p>test@test:~$ '''cd ky-ort.riscv64.1.2.2/python/genai-builder'''</p>
<p>test@test:~/ky-ort.riscv64.1.2.2/python/genai-builder'''$ python3 builder.py \'''</p>
<p>'''-i /home/test/Qwen2.5-0.5B-Instruct/ -o /home/test/qwen2-int4-0.5b/ \'''</p>
<p>'''-p int4 -e cpu -c /home/test/tmp --extra_options int4_block_size=64 int4_accuracy_level=4'''</p>
<ol style="list-style-type: lower-alpha;">
<li><p>-i /home/test/Qwen2.5-0.5B-Instruct/:Original model path.</p></li>
<li><p>-o /home/test/qwen2-int4-0.5b/:Output model path.</p></li>
<li><p>-p int4:Set the output model accuracy to int4.</p></li>
<li><p>-e cpu:Built using CPU.</p></li>
<li><p>-c model_cache:Model cache path.</p></li>
<li><p>int4_block_size=64: Additional parameter, set the block size to 64 when using int4 quantization.</p></li>
<li><p>int4_accuracy_level=4: Additional parameters are set to quantize input A of MatMul to int8 and convert input B up to int8 for computation.</p></li>
<li><p>For other parameters, please use the "python3 builder. py -- help" command to query the relevant instructions.</p></li></ol>
</li>
<li><p>After the conversion is completed, enter the model save directory and confirm that the conversion is correct.</p>
<p>test@test:~/qwen2-int4-0.5b$ '''ls -lh'''</p>
<p>total 804M</p>
<p>-rw-r--r-- 1 test test 605 Jan 13 13:35 added_tokens.json</p>
<p>-rw-r--r-- 1 test test 1.5K Jan 13 13:35 genai_config.json</p>
<p>-rw-r--r-- 1 test test 1.6M Jan 13 13:35 merges.txt</p>
<p>-rw-r--r-- 1 test test 164K Jan 13 13:35 model.onnx</p>
<p>-rw-r--r-- 1 test test 793M Jan 13 13:35 model.onnx.data</p>
<p>-rw-r--r-- 1 test test 613 Jan 13 13:35 special_tokens_map.json</p>
<p>-rw-r--r-- 1 test test 6.8M Jan 13 13:35 tokenizer.json</p>
<p>-rw-r--r-- 1 test test 8.2K Jan 13 13:35 tokenizer_config.json</p>
<p>-rw-r--r-- 1 test test 2.7M Jan 13 13:35 vocab.json</p></li></ol>
<span id="model-reasoning"></span>
=== Model Reasoning ===
'''It is recommended to use a development board with 8GB of memory for testing. A development board with 2GB or 4GB of memory may not run the model due to insufficient memory.'''
<ol style="list-style-type: decimal;">
<li><p>Upload the model file constructed in the previous section or the model file downloaded from official sources to the development board Linux system according to the steps in the "Methods for Uploading Files" section. For example, we upload it to the "/home/orangepi/models" directory.</p></li>
<li><p>Upload the KY ORT toolkit to the development board Linux system according to the steps in the "Methods" section.</p></li>
<li><p>Use the following command to decompress the ky ort toolkit.</p>
<p>orangepi@orangepirv2:~$ '''tar zxf ky-ort.riscv64.1.2.2.tar.gz'''</p></li>
<li><p>Follow the steps below to compile the cpp demo.</p>
<p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2$ '''bash scripts/build_samples_riscv64.sh'''</p></li>
<li><p>After successful compilation, the following files can be found in the build/iscv64 directory:</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2$ '''ls build/riscv64/'''</p>
<p>'''chatllm_demo''' CMakeCache.txt CMakeFiles cmake_install.cmake imagenet_test</p>
<p>Makefile phi3v run_demo</p></li>
<li><p>Execute the following command to update Python dependencies:</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2$ '''cd python'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/python$ '''pip3 install ./onnxruntime_genai-0.4.0.dev1-cp312-cp312-linux_riscv64.whl ./ky_ort-1.2.2-cp312-cp312-linux_riscv64.whl --break-system-packages'''</p></li></ol>
<span id="llama-1b"></span>
==== Llama-1B ====
<ol style="list-style-type: decimal;">
<li><p>The C++inference command is as follows:</p>
<p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/build/riscv64/'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/build/riscv64$ '''./chatllm_demo ~/models/llama-cn-int4-1b/ llama3'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image205.png|576x95px]]</p></li>
<li><p>The Python inference command is as follows:</p>
<p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/samples'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/samples$ '''python3 llm_qa.py -m ~/models/llama-cn-int4-1b/ -l 128 -e llama3 -v -g'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image206.png|575x155px]]</p></li></ol>
<span id="llama3-8b"></span>
==== Llama3-8B ====
<ol style="list-style-type: decimal;">
<li><p>The C++inference command is as follows:</p>
<p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/build/riscv64/'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/build/riscv64$ '''./chatllm_demo ~/models/llama3-int4-8b-blk64-fusion/ llama3'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image207.png|576x211px]]</p></li>
<li><p>The Python inference command is as follows:</p>
<p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/samples'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/samples$ '''python3 llm_qa.py -m ~/models/llama3-int4-8b-blk64-fusion/ -l 128 -e llama3 -v -g'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image208.png|576x143px]]</p></li></ol>
<span id="minicpm-1b"></span>
==== Minicpm-1B ====
# The C++inference command is as follows:
<!-- -->
<ol style="list-style-type: decimal;">
<li><p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/build/riscv64/'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/build/riscv64$ '''./chatllm_demo ~/models/minicpm-1b-int4-blk64-fusion/ minicpm'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image209.png|576x205px]]</p></li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li>The Python inference command is as follows:</li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li><p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/samples'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/samples$ '''python3 llm_qa.py -m ~/models/minicpm-1b-int4-blk64-fusion/ -l 128 -e minicpm -v -g'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image210.png|575x141px]]</p></li></ol>
<span id="phi3-3.8b"></span>
==== Phi3-3.8B ====
# The C++inference command is as follows:
<!-- -->
<ol style="list-style-type: decimal;">
<li><p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/build/riscv64/'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/build/riscv64$ '''./chatllm_demo ~/models/phi-3-mini-int4-3.8b/ phi3'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image211.png|575x100px]]</p></li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li>The Python inference command is as follows:</li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li><p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/samples'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/samples$ '''python3 llm_qa.py -m ~/models/phi-3-mini-int4-3.8b/ -l 128 -e phi3 -v -g'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image212.png|575x122px]]</p></li></ol>
<span id="qwen2-1.5b"></span>
==== qwen2-1.5B ====
# The C++inference command is as follows:
<!-- -->
<ol start="3" style="list-style-type: decimal;">
<li><p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/build/riscv64/'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/build/riscv64$ '''./chatllm_demo ~/models/qwen2-int4-1.5b/ qwen2'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image213.png|575x178px]]</p></li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li>The Python inference command is as follows:</li></ol>
<!-- -->
<ol start="4" style="list-style-type: decimal;">
<li><p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/samples'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/samples$ '''python3 llm_qa.py -m ~/models/qwen2-int4-1.5b/ -l 128 -e qwen2 -v -g'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image214.png|575x138px]]</p></li></ol>
<span id="qwen2-0.5b"></span>
==== qwen2-0.5B ====
# The C++inference command is as follows:
<!-- -->
<ol style="list-style-type: decimal;">
<li><p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/build/riscv64/'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/build/riscv64$ '''./chatllm_demo ~/models/qwen2-int4-0.5b/ qwen2'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image215.png|576x137px]]</p></li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li>The Python inference command is as follows:</li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li><p>orangepi@orangepirv2:~$ '''cd ky-ort.riscv64.1.2.2/samples'''</p>
<p>orangepi@orangepirv2:~/ky-ort.riscv64.1.2.2/samples$ '''python3 llm_qa.py -m ~/models/qwen2-int4-0.5b/ -l 128 -e qwen2 -v -g'''</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image216.png|576x85px]]</p></li></ol>
<span id="use-of-deepseek"></span>
== Use of DeepSeek ==
<span id="installing-openwebui"></span>
=== Installing OpenWebUI ===
<ol style="list-style-type: decimal;">
<li><p>The installation command for openwebui is as follows.</p>
<p>orangepi@orangepirv2:~$ '''sudo apt install /opt/openwebui_0.0.1_riscv64.deb'''</p></li>
<li><p>Then click on the application icon shown in the figure below to open the OpenWebUI application.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image217.png|574x322px]]</p></li>
<li><p>The display interface of the OpenWebUI application is shown below, and registration is required before use.</p></li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image218.png|325x233px|D106B71A-8040-4db5-9628-D97C80B039F2]]
</div>
<span id="methods-for-shutting-down-and-restarting-the-development-board"></span>
== Methods for shutting down and restarting the development board ==
<ol style="list-style-type: decimal;">
<li><p>During the operation of the Linux system, if the Type-C power is directly unplugged and the power is cut off, it may cause the file system to lose some data or be damaged. Therefore, please use the '''poweroff''' command to shut down the Linux system of the development board before unplugging the power.</p>
<p>orangepi@orangepi:~$ '''sudo poweroff'''</p></li>
<li><p>In addition, the development board is equipped with power on/off buttons, and you can also '''short press''' the power on/off button on the development board to shut down.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image219.png|359x124px]]</p></li></ol>
'''Note that when the Linux desktop system presses the power on/off button, a confirmation box will pop up as shown in the figure below. You need to click the''' '''Power off''' '''option before shutting down.'''
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image220.png|285x210px]]
<ol start="3" style="list-style-type: decimal;">
<li><p>After shutting down, press the power button on the development board briefly to turn it on.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image219.png|359x124px]]</p></li>
<li><p>The command to restart the Linux system is:</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 ==
<ol style="list-style-type: decimal;">
<li><p>The Linux SDK, also known as '''orangepi-build''', supports running on computers with '''Ubuntu 22.04''' installed. Therefore, before downloading orangepi build, please make sure that the Ubuntu version installed on your computer is Ubuntu 22.04. The command to check the installed Ubuntu version on the computer is as follows. If the Release field does not display '''22.04''', it means that the current Ubuntu version used does not meet the requirements. Please replace the system before performing the following operations.</p>
<p>test@test:~$ '''lsb_release -a'''</p>
<p>No LSB modules are available.</p>
<p>Distributor ID: Ubuntu</p>
<p>Description: Ubuntu 22.04 LTS</p>
<p>Release: '''22.04'''</p>
<p>Codename: jammy</p></li>
<li><p>If the computer is installed with a Windows system and does not have Ubuntu 22.04 installed, you can consider using '''VirtualBox''' or '''VMware''' to install an Ubuntu 22.04 virtual machine on the Windows system. However, please note that do not compile orangepi build on a WSI virtual machine, as orangepi build has not been tested on a WSI virtual machine, so it cannot be guaranteed that orangepi build can be used properly in WSI.</p></li>
<li><p>The installation image download address for Ubuntu 22.04 '''amd64''' version is:</p>
<p>[https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04/ubuntu-22.04.3-desktop-amd64.iso '''https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04/ubuntu-22.04.3-desktop-amd64.iso''']</p>
<p>或者</p>
<p>[https://repo.huaweicloud.com/ubuntu-releases/22.04/ubuntu-22.04.3-desktop-amd64.iso '''https://repo.huaweicloud.com/ubuntu-releases/22.04/ubuntu-22.04.3-desktop-amd64.iso''']</p></li>
<li><p>After installing Ubuntu 22.04 on a computer or virtual machine, please first set the software source of Ubuntu 22.04 to Qinghua Source, otherwise errors may occur during software installation due to network issues</p>
<ol style="list-style-type: lower-alpha;">
<li>The method of replacing Tsinghua Source can refer to the instructions on this webpage</li></ol>
</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 Ubuntu version needs to be switched to 22.04</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image221.png|576x241px]]</p></li>
<li><p>The contents of the'''/etc/apt/sources.list''' file that needs to be replaced are</p>
<p>test@test:~$ '''sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak'''</p>
<p>test@test:~$ '''sudo vim /etc/apt/sources.list'''</p>
<p># By default, the source code image has been annotated to improve the speed of apt updates. If necessary, you can remove the annotation yourself</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 replacement, it is necessary to update the package information and ensure that there are no errors</p>
<p>test@test:~$ '''sudo apt update'''</p></li>
<li><p>'''In addition, since the kernel and U-boot source code are stored on GitHub, it is important to ensure that the computer can download the code from GitHub properly when compiling the image.'''</p></li></ol>
<span id="obtain-the-source-code-of-linux-sdk"></span>
== Obtain the source code of Linux SDK ==
<span id="download-orangepi-build-from-github"></span>
=== Download Orangepi build from GitHub ===
# The Linux SDK actually refers to the Orangepi build code, which is modified based on the armbian build compilation system. Using Orangepi build, multiple versions of Linux images can be compiled. First, download the code for orangepi build. The command is as follows:
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 the Orange Pi RV2 development board requires downloading the''' '''next''' '''branch source code of orangepi build. The git clone command above needs to specify the branch of orangepi build source code as next.'''
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image222.png|576x298px|图片6]]
</div>
'''Downloading the code for orangepi build through the git clone command does not require entering the username and password of the GitHub account (the same applies to downloading other code in this manual). If Ubuntu PC prompts for the username and password of the GitHub account after entering the git clone command, it is usually due to an incorrect input of the address of the orangepi build repository after git clone. Please carefully check the spelling of the command for errors, rather than thinking that we forgot to provide the username and password of the GitHub account here.'''
<ol start="2" style="list-style-type: decimal;">
<li>The u-boot and Linux kernel versions currently used on the development board are as follows</li></ol>
{| class="wikitable"
|-
| style="text-align: left;"| '''Branch'''
| 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 22.10'''
| style="text-align: left;"| '''Linux6.6'''
|}
'''The branch mentioned here and the branch of orangepi build source code are not the same thing, please don't confuse them. This branch is mainly used to distinguish between different versions of kernel source code.'''
<ol start="3" style="list-style-type: decimal;">
<li><p>After downloading orangepi build, it will include the following files and folders</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 images, specific scripts, and source code for some programs, etc</p></li>
<li><p>'''LICENSE''': GPL 2 License File</p></li>
<li><p>'''README.md''': Orangepi build documentation</p></li>
<li><p>'''scripts''': General 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 code for Orangepi build from GitHub, you may find that the Orangepi build does not include the source code for u-boot and Linux kernel, nor does it require a cross compilation toolchain to compile u-boot and Linux kernel. This is normal because these things are stored in other separate GitHub repositories or on certain servers (the addresses will be detailed below). Orangepi build specifies the addresses of u-boot, Linux kernel, and cross compilation toolchain in the script and configuration files. 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>
</li></ol>
<span id="download-the-cross-compilation-toolchain"></span>
=== Download the cross compilation toolchain ===
'''The cross compilation toolchain will only be downloaded when using orangepi build to compile the image on an x64 computer. Compiling the Linux image of the development board in Ubuntu 22.04 will not download cross compilation toolchains, and orangepi build/toolchains will be an empty folder.'''
<ol style="list-style-type: decimal;">
<li><p>When Orangepi build runs for the first time, it automatically downloads the cross compilation toolchain and places it in the '''toolchains''' folder. After running the build.sh script of Orangepi build, it checks whether all the cross compilation toolchains in '''toolchains''' exist. If they do not exist, it will restart the download. If they do exist, it will be used directly without repeated downloads.</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image223.png|575x278px|选区_396]]
</div></li>
<li><p>The mirror website of the cross compilation toolchain in China is the open source software mirror site of Tsinghua University</p>
<p>[https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/ '''https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/''']</p></li>
<li><p>After downloading '''toolchains''', multiple versions of cross compilation toolchains will be included, and the development board will only use two of them</p>
<p>test@test:~/orangepi-build$ '''ls toolchains/'''</p>
<p>gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu</p>
<p>gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf</p>
<p>gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu</p>
<p>gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf</p>
<p>gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi</p>
<p>gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf</p>
<p>gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu</p>
<p>gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi</p>
<p>gcc-linaro-aarch64-none-elf-4.8-2013.11_linux</p>
<p>gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux</p>
<p>gcc-linaro-arm-none-eabi-4.8-2014.04_linux</p></li>
<li><p>The cross compilation toolchain used to compile Linux kernel source code is</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Linux6.6</p>
<p>'''riscv64-unknown-linux-gnu-gcc'''</p></li></ol>
</li>
<li><p>The cross compilation toolchain used to compile the u-boot source code is</p>
<ol style="list-style-type: lower-alpha;">
<li><p>v2022.10</p>
<p>'''riscv64-unknown-linux-gnu-gcc'''</p></li></ol>
</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:</p>
<p>'''https://github.com/orangepi-xunlong/linux-orangepi/tree/orange-pi-6.6-ky'''</p></li>
<li><p>The git repository where the u-boot source code is stored is as follows:</p>
<p>'''https://github.com/orangepi-xunlong/u-boot-orangepi/tree/v2022.10-ky'''</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, and the folder named '''orange-pi-6.6-ky''' contains the kernel source code of the current branch of the Orange Pi RV2 development board. Please do not manually modify the name of the kernel source code folder. If modified, the compiled system will re download the kernel source code during runtime</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, and the folder named '''v2022.10-ky''' contains the u-boot source code of the current branch of the Orange Pi RV2 series development board. Please do not manually modify the name of the u-boot source code folder. If it is modified, the compilation system will re download the u-boot source code when running</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:OrangePi_RV2_X1_User Manual_v1.0.1_image224.png|576x132px|选区_238]]
</div></li>
<li><p>Next, select the model of the development board</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image225.png|576x220px|C9777014-7083-4156-8EA2-97572BDEBA99]]
</div></li>
<li><p>Then it will start compiling u-boot, and some of the information prompted during compilation is explained 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 [ '''v2022.10''' ]</p></li>
<li><p>Version of cross compilation toolchain</p>
<p>[ o.k. ] Compiler version [ '''riscv64-unknown-linux-gnu-gcc 13.2.1''' ]</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-orangepirv2_1.0.0_riscv64.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=orangepirv2 BRANCH=current BUILD_OPT=u-boot KERNEL_CONFIGURE=no''' ]</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-orangepirv2_1.0.0_riscv64.deb</p></li>
<li><p>The generated deb package of u-boot contains the following files</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Use the following command to decompress the deb package</p>
<p>test@test:~/orangepi-build$ '''cd output/debs/u-boot'''</p>
<p>test@test:~/orangepi_build/output/debs/u-boot$ $ '''dpkg -x''' \</p>
<p>'''linux-u-boot-current-orangepirv2_1.0.0_riscv64.deb . (Please note that there is a '.' at the end of the command)'''</p>
<p>test@test:~/orangepi_build/output/debs/u-boot$ '''ls'''</p>
<p>linux-u-boot-current-orangepirv2_1.0.0_riscv64.deb '''usr'''</p></li>
<li><p>The decompressed file is shown below</p>
<p>test@test:~/orangepi-build/output/debs/u-boot$ '''tree usr'''</p>
<p>usr</p>
<p>└── lib</p>
<p>├── linux-u-boot-current-orangepirv2_1.0.0_riscv64</p>
<p>│ ├── bootinfo_emmc.bin</p>
<p>│ ├── bootinfo_sd.bin</p>
<p>│ ├── bootinfo_spinor.bin</p>
<p>│ ├── FSBL.bin</p>
<p>│ ├── u-boot-env-default.bin</p>
<p>│ └── u-boot-opensbi.itb</p>
<p>└── u-boot</p>
<p>├── LICENSE</p>
<p>├── platform_install.sh</p>
<p>└── x1_defconfig</p>
<p>3 directories, 9 files</p></li></ol>
</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 u-boot source code on the GitHub server. Therefore, if you want to modify the u-boot source code, you first need to turn off the download and update function of the source code '''(you need to compile the u-boot completely before turning off this function, otherwise it will prompt that the u-boot source code cannot be found. If it is a compressed source code downloaded from Baidu Cloud Drive, there is no problem because the u-boot source code is already cached)'''. Otherwise, the modifications made will be restored. The method is as follows:</p>
<p>Set the IGNOREUPDATES variable to "yes" in userpatches/config-default.conf</p>
<p>test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''</p>
<p>IGNORE_UPDATES="'''yes'''"</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>Upload the compiled deb package of u-boot to the Linux system of 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-orangepirv2_1.0.0_riscv64.deb [mailto:[email protected]:/root [email protected]:/root]'''</p></li>
<li><p>Then log in to the development board and uninstall the deb package of the installed u-boot</p>
<p>root@orangepi:~# '''apt purge -y linux-u-boot-orangepirv2-current'''</p></li>
<li><p>Reinstall the newly uploaded deb package for u-boot</p>
<p>root@orangepi:~# '''dpkg -i''' '''linux-u-boot-current-orangepirv2_1.0.0_riscv64.deb'''</p></li>
<li><p>Then run the nand sata install script</p>
<p>root@orangepi:~# '''nand-sata-install'''</p></li>
<li><p>Then select '''5 Install/Update the bootloader on SD/eMM''' to update u-boot in TF card or '''7 Install/Update the bootloader on SPI Flash''' to update u-boot in SPI Flash</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image226.png|312x152px]]</p></li>
<li><p>After pressing the enter key, a warning will first pop up</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image227.png|309x168px]]</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:OrangePi_RV2_X1_User Manual_v1.0.1_image228.png|244x137px]]</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>
<li><p>Other useful information</p>
<ol style="list-style-type: lower-alpha;">
<li><p>In the U-boot 2022.10 source code, the defconfig configuration file used by the development board is</p></li>
<li><p>[[orangepi-build/u-boot/v2022.10-ky/configs/x1_defconfig|'''orangepi-build/u-boot/v2022.10-ky/configs/x1_defconfig''']]In the U-boot 2022.10 source code, the development board uses dts files as</p></li></ol>
</li></ol>
<span id="orangepi-buildu-bootv2022.10-kyarchriscvdtsx1_orangepi-rv2.dtscompiling-linux-kernel"></span>
== [[orangepi-build/u-boot/v2022.10-ky/arch/riscv/dts/x1_orangepi-rv2.dts|'''orangepi-build/u-boot/v2022.10-ky/arch/riscv/dts/x1_orangepi-rv2.dts'''<span id="_Toc4396" class="anchor"></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:OrangePi_RV2_X1_User Manual_v1.0.1_image229.png|575x116px|选区_240]]
</div></li>
<li><p>Next, select the model of the development board</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image225.png|576x220px|C9777014-7083-4156-8EA2-97572BDEBA99]]
</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:OrangePi_RV2_X1_User Manual_v1.0.1_image230.png|576x87px]]</p></li>
<li><p>If step 4) 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 then start compiling the kernel source code</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image231.png|575x400px]]</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''' 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:OrangePi_RV2_X1_User Manual_v1.0.1_image232.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 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 [ '''6.6.63''' ]</p></li>
<li><p>The version of the cross compilation toolchain used</p>
<p>[ o.k. ] Compiler version [ '''riscv64-unknown-linux-gnu-gcc 13.2.1''' ]</p></li>
<li><p>The default configuration file used by the kernel and the path where it is stored</p>
<p>[ o.k. ] Using kernel config file [ '''config/kernel/linux-ky-current.config''' ]</p></li>
<li><p>The path of the compiled kernel related deb package</p>
<p>[ o.k. ] Target directory [ '''orangepi-build/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-ky_1.0.0_riscv64.deb''' ]</p></li>
<li><p>Compilation time used</p>
<p>[ o.k. ] Runtime [ '''5 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=orangepirv2 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-ky_1.0.0_riscv64.deb''' Contains dtb files used by the kernel</p></li>
<li><p>'''linux-headers-current-ky_1.0.0_riscv64.deb''' Contains kernel header files</p></li>
<li><p>'''linux-image-current-ky_1.0.0_riscv64.deb''' Contains kernel images and kernel modules</p>
<p>test@test:~/orangepi-build$ '''ls output/debs/linux-*'''</p>
<p>output/debs/linux-dtb-current-ky_1.0.0_riscv64.deb output/debs/linux-image-current-ky_1.0.0_riscv64.deb</p>
<p>output/debs/linux-headers-current-ky_1.0.0_riscv64.deb</p></li></ol>
</li>
<li><p>The deb package of the generated Linux image contains the following files</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Use the following command to decompress the deb package</p>
<p>test@test:~/orangepi-build$ '''cd output/debs'''</p></li></ol>
</li></ol>
test@test:~/orangepi_build/output/debs$ '''mkdir test'''
test@test:~/orangepi_build/output/debs$ '''cp \'''
'''linux-image-current-ky_1.0.0_riscv64.deb test/'''
test@test:~/orangepi_build/output/debs$ '''cd test'''
test@test:~/orangepi_build/output/debs/test$ '''dpkg -x \'''
'''linux-image-current-ky_1.0.0_riscv64.deb .'''
test@test:~/orangepi_build/output/debs/test$ '''ls'''
'''boot etc lib''' linux-image-current-ky_1.0.0_riscv64.deb '''usr'''
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>The decompressed file is shown below</p>
<p>test@test:~/orangepi-build/output/debs/test$ '''tree -L 2'''</p>
<p>.</p>
<p>├── boot</p>
<p>│ ├── config-6.6.63-ky</p>
<p>│ ├── System.map-6.6.63-ky</p>
<p>│ └── vmlinuz-6.6.63-ky</p>
<p>├── etc</p>
<p>│ └── kernel</p>
<p>├── lib</p>
<p>│ └── modules</p>
<p>├── linux-image-current-ky_1.0.0_riscv64.deb</p>
<p>└── usr</p>
<p>├── lib</p>
<p>└── share</p></li></ol>
<!-- -->
<ol start="9" style="list-style-type: decimal;">
<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 '''(you need to compile the Linux kernel source code completely before turning off this function, otherwise it will prompt that the Linux kernel source code cannot be found. If it is a source code compressed package downloaded from Baidu Cloud Drive, there is no problem because the Linux source code is already cached)'''. Otherwise, the modifications made will be restored. The method is as follows:</p>
<p>Set the IGNOREUPDATES variable to "yes" in '''userpatches/config-default.conf'''</p>
<p>test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''</p>
<p>IGNORE_UPDATES="'''yes'''"</p></li>
<li><p>If modifications have been made to the kernel, the following method can be used to update the kernel and kernel modules of the Linux system on the development board</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-ky_1.0.0_riscv64.deb [email protected]:/root'''</p></li>
<li><p>Then log in to the development board and uninstall the deb package of the installed Linux kernel</p>
<p>root@orangepi:~# '''apt purge -y linux-image-current-ky'''</p></li>
<li><p>Reinstall the deb package of the new Linux kernel that was just uploaded</p>
<p>root@orangepi:~# '''dpkg -i linux-image-current-ky_1.0.0_riscv64.deb'''</p></li>
<li><p>Then restart the development board and check if the kernel related modifications have taken effect</p>
<p>root@orangepi:~# '''reboot'''</p></li></ol>
</li>
<li><p>Other useful information</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The storage location of the kernel configuration file is as follows. Please do not search for the kernel configuration file used by the development board in the kernel source code</p></li>
<li><p>[https://github.com/orangepi-xunlong/orangepi-build/blob/nextexternal/config/kernel/linux-ky-current.config '''orangepi-build/external/config/kernel/linux-ky-current.config''']The location of the dts file used by the development board is</p></li></ol>
</li></ol>
[https://github.com/orangepi-xunlong/linux-orangepi/blob/orange-pi-6.6-ky/arch/riscv/boot/dts/ky/x1_orangepi-rv2.dts '''orangepi-build/kernel/orange-pi-6.6-ky/arch/riscv/boot/dts/ky/x1_orangepi-rv2.dts''']
<span id="compile-rootfs"></span>
== Compile rootfs ==
<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 '''Rootfs and all deb packages''', then press enter</p></li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image233.png|576x119px|选区_241]]
</div>
<ol start="3" style="list-style-type: decimal;">
<li><p>Next, select the model of the development board</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image225.png|576x220px|C9777014-7083-4156-8EA2-97572BDEBA99]]
</div></li>
<li><p>Then select the type of rootfs</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image234.png|575x115px|01FA3326-5980-4962-B8BE-7FB68F6CA459]]
</div></li>
<li><p>Then select the type of image</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Image with console interface (server)''' Represents a server version image with a relatively small size</p></li>
<li><p>'''Image with desktop environment''' Represents a desktop image with a relatively large volume</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image235.png|576x75px|选区_245]]
</div></li></ol>
</li>
<li><p>If you are compiling the server version image, you can also choose to compile the Standard version or the Minimal version. The Minimal version comes with much less pre installed software than the Standard version '''(please do not choose the Minimal version unless you have special requirements, as many things are not pre installed by default and some features may not be available)'''</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image236.png|576x78px|选区_397]]
</div></li>
<li><p>If compiling the desktop version of the image, you also need to choose the type of desktop environment. Currently, Ubuntu Noble mainly maintains the Gnome desktop</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image237.png|576x84px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image238.png|576x74px]]</p>
<p>Then you can choose additional software packages that need to be installed. Please press the enter key here to skip directly.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image239.png|575x264px]]</p></li>
<li><p>Then it will start compiling rootfs, and some of the information prompted during compilation is as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Types of rootfs</p>
<p>[ o.k. ] local not found [ Creating new rootfs cache for '''noble''']</p></li>
<li><p>The storage path of the rootfs compressed file generated by compilation</p>
<p>[ o.k. ] Target directory [ '''external/cache/rootfs''' ]</p></li>
<li><p>The name of the rootfs compressed file generated by compilation</p>
<p>[ o.k. ] File name [ '''noble-gnome-riscv64.ef7fa533e64f5a838939560d81632155.tar.lz4''' ]</p></li>
<li><p>Compilation time used</p>
<p>[ o.k. ] Runtime [ '''13 min''' ]</p></li></ol>
</li>
<li><p>View the compiled rootfs compressed file</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''noble-gnome-riscv64.ef7fa533e64f5a838939560d81632155.tar.lz4''' is a compressed file of rootfs, and the meaning of each field in the name is</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''noble''' represents the type of Linux distribution of rootfs</p></li>
<li><p>'''gnome''' indicates that rootfs is a desktop version type, and if it is '''cli''', it indicates a server version type</p></li>
<li><p>'''riscv64''' represents the architecture type of rootfs</p></li>
<li><p>'''ef7fa533e64f5a838939560d81632155''' is an MD5 hash value generated from the package names of all software packages installed by rootfs. As long as the list of software packages installed by rootfs is not modified, this value will not change. The compilation script will use this MD5 hash value to determine whether rootfs needs to be recompiled</p></li></ol>
</li>
<li><p>'''noble-gnome-riscv64.ef7fa533e64f5a838939560d81632155.tar.lz4.list''' lists the package names of all the software packages installed by rootfs</p>
<p>test@test:~/orangepi-build$ '''ls external/cache/rootfs/'''</p>
<p>'''noble-gnome-riscv64.ef7fa533e64f5a838939560d81632155.tar.lz4'''</p>
<p>noble-gnome-riscv64.ef7fa533e64f5a838939560d81632155.tar.lz4.current</p>
<p>noble-gnome-riscv64.ef7fa533e64f5a838939560d81632155.tar.lz4.list</p></li></ol>
</li>
<li><p>If the required rootfs already exist in '''external/cache/rootfs''', compiling rootfs again will skip the compilation process and will not restart. When compiling the image, it will also search for available rootfs in '''external/cache/rootfs''', and if so, use them directly, which can save a lot of download and compilation time.</p></li></ol>
<span id="compiling-linux-images"></span>
== Compiling Linux Images ==
<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 '''Full OS image for flashing''' and press Enter</p></li></ol>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image240.png|576x128px|选区_242]]
</div>
<ol start="3" style="list-style-type: decimal;">
<li><p>Then select the model of the development board</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image225.png|576x220px|C9777014-7083-4156-8EA2-97572BDEBA99]]
</div></li>
<li><p>Then select the type of rootfs</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image234.png|575x115px|01FA3326-5980-4962-B8BE-7FB68F6CA459]]
</div></li>
<li><p>Then select the type of image</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Image with console interface (server)''' Represents a server version image with a relatively small size</p></li>
<li><p>'''Image with desktop environment''' Represents a desktop image with a relatively large volume</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image235.png|576x75px|选区_245]]
</div></li></ol>
</li>
<li><p>If you are compiling the server version image, you can also choose to compile the Standard version or the Minimal version. The Minimal version comes with much less pre installed software than the Standard version '''(please do not choose the Minimal version unless you have special requirements, as many things are not pre installed by default and some features may not be available)'''</p>
<div class="figure">
[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image236.png|569x77px|选区_397]]
</div></li>
<li><p>If compiling a desktop version image, you also need to choose the type of desktop environment. Currently, Ubuntu Noble mainly maintains two types of desktops Gnome.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image237.png|576x84px]]</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image238.png|576x74px]]</p>
<p>Then you can choose additional software packages that need to be installed. Please press the enter key here to skip directly.</p>
<p>[[File:OrangePi_RV2_X1_User Manual_v1.0.1_image239.png|575x264px]]</p></li>
<li><p>Then it will start compiling the Linux image, and the general process of compilation is as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Initialize the compilation environment of Ubuntu PC and install the necessary software packages for the compilation process</p></li>
<li><p>Download the source code for u-boot and Linux kernel (if cached, only update the code)</p></li>
<li><p>Compile the u-boot source code and generate the deb package for u-boot</p></li>
<li><p>Compile Linux source code and generate deb packages related to Linux</p></li>
<li><p>Creating a deb package for Linux firmware</p></li>
<li><p>Create a deb package for the orangepi config tool</p></li>
<li><p>Create deb packages that support board level support</p></li>
<li><p>If compiling the desktop version image, desktop related deb packages will also be created</p></li>
<li><p>Check if rootfs have been cached. If not, create a new rootfs. If cached, decompress and use it directly</p></li>
<li><p>Install the deb package generated earlier into rootfs</p></li>
<li><p>Make specific settings for different development boards and types of images, such as pre installing additional software packages, modifying system configurations, etc</p></li>
<li><p>Then create an image file and format the partition, with the default type being ext4</p></li>
<li><p>Copy the configured rootfs to the partition of the image again</p></li>
<li><p>Then update initramfs</p></li>
<li><p>Finally, write the bin file of u-boot to the image using the dd command</p></li></ol>
</li>
<li><p>After compiling the image, the following message will be prompted</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The storage path of the compiled image</p>
<p>[ o.k. ] Done building [ '''output/images/Orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63/Orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.img''' ]</p></li>
<li><p>Compilation time used</p></li></ol>
</li></ol>
'''[ o.k. ] Runtime [ 19 min ]'''
<ol style="list-style-type: lower-alpha;">
<li><p>The command to repeatedly compile the image can be used to start compiling the image without selecting through the graphical interface</p>
<p>[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepirv2 BRANCH=current BUILD_OPT=image RELEASE=noble BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=yes''' ]</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;"| '''Version'''
| style="text-align: center;"| '''Date'''
| style="text-align: center;"| '''Update Explanation'''
|-
| style="text-align: center;"| v1.0
| style="text-align: center;"| 2025-02-18
| 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;"| 2025-02-18
| style="text-align: center;"| Orange pirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.7z
Orangepirv2_1.0.0_ubuntu_noble_server_linux6.6.63.7z
* Initial version
|}