Orange - Pi - 4 - Lts - User Manual - v1.6
Orange - Pi - 4 - Lts - User Manual - v1.6
, Ltd
Orange Pi 4 LTS
User Manual
www.orangepi.org www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Contents
1. Basic Features of Orange Pi 4 LTS ................................................................................. 1
1.1. What is Orange Pi 4 LTS? ................................................................................................ 1
2.2. Download the image of the development board and related files .................................... 15
2.3. Use the Debian image pre-installed in eMMC to test the function of the development
board ........................................................................................................................................... 15
2.8. The method of burning Android firmware to eMMC based on Windows PC ..................29
www.orangepi.org www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3.6. Start the rootfs in the auto-expanding TF card for the first time ...................................... 60
3.14.1. The server version image is connected to WIFI through the command77
www.orangepi.org www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3.20.1. Connect SATA hard disk through mini PCIE interface ....................... 97
3.20.2. Connect the Gigabit LAN through the mini PCIE interface ............... 98
3.20.3. Connect the wireless network card through the mini PCIE interface 101
3.20.4. Connect SSD through mini PCIE interface ....................................... 106
3.21. GPU test method ...........................................................................................................111
3.27. 26pin interface GPIO, I2C, UART, SPI, PWM test ..................................................... 120
www.orangepi.org www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3.35. How to use the orange pi DS1307 RTC clock module .................................................148
3.37. Partial programming language test supported by Linux system .................................. 154
4.7. The method of displaying the system interface through the TypeC interface ................ 164
www.orangepi.org www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
www.orangepi.org www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
A computer
A wireless server
Games
Music and sounds
HD video
Android
The Orange Pi development board is not just a consumer product, it is designed for
anyone who wants to use technology to create and innovate. It's a very simple, fun, and
useful tool that you can use to shape the world around you
www.orangepi.org 1 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Hardware specification
www.orangepi.org 2 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
• Headphone recording
• DC 5V/3A or DC 5V/4A
power supply
• TYPE-C 5V/4A
• USB2.0 HOST x 2
USB port • USB3.0 HOST x 1
• USB3.0 Type-C x 1
26 pins header with I2Cx2, SPIx1 or UARTx1 and multiple GPIOs
Mini-PCIE 24pin mini-PCIE interface
Supported OS Android8.1、Ubuntu、Debian
Appearance Specifications
Dimension 91mm×56mm
www.orangepi.org 3 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Top view:
Buttom view:
www.orangepi.org 4 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Top view:
Buttom view:
www.orangepi.org 5 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Top view:
Buttom view:
www.orangepi.org 6 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Top view:
Buttom view:
www.orangepi.org 7 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
www.orangepi.org 8 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
www.orangepi.org 9 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
www.orangepi.org 10 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) HDMI to HDMI cable, used to connect the development board to an HDMI monitor
or TV for display
www.orangepi.org 11 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) Type-C to USB3.0 adapter, used to connect USB3.0 storage devices or USB devices
such as mouse and keyboard
6) 10.1-inch MIPI screen, used to display the system interface of the development board
7) Power adapter, Orange Pi 4 LTS supports 5V/3A or 5V/4A DC power supply, and also
supports 5V/4A Type-C power supply
www.orangepi.org 12 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
It is not recommended to use 5V/3A Type-C power supply, because the system
may be unstable due to insufficient power supply. In addition, the Orange Pi 4 LTS
cannot be powered through the 5v pin on the 26pin interface
8) USB interface mouse and keyboard, as long as it is a standard USB interface mouse
and keyboard, the mouse and keyboard can be used to control the Orange Pi development
board
9) Metal heat dissipation shell, Orange Pi 4 LTS matching metal shell is shown in the
figure below, because the RK3399/RK3399-T chip generates a relatively large amount of
heat, it is necessary to have a metal shell
www.orangepi.org 13 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
10) If you don't buy a metal cooling case, it is recommended to add a 5V cooling fan. As
shown in the figure below, there are 5V and GND pins on the 26pin interface of the
development board that can be connected to the cooling fan. The spacing between the
26pin pin headers is 2.54mm. The power interface of the cooling fan can be purchased
from Taobao according to this specification (the development board is plugged into the
power supply) After the 5V pin can be used directly, no other settings are required)
11) Fast or Gigabit Ethernet cable to connect the development board to the Internet
12) OV13850 13MP camera, dedicated camera for Orange Pi 4 LTS, compatible with
MIPI interface
13) 3.3V USB to TTL module and DuPont cable, when using the serial port debugging
function, USB to TTL module and DuPont cable are required to connect the development
board and computer
www.orangepi.org 14 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Note that if you purchase the version without eMMC, you cannot pass the
Debian image test pre-installed in eMMC, you can only burn the image to the TF
card, and then start the system in the TF card to test the function of the
development board
If you purchased the Orange Pi 4 LTS development board with 16GB eMMC, after
getting the development board, you can use the Debian 11 image pre-installed in the
www.orangepi.org 15 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
eMMC to test the functions of the development board, and make sure that all hardware
functions of the development board are OK. After that, burn the system you want to use.
Note that: the Linux image mentioned here refers specifically to the image of a
Linux distribution such as Debian or Ubuntu downloaded from the Orange Pi data
download page
2.4.1. How to use Win32Diskimager to burn Linux image
1) First prepare a TF card with a capacity of 8GB or more. The transmission speed of the
TF card must be above class 10. It is recommended to use a TF card from a brand such as
SanDisk
2) Then use the card reader to insert the TF card into the computer
b. After downloading, unzip and install directly, and then open the software
c. If only the TF card is inserted into the computer, the “Select card” column will
display the drive letter of the TF card. If multiple USB storage devices are
inserted into the computer, you can select the drive letter corresponding to the
TF card through the drop-down box.
www.orangepi.org 16 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
d. Then click "Format", a warning box will pop up before formatting, select "Yes
(Y)" to start formatting
e. After formatting the TF card, the information shown in the figure below will pop
up, click OK.
4) Download the compressed package of the Linux operating system image file you want
to burn from the data download page of Orange Pi, and then use the decompression
software to decompress it. In the decompressed file, the file ending with ".img" is the
image file of the operating system. The size is generally more than 1GB
www.orangepi.org 17 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
c. After the image writing is completed, click the "Exit" button to exit, and then
you can pull out the TF card and insert it into the development board to start
2.4.2. How to use balenaEtcher to burn a Linux image
1) First prepare a TF card with a capacity of 8GB or more. The transmission speed of the
TF card must be above class 10. It is recommended to use a TF card from a brand such as
SanDisk
2) Then use the card reader to insert the TF card into the computer
3) Download the compressed package of the Linux operating system image file you want
to burn from the data download page of Orange Pi, and then use the decompression
software to decompress it. In the decompressed file, the file ending with ".img" is the
image file of the operating system. The size is generally more than 1GB
4) Then download the burning software of the Linux image - balenaEtcher, the
download address is
www.orangepi.org 18 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
https://www.balena.io/etcher/
5) After entering the balenaEtcher download page, click the green download button to
download the installation package of balenaEtcher. You can also select the Portable
version of balenaEtcher through the drop-down box. The Portable version does not need
to be installed. Double-click to open it and use it
www.orangepi.org 19 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
7) The specific steps to use balenaEtcher to burn a Linux image are as follows
a. First select the path of the Linux image file to be burned
b. Then select the drive letter of the TF card
c. Finally, click Flash to start burning the Linux image to the TF card
8) The interface displayed in the process of balenaEtcher burning the Linux image is
shown in the figure below. In addition, the progress bar shows purple to indicate that the
Linux image is being burned to the TF card.
www.orangepi.org 20 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
9) After the Linux image is burned, balenaEtcher will also verify the image burned to the
TF card by default to ensure that there is no problem in the burning process. As shown in
the figure below, a green progress bar indicates that the image has been burned, and
balenaEtcher is verifying the burned image.
10) After the successful burning is completed, the display interface of balenaEtcher is
shown in the figure below. If a green indicator icon is displayed, it means that the image
burning is successful. At this time, you can exit balenaEtcher, and then pull out the TF
card and insert it into the TF card slot of the development board.
www.orangepi.org 21 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Note that: the Linux image mentioned here specifically refers to a Linux
distribution image such as Debian or Ubuntu downloaded from the Orange Pi data
download page, and Ubuntu PC refers to a personal computer with Ubuntu
installed.
1) First prepare a TF card with a capacity of 8GB or more. The transmission speed of the
TF card must be above class 10. It is recommended to use a TF card from a brand such as
SanDisk
2) Then use the card reader to insert the TF card into the computer
4) After entering the balenaEtcher download page, please select the Linux version of the
software through the drop-down box to download
www.orangepi.org 22 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) After downloading, please use the unzip command to decompress the downloaded
compressed package. The decompressed balenaEtcher-1.5.109-x64.AppImage is the
software needed to burn the Linux image
test@test:~$ unzip balena-etcher-electron-1.5.109-linux-x64.zip
Archive: balena-etcher-electron-1.5.109-linux-x64.zip
inflating: balenaEtcher-1.5.109-x64.AppImage
test@test:~$ ls
balenaEtcher-1.5.109-x64.AppImage balena-etcher-electron-1.5.109-linux-x64.zip
6) Download the compressed package of the Linux operating system image file you want
to burn from the data download page of Orange Pi, and then use the decompression
software to decompress it. In the decompressed file, the file ending with ".img" is the
image file of the operating system. The size is generally more than 1GB
The decompression command for the compressed package ending in 7z is as follows
test@test:~$ 7z x Orangepi4-lts_3.0.0_debian_bullseye_desktop_xfce_linux5.10.43.7z
test@test:~$ ls Orangepi4-lts_3.0.0_debian_bullseye_desktop_xfce_linux5.10.43.*
Orangepi4-lts_3.0.0_debian_bullseye_desktop_xfce_linux5.10.43.7z
Orangepi4-lts_3.0.0_debian_bullseye_desktop_xfce_linux5.10.43.sha #checksum file
Orangepi4-lts_3.0.0_debian_bullseye_desktop_xfce_linux5.10.43.img #image file
7) After decompressing the image, you can use the sha256sum -c *.sha command to
calculate whether the checksum is correct. If the message is successful, it means that the
downloaded image is correct, and you can safely burn it to the TF card. If the checksum
does not match, it means that There is a problem with the downloaded image, please try
to download again
www.orangepi.org 23 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
9) The specific steps to use balenaEtcher to burn a Linux image are as follows
a. First select the path of the Linux image file to be burned
b. Then select the drive letter of the TF card
c. Finally, click Flash to start burning the Linux image to the TF card
10) The interface displayed in the process of balenaEtcher burning the Linux image is
www.orangepi.org 24 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
shown in the figure below. In addition, the progress bar shows purple to indicate that the
Linux image is being burned to the TF card.
11) After the Linux image is burned, balenaEtcher will also verify the image burned to
the TF card by default to ensure that there is no problem in the burning process. As
shown in the figure below, a green progress bar indicates that the image has been burned,
and balenaEtcher is verifying the burned image.
12) After the successful burning, the display interface of balenaEtcher is shown in the
figure below. If the green indicator icon is displayed, it means that the image burning is
successful. At this time, you can exit balenaEtcher, and then pull out the TF card and
insert it into the TF card slot of the development board.
www.orangepi.org 25 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
The Android firmware of the development board can only be burned to the TF
card using SDDiskTool software under the Windows platform. In addition, the
SDDiskTool software does not have a Linux platform version, so it is impossible to
burn the Android system to the TF card under the Linux platform.
1) First prepare a TF card with a capacity of 8GB or more. The transmission speed of the
TF card must be above class 10. It is recommended to use a TF card from a brand such as
SanDisk
2) Then use the card reader to insert the TF card into the computer
3) Then download the SDDiskTool programming tool and Android firmware from the
www.orangepi.org 26 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
data download page of Orange Pi. The Android firmware on the official website has two
versions: eMMC boot and TF card boot. Here you need to select the TF card boot version,
and pay attention to the TF card boot version. The name of the Android firmware contains
the word "SD"
6) After opening SDDiskTool, if the TF card is recognized normally, the inserted disk
device will be displayed in the "Select Removable Disk Device" column. Please make
sure that the displayed disk device is the same as the drive letter of the TF card you
want to burn. Yes, if there is no display, you can try to unplug the TF card
www.orangepi.org 27 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
7) After confirming the drive letter, format the TF card first, click the restore disk button
in SDDiskTool, or use the SD Card Formatter mentioned above to format the TF card
www.orangepi.org 28 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
9) After burning, you can exit SDDiskTool, and then you can pull out the TF card from
the computer and insert it into the development board to start
Orange Pi 4 LTS has three upgrade modes, namely MaskRom mode, Loader
mode and SD upgrade mode. The first two modes need to be burned through the
Type C cable, and the latter mode is burned through the TF card. For the way of
programming through Type C cable, if there is no programming system in eMMC, it
will enter MaskRom mode by default. If a bootable system has been programmed in
eMMC, you can enter Loader mode for programming. It should be noted that if the
system in eMMC is damaged due to an accident in programming or other reasons, it
will not be able to enter the Loader mode for programming. You need to enter the
MaskRom mode according to the method of entering the MaskRom mode, and then
use the TypeC cable to connect. Computer and development board for programming
2.8.1. Directly burn Android firmware to eMMC through Type C
interface
1) First prepare a good quality Type C data cable
www.orangepi.org 29 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
b. After waiting for a while, a pop-up window will prompt "Driver installed
successfully"
5) Unzip AndroidTool_v2.58.zip, this software does not need to be installed, just find
AndroidTool in the unzipped folder and open it
www.orangepi.org 30 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) After opening the AndroidTool tool, because the computer has not been connected to
the Orange Pi 4 LTS development board through the Type-C cable at this time, the lower
left corner will prompt "No Devices Found"
www.orangepi.org 31 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
a. If the previous steps are successful, the development board has entered the
Loader mode, and "Found One LOADER Device" will be prompted on the
interface of the AndroidTool tool
www.orangepi.org 32 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
c. Then click the "Firmware" button to select the path of the Android firmware, and
then click "Open", as shown in the following figure
d. After the Android firmware path selection is completed, the firmware will start
to be loaded, and the button will turn into a gray unselectable state.
e. After the firmware is loaded, the button becomes selectable, and then click
"Erase Flash" to start erasing eMMC
www.orangepi.org 33 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
f. The interface of the successful erasing is shown in the figure below, because the
system in eMMC has been erased, so you can see the prompt "found a
MASKROM device"
g. Finally, click the "Upgrade" button to burn. During the burning process, the
AndroidTool is displayed as shown in the figure below, and the Android system
will automatically start after the burning is completed.
www.orangepi.org 34 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) Then use the card reader to insert the TF card into the computer
3) Download the Android firmware and SDDiskTool programming tool from the data
download page of Orange Pi. It should be noted that the firmware on the official website
has two versions: eMMC boot and TF card boot. Here you need to select the eMMC boot
version, and pay attention to support eMMC boot The firmware does not contain the
word "SD", and please ensure that the version of SDDiskTool is v1.59
www.orangepi.org 35 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) After opening SDDiskTool, if the TF card is recognized normally, the inserted disk
device will be displayed in "Select Removable Disk Device". Please make sure that the
displayed disk device is consistent with the drive letter of the TF card you want to burn.
If there is no display, you can try to unplug the TF card
www.orangepi.org 36 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
8) After burning, you can exit SDDiskTool, and then you can unplug the TF card from
the computer and insert it into the development board. After the development board is
powered on, it will start to burn the Android firmware in the TF to the eMMC.
9) If the development board is connected to an HDMI display, you can also see the
progress bar of burning Android firmware to eMMC from the HDMI display
10) When the following information is displayed, it means that the Android firmware has
been burned into the eMMC. At this time, the TF card can be pulled out, and then the
www.orangepi.org 37 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) Then download the upgrade_tool tool and Android 8.1 firmware from the data
download page of Orange Pi. The firmware on the official website has two versions:
eMMC boot and TF card boot. Here you need to select the eMMC boot version. Note that
the firmware that supports eMMC boot does not contain "SD", please make sure the
upgrade_tool version is v1.39, please do not use the upgrade_tool software lower than
v1.39 to burn the Android 8.1 firmware of Orange Pi 4 LTS, the upgrade_tool tool lower
than this version Burning Android 8.1 may be problematic
3) Then execute the command in the terminal to decompress upgrade_tool and add
executable permissions
test@test:~$ unzip Linux_Upgrade_Tool_v1.39.zip
test@test:~$ cd Linux_Upgrade_Tool_v1.39
test@test:~/Linux_Upgrade_Tool_v1.39$ sudo chmod +x ./upgrade_tool
www.orangepi.org 38 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
a. If the previous steps are successful, the development board has entered the
Loader mode at this time, execute the following command and you will see
Mode=Loader, indicating that the Loader device has been recognized
test@test:~/Linux_Upgrade_Tool_v1.39$ ./upgrade_tool LD
Program Data in /home/csy/.config/upgrade_tool
List of rockusb connected(1)
DevNo=1 Vid=0x2207,Pid=0x330c,LocationID=2010201 Mode=Loader
www.orangepi.org 39 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
c. Then enter the following command in the terminal of the Ubuntu PC to erase the
eMMC
test@test:~$ sudo ./upgrade_tool ef Orangepi4-lts_Android8.1_v1.0.img
d. Finally execute the following command to start burning Android firmware to
eMMC
test@test:~$ sudo ./upgrade_tool uf Orangepi4-lts_Android8.1_v1.0.img
1) First make sure that the OrangePi 4 LTS development board is disconnected from all
power sources, and the SD card is unplugged
2) Then use metal tweezers to connect the two test points in the yellow box in the
picture below reserved by the OrangePi 4 LTS development board, and keep it still (make
sure that the two test points are short-circuited)
3) Then plug in the DC power supply to the Orange Pi 4 LTS development board, wait
www.orangepi.org 40 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
for 2~3 seconds and then release the metal tweezers. At this point the OrangePi 4 LTS
development board will enter maskrom mode
4)Then use the Type C cable to connect the OrangePi 4 LTS development board to the
Windows PC, and then open the AndroidTool tool, if all goes well, you can see the
AndroidTool interface prompts "Found
One MASKROM Device”
5)At this point, you can burn the Android firmware through the AndroidTool tool under
Windows
1) The metal heat dissipation shell kit includes 1 aluminum alloy shell, 3 pieces of
thermal conductive silicone, 4 M2x8 screws, 1 screwdriver, and 1 set of external WIFI
antenna (optional)
www.orangepi.org 41 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) Then put the development board on the lower shell of the metal heat dissipation shell,
pay attention to the alignment of the four screw holes
www.orangepi.org 42 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Tear off the protective stickers on both sides of the 3 pieces of thermally conductive
silica gel, and then place 3 pieces of thermally conductive silica gel on the CPU chip and
memory chip of the development board, which need to be placed in the corresponding
positions as shown in the figure below, pay attention to the missing corners of the
thermally conductive silica gel of the CPU chip Side facing 26pin double row pin
The height of the thermal conductive silica gel at the CPU chip and the memory chip is
basically the same, please pay attention to this
www.orangepi.org 43 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) Then insert the copper column of the WiFi external antenna into the groove of the
upper shell of the metal heat dissipation shell, as shown in the figure below, pay attention
to the angle and direction
www.orangepi.org 44 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) Then tighten the glue post of the WiFi external antenna to the copper post of the WiFi
external antenna, as shown in the figure below
7) Then align the upper case with the lower case as shown in the figure below, and press
down slowly to fasten them together. Note that if the fastening fails, the thermal
conductive silicone may be displaced. Readjust the position of the lower thermal
conductive silicone, and then try to fasten it again.
www.orangepi.org 45 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
8) Finally, let the lower shell of the metal heat dissipation shell face upward, and use a
Phillips screwdriver to tighten the 4 screws to the lower shell of the metal heat dissipation
shell, and the assembly is completed.
www.orangepi.org 46 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) The development board has an onboard eMMC, and the Debian 11 image is burned by
default in it. When you get the development board, you can directly use the image in the
eMMC for startup and full-function testing.
2) If you need to use the linux image, you can insert the TF card with the linux image
burned into the TF card slot of the Orange Pi development board
3) The development board has an HDMI interface, and the development board can be
connected to a TV or HDMI display through an HDMI to HDMI cable
4) Connect the USB mouse and keyboard to control the orange pi development board
5) The development board has an Ethernet port, which can be plugged into a network
cable for Internet access
6) Connect a 5V/3A (5V/4A can also) high-quality power adapter
a.Orange Pi 4 LTS cannot be powered through the 5v pin on the 26pin interface
b. Remember not to plug in the 12V power adapter, if the 12V power adapter is
plugged in, it will burn out the development board
c. Many unstable phenomena during system startup are basically caused by
power supply problems, so a reliable power adapter is very important
1) Then turn on the switch of the power adapter. If everything is normal, the HDMI
display can see the startup screen of the system.
2) If you want to view the output information of the system through the debugging serial
port, please use the USB to TTL module and DuPont cable to connect the development
board to the computer. For the connection method of the serial port, please refer to the
section on how to use the debugging serial port.
www.orangepi.org 47 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
stops at the login interface of the terminal, it means that the system has been started
normally;
3) If there is no HDMI display and serial port cable, you can judge the startup status
of the system through the two LED lights on the development board. If the red LED
light is on and the green LED light is flashing, the system has generally started
normally. , If after power-on and waiting for a period of time, only the red LED light
is on, or the red and green LED lights are not on, it means that the system has not
started normally.
If the system fails to start or cannot enter the login interface normally, please check
the following first:
1) Check whether the downloaded image is damaged, which can be judged by
calculating the checksum attached to the image;
2) If there is any problem in the process of burning the image to the TF card, you
can re-burn the image and test it again;
3) Make sure there is no problem with the power adapter, you can try another one;
4) Make sure that the TF card meets the requirements of the Orange Pi development
board. If there is an extra TF card, you can try to change the TF card and then burn
the image and test it again;
5) If all of the above are OK, please save the output log of the debugging serial port
during the system startup process (preferably in the form of txt text instead of
taking pictures), and then report the problem to the customer service.
www.orangepi.org 48 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) The corresponding relationship between the debug serial port GND, RXD and TXD
pins of the development board is shown in the figure below
3) 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 a DuPont cable
a. Connect the GND of the USB to TTL module to the GND of the development
board
b. The RX of the USB to TTL module is connected to the TX of the development
board
c. The TX of the USB to TTL module is connected to the RX of the development
board
4) The schematic diagram of connecting the USB to TTL module to the computer and
the Orange Pi development board is shown below
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 casually. If there is no output in the test, then exchange the order of
www.orangepi.org 49 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) If the CP2102 USB to TTL module is used, in the case of a baud rate of 1500000,
some systems may encounter garbled or unusable problems. The specific test situation is
as follows
USB to TTL module model Host system Support situation
win7 OK
win10 OK
CH340 ubuntu14.04 OK
ubuntu18.04 OK
ubuntu20.04 OK
win7 OK
win10 NO
CP2102 ubuntu14.04 OK
ubuntu18.04 NO
ubuntu20.04 NO
1) First, insert the USB to TTL module into the USB interface of the Ubuntu computer. If
the connection and recognition of the USB to TTL module is normal, you can see the
corresponding device node name under /dev of the Ubuntu PC, remember this node name,
and set the serial port later software will be used
test@test:~$ ls /dev/ttyUSB*
/dev/ttyUSB0
www.orangepi.org 50 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) After executing the putty command, the following interface will pop up
www.orangepi.org 51 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
7) After setting the serial port setting interface, go back to the Session interface
a. First select the Connection type as Serial
b. Then click the Open button to connect the serial port
www.orangepi.org 52 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
8) After starting the development board, you can see the Log information output by the
system from the open serial terminal
1) Download MobaXterm
a. Download MobaXterm URL as follows
https://mobaxterm.mobatek.net/
b. After entering the MobaXterm download page, click GET XOBATERM NOW!
www.orangepi.org 53 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
d. Then select the Portable portable version. After downloading, there is no need to
install it, just open it and use it
www.orangepi.org 54 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) After opening the software, the steps to set the serial port connection are as follows
a. Open the session settings interface
b. Select serial port type
c. Select the port number of the serial port (select the corresponding port number
according to the actual situation). If you cannot see the port number, please use
the 360 driver master to scan and install the driver for the USB to TTL serial port
chip.
d. Select the baud rate of the serial port to be 1500000
e. Finally, click the "OK" button to complete the setting
4) After clicking the "OK" button, it will enter the following interface. At this time, you
can see the output information of the serial port when you start the development board.
www.orangepi.org 55 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
www.orangepi.org 56 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
www.orangepi.org 57 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Headphone playback OK OK
Headphone recording OK OK
WIFI OK OK
Bluetooth OK OK
LED lights OK OK
Type-C to HDMI display OK OK
GPU OK OK
Hardware codec OK OK
Reset button OK OK
webGL hardware acceleration OK OK
Dual camera display at the same time OK NO
MIPI screen dual screen OK OK
simultaneous display OK OK
watchdog test OK OK
Account Password
root orangepi
orangepi orangepi
1) The desktop version of the system will automatically log in to the desktop after
starting by default, no need to enter a password
www.orangepi.org 58 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Then restart the system, the login dialog box will appear, at this time, you need to
enter the password to enter the system
www.orangepi.org 59 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3.6. Start the rootfs in the auto-expanding TF card for the first
time
1) When the TF card starts the Linux system for the first time, it will call the
orangepi-resize-filesystem script through the systemd service
orangepi-resize-filesystem.service to automatically expand the rootfs, so there is no need
to manually expand the capacity.
2) After logging in to the system, you can use the df -h command to check the size of the
rootfs. If it is consistent with the actual capacity of the TF card, it means that the
automatic expansion is running correctly.
root@orangepi4-lts:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 382M 5.6M 376M 2% /run
/dev/mmcblk0p1 15G 2.5G 12G 18% /
tmpfs 1.9G 140K 1.9G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
www.orangepi.org 60 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) It should be noted that the Linux system has only one partition in ext4 format, and a
separate BOOT partition is not used to store files such as kernel images, so there is no
problem of BOOT partition expansion.
4) In addition, if you do not need to automatically expand rootfs, you can use the
following method to prohibit
a. First burn the linux image to the TF card
b. Then insert the TF card into the Ubuntu PC (Windows does not work), the
Ubuntu PC will generally automatically mount the partition of the TF card. If the
automatic mounting is normal, you can use the ls command to see the following
output. The partition name of the TF card is shown in the following command.
The name is not necessarily the same, please modify it according to the actual
situation
test@test:~$ ls /media/test/27e62f92-8250-4ef1-83db-3d8f0c2e23db/
bin boot dev etc home lib lost+found media mnt opt proc root run
sbin selinux srv sys tmp usr var
c. Then switch the current user to the root user in the Ubuntu PC
test@test:~$ sudo -i
[sudo] test 的密码:
root@test:~#
d. Then enter the root directory of the Linux system in the TF card and create a
new file named .no_rootfs_resize
root@test:~# cd /media/test/27e62f92-8250-4ef1-83db-3d8f0c2e23db
root@test:/media/test/27e62f92-8250-4ef1-83db-3d8f0c2e23db# cd root
root@test:/media/test/27e62f92-8250-4ef1-83db-3d8f0c2e23db/root# touch .no_rootfs_resize
root@test:/media/test/27e62f92-8250-4ef1-83db-3d8f0c2e23db/root# ls .no_rootfs*
.no_rootfs_resize
e. Then you can uninstall the TF card, then pull out the TF card and insert it into
the development board to start. When the linux system starts, when it is detected
www.orangepi.org 61 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
that there is a .no_rootfs_resize file in the /root directory, the rootfs will no
longer be automatically expanded.
f. After prohibiting the automatic expansion of rootfs, you can see that the
available capacity of the TF card is only about 200M
root@orangepi4-lts:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 382M 5.6M 376M 2% /run
/dev/mmcblk0p1 2.9G 2.3G 487M 83% /
tmpfs 1.9G 140K 1.9G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
tmpfs 1.9G 12K 1.9G 1% /tmp
/dev/zram0 49M 2.6M 43M 6% /var/log
cgmfs 100K 0 100K 0% /run/cgmanager/fs
tmpfs 382M 0 382M 0% /run/user/0
tmpfs 382M 12K 382M 1% /run/user/1000
1) The loglevel of the linux system is set to 1 by default. When using the serial port to
view the startup information, the kernel output log is as follows, basically all shielded
Starting kernel ...
orangepi login:
2) When there is a problem with the startup of the Linux system, you can use the
following method to modify the value of loglevel, so as to print more log information to
the serial port display, which is convenient for debugging. If the Linux system fails to
start and cannot enter the system, you can insert the TF card into the Ubuntu PC through
the card reader, and then directly modify the configuration of the Linux system in the TF
www.orangepi.org 62 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
card after mounting the TF card in the Ubuntu PC. Insert the TF card into the
development board to start
root@orangepi4-lts:~# sed -i "s/verbosity=1/verbosity=7/" /boot/orangepiEnv.txt
root@orangepi4-lts:~# sed -i "s/console=both/console=serial/" /boot/orangepiEnv.txt
3) The above commands actually set the variables in /boot/orangepiEnv.txt. After setting,
you can open /boot/orangepiEnv.txt to check.
root@orangepi4-lts:~# cat /boot/orangepiEnv.txt
verbosity=7
console=serial
4) Then restart the development board, the output information of the kernel will be
printed to the serial port output
1) First, insert the network cable into the Ethernet interface of the development board,
and ensure that the network is unblocked
2) After the system starts, it will automatically assign an IP address to the Ethernet card
through DHCP
There are three ways to check the IP address after the development board is
www.orangepi.org 63 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
started:
1. Connect the HDMI display, then log in to the system and use the ifconfig
command to check the IP address
2. Enter the ifconfig command in the debug serial 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 network port of the development board through the
management interface of the router. However, this method often fails to see the IP
address of the development board. If you can't see it, the debug method looks like
this:
A) First check whether the Linux system has been started normally. If the green
light of 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.
B) Check whether the network cable is plugged in tightly, or try another
network cable
C) Try another router (I have encountered many problems with the router, such
as the router cannot assign an IP address normally, or the IP address has been
assigned normally but cannot be seen in the router)
D) If there is no router to replace, you can only connect the HDMI display or use
the debug serial port to view the IP address
www.orangepi.org 64 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) Then select the network interface that needs to set a static IP address, such as setting
the static IP address of the Ethernet interface and select Wired connection 1.
www.orangepi.org 65 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) Then use the Tab key to move the cursor to the <Automatic> position shown in the
figure below to configure IPv4
6) Then press Enter, use the up and down arrow keys to select Manual, then press Enter
to confirm
www.orangepi.org 66 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
9) Then press Enter, the following setting interface will pop up after pressing Enter
www.orangepi.org 67 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
10) Then you can set the IP address (Addresses), gateway (Gateway) and DNS server
address in the location shown in the figure below (there are many other setting options,
please explore by yourself), please set according to your specific needs, The value set in
the image below is just an example
11) After setting, move the cursor to <OK> in the lower right corner, then press Enter to
www.orangepi.org 68 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
confirm
13) Then select Activate a connection, move the cursor to <OK>, and finally click Enter
www.orangepi.org 69 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
14) Then select the network interface to be set, such as Wired connection 1, then move
the cursor to <Deactivate>, and press Enter to disable Wired connection 1
15) Then please do not move the cursor, and then press the Enter key to re-enable Wired
connection 1, so that the static IP address set earlier will take effect
16) Then exit nmtui through the <Back> and Quit buttons
www.orangepi.org 70 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
17) Then through ifconfig, you can see that the IP address of the network port has
become the static IP address set earlier
root@orangepi:~# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.177 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::69f6:23d3:a3f3:9772 prefixlen 64 scopeid 0x20<link>
ether 86:f2:85:2c:81:ce txqueuelen 1000 (Ethernet)
RX packets 47817 bytes 4047732 (4.0 MB)
RX errors 0 dropped 1563 overruns 0 frame 0
TX packets 1815 bytes 295954 (295.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 64
18) Then you can test the connectivity of the network to check whether the IP address is
configured OK
root@orangepi:~# ping 192.168.1.47 -I eth0
PING 192.168.1.47 (192.168.1.47) from 192.168.1.188 eth0: 56(84) bytes of data.
64 bytes from 192.168.1.47: icmp_seq=1 ttl=64 time=0.233 ms
64 bytes from 192.168.1.47: icmp_seq=2 ttl=64 time=0.263 ms
64 bytes from 192.168.1.47: icmp_seq=3 ttl=64 time=0.273 ms
64 bytes from 192.168.1.47: icmp_seq=4 ttl=64 time=0.269 ms
64 bytes from 192.168.1.47: icmp_seq=5 ttl=64 time=0.275 ms
^C
--- 192.168.1.47 ping statistics ---
www.orangepi.org 71 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
By default, Linux systems enable ssh remote login and allow root users to log in to
the system. Before ssh login, you need to ensure that the Ethernet or wifi network is
connected, and then use the ifconfig command or obtain the IP address of the
development board by viewing the router
2) Then you can log in to the Linux system remotely through the ssh command
test@test:~$ ssh [email protected] (It needs to be replaced with the IP address of the
development board)
[email protected]'s password: ( Enter the password here, the default password is
orangepi)
If ssh cannot log in to the Linux system normally, you can enter the following
www.orangepi.org 72 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
root@orangepi:~# rm /etc/ssh/ssh_host_*
root@orangepi:~# dpkg-reconfigure openssh-server
3) Then you will be prompted to enter a password. The default passwords for both root
and orangepi users are orangepi
www.orangepi.org 73 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) Use HDMI to HDMI cable to connect Orange Pi development board and HDMI
display
www.orangepi.org 74 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) After starting the linux system, if the HDMI display has image output, it means that
the HDMI interface is working normally
1) Use Type C to HDMI cable to connect Orange Pi development board and HDMI
display
2) After starting the linux system, if the HDMI display has image output, it means that
the Type C to HDMI display function is normal
b. A VGA cable
www.orangepi.org 75 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
When using HDMI to VGA display, the development board and the Linux
system of the development board do not need to do any settings, as long as the
HDMI interface of the development board can display normally. So if there is a
problem with the test, please check the HDMI to VGA converter, VGA cable and
monitor if there is any problem
www.orangepi.org 76 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) First log in to the linux system, there are the following three ways
a. If the development board is connected to the network cable, you can log in to the
Linux system remotely through ssh
b. If the development board is connected to the debugging serial port, you can use
the serial port terminal to log in to the linux system
c. If the development board is connected to the HDMI display, you can log in to the
linux system through the HDMI display terminal
1) First use the nmcli dev wifi command to scan the surrounding WIFI hotspots
root@orangepi4-lts:~# nmcli dev wifi
2) Then use the nmcli command to connect to the scanned WIFI hotspot, where:
a. wifi_name needs to be replaced with the name of the WIFI hotspot you want to
connect to
b. wifi_passwd needs to be replaced with the password of the WIFI hotspot you
want to connect to
root@orangepi4-lts:~# nmcli dev wifi connect wifi_name password wifi_passwd
www.orangepi.org 77 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) You can view the IP address of the wifi through the ifconfig command
root@orangepi4-lts:~# ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr b0:02:47:cf:28:77
inet addr:192.168.1.187 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::8008:703d:8f92:41c7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:17 errors:0 dropped:0 overruns:0 frame:0
TX packets:42 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1837 (1.8 KB) TX bytes:8320 (8.3 KB)
4) Use the ping command to test the connectivity of the wifi network
root@orangepi4-lts:~# ping www.baidu.com -I wlan0
PING www.a.shifen.com (14.215.177.39) from 192.168.1.187 wlan0: 56(84) bytes of
data.
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=3 ttl=56 time=15.0 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=4 ttl=56 time=12.8 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=5 ttl=56 time=13.7 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=6 ttl=56 time=14.9 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=7 ttl=56 time=13.6 ms
^C
www.orangepi.org 78 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) Then enter the nmtui command in the command line to open the wifi connection
interface
root@orangepi4-lts:~# nmtui
www.orangepi.org 79 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) Select the WIFI hotspot you want to connect, then use the Tab key to position the
cursor to Activate and press Enter
7) Then a dialog box for entering a password will pop up, enter the corresponding
password in Pssword and press Enter to start connecting to WIFI
www.orangepi.org 80 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
8) After the WIFI connection is successful, a "*" will be displayed in front of the
connected WIFI name
9) You can view the IP address of the wifi through the ifconfig command
root@orangepi4-lts:~# ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.187 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::76bb:f67d:ef98:2f9a prefixlen 64 scopeid 0x20<link>
ether 12:81:3e:a8:58:d8 txqueuelen 1000 (Ethernet)
RX packets 185 bytes 109447 (109.4 KB)
RX errors 0 dropped 61 overruns 0 frame 0
TX packets 27 bytes 14783 (14.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
10) Use the ping command to test the connectivity of the wifi network
root@orangepi4-lts:~# ping www.baidu.com -I wlan0
PING www.a.shifen.com (14.215.177.39) from 192.168.1.187 wlan0: 56(84) bytes of
data.
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=3 ttl=56 time=15.0 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=4 ttl=56 time=12.8 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=5 ttl=56 time=13.7 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=6 ttl=56 time=14.9 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=7 ttl=56 time=13.6 ms
^C
www.orangepi.org 81 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) Click More networks in the pop-up drop-down box to see all scanned WIFI hotspots,
and then select the WIFI hotspot you want to connect to
3) Then enter the password of the WIFI hotspot, and then click Connect to start
connecting to the WIFI
www.orangepi.org 82 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) After connecting to WIFI, you can open the browser to check whether you can access
the Internet. The entrance of the browser is shown in the figure below.
5) After opening the browser, if you can see the page of the Orange Pi website, or you
can open other pages, it means the WIFI connection is normal
www.orangepi.org 83 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
www.orangepi.org 84 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) In the Bluetooth adapter setting interface, set the Visibility Setting to Always visible,
and then click the upper right corner to close the window
www.orangepi.org 85 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) Then select the Bluetooth device you want to connect, and then click the right mouse
button to pop up the operation interface of the Bluetooth device. Select Pair to start
pairing. The demonstration here is pairing with an Android phone.
7) When pairing, a pairing confirmation box will pop up in the upper right corner of the
desktop. Select Confirm to confirm. At this time, the mobile phone also needs to be
confirmed.
www.orangepi.org 86 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
8) After pairing with the mobile phone, you can select the paired Bluetooth device, then
right-click and select Send a File to start sending a picture to the mobile phone
www.orangepi.org 87 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
www.orangepi.org 88 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) After scanning the device you want to pair, you can pair it. Pairing needs to use the
MAC address of the device
[bluetooth]# pair DC:72:9B:4C:F4:CF #Use the scanned MAC address of the
Bluetooth device for pairing
Attempting to pair with DC:72:9B:4C:F4:CF
[CHG] Device DC:72:9B:4C:F4:CF Connected: yes
Request confirmation
[leeb1m[agent] Confirm passkey 764475 (yes/no): yes #Enter yes here, you also need
to confirm on the phone
[CHG] Device DC:72:9B:4C:F4:CF Modalias: bluetooth:v010Fp107Ed1436
[CHG] Device DC:72:9B:4C:F4:CF UUIDs: 0000046a-0000-1000-8000-00805f9b34fb
[CHG] Device DC:72:9B:4C:F4:CF ServicesResolved: yes
[CHG] Device DC:72:9B:4C:F4:CF Paired: yes
Pairing successful #Prompt pairing is successful
[CHG] Device DC:72:9B:4C:F4:CF ServicesResolved: no
[CHG] Device DC:72:9B:4C:F4:CF Connected: no
4) After the pairing is successful, the display of the Bluetooth interface of the mobile
phone is as follows
www.orangepi.org 89 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) If the mouse or keyboard can operate normally, the USB interface is in normal use
(the mouse can only be used in the desktop version of the system)
2) Execute the following command, if you can see the output of sdX, it means that the U
disk is successfully recognized
root@orangepi4-lts:~# cat /proc/partitions | grep "sd*"
major minor #blocks name
8 0 30044160 sda
8 1 30043119 sda1
3) Use the mount command to mount the U disk to /mnt, and then you can view the files
in the U disk
root@orangepi4-lts:~# mount /dev/sda1 /mnt/
root@orangepi4-lts:~# ls /mnt/
test.txt
www.orangepi.org 90 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) After mounting, you can view the capacity usage and mount point of the U disk
through the df -h command
root@orangepi4-lts:~# df -h | grep "sd"
/dev/sda1 29G 208K 29G 1% /mnt
1) First insert the USB camera into the USB port of the Orange Pi development board
2) Through the v4l2-ctl (note that the l in v4l2 is a lowercase letter l, not the number 1)
command, you can see that the device node information of the USB camera is
/dev/video10
root@orangepi4-lts:~# apt update
root@orangepi4-lts:~# apt install v4l-utils
root@orangepi4-lts:~# v4l2-ctl --list-devices
USB2.0 Camera RGB (usb-xhci-hcd.11.auto-1):
/dev/video10
In addition, the serial number of the video is not necessarily video10, please
modify it according to the actual situation.
www.orangepi.org 91 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
c. If there is no HDMI display or LCD screen connected, after taking the picture,
you can use the scp command to transfer the taken picture to the Ubuntu PC for
image viewing
root@orangepi4-lts:~# scp image.jpg [email protected]:/home/test (Modify the IP
address and path according to the actual situation)
d. If an HDMI display or LCD screen is connected, you can view the captured
pictures directly through the HDMI display or LCD screen
www.orangepi.org 92 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
www.orangepi.org 93 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) Through the aplay -l command, you can view the sound card devices supported by
the linux system, among which rockchipes8316c is the sound card device required
for headphone playback
root@orangepi4-lts:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
xcb_connection_has_error() returned true
card 0: rockchipes8316c [rockchip-es8316c], device 0: ff890000.i2s-ES8316 HiFi
ES8316 HiFi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: rkhdmidpsound [rk-hdmi-dp-sound], device 0: HDMI-DP multicodec-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
3) Then use the aplay command to play the audio, and the headset can hear the sound
www.orangepi.org 94 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) After the recording is completed, a recording file named test.wav will be generated in
the current path. Use the aplay command to play test.wav to check whether there is sound
output. If there is sound output, the recording is normal.
root@orangepi4-lts:~# ls -lh
total 862K
-rw-r--r-- 1 root root 862K Feb 5 04:24 test.wav
root@orangepi4-lts:~# aplay -D hw:0,0 test.wav
4) After the recording is completed, a recording file named test.wav will be generated in
the current path. Use the aplay command to play test.wav to check whether there is sound
output. If there is sound output, the recording is normal.
root@orangepi4-lts:~# ls -lh
total 862K
www.orangepi.org 95 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) Upload the audio files to be played to the /root folder of the linux system. In Ubuntu
PC, you can use the scp command to upload (the IP address in the command is the IP
address of the Orange Pi development board), or use a U disk to copy
test@test:~/AudioTest$ scp audio.wav [email protected]:/root (Modify the IP
address and path according to the actual situation)
3) HDMI audio playback does not require other settings, just use the aplay command to
play
root@orangepi4-lts:~# aplay -D hw:1,0 audio.wav
1) RK3399 has a total of 2 temperature sensors, the command to check the temperature is
as follows
a. sensor0:CPU
root@orangepi4-lts:~# cat /sys/class/thermal/thermal_zone0/type
soc-thermal
root@orangepi4-lts:~# cat /sys/class/thermal/thermal_zone0/temp
48125
b. sensor1:GPU
root@orangepi4-lts:~# cat /sys/class/thermal/thermal_zone1/type
gpu-thermal
root@orangepi4-lts:~# cat /sys/class/thermal/thermal_zone1/temp
49375
www.orangepi.org 96 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) After completing the wiring, connect the DC power supply to the development board.
After the system starts, execute the lspci command in the terminal to see the recognized
pci device
root@orangepi4-lts:~# lspci
00:00.0 PCI bridge: Fuzhou Rockchip Electronics Co., Ltd RK3399 PCI Express Root
Port
01:00.0 SATA controller: ASMedia Technology Inc. ASM1062 Serial ATA Controller (rev
02)
And the information about the hard disk can also be seen in the output information of
the dmesg command
[ 14.535120] scsi 0:0:0:0: Direct-Access ATA WDC WD5000LPCX-2
1A01 PQ: 0 ANSI: 5
[ 14.536785] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[ 14.536808] sd 0:0:0:0: [sda] 4096-byte physical blocks
[ 14.537238] sd 0:0:0:0: [sda] Write Protect is off
[ 14.537262] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 14.537411] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't
support DPO or FUA
[ 14.590267] sda: sda1
[ 14.592221] sd 0:0:0:0: [sda] Attached SCSI disk
3) On the desktop of the Linux system, you can see that the hard disk has been mounted
www.orangepi.org 97 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3.20.2. Connect the Gigabit LAN through the mini PCIE interface
1) First prepare the required accessories
a. Realtek 8111E mini PCIE to Gigabit Ethernet module
www.orangepi.org 98 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) Connect the 24pin reverse cable to the mini PCIE adapter board as shown in the figure
below
3) Then connect the mini PCIE to Gigabit LAN module to the mini PCIE adapter board
Put a piece of insulating white paper between the gigabit network card module
and the mini PCIE adapter board to avoid short circuit caused by direct contact
between the gigabit network card module and the mini PCIE adapter board, and
www.orangepi.org 99 www.xunlong.tv
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Then connect the mini PCIE adapter board to the Orange Pi 4 LTS development board
through the 24pin reverse cable
5) Finally, connect the network cable to the network port of the mini PCIE to Gigabit
network card module
6) Power on the Orange Pi 4 LTS. After the system starts, enter the lspci command in the
command line terminal. If there is the following output information, it means that the
mini PCIE to Gigabit network card has been recognized.
root@orangepi4-lts:~# lspci
00:00.0 PCI bridge: Fuzhou Rockchip Electronics Co., Ltd RK3399 PCI Express Root
Port
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI
Express Gigabit Ethernet Controller (rev 06)
Use the ifconfig command to view the network device name and IP address
corresponding to the mini PCIE to Gigabit network card
root@orangepi4-lts:~# ifconfig
enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.63 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::bafe:2ff8:1a59:c3eb prefixlen 64 scopeid 0x20<link>
ether 00:e0:4c:68:0c:3c txqueuelen 1000 (Ethernet)
RX packets 98 bytes 7680 (7.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 31 bytes 3066 (2.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
3.20.3. Connect the wireless network card through the mini PCIE
interface
Note that only Linux4.4 Debian10 system supports this function
b. Supporting antenna, IPX4 interface, there are two kinds of built-in and external,
the picture below shows the external antenna
2) Connect the RTL8822BE wireless network card to the NGFF to mini PCIE adapter
card as shown below
3) Then connect the 24pin reverse row wiring to the mini PCIE adapter board as shown
below
4) Then connect the NGFF to mini PCIE adapter card to the mini PCIE adapter board
Put a piece of insulating white paper between the wireless network card module
and the mini PCIE adapter board to avoid short circuit caused by direct contact
between the wireless network card module and the mini PCIE adapter board, and
can be fixed with a rope after connection.
8) Finally, connect the mini PCIE adapter board to the Orange Pi 4 LTS development
board through the 24pin reverse cable
9) Power on the Orange Pi 4 LTS development board. After the system starts, enter the
lspci command in the command line terminal. If there is the following output information,
it means that the RTL8822BE wireless network card is recognized
root@orangepi4-lts:~# lspci
00:00.0 PCI bridge: Fuzhou Rockchip Electronics Co., Ltd RK3399 PCI Express Root
Port
01:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTL8822BE
802.11a/b/g/n/ac WiFi adapter
Use the ifconfig command to view the network device name corresponding to the
RTL8822BE wireless network card
root@orangepi4-lts:~# ifconfig wlp1s0
wlp1s0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 5a:00:e3:f9:bd:bd txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 18 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
10) In this case, you can connect WIFI according to the WIFI connection test
protocol is NvMe
When purchasing, be sure to choose an M.2 NGFF SSD that supports the NVMe
protocol. The corresponding M.2 interface is of the M key type. SSDs that meet this
requirement should be able to support it. If it is an M.2 NGFF SSD of the SATA
protocol, it is not supported. Yes, you can check this link for information on the M.2
interface
https://www.delock.de/infothek/M.2/M.2_e.html
2) Then connect the SSD to the mini PCIE to NVMe M.2 NGFF riser card as shown in
the figure below, put a piece of insulating white paper in the middle to avoid short circuit
caused by direct contact between the SSD and the riser card, and fix it with a rubber band
3) Then connect the 24pin reverse cable to the mini PCIE adapter board as shown below
4) Then connect the mini PCIE to NVMe M.2 NGFF adapter card to the mini PCIE
adapter board
5) Then connect the mini PCIE adapter board to the Orange Pi 4 LTS development board
through a 24pin reverse cable
6) Power on the Orange Pi 4 LTS development board. After the system starts, enter the
lspci command in the command line terminal. If the following output information is
displayed, it means that the Kingston SSD has been recognized
root@orangepi4-lts:~# lspci
00:00.0 PCI bridge: Fuzhou Rockchip Electronics Co., Ltd RK3399 PCI Express Root
Port
01:00.0 Non-Volatile memory controller: Kingston Technology Company, Inc. Device
2262 (rev 03)
And the nvme device can also be seen in the output information of the dmesg command
root@orangepi4-lts:~# dmesg |grep nvme
[ 2.922491] nvme nvme0: pci function 0000:01:00.0
[ 2.922563] nvme 0000:01:00.0: enabling device (0000 -> 0002)
[ 2.937629] nvme nvme0: missing or invalid SUBNQN field.
[ 2.944972] nvme nvme0: 6/0/0 default/read/poll queues
/dev/nvme0 /dev/nvme0n1
7) Test the read and write rate of SSD
a. First format the SSD as ext4 format
root@orangepi4-lts:~# mkfs.ext4 /dev/nvme0n1
mke2fs 1.46.2 (28-Feb-2021)
/dev/nvme0n1 contains a ext4 file system
created on Mon Mar 21 07:34:41 2022
Proceed anyway? (y,N) y
Discarding device blocks: done
Creating filesystem with 61049646 4k blocks and 15269888 inodes
Filesystem UUID: ef089041-afa0-4ec6-acba-d32282952f80
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Note that only Debian10 and Debian11 desktop systems support this feature,
1) the GPU driver has been adapted to Debian10 and Debian11. Glmark2-es2 can be
used for testing. Glmark2-es2 is preinstalled on Debian10 and Debian11 by default
3) The effect of running glmark2-es2 is shown in the figure below. From the output log,
you can see that the GPU used is Mali-T860
4) After Debian11 turns on GPU hardware acceleration, as shown in the figure below,
when dragging with the mouse in the application list in the upper left corner, the speed
will be slower than when GPU hardware acceleration is not turned on. This is a known
issue
5) If you do not need GPU hardware acceleration, you can modify the following
configuration file to turn off GPU hardware acceleration (after turning off GPU and VPU,
both GPU and VPU cannot be used, including MPV hardware decoding and Chromium
hardware acceleration), and then restart the system, it will not work I have the above
carton problem.
root@orangepi4-lts:~# cat /etc/X11/xorg.conf.d/02-modesetting.conf
Section "Device"
Identifier "Rockchip Graphics"
Driver "modesetting"
1) The desktop version system has integrated MPV player, the player can call the rkmpp
decoding plug-in, the currently tested and supported decoding formats are H264, H265,
VP9
2) The test video file can be downloaded by opening the link below
a. The video download link in H264 format is
https://test-videos.co.uk/vids/jellyfish/mp4/h264/1080/Jellyfish_1080_10s_30MB.mp4
http://bbb3d.renderfarming.net/download.html
b. The video download link in H265 format is
https://test-videos.co.uk/vids/jellyfish/mp4/h265/1080/Jellyfish_1080_10s_30MB.mp4
c. The video download link in VP9 format is
https://test-videos.co.uk/vids/jellyfish/webm/vp9/1080/Jellyfish_1080_10s_30MB.webm
3) Copy the video file to the desktop, right click and open it with MPV player
4) The video will start to play, then open the terminal and enter the top command, you
can see the CPU usage
5) Then enter the following command in the terminal to turn on the debugging switch of
the VPU driver, and you can see the output information of the VPU driver
a. The command for Linux4.4 is as follows
root@orangepi4-lts:~# echo 0x100 > \
/sys/module/rk_vcodec/parameters/debug
b. The command for Linux5.10 is as follows
root@orangepi4-lts:~# echo 0x100 > \
/sys/module/rk_vcodec/parameters/mpp_dev_debug
6) Use the left and right arrow keys to control the video playback progress
Note that the Ubuntu system does not support this function. Currently, the
Debian11 desktop version system supports WebGL hardware acceleration and video
decoding hardware acceleration. Debian10 only supports WebGL hardware
acceleration, not video decoding hardware acceleration. This needs to be noted.
2) Then enter chrome://gpu in the address bar to view the hardware acceleration
4) Then enter the following command in the terminal to turn on the debugging switch of
the VPU driver, and you can see the printout of the VPU driver
a. The command for Linux4.4 is as follows
root@orangepi4-lts:~# echo 0x100 > \
/sys/module/rk_vcodec/parameters/debug
b. The command for Linux5.10 is as follows
root@orangepi4-lts:~# echo 0x100 > \
/sys/module/rk_vcodec/parameters/mpp_dev_debug
6) Test docker
root@orangepi:~# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
256ab8fe8778: Pull complete
Digest:
sha256:7f0a9f93b4aa3022c3a4c147a449ef11e0941a1fd0bf4a8e6c9408b2600777c5
Status: Downloaded newer image for hello-world:latest
1) Please refer to the figure below for the order of the 26 pin interface pins of the Orange
Pi 4 LTS development board
2) The functions of the 40 pin interface pins of the Orange Pi 4 LTS development board
are shown in the table below
GPIO GPIO Function Pin Pin Function GPIO GPI
O
3.3V 1 2 5V
52 GPIO1_C4 I2C8_SDA 3 4 5V
53 GPIO1_C5 I2C8_SCL 5 6 GND
150 GPIO4_C6 PWM1 7 8 I2C3_SCL GPIO4_C1 145
GND 9 10 I2C3_SDA GPIO4_C0 144
33 GPIO1_A1 GPIO1_A1 11 12 GPIO1_C2 GPIO1_C2 50
35 GPIO1_A3 GPIO1_A3 13 14 GND
92 GPIO2_D4 GPIO2_D4 15 16 GPIO1_C6 GPIO1_C6 54
3.3V 17 18 GPIO1_C7 GPIO1_C7 55
40 GPIO1_B0 SPI1_TXD 19 20 GND
39 GPIO1 SPI1_RXD 21 22 GPIO1_D0 GPIO1_D0 56
_A7
41 GPIO1_B1 SPI1_CLK 23 24 SPI1_CS GPIO1_B2 42
GND 25 26 GPIO4_C5 GPIO4_C5 149
2) Compile wiringOP
root@orangepi4-lts:~# cd wiringOP
root@orangepi4-lts:~/wiringOP# ./build clean
root@orangepi4-lts:~/wiringOP# ./build
3) The output of the test gpio readall command is as follows, in which the physical pins 1
to 26 are in one-to-one correspondence with the 26Pin pins on the development board
wiringOP has been adapted to the Orange Pi 4 LTS development board. Using
wiringOP can test the functions of GPIO, I2C, UART, and SPI
2) First set the GPIO port as output mode, where the third parameter requires the serial
number of the wPi corresponding to the input pin
root@orangepi4-lts:~/wiringOP# gpio mode 5 out
Use gpio readall to see that the mode of pin 11 has changed to out
3) Then set the GPIO port to output a low level. After setting, you can use a multimeter
to measure the voltage value of the pin. If it is 0v, it means that the low level is
successfully set.
root@orangepi4-lts:~/wiringOP# gpio write 5 0
Use gpio readall to see that the value of pin 11 (V) has become 0
4) Then set the GPIO port to output a high level. After setting, you can use a multimeter
to measure the voltage value of the pin. If it is 3.3v, it means that the high level is
successfully set.
root@orangepi4-lts:~/wiringOP# gpio write 5 1
Use gpio readall to see that the value (V) of pin 11 has changed to 1
122
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) The setting method of other pins is similar, just modify the serial number of wPi to the
corresponding serial number of the pin.
3.27.2. 26pin SPI test
1) It can be seen from the schematic diagram of 26pin that the spi available for the
development board is spi1
2) First check whether there is a device node of spidev1.x (x may be 0 or 1) in the linux
system. If it exists, it means that SPI1 has been set and can be used directly
root@orangepi4-lts:~# ls /dev/spi*
/dev/spidev1.0
4) Do not short the txd and rxd pins of SPI1 first, the output result of running spidev_test
is as follows, you can see that the data of TX and RX are inconsistent
123
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) Then short-circuit the two pins of SPI1's txd (pin 19 in the 40pin interface) and rxd
(pin 21 in the 40pin interface) and then run the output of spidev_test as follows, you can
see the sent and received the same data
root@orangepi4-lts:~/wiringOP/examples# ./spidev_test -v -D /dev/spidev1.0
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)
TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF F0 0D | ......@....▒..................▒.
RX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF F0 0D | ......@....▒..................▒.
2) After the system starts, you can see the following multiple i2c device nodes under
/dev
a. i2c3 in 26pin corresponds to /dev/i2c-3
124
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Then connect an i2c device to the i2c8 pin of the 26pin connector (the i2c3 test is the
same as the i2c8, just connect the device to the i2c3 pin, the following takes i2c8 as an
example)
i2c8 i2c3
sda pin Corresponds to pin 3 Corresponds to pin 10
sck pin Corresponds to pin 5 Corresponds to pin 8
vcc pin Corresponds to pin 1 Corresponds to pin 1
gnd pin Corresponds to pin 6 Corresponds to pin 6
5) Then use the i2cdetect -y 8 command. If the address of the connected i2c device can
be detected, it means that the i2c can be used normally
125
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) The SPI and UART4 of OragnePi 4 LTS multiplex the same pins. In dts, UART4 is
turned off and SPI1 is turned on by default. In Linux system, DT overlay can be used to
open the configuration of uart4
a. For Linux4.4 system, the method is as follows
a) A script named orangepi-add-overlay is pre-installed in the linux system.
Through this script, we can use DT overlay to dynamically modify the
configuration in dts. First write the rockchip-uart4.dts file, the content is as
follows
/dts-v1/;
/plugin/;
/{
compatible = "rockchip,rk3399";
fragment@0 {
target = <&spi1>;
__overlay__ {
status = "disabled";
};
};
fragment@1 {
target = <&uart4>;
__overlay__ {
status = "okay";
};
};
126
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
};
b) Then you can use orangepi-add-overlay to compile rockchip-uart4.dts into
rockchip-uart4.dtbo
root@orangepi:~# orangepi-add-overlay rockchip-uart4.dts
Compiling the overlay
Copying the compiled overlay file to /boot/overlay-user/
Reboot is required to apply the changes
c) Then restart the Linux system, you can see the following printing
information in the log output from the serial port, indicating that
rockchip-uart4.dtbo is loaded successfully
384 bytes read in 6 ms (62.5 KiB/s)
Applying user provided DT overlay rockchip-uart4.dtbo
d) After entering the Linux system, you can see the device node ttyS4 under
/dev
root@orangepi4-lts:~# ls /dev/ttyS*
/dev/ttyS0 /dev/ttyS4
127
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
root@orangepi4-lts:~# ls /dev/ttyS*
/dev/ttyS2 /dev/ttyS4
3) Then start to test the uart interface, first use the DuPont line to short-circuit the rx and
tx of the uart4 interface to be tested
Uart4
tx pin Corresponds to pin 19
rx pin Corresponds to pin 21
4) Then modify the serial device node name opened by the serial test program serialTest
in wiringOP to /dev/ttyS4
root@orangepi4-lts:~/wiringOP/examples# vim serialTest.c
6) Finally run serialTest, if you can see the following print, it means the serial
communication is normal
root@orangepi4-lts:~/wiringOP/examples# ./serialTest
Out: 0: -> 0
Out: 1: -> 1
Out: 2: -> 2
Out: 3: -> 3
Out: 4: -> 4
128
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Out: 5: -> 5
Out: 6: -> 6
Out: 7: -> 7
Out: 8: -> 8^C
2) After the pwm driver is loaded successfully, the pwmchip1 directory will be generated
under /sys/class/pwm/, write 0 to the export file, the pwm timer will be opened, and a
pwm0 directory will be generated. On the contrary, writing 0 to the unexport file will turn
off the pwm timer, and the pwm0 directory will be deleted. This directory has the
following files:
enable : pwmWrite 1 to enable pwm, write 0 to disable pwm
polarity : There are two parameter options, normal and inversed, indicating that the
output pin level is inverted.
duty_cycle : The unit is nanoseconds. In normal mode, it means the duration of high level.
In inversed mode, it means the duration of low level.
period : The unit is nanoseconds, indicating the duration of the pwm wave
3) Example of use: let pwm1 output a square wave with a duty cycle of 50% and a period
of 50 microseconds
root@orangepi4-lts:~#cd /sys/class/pwm/pwmchip1
root@orangepi4-lts:/sys/class/pwm/pwmchip1#echo 0 > export
root@orangepi4-lts:/sys/class/pwm/pwmchip1#
echo 50000 > pwm0/period
129
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
root@orangepi4-lts:/sys/class/pwm/pwmchip1#
echo 25000 > pwm0/duty_cycle
root@orangepi4-lts:/sys/class/pwm/pwmchip1#
echo 1 > pwm0/enable
4) On the oscilloscope, you can see that pwm1 outputs the following waveforms
1) The 0.96-inch OLED module of Orange Pi is shown in the figure below, and its 7-bit
i2c slave address is 0x3c
2) First, connect the 0.96-inch OLED module to the 26pin interface of the Orange Pi
130
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
development board through the DuPont cable. The wiring method is as follows (the
following takes i2c8 as an example, i2c3 only needs to change the scl to pin 8, and the
sda to the 8th pin. to pin 10)
OLED module pins description Development board Development board
26pin interface i2c8 26pin interface i2c3
pin pin
GND power ground pin 6 pin 6
VCC 5V pin 4 pin 4
SCL I2C clock line pin 5 pin 8
SDA I2C data line pin 3 pin 10
RST Connect to 3.3V pin 1 pin 1
DC Connect to GND pin 9 pin 9
CS Connect to GND pin 25 pin 25
3) After connecting the OLED module to the development board, first use the i2c-tools
tool to check whether the address of the OLED module can be scanned
root@orangepi4-lts:~# apt update
root@orangepi4-lts:~# apt install i2c-tools
root@orangepi4-lts:~# i2cdetect -y 8
131
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Then you can use the oled_demo in wiringOP to test the OLED module. The test
steps are as follows
root@orangepi4-lts:~# git clone https://github.com/orangepi-xunlong/wiringOP
root@orangepi4-lts:~# cd wiringOP
root@orangepi4-lts:~/wiringOP# ./build clean && ./build
root@orangepi4-lts:~/wiringOP# cd examples
root@orangepi4-lts:~/wiringOP/examples# make oled_demo
root@orangepi4-lts:~/wiringOP/examples# ./oled_demo /dev/i2c-8
---------start--------
----------end---------
5) After running oled_demo, you can see the following output on the OLED screen
132
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) The command to view the serial number of the RK3399 chip is as follows, the serial
number of each chip is different and unique, so the serial number can be used to
distinguish multiple development boards
133
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Serial : a64e6031a34aa990
Note that only the Orange Pi 4 LTS development board with the eMMC chip model can
burn the image into the eMMC. If the Orange Pi 4 LTS development board without the eMMC
chip is purchased, the image cannot be burned into the eMMC.
1) Burning the linux image to eMMC needs to be done with the help of a TF card, first
burn the linux image to the TF card, and then start the development board to enter the
linux system
134
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Then a warning will pop up, the script will erase all data on the eMMC, select <Yes>
to continue
5) Then you will be prompted to select the type of file system, which supports ext2/3/4,
f2fs and btrfs five file systems
135
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) Then it will start to format eMMC. After formatting eMMC, it will start to burn the
linux image into eMMC.
7) After burning, the following options will be prompted, you can select <Power off> to
directly shut down
136
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
8) Then pull out the TF card, and then power on again, it will start the linux system in
eMMC
Note that only Debian10 supports this function, other systems do not support it
temporarily
3.32.1. Camera connection instructions
1) OrangePi 4 LTS has two Camera ports, both ports only support OV13850 camera by
default. The two Canera interfaces can use one of the interfaces alone, or you can use the
two Camera interfaces to connect two cameras at the same time
2) The OV13850 camera kit includes an OV13850 camera, an adapter board and a cable
137
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) First insert the OV13850 camera into the adapter board, and then insert the cable into
another card slot of the adapter board
4) Then insert the other end of the cable into the Camera camera interface of the
development board. The interface can be connected to two cameras at the same time, or
one camera can be connected separately. After connecting the camera, start the Linux
system (do not plug in the camera after powering on)
5) After starting the system, execute the following commands. If the following
information appears, the camera is working normally. If there is no such information,
please check whether the camera is connected correctly.
root@orangepi4-lts:~# dmesg | grep Async
138
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
139
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
c. If no parameters are specified for this command, the default action is to preview,
which will open the camera recognized by the system. If two OV13850 cameras
are connected, camera1 (the camera interface near the headphone holder) will be
opened first.
d. Take a picture with the camera, take a picture with the command, and save it as
the file test.jpg
root@orangepi4-lts-lts:~# test_camera-gst.sh -a photo -o test.jpg
gst-launch-1.0: no process found
Setting pipeline to PAUSED ...
media get entity by name: lens is null
Pipeline is live and does not need PREROLL ...
root@orangepi4-lts:~# ls
test.jpg
3) Use the camera to record, after running the script, it will start to record a 17s video.
root@orangepi4-lts-lts:~# test_camera-gst.sh --action video --output test.ts
gst-launch-1.0: no process found
Setting pipeline to PAUSED ...
mpi: mpp version: Without VCS info
mpp_rt: NOT found ion allocator
140
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
...
root@orangepi4-lts:~# ls
test.ts
3.32.3. Dual camera usage
1) Run test_camera-dual.sh to open the dual camera
root@orangepi4-lts:~# test_camera-dual.sh
Start MIPI CSI Camera Preview!
Setting pipeline to PAUSED ...
Setting pipeline to PAUSED ...
2) The effect is as shown in the figure below, the real-time windows of the two cameras
will be opened on the desktop respectively
The Linux image on the official website supports two video outputs by default,
namely HDMI video output and TypeC-DP video output. MIPI LCD output is
disabled by default. Orange Pi 4 LTS has two MIPI interfaces, and MIPI LCD1 only
has the function of video output. MIPI LCD2 and Camera 2 are multiplexed
141
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
/{
compatible = "rockchip,rk3399";
fragment@0 {
target = <&dsi>;
__overlay__ {
status = "okay";
};
};
fragment@1 {
target = <>9xx>;
__overlay__ {
status = "okay";
};
};
};
b) Then you can use orangepi-add-overlay to compile rockchip-lcd1.dts into
rockchip-lcd1.dtbo
root@orangepi:~# orangepi-add-overlay rockchip-lcd1.dts
Compiling the overlay
Copying the compiled overlay file to /boot/overlay-user/
Reboot is required to apply the changes
c) Then restart the Linux system, you can see the following printing
142
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
information in the log output from the serial port, indicating that
rockchip-lcd1.dtbo is loaded successfully
379 bytes read in 6 ms (61.5 KiB/s)
Applying user provided DT overlay rockchip-lcd1.dtbo
d) After entering the Linux system, enter the following command to see the
relevant information of the kernel output
root@orangepi4-lts:~# dmesg |grep mipi
[ 1.478148] dw-mipi-dsi ff960000.dsi: final DSI-Link bandwidth: 444 x 4 Mbps
2) Then disconnect the power supply of the development board, and then connect the
MIPI screen by referring to the usage of the 10.1-inch MIPI screen, plug in the power
supply to start the system, and you can see the system interface on the screen
143
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
/{
compatible = "rockchip,rk3399";
fragment@0 {
target = <&dsi1>;
144
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
__overlay__ {
status = "okay";
};
};
fragment@1 {
target = <>9xx_1>;
__overlay__ {
status = "okay";
};
};
fragment@2 {
target = <&rkisp1_1>;
__overlay__ {
status = "disabled";
};
};
fragment@3 {
target = <&isp1_mmu>;
__overlay__ {
status = "disabled";
};
};
fragment@4 {
target = <&mipi_dphy_tx1rx1>;
__overlay__ {
status = "disabled";
};
};
fragment@5 {
target = <&ov13850_1>;
__overlay__ {
status = "disabled";
};
};
fragment@6 {
target = <&cdn_dp>;
145
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
__overlay__ {
status = "disabled";
};
};
fragment@7 {
target = <&hdmi>;
__overlay__ {
status = "disabled";
};
};
};
b) Then you can use orangepi-add-overlay to compile rockchip-lcd2.dts into
rockchip-lcd2.dtbo
root@orangepi:~# orangepi-add-overlay rockchip-lcd2.dts
Compiling the overlay
Copying the compiled overlay file to /boot/overlay-user/
Reboot is required to apply the changes
c) Then restart the Linux system, you can see the following printing
information in the log output by the serial port, indicating that
rockchip-lcd2.dtbo is loaded successfully
1135 bytes read in 6 ms (184.6 KiB/s)
Applying user provided DT overlay rockchip-lcd2.dtbo
d) After entering the Linux system, enter the following command to see the
relevant information of the kernel output
root@orangepi4-lts:~# dmesg |grep mipi
root@orangepi4-lts:~# dmesg |grep mipi
[ 2.714240] dw-mipi-dsi ff960000.dsi: final DSI-Link bandwidth: 444 x 4 Mbps
[ 3.104433] dw-mipi-dsi ff968000.dsi: final DSI-Link bandwidth: 444 x 4 Mbps
146
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
overlay_prefix=rockchip
fdtfile=rockchip/rk3399-orangepi-4-lts.dtb
rootdev=UUID=c51e6614-42cf-473c-9134-46a72667eb9c
rootfstype=ext4
overlays=lcd1 lcd2
b) Then restart the system. When starting up, you can see the following
printing information in the startup log of u-boot, indicating that the
configurations of lcd1 and lcd2 are loaded successfully
379 bytes read in 9 ms (41 KiB/s)
Applying kernel provided DT overlay rockchip-lcd1.dtbo
626 bytes read in 9 ms (67.4 KiB/s)
Applying kernel provided DT overlay rockchip-lcd2.dtbo
c) After entering the Linux system, enter the following command to see the
relevant information of the kernel output
root@orangepi4-lts:~# dmesg |grep mipi
[ 8.124926] dw-mipi-dsi-rockchip ff960000.dsi:
[drm:dw_mipi_dsi_bridge_mode_set] final DSI-Link bandwidth: 444 x 4 Mbps
[ 8.168243] dw-mipi-dsi-rockchip ff968000.dsi:
[drm:dw_mipi_dsi_bridge_mode_set] final DSI-Link bandwidth: 444 x 4 Mbps
2) Then disconnect the power supply of the development board, and then connect the
MIPI screen by referring to the usage of the 10.1-inch MIPI screen, plug in the power
supply to start the system, if two 10.1-inch screens are connected at the same time, you
can see the system on the two 10.1-inch screens interface
147
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) The Linux image on the official website supports HDMI output and TypeC-DP output
by default. You can use the following commands to set dual-screen simultaneous display
root@orangepi4-lts:~#
su orangepi -c "DISPLAY=:0 xrandr --output HDMI-1 --same-as DP-1"
2) If you use MIPI LCD output and connect two 10.1-inch MIPI screens, you can use the
following commands to set up, if the system restarts after setting, please confirm
whether the power supply is sufficient
root@orangepi4-lts:~#
su orangepi -c "DISPLAY=:0 xrandr --output DSI-1 --same-as DSI-2"
1) The orange pi DS1307 RTC clock module is shown in the figure below. It uses the
148
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
i2c interface to communicate with the development board, and the i2c device address is
0x68. The RTC module is not equipped with a battery by default, and a button battery
needs to be prepared before use
2) First, connect the RTC module to the 40pin of the development board. The wiring
method is as follows
Pins of the RTC module The corresponding pin of the development
board 26pin
5V pin 2
GND Pin 6
SDA Pin 3
SCL Pin 5
3) After connecting the RTC module, first use the i2cdetect command to check whether
the device address of the RTC module can be detected
root@orangepi:~# apt update
root@orangepi:~# apt -y install i2c-tools
root@orangepi:~# i2cdetect -y 8
4) Because the kernel has opened the ds1037 driver by default, the function can be
149
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
tested directly. Execute the following command to add an rtc device and view the
generated rtc device, where rtc0 is the onboard rtc and rtc1 is the newly added external rtc
root@orangepi:~# echo "ds1307 0x68" > /sys/class/i2c-adapter/i2c-8/new_device
root@orangepi:~# ls /dev/rtc*
/dev/rtc /dev/rtc0 /dev/rtc1
5) When the linux system starts, if the development board is connected to the network,
the linux system will automatically synchronize the system time to the correct time
through the network. The default time of the linux system is UTC. In China, the time
zone needs to be changed to Asia/Shanghai. The time obtained by using the data
command is correct, the method is as follows
a. Execute the following command
root@orangepi:~# dpkg-reconfigure tzdata
b. Then select the geographic area as Asia
150
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
d. After the configuration is completed, use the date command to view the time and
it will be normal
root@orangepi:~# date
6) If the current time of the system is incorrect, please connect to the network first, and
then use the following command to synchronize the time. The reason why the system
time is set correctly is to prepare for the synchronization of the time of the RTC module
later.
root@orangepi:~# apt -y update
root@orangepi:~# apt install ntpdate
root@orangepi:~# ntpdate 0.cn.pool.ntp.org
7) The command to view the current time of the RTC module is as follows, because the
rtc specified by hwclock by default is the rtc0 device, so you need to use the -f option to
specify the rtc1 device
root@orangepi:~# hwclock -r -f /dev/rtc1
8) The time read by the RTC module for the first time is definitely wrong. The current
time of the system can be synchronized to the RTC module through the following
command. Before synchronization, it is necessary to ensure that the current time of the
system is correct
root@orangepi:~# date #First make sure the current system time is
correct
root@orangepi:~# hwclock -w -f /dev/rtc1 #Then write the system time to the RTC
module
root@orangepi:~# hwclock -r -f /dev/rtc1 #Finally read the time of the RTC module to
151
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
9) If it is confirmed that the time in the RTC module is correct, then you can unplug the
power supply, then power it on, and execute the following command to synchronize the
time in the RTC module to the system
root@orangepi:~#
echo "ds1307 0x68" > /sys/class/i2c-adapter/i2c-8/new_device #add rtc device
root@orangepi:~# hwclock -s -f /dev/rtc1 #Then synchronize the RTC module
time to the system
root@orangepi:~# date #Finally, use the date command to check
whether the system time is correct
10) The above operation is to manually synchronize the time of the RTC module to the
system. If you need to automatically synchronize the system time at startup, you need to
set the startup script as follows to automatically synchronize the system time
a. Create the rc-local.service file
root@orangepi:~# sudo vi /etc/systemd/system/rc-local.service
Copy the following content into the rc-local.service file
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99
[Install]
WantedBy=multi-user.target
b. Create the rc.local file
root@orangepi:~# sudo vi /etc/rc.local
Copy the following content into the rc-local.service file
152
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
c. Add permissions to rc.local
root@orangepi:~# sudo chmod +x /etc/rc.local
d. Enable service
root@orangepi:~# sudo systemctl enable rc-local
e. Start the service and check the status
root@orangepi:~# sudo systemctl start rc-local.service
root@orangepi:~# sudo systemctl status rc-local.service
11) At this point, you can disconnect all network connections of the development board,
wait for a few minutes, restart the system, and then check the system time to find that
even if there is no network, the system time is correct
1) During the operation of the Linux system, if the power is directly unplugged, some
data may be lost in the file system. It is recommended to use the poweroff command to
shut down the Linux system of the development board before power off, and then unplug
the power.
153
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
root@orangepi:~# poweroff
2) After turning off the development board, you need to re-plug the power supply to
turn it on
3) Use the reboot command to restart the Linux system on the development board
root@orangepi:~# reboot
4) You can also short press the power button on the development board to reset
2) Debian Bullseye is installed with gcc compilation toolchain by default, which can
directly compile C language programs in the Linux system of the development board
a. The version of a.gcc is shown below
root@orangepi:~# gcc --version
gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
154
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE..
b. Write the hello_world.c program in C language
root@orangepi:~# cat hello_world.c
#include <stdio.h>
int main(void)
{
printf("Hello World!\n");
return 0;
}
c. Then compile and run hello_world.c
root@orangepi:~# gcc -o hello_world hello_world.c
root@orangepi:~# ./hello_world
Hello World!
4) Debian Bullseye does not install Java compilation tools and runtime environment by
default
a. You can install openjdk with the following command, the default version in
155
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
156
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Function status
HDMI video OK
HDMI audio OK
USB2.0 x 2 OK
USB3.0 x 1 OK
TypeC USB3.0 OK
TF card boot OK
EMMC start OK
network card OK
WIFI OK
Bluetooth OK
Bluetooth earphone OK
headphone recording OK
Headphone playback OK
microphone recording OK
LED lights OK
Temperature Sensor OK
USB camera OK
GPU OK
Video codec OK
Reset button OK
upgrade key OK
ADB debugging OK
OV13850 camera OK
157
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) First, you need to use the Type-C data cable to connect the development board to the
USB interface of the computer (please use the DC power supply to power the
development board at the same time)
158
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) Then you can log in to the android system through adb shell on the Ubuntu PC
test@test:~$ adb shell
rk3399_mid:/ $
6) If you need to change the Android system files, you need to close the security
verification, execute the following command
test@test:~$ adb root
test@test:~$ adb disable-verity
1) Make sure that the service.adb.tcp.port of the Android system is set to the port
number 5555
159
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) If service.adb.tcp.port is not set, you can use the following command to set the port
number of network adb
rk3399_mid:/ # setprop service.adb.tcp.port 5555
rk3399_mid:/ # stop adbd
rk3399_mid:/ # start adbd
5) Then you can log in to the android system through adb shell on the Ubuntu PC
test@test:~$ adb shell
rk3399_mid:/ #
1) OrangePi 4 LTS has two Camera ports and both support OV13850 camera. The two
Canera interfaces can use one of the interfaces alone, or you can use the two Camera
interfaces to connect two cameras at the same time. After connecting two cameras, one is
front and one is rear
160
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) The OV13850 camera kit includes an OV13850 camera, an adapter board, and a
ribbon cable
3) First insert the OV13850 camera into the adapter board, and then insert the cable into
another slot on the adapter board
161
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Then insert the other end of the cable into the Camera camera interface of the
development board. The interface can be connected to two cameras at the same time, or
one camera can be connected separately. After connecting the camera, start the Android
system (do not plug in the camera after power on)
5) After the Android system is started, open the camera APP and you can see the output
of the OV13850 camera. The location of the camera APP is shown in the following
figure:
162
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) If burning a image with the word "LCD", the display interface is as shown in the
163
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
figure below.
1)You need to prepare a Type-C to HDMI cable, and connect the development board to
an HDMI display or TV through the Type-C interface for display
Please burn the Android firmware with the word "LCD" on the official website
that supports 10.1-inch MIPI screen.
1) 10.1 inch MIPI screen delivery list, including a touch screen, a MIPI LCD screen, a
31pin to 40pin cable, a 12pin touch screen cable, a 30pin MIPI cable, and a transfer board
164
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) Connect the 12pin touch screen cable and 30pin MIPI cable to the adapter board as
shown in the figure below. Note that the 12pin touch screen cable direction is the blue bar
facing down.
165
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) With the touch screen facing down, stack the MIPI LCD screen on the touch screen
as shown below
4) Place the connected adapter board on the MIPI LCD screen as shown in the figure
below
5) Then connect the MIPI LCD screen and the adapter board through the 31pin to 40pin
166
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
cable
6) Then connect the touch screen and the adapter board through the 12pin touch screen
cable
7) Connect the adapter board to the LCD1 interface of the Orange Pi 4 LTS through a
30pin MIPI cable
8) Then insert the DC power supply into the development board. After the system is
started, the interface is as shown in the figure below.
167
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) First insert the USB camera into the USB interface of the development board. If the
USB camera is recognized normally, the corresponding video device node will be
generated under /dev
rk3399_mid:/ $ ls /dev/video*
/dev/video0
rk3399_mid:/ $ ls /sys/class/video4linux/ -lh
total 0
lrwxrwxrwx 1 root root 0 2020-09-30 03:29 video0 \
-> ../../devices/platform/usb@fe900000/fe900000.d0
2) Then make sure the adb connection between the Ubuntu PC and the development
board is normal
3) Download the USB camera test APP in the official tool on the data download page of
Orange Pi 4 LTS
168
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Then use the adb command to install the USB camera test APP to the Android system,
of course, you can also use the U disk copy method to install
test@test:~$ adb install usbcamera.apk
5) After installation, you can see the startup icon of the USB camera in the Android App
list
6) Then double-click to open the USB camera APP to see the output video of the USB
camera
169
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) Connect the 24pin reverse cable to the mini-PCIE adapter board as shown in the
figure below. Note that the blue bar of the cable is facing outward.
3) Connect the mini-PCIE adapter board to the 24pin interface of the Orange Pi 4 LTS
development board
170
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Connect the ASM1062 mini-PCIE to SATA module to the mini-PCIE adapter board
5) Connect the hard disk to the interface of the mini-PCIE to SATA module through a
SATA cable
171
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) Connect the power cable of the SATA adapter cable to the 5V power supply. After the
connection is completed, the development board is connected to the DC power supply
and powered on. ASM1062 mini-PCIE to SATA module LED light flashes, indicating
that the connection is successful
This function does not support hot swapping and must be connected before
powering on
172
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
7) Power on and start the development board. After the system is started, open the file
manager app
8) After opening, the file manager interface is as shown below, and then click the
position of the red box in the upper left corner
9) At this point, you can see that the 500G hard disk is recognized
173
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
174
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) The Linux SDK, the Ubuntu_21.04 branch of orangepi-build, only supports running
on a computer with Ubuntu21.04 installed, so before downloading orangepi-build, please
make sure that the Ubuntu version installed on your computer is Ubuntu21.04. The
command to check the Ubuntu version installed on the computer is as follows. If the
Release field shows other than 21.04, it means that the current Ubuntu version does not
meet the requirements. Please change the system before performing the following
operations.
test@test:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 21.04
Release: 21.04
Codename: hirsute
test@test:~$
2) If the Windows system is installed on the computer and there is no computer with
Ubuntu 21.04 installed, you can consider using VirtualBox or VMware to install an
Ubuntu21.04 virtual machine in the Windows system. But please note, do not compile
orangepi-build on the WSL virtual machine, because orangepi-build has not been tested
in the WSL virtual machine, so it cannot be guaranteed that orangepi-build can be used
normally in WSL, and please do not use the Linux system of the development board.
using orangepi-build in
Note that Orange Pi 4 LTS must use the source code of the next branch of
orangepi-build, and the source code of the main branch is not adapted to Orange Pi
4 LTS.
175
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) The linux sdk actually refers to the code of orangepi-build. Orangepi-build is modified
based on the armbian build compilation system. Using orangepi-build, multiple versions
of linux images can be compiled. First download the code of orangepi-build. Currently,
the RK3399 series development boards in the Linux SDK already support the legacy
branch and the current branch.
test@test:~$ sudo apt update
test@test:~$ sudo apt install git
test@test:~$ git clone https://github.com/orangepi-xunlong/orangepi-build.git -b
Ubuntu21.04
Note that Orange Pi 4 LTS must use the source code of the next branch of
orangepi-build. The above git clone command specifies that the branch of the
orangepi-build source code is next. The source code of the main branch is not
adapted to Orange Pi 4 LTS.
Downloading the code of orangepi-build through the git clone command does
not require entering the username and password of the github account (the same is
true for downloading other codes in this manual). If the Ubuntu PC prompts the
user who needs to enter the github account after entering the git clone command
The name and password are usually the wrong address of the orangepi-build
176
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
repository behind git clone. Please check the spelling of the command carefully,
instead of thinking that we forgot to provide the username and password of the
github account here.
2) The u-boot and linux kernel versions currently used by the RK3399 series
development boards are as follows
branch u-boot version linux kernel version
legacy u-boot 2020.10 linux4.4
current u-boot 2020.10 linux5.10
3) Orangepi-build will contain the following files and folders after downloading
a. build.sh: Compile startup script
b. external: Contains configuration files, specific scripts and source code of some
programs needed to compile the image, etc.
c. LICENSE: GPL 2 license file
d. README.md: orangepi-build documentation
e. scripts: Generic script for compiling linux images
test@test:~/orangepi-build$ ls
build.sh external LICENSE README.md scripts
177
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) The image website of the cross-compilation tool chain in China is the open source
software mirror site of Tsinghua University
https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/
4) The cross-compilation toolchain used to compile the RK3399 Linux kernel source
code is
a. linux4.4
gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu
b. linux5.10
178
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu
5) The cross-compilation toolchain used to compile RK3399 u-boot source code is
a. v2020.10
gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu
If you are not familiar with orangepi-build and do not know the detailed process
of compiling the linux kernel and u-boot, please do not download and use the above
linux kernel and u-boot source code for compilation operation, because the
compilation script and configuration file of orangepi-build Some adjustments and
optimizations will be made to u-boot and linux. If you do not use orangepi-build to
compile u-boot and linux, you may encounter problems of compilation failure or
failure to start.
2) When orangepi-build runs for the first time, it will download the cross-compilation
toolchain, u-boot and linux kernel source code. After successfully compiling a linux
image, the files and folders that can be seen in orangepi-build are:
c. build.sh: Compile startup script
d. external: Contains configuration files, scripts for specific functions and source
code of some programs needed to compile the image. The rootfs compressed
package cached in the process of compiling the image is also stored in external
179
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
e. kernel: Store the source code of the linux kernel, the folder named
orange-pi-4.4-rockchip64 stores the kernel source code of the legacy branch of
the RK3399 series development board, and the folder named
orange-pi-5.10-rk3399 stores the The kernel source code of the current branch of
the RK3399 series development board (if only the linux image of the legacy
branch is compiled, then only the kernel source code of the legacy branch can be
seen; if only the linux image of the current branch is compiled, then only the
current branch can be seen. Kernel source code), please do not manually modify
the name of the folder of the kernel source code. If modified, the compilation
system will re-download the kernel source code when running.
f. LICENSE: GPL 2 license file
g. README.md: orangepi-build documentation
h. output: Store the compiled u-boot, linux and other deb packages, compilation
logs, and compiled images and other files
i. scripts: Generic script for compiling linux images
j. toolchains: Store the cross-compilation toolchain
k. u-boot: The source code of u-boot is stored. The folder named
v2020.10-rockchip64 stores the u-boot source code of the current branch and
legacy branch of the RK3399 series development board. Please do not manually
modify the name of the folder of the u-boot source code. If it is modified, the
u-boot source code will be re-downloaded when the compilation system is
running.
l. userpatches: Store the configuration files needed to compile the script
test@test:~/orangepi-build$ ls
build.sh external kernel LICENSE output README.md scripts
toolchains u-boot userpatches
180
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) Then it will start to compile u-boot, and some of the information prompted during
compilation are as follows
a. u-boot source code version
[ o.k. ] Compiling u-boot [ v2020.10 ]
b. The version of the cross-compile toolchain
[ o.k. ] Compiler version [ aarch64-none-linux-gnu-gcc 9.2.1 ]
c. The path to the generated u-boot deb package
[ o.k. ] Target directory [ orangepi-build/output/debs/u-boot ]
d. The package name of the u-boot deb package generated by compilation
[ o.k. ] File name [ linux-u-boot-current-orangepi4-lts_3.0.0_arm64.deb ]
e. Compilation time used
[ o.k. ] Runtime [ 1 min ]
f. Repeat the command to compile u-boot, use the following command to start
compiling u-boot directly without selecting through the graphical interface
[ o.k. ] Repeat Build Options [ sudo ./build.sh BOARD=orangepi4-lts
181
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
7) The files contained in the generated u-boot deb package are as follows
a. Use the following command to decompress the deb package
test@test:~/orangepi-build$ cd output/debs/u-boot
test@test:~/orangepi_build/output/debs/u-boot$ $ dpkg -x \
linux-u-boot-current-orangepi4-lts_3.0.0_arm64.deb . (Note that there is a "." at
the end of the command)
test@test:~/orangepi_build/output/debs/u-boot$ ls
linux-u-boot-current-orangepi4-lts_3.0.0_arm64.deb usr
b. The decompressed file is as follows
test@test:~/orangepi-build/output/debs/u-boot$ tree usr
usr
└── lib
├── linux-u-boot-current-orangepi4-lts_3.0.0_arm64
│ ├── idbloader.bin
│ ├── trust.bin
│ └── uboot.img
└── u-boot
├── LICENSE
├── orangepi-4-rk3399_defconfig
└── platform_install.sh
3 directories, 6 files
8) When the orangepi-bulid compilation system compiles the u-boot source code, it first
synchronizes the u-boot source code with the u-boot source code of the github server, so
if you want to modify the u-boot source code, you need to turn off the download and
update function of the source code (required This function can only be turned off after
u-boot is fully compiled once, otherwise it will prompt that the source code of u-boot
cannot be found), otherwise the modifications will be restored, the method is as follows
182
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
9) When debugging the u-boot code, you can use the following method to update the
u-boot in the linux image for testing
a. Upload the compiled u-boot deb package to the linux system of the development
board
test@test:~/orangepi-build$ cd output/debs/u-boot
test@test:~/orangepi_build/output/debs/u-boot$ scp \
linux-u-boot-current-orangepi4-lts_3.0.0_arm64.deb [email protected]:/root
b. Then log in to the development board and uninstall the installed deb package of
u-boot
root@orangepi:~# apt purge -y linux-u-boot-orangepi4-lts-current
c. Install the new u-boot deb package just uploaded
root@orangepi:~# dpkg -i linux-u-boot-current-orangepi4-lts_3.0.0_arm64.deb
d. Then run the nand-sata-install script
root@orangepi:~# nand-sata-install
e. then select 5 Install/Update the bootloader on SD/eMMC
183
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
g. Press the Enter key again to start updating u-boot. After the update, the following
information will be displayed
h. Then you can restart the development board to test whether the modification of
u-boot takes effect
184
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) Then the kernel configuration interface opened by make menuconfig will pop up. At
this time, you can directly modify the kernel configuration. If you do not need to modify
the kernel configuration, you can simply exit. After exiting, the kernel source code will be
compiled.
185
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
a. If you do not need to modify the configuration options of the kernel, when
running the build.sh script, pass in KERNEL_CONFIGURE=no to temporarily shield
the configuration interface of the pop-up kernel
test@test:~/orangepi-build$ sudo ./build.sh KERNEL_CONFIGURE=no
b. You can also set KERNEL_CONFIGURE=no in the
orangepi-build/userpatches/config-default.conf configuration file to permanently disable
this feature
c. If the following error is displayed when compiling the kernel, this is because the
terminal interface of the Ubuntu PC is too small, so the interface of make menuconfig
cannot be displayed. Please adjust the terminal of the Ubuntu PC to the maximum, and
then re-run the build.sh script
186
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) Part of the information prompted when compiling the kernel source code is explained
as follows
a. The version of the linux kernel source code
[ o.k. ] Compiling current kernel [ 5.10.43 ]
b. The version of the cross-compilation toolchain used
[ o.k. ] Compiler version [ aarch64-none-linux-gnu-gcc 9.2.1 ]
c. The configuration file used by the kernel by default and the path where it is
stored
[ o.k. ] Using kernel config file [ config/kernel/linux-5.10-rk3399.config ]
d. If KERNEL_CONFIGURE=yes, the final configuration file .config used by the
kernel will be copied to output/config. If the kernel configuration is not
modified, the final configuration file is the same as the default configuration file
[ o.k. ] Exporting new kernel config [ output/config/linux-5.10-rk3399.config ]
e. The path to the generated kernel-related deb package
[ o.k. ] Target directory [ output/debs/ ]
f. The package name of the kernel image deb package generated by compilation
[ o.k. ] File name [ linux-image-current-rk3399_3.0.0_arm64.deb ]
g. Compilation time used
[ o.k. ] Runtime [ 5 min ]
h. Finally, the compilation command to repeat the compilation of the last selected
kernel will be displayed. Use the following command to directly start compiling
the kernel source code without selecting through the graphical interface.
[ o.k. ] Repeat Build Options [ sudo ./build.sh BOARD=orangepi4-lts
BRANCH=current BUILD_OPT=kernel KERNEL_CONFIGURE=yes ]
187
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
8) The files contained in the generated linux-image deb package are as follows
a. Use the following command to decompress the deb package
test@test:~/orangepi-build$ cd output/debs
test@test:~/orangepi_build/output/debs$ mkdir test
test@test:~/orangepi_build/output/debs$ cp \
linux-image-current-rk3399_3.0.0_arm64.deb test/
test@test:~/orangepi_build/output/debs$ cd test
test@test:~/orangepi_build/output/debs/test$ dpkg -x \
linux-image-current-rk3399_3.0.0_arm64.deb .
test@test:~/orangepi_build/output/debs/test$ ls
boot etc lib linux-image-current-rk3399_3.0.0_arm64.deb usr
b. The decompressed file is as follows
test@test:~/orangepi-build/output/debs/test$ tree -L 2
.
├── boot
│ ├── config-5.10.43 //The configuration file used to
compile the kernel source code
│ ├── System.map-5.10.43
│ └── vmlinuz-5.10.43 //Compile the generated kernel image file
├── etc
│ └── kernel
├── lib
│ └── modules //Compile the generated kernel module
├── linux-image-current-rk3399_3.0.0_arm64.deb
188
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
└── usr
├── lib
└── share
8 directories, 4 files
9) The orangepi-bulid compilation system will first synchronize the linux kernel source
code with the linux kernel source code of the github server when compiling the linux
kernel source code, so if you want to modify the linux kernel source code, you first need
to turn off the update function of the source code (you need to compile it once This
function can only be turned off after the linux kernel source code, otherwise it will
prompt that the source code of the linux kernel cannot be found), otherwise the
modification will be restored, the method is as follows:
Set the IGNORE_UPDATES variable in userpatches/config-default.conf to "yes"
test@test:~/orangepi-build$ vim userpatches/config-default.conf
IGNORE_UPDATES="yes"
10) If the kernel is modified, the following methods can be used to update the kernel and
kernel modules of the development board linux system
a. Upload the compiled deb package of the linux kernel to the linux system of the
development board
test@test:~/orangepi-build$ cd output/debs
test@test:~/orangepi-build/output/debs$ scp \
linux-image-current-rk3399_3.0.0_arm64.deb [email protected]:/root
b. Then log in to the development board and uninstall the deb package of the
installed linux kernel
root@orangepi:~# apt purge -y linux-image-current-rk3399
c. Install the deb package of the new linux kernel just uploaded
root@orangepi:~# dpkg -i linux-image-current-rk3399_3.0.0_arm64.deb
d. Then restart the development board, and then check whether the kernel-related
modifications have taken effect
189
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
190
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
7) If you are compiling the image of the server version, you can also choose to compile
the Standard version or the Minimal version. The software pre-installed in the Minimal
version will be much less than the Standard version.
8) If you are compiling the desktop version of the image, you also need to select the type
of desktop environment, but only XFCE is currently supported, so just press Enter.
9) You can then select additional packages that need to be installed. For example, if you
need to install a browser, you can choose browsers. Which packages are included in each
selection can be seen in the code of orangepi-build, you can also modify these
configurations to add the packages you want to install
1. First enter external/config/desktop to see the desktop configuration folders of
different linux distributions. Note that not all the Orange Pi development boards that can
be seen in the code are supported and tested.
test@test:~/orangepi-build$ cd external/config/desktop
test@test:~/orangepi-build/external/config/desktop$ ls
bionic bookworm bullseye buster focal jammy README.md sid
2. Then select the type of distribution you want to view or modify, and enter the
191
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4. Open the packages file under different groups to view the software contained in the
group
test@test:~/orangepi-build/external/config/desktop/bullseye/appgroups$ cat
programming/packages
geany
thonny
test@test:~/orangepi-build/external/config/desktop/bullseye/appgroups$ cat
office/packages
ibreoffice
5. Except for the browser, the Linux image released by Orange Pi does not choose to
install other software packages here. This is mainly to reduce the size of the Linux
image.
192
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
10) Then the rootfs will be compiled, and some of the information prompted during
compilation are as follows
a. type of rootfs
[ o.k. ] local not found [ Creating new rootfs cache for bullseye ]
b. The storage path of the rootfs compressed package generated by compilation
[ o.k. ] Target directory [ external/cache/rootfs ]
c. The name of the rootfs compressed package generated by compilation
[ o.k. ] File name
[ bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4 ]
d. Compilation time
[ o.k. ] Runtime [ 13 min ]
e. Repeat the command to compile rootfs, use the following command to start
compiling rootfs directly without selecting through the graphical interface
[ o.k. ] Repeat Build Options [ sudo ./build.sh BOARD=orangepi4-lts
BRANCH=current BUILD_OPT=rootfs RELEASE=bullseye
BUILD_MINIMAL=no BUILD_DESKTOP=no
KERNEL_CONFIGURE=yes ]
193
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.current
bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.list
12) If the required rootfs already exists under external/cache/rootfs, then compiling the
rootfs again will skip the compilation process and will not restart the compilation. When
compiling the image, it will also go to external/cache/rootfs to find out whether it has
There is a rootfs available for cache, if there is one, use it directly, which can save a lot of
download and compilation time
13) Since it takes a long time to compile rootfs, if you do not want to compile rootfs
from scratch, or there is a problem with the process of compiling rootfs, you can directly
download the rootfs compressed package cached by Orange Pi. The download link of the
rootfs compressed package Baidu cloud disk is as follows, download A good rootfs
compressed package needs to be placed in the external/cache/rootfs directory of
orangepi-build to be used normally by the compiled script
Link:https://pan.baidu.com/s/1vWQmCmSYdH7iCDFyKpJtVw
password:zero
194
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
195
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
7) If you are compiling the image of the server version, you can also choose to compile
the Standard version or the Minimal version. The software pre-installed in the Minimal
version will be much less than the Standard version.
8) If you are compiling the desktop version of the image, you also need to select the type
of desktop environment, but only XFCE is currently supported, so just press Enter.
9) You can then select additional packages that need to be installed. For example, if you
need to install a browser, you can choose browsers. Which packages are included in each
selection can be seen in the code of orangepi-build, you can also modify these
configurations to add the packages you want to install
1. First enter external/config/desktop to see the desktop configuration folders of
different linux distributions. Note that not all the Orange Pi development boards that can
be seen in the code are supported and tested.
test@test:~/orangepi-build$ cd external/config/desktop
test@test:~/orangepi-build/external/config/desktop$ ls
bionic bookworm bullseye buster focal jammy README.md sid
2. Then select the type of distribution you want to view or modify, and enter the
corresponding directory, such as bullseys
196
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
test@test:~/orangepi-build/external/config/desktop$ cd bullseye
test@test:~/orangepi-build/external/config/desktop/bullseye$ ls
appgroups environments
4. Open the packages file under different groups to view the software contained in the
group
test@test:~/orangepi-build/external/config/desktop/bullseye/appgroups$ cat
programming/packages
geany
thonny
test@test:~/orangepi-build/external/config/desktop/bullseye/appgroups$ cat
office/packages
ibreoffice
5. Except for the browser, the Linux image released by Orange Pi does not choose to
install other software packages here. This is mainly to reduce the size of the Linux
image.
197
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
10) Then the linux image will be compiled. The general process of compilation is as
follows
a. Initialize the compilation environment of the Ubuntu PC and install the software
packages required for the compilation process
b. Download the source code of u-boot and linux kernel (if cached, only update the
code)
c. Compile u-boot source code and generate u-boot deb package
d. Compile the linux source code to generate linux-related deb packages
e. Make a deb package of linux firmware
f. Make the deb package of the orangepi-config tool
g. Make board-level supported deb packages
h. If you are compiling the desktop version of the image, you will also create a
desktop-related deb package
i. Check whether the rootfs has been cached, if there is no cache, then recreate the
rootfs, if it has been cached, directly decompress and use
j. Install the deb package generated earlier into rootfs
k. Make some specific settings for different development boards and different types
of images, such as pre-installing additional software packages, modifying system
configuration, etc.
l. Then make an image file and format the partition, the default type is ext4
m. Copy the configured rootfs to the mirrored partition
n. then update initramfs
o. Finally, write the bin file of u-boot into the image through the dd command
11) After compiling the image, the following information will be prompted
a. The storage path of the compiled image
[ o.k. ] Done building
[ output/images/Orangepi4-lts_3.0.0_debian_bullseye_desktop_xfce_linux5.10.43/Or
angepi4-lts_3.0.0_debian_bullseye_desktop_xfce_linux5.10.43.img ]
b. Compilation time used
[ o.k. ] Runtime [ 19 min ]
c. Repeat the command to compile the image, use the following command to start
compiling the image directly without selecting through the graphical interface
[ o.k. ] Repeat Build Options [ sudo ./build.sh BOARD=orangepi4-lts
BRANCH=current BUILD_OPT=image RELEASE=bullseye
198
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
199
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) First download the Android SDK's sub-volume compressed package from the Google
disk
2) After downloading the compressed package of Android SDK, please check whether
the MD5 checksum is correct. If it is not correct, please download the source code again.
test@test:~$ md5sum -c RK3399-Android8.1.tar.gz.md5sum
RK3399-Android8.1.tar.gz00: OK
RK3399-Android8.1.tar.gz01: OK
RK3399-Android8.1.tar.gz02: OK
RK3399-Android8.1.tar.gz03: OK
3) Then you need to combine multiple compressed files into one, and then decompress
test@test:~$ cat RK3399-Android8.1.tar.gz* > RK3399-Android8.1.tar.gz
test@test:~$ tar xvf RK3399-Android8.1.tar.gz
200
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) Install JDK
test@test:~$ sudo add-apt-repository ppa:openjdk-r/ppa
test@test:~$ sudo apt-get update
test@test:~$ sudo apt-get install openjdk-8-jdk
201
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
out:trust.img
merge success(trust.img)
load addr is 0x200000!
pack input u-boot.bin
pack file size: 682652
crc = 0xc21153c6
pack uboot.img success!
202
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) After the compilation is completed, the generated image file will be placed under
rockdev/Image-rk3399_mid/. Where update.img is the Android firmware that can be
burned and run
test@test:~/RK3399-Android8.1$ cd rockdev/Image-rk3399_mid/
test@test:~/RK3399-Android8.1$ ls update*
update.img
203