Orange Pi PC Plus User Manual - v3.2
Orange Pi PC Plus User Manual - v3.2
Content
1. Basic features of Orange Pi PC Plus................................................................................5
1.1. What’s Orange Pi PC Plus?....................................................................................................5
2.2. Download the image and related information of the development board............................12
2.3. Use the Android image pre-installed in eMMC to test the functions of the development
board............................................................................................................................................13
www.orangepi.cn 1 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
3.7. The first time the Linux5.4 system starts to automatically expand rootfs........................... 38
www.orangepi.cn 2 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
www.orangepi.cn 3 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
4.5.2. How to enable the USB debugging option in Android7.0................................... 110
4.5.3. Use data cable to connect adb for debugging.......................................................111
4.5.4. Use network connection adb debugging.............................................................. 112
4.6. How to use USB camera.................................................................................................... 113
www.orangepi.cn 4 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
A computer
A wireless network server
Games
Music player
HD video player
Speaker
Android
The Orange Pi development board is not only a consumer product, but also designed
for anyone who wants to use technology to create and innovate. It is a very simple,
interesting and practical tool, you can use it to create the world around you
www.orangepi.cn 5 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
Interface Definition
www.orangepi.cn 6 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
Top View:
Bottom View:
www.orangepi.cn 7 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
www.orangepi.cn 8 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
3) Standard HDMI to HDMI cable, used to connect the development board to an HDMI
monitor or TV for display
4) Power adapter, at least 5V/2A high-quality power adapter, note that the OTG interface
of the development board cannot be used as a power input
www.orangepi.cn 9 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
5) 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
7) 100M or Gigabit network cable, used to connect the development board to the Internet
8) GC2035 or OV5640 camera kit, which can be connected to the CSI interface of the
development board to display video images
www.orangepi.cn 10 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
9) Micro USB interface data cable, when using the ADB debugging function of the
Android system, you need to connect the development board to the computer through the
Micro USB interface data cable
10) AV video cable, if you want to display video through the CVBS interface instead of
the HDMI interface, then you need to connect the development board to the TV through
the AV video cable
11) 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 the computer
www.orangepi.cn 11 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
www.orangepi.cn 12 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
will assist in solving various problems. This is also a fastest solution way to the
problem.Orange Pi is not responsible for maintaining this image.
Orange Pi PC Plus has 8GB of eMMC onboard. Before leaving the factory, the
factory will pre-install Android image to eMMC for testing. After getting the
development board, you can use the pre-installed Android image in eMMC to test the
functions of the development board and confirm the development. After all the functions
of the board are ok, then burn the system you want to use
2) Then use the card reader to insert the TF card into the windows computer
b. After downloading, you can directly unzip and install, and then open the
software
www.orangepi.cn 13 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
c. If the computer only has a TF card inserted, the TF card's drive letter will be
displayed in the Select card column. If the computer has multiple USB storage
devices inserted, you can select the drive letter corresponding to the TF card
through the drop-down box
d. Then click Format, a warning box will pop up before formatting, and formatting
will start after selecting "Yes (Y)"
e. After formatting the TF card, the message shown in the figure below will pop up,
click OK
4) Download the Linux operating system image file compression package you want to
www.orangepi.cn 14 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
burn from the Orange Pi data download page, and then use the decompression software to
decompress it. In the decompressed file, the file ending with ".img" is the operating
system image file. The size is generally above 1GB
c. After the image is written, click the "Exit" button to exit, and then you can pull
out the TF card and insert it into the development board to start
www.orangepi.cn 15 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2) Then use a 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
6) Download the Linux operating system image file compression package you want to
burn from the Orange Pi data download page, and then use the decompression software to
decompress it. In the decompressed file, the file ending with ".img" is the operating
system image file. The size is generally above 1GB
a. The decompression command of the compressed package at the end of 7z is as
follows
test@test:~$ 7z x image_filename.7z
b. The decompression command for the compressed package at the end of tar.gz is
as follows
test@test:~$ tar -zxf image_filename.tar.gz
www.orangepi.cn 16 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
8) The writing speed and remaining time will be prompted during the burning process
9) After burning, the following interface will be displayed. At this time, you can unplug
the TF card from the computer and insert it into the development board to start.
www.orangepi.cn 17 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
1) First, prepare a TF card with 8GB or larger capacity. The transmission speed of the TF
card must be above class10. It is recommended to use a TF card of SanDisk and other
brands
2) Then use a card reader to insert the TF card into the computer
3) Download Android 4.4 or Android 7.0 firmware and PhoenixCard burning tool
from Orange Pi's data download page, please make sure that the phonenixCrad tool
version is PhoenixCard v4.1.2
www.orangepi.cn 18 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
5) Use decompression software to decompress PhoenixCard v4.1.2.rar, this software does
not need to be installed, you can find PhoenixCard in the decompressed folder and open it
6) After opening PhoenixCard, if the TF card is recognized normally, the drive letter and
capacity of the TF card will be displayed in the middle list. Please make sure that the
displayed drive letter is consistent with the drive letter of the TF card you want to burn. If
it is not displayed You can try to unplug and plug the TF card
7) After confirming the drive letter, format the TF card first, click the restore card button
in PhoenixCard, or use the aforementioned SD Card Formatter to format the TF card
www.orangepi.cn 19 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
9) After burning, the PhoenixCard will be displayed as shown in the figure below. At this
time, click the close button to exit PhoenixCard, and then you can unplug the TF card
from the computer and insert it into the development board to start.
www.orangepi.cn 20 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
Android image can only be burned into EMMC using PhoenixCard software
under Windows platform, but cannot be burned under Linux platform
1) First of all, please note that burning the Android firmware to the eMMC of the
development board needs to be completed with the help of a TF card, which is mainly
divided into the following two steps
a. First use PhoenixCard to burn the Android firmware to the TF card as a mass
production card
b. Then use TF card to burn Android firmware into eMMC
2) First prepare a TF card with 8GB or larger capacity. The transmission speed of the TF
card must be above class10. It is recommended to use a TF card of SanDisk and other
brands
3) Then use a card reader to insert the TF card into the computer
4) Download Android 4.4 or Android 7.0 firmware and PhoenixCard burning tool
www.orangepi.cn 21 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
from Orange Pi's data download page. Please make sure that the version of
PhonenixCrad tool is PhoenixCard v4.1.2
7) After opening PhoenixCard, if the TF card is recognized normally, the drive letter and
capacity of the TF card will be displayed in the middle list. Please make sure that the
displayed drive letter is consistent with the drive letter of the TF card you want to burn.
There is no display, you can try to unplug the TF card
8) After confirming the drive letter, format the TF card first, click the restore card
button in PhoenixCard, or use the aforementioned SD Card Formatter to format the TF
card
www.orangepi.cn 22 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
www.orangepi.cn 23 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
10)After burning, the PhoenixCard will be displayed as shown in the figure below. At
this time, click the close button to exit PhoenixCard
www.orangepi.cn 24 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
11)Then insert the TF card into the development board, and the Android firmware in the
TF card will be automatically burned to the eMMC of the development board after the
development board is powered on. If the development board is connected to an HDMI
display, the progress bar of burning Android firmware to eMMC will be displayed on the
HDMI display.
12)After the programming is completed, the HDMI display is shown in the figure below,
and then the development board will automatically shut down
13)At this time, you can pull out the TF card, and then power on again, and the Android
system in eMMC will be started.
www.orangepi.cn 25 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
1) Insert the TF card with the burned image into the TF card slot of the Orange Pi
development board. If there is a system in the eMMC, you can directly start the system in
the eMMC without inserting the TF card.
2) The development board has an HDMI interface, you can connect the development
board to a TV or other HDMI monitors through an HDMI cable
3) Connect the USB mouse and keyboard to control the Orange Pi development board
4) The development board has an Ethernet port, which can be plugged into a network
cable for Internet access
5) Connect a 5V and at least 2A power adapter (3A is also possible)
a. Remember not to plug in the 12V power adapter, if you plug in the 12V
power adapter, it will burn the development board
b. Many unstable phenomena during system power-on and startup are
basically caused by power supply problems, so a reliable power adapter is
very important
6) Then turn on the switch of the power adapter, if everything is normal, the HDMI
display will be able to see the startup screen of the system at this time
7) If you want to view the output information of the system through the debug serial port,
please use the serial cable to connect the development board to the computer. For the
connection method of the serial port, please refer to the section on the use of the debug
serial port
www.orangepi.cn 26 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2) The corresponding relationship between the debug serial port GND, TXD and RXD
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. Connect the RXD of the USB to TTL module to the TXD of the development
board
c. Connect the TXD of the USB to TTL module to the RXD 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
www.orangepi.cn 27 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2.10.2. How to use the debug serial port on the Ubuntu platform
1) If the USB to TTL module is connected normally, you can see the corresponding
device node name under /dev of Ubuntu PC, remember this node name, you will use it
when setting up the serial port software later
test@test:~$ ls /dev/ttyUSB*
/dev/ttyUSB0
2) There are many serial debugging tools that can be used under linux, such as putty,
minicom, etc. The following shows how to use putty
5) After executing the putty command, the following interface will pop up
www.orangepi.cn 28 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
www.orangepi.cn 29 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
8) After setting the serial port setting interface, return to the Session interface
a. First select the Connection type as Serial
b. Then click the Open button to connect to the serial port
9) After starting the development board, you can see the Log information output by the
system from the opened serial terminal
www.orangepi.cn 30 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
SecureCRT, MobaXterm, etc. The following demonstrates how to use MobaXterm. This
software is free and can be used without purchasing a serial number.
2) Download MobaXterm
a. Download MobaXterm URL as follows
https://mobaxterm.mobatek.net/
b. After entering the MobaXterm download page, click GET XOBATERM
NOW!
d. Then select the Portable version, after downloading, you don’t need to install it,
just open it and you can use it
www.orangepi.cn 31 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
4) After opening the software, the steps to set the serial port connection are as follows
a. Open the session setting interface
b. Select the serial port type
c. Select the port number of the serial port (choose the corresponding port number
according to the specific situation), if you can't see the port number, please use the
360 driver master to scan and install the USB to TTL serial chip driver
d. Select the baud rate of the serial port to be 115200
e. Finally click the OK button to complete the setting
www.orangepi.cn 32 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
5) After clicking OK, you will enter the following interface, and you can see the output
information of the serial port when you start the development board.
www.orangepi.cn 33 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
Function Status
HDMI Video OK
HDMI Audio OK
USB2.0 x 3 OK
TF card boot OK
EMMC boot OK
Network card OK
IR receiver OK
WIFI OK
Headphone Audio OK
MIC recording OK
USB camera OK
LED OK
40pin GPIO OK
I2C OK
SPI OK
UART OK
Temperature Sensor OK
Hardware Watchdog OK
www.orangepi.cn 34 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
OV5640 camera OK
GC2035 camera NO
TV-OUT NO
Function Status
HDMI video OK
HDMI Audio OK
USB2.0 x 3 OK
TF card boot OK
EMMC boot OK
Network card OK
IR receiver OK
WIFI OK
Headphone Audio OK
USB camera OK
LED OK
40pin GPIO OK
I2C OK
SPI OK
UART OK
Temperature Sensor OK
Hardware watchdog OK
OV5640 camera OK
GC2035 camera OK
Mali GPU OK
TV-OUT OK
Account Password
root orangepi
orangepi orangepi
www.orangepi.cn 35 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
1) There are two LED lights on the development board, one green light and one red light.
The default display of the LED lights when the system starts is as follows
Green Light Red Light
u-boot startup phase Light off Bright
Kernel boot to enter the Bright Off or flash
system
GPIO port PL10 PA15
2) The method of setting the green light on and off and flashing is as follows (take
linux3.4 system as an example)
a. First enter the green light setting directory
root@orangepi:~# cd /sys/class/leds/green_led
b. The command to set the green light off is as follows
root@orangepi:/sys/class/leds/green_led# echo 0 > brightness
c. The command to set the green light is as follows
root@orangepi:/sys/class/leds/green_led# echo 1 > brightness
d. The command to set the green light to flash is as follows
root@orangepi:/sys/class/leds/green_led# echo heartbeat > trigger
e. The command to set the green light to stop flashing is as follows
root@orangepi:/sys/class/leds/green_led# echo none > trigger
3) The method of setting the red light on and off and flashing is as follows (take the
linux3.4 system as an example)
a. First enter the red light setting directory
root@orangepi:~# cd /sys/class/leds/red_led
b. The command to set the red light off is as follows
root@orangepi:/sys/class/leds/red_led# echo 0 > brightness
c. The command to set the red light to be always on is as follows
root@orangepi:/sys/class/leds/red_led# echo 1 > brightness
d. The command to set the red light to flash is as follows
root@orangepi:/sys/class/leds/red_led# echo heartbeat > trigger
e. The command to set the red light to stop flashing is as follows
www.orangepi.cn 36 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
1) The linux5.4 desktop version system will automatically log in to the desktop after it is
started by default, without entering a password
4) Then restart the system and a login dialog box will appear, at this time you need to
enter a password to enter the system
www.orangepi.cn 37 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2) After logging in to the system, you can use the df -h command to check the size of
rootfs. If it is consistent with the actual capacity of the TF card, it means that the
automatic expansion is running correctly
root@orangepi:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 430M 0 430M 0% /dev
tmpfs 100M 5.6M 95M 6% /run
/dev/mmcblk0p1 15G 915M 14G 7% /
tmpfs 500M 0 500M 0% /dev/shm
3) It should be noted that the Linux system has only one partition in ext4 format, and
does not use a separate BOOT partition to store 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
www.orangepi.cn 38 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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 usually automatically mount the TF card partition. If the
automatic mounting is normal, use the ls command to see the following output,
the TF card partition name and the following command The names shown are
not necessarily the same, please modify 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 root user in 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 delete the TF card, then unplug the TF and plug it into the
development board to start. When the linux system starts, when it detects that
there is a file .no_rootfs_resize in the /root directory, the rootfs will no longer be
automatically expanded
f. After disabling automatic expansion of rootfs, you can see that the available
capacity of the TF card is only about 200M
root@orangepi:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 927M 0 927M 0% /dev
tmpfs 200M 5.6M 194M 3% /run
/dev/mmcblk0p1 1.5G 1.3G 196M 87% /
tmpfs 997M 0 997M 0% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 997M 0 997M 0% /sys/fs/cgroup
www.orangepi.cn 39 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
1) When the linux3.4 system is started for the first time through the TF card, the
orangepi-resize-filesystem script will be called through the
orangepi-resize-filesystem.service systemd service to automatically expand the rootfs,
but it is different from the linux5.4 system. After the first boot is completed, the
automatic expansion has not been completed, and the system needs to be restarted
to finally complete the automatic expansion of rootfs
2) When you start the linux3.4 system for the first time, you will see a warning
when you log in to the system through ssh or serial port: a restart is required to
complete the expansion of the file system, please restart as soon as possible
a. If you see this warning, please restart as soon as possible, and perform other
operations after the automatic expansion is completed
b. After starting the linux system for the first time, you can see the size of rootfs as
shown below before restarting, only a few hundred megabytes of free space
root@orangepi:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 370M 0 370M 0% /dev
www.orangepi.cn 40 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
3) After restarting, log in to the system through ssh or serial port to see
a. The warning that needs to restart to complete the expansion has disappeared
b. Use the df -h command to check the size of the rootfs. If the automatic
expansion is running correctly, you can see that the size of the rootfs is basically
the same as the actual capacity of the TF card
root@orangepi:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 430M 0 430M 0% /dev
tmpfs 100M 5.6M 95M 6% /run
/dev/mmcblk0p1 15G 915M 14G 7% /
tmpfs 500M 0 500M 0% /dev/shm
4) It should be noted that the linux3.4 system has only one partition in ext4 format, and
does not use a separate BOOT partition to store files such as kernel images, so there is no
problem of BOOT partition expansion
5) 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
www.orangepi.cn 41 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
Ubuntu PC will usually automatically mount the TF card partition. If the
automatic mounting is normal, use the ls command to see the following output,
the TF card partition name and the following command The names shown are
not necessarily the same, please modify according to the actual situation
test@test:~$ ls /media/test/49cc0cc0-8cb2-435d-bd35-4bbc6b7cd975/
bin dev home lost+found mnt proc run selinux sys usr
boot etc lib media opt root sbin srv tmp var
c. Then switch the current user to root user in 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/49cc0cc0-8cb2-435d-bd35-4bbc6b7cd975
root@test:/media/test/49cc0cc0-8cb2-435d-bd35-4bbc6b7cd975# cd root
root@test:/media/test/49cc0cc0-8cb2-435d-bd35-4bbc6b7cd975/root# touch .no_rootfs_resize
root@test:/media/test/49cc0cc0-8cb2-435d-bd35-4bbc6b7cd975/root# ls .no_rootfs*
.no_rootfs_resize
e. Then you can unmount the TF card, then unplug the TF and plug it into the
development board to start. When the linux system starts, when it detects that
there is a file .no_rootfs_resize in the /root directory, the rootfs will no longer be
automatically expanded
f. After disabling rootfs automatic expansion, after the first startup, you will no
longer see the warning that you need to restart to complete expansion after
logging in to the system through ssh or serial port. Even after restarting, you can
see that the available capacity of the TF card is only about 300M
root@orangepi:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 370M 0 370M 0% /dev
tmpfs 101M 2.0M 99M 2% /run
/dev/mmcblk0p1 2.0G 1.6G 335M 84% /
tmpfs 501M 140K 501M 1% /dev/shm
www.orangepi.cn 42 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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 linux system startup, you can use the following
method to modify the value of loglevel, so as to print more log information to the serial
port to 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 a card
reader, and then directly modify the configuration of the linux system in the TF card after
mounting the TF card in the Ubuntu PC. Insert the TF card into the development board to
start
root@orangepi:~# sed -i "s/verbosity=1/verbosity=7/" /boot/orangepiEnv.txt
root@orangepi:~# sed -i "s/console=both/console=serial/" /boot/orangepiEnv.txt
3) The above commands are actually to set the variables in /boot/orangepiEnv.txt. After
setting, you can open /boot/orangepiEnv.txt to check
root@orangepi:~# cat /boot/orangepiEnv.txt
verbosity=7
bootlogo=false
console=serial
4) Then restart the development board, the output information of the kernel will be
printed to the serial port for output
[ OK ] Started Dispatcher daemon for systemd-networkd.
[ OK ] Reached target Multi-User System.
[ OK ] Reached target Graphical Interface.
Starting Update UTMP about System Runlevel Changes...
www.orangepi.cn 43 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
orangepi login:
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
www.orangepi.cn 44 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
^C
--- www.orangepi.org ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 39.323/39.617/39.922/0.274 ms
Linux systems have SSH remote login enabled by default, and allow root users to log
in to the system. Before ssh login, you need to make sure that the Ethernet or wifi
network is connected, and then use the ifconfig command or check the router to obtain
the IP address of the development board
3.11.1. SSH remote login development board under Ubuntu
1) First get the IP address of the development board
2) Then you can log in to the linux system remotely through the ssh command
test@test:~$ ssh [email protected] // Need to be replaced with the IP address of
the development board
[email protected]'s password: // Enter the password here, the default
password is orangepi
3) The display after successfully logging in to the system is as shown in the figure below
www.orangepi.cn 45 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
You can enter the following command on the development board and try to connect
root@orangepi:~# rm /etc/ssh/ssh_host_*
root@orangepi:~# dpkg-reconfigure openssh-server
3.11.2. SSH remote login development board under Windows
1) First get the IP address of the development board
2) In windows, you can use MobaXterm to remotely log in to the development board,
first create a new ssh session
a. Open Session
b. Then select SSH in Session Setting
c. Then enter the IP address of the development board in Remote host
d. Then enter the username root or orangepi of the Linux system in Specify
username
e. Finally click OK
3) Then you will be prompted to enter a password, the default passwords for both root
and orangepi users are orangepi
www.orangepi.cn 46 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
4) The display after successfully logging in to the system is as shown in the figure below
1) Use HDMI to HDMI cable to connect Orange Pi development board and HDMI
display
www.orangepi.cn 47 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2) If the HDMI display has image output after starting the linux system, it means that the
HDMI interface is in normal use
3) In the absence of network and serial port, you can use HDMI display, and then
connect the mouse and keyboard to control the development board
1) First use the nmcli dev wifi command to scan the surrounding WIFI hotspots
root@orangepi:~# nmcli dev wifi
www.orangepi.cn 48 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2) Then use the nmcli command to connect to the scanned WIFI hotspot, where:
a. wifi_name : Need to change to the name of the WIFI hotspot you want to
connect to
b. wifi_passwd:You need to change to the password of the WIFI hotspot you want
to connect to
root@orangepi:~# nmcli dev wifi connect wifi_name password wifi_passwd
Device 'wlan0' successfully activated with 'cf937f88-ca1e-4411-bb50-61f402eef293'.
4) Use the ping command to test the connectivity of the wifi network
root@orangepi:~# ping www.orangepi.org -I wlan0
PING www.orangepi.org (182.92.236.130) from 192.168.1.49 wlan0: 56(84) bytes of
data.
www.orangepi.cn 49 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2) Then enter the nmtui command in the command line to open the wifi connection
interface
root@orangepi:~# nmtui
www.orangepi.cn 50 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
6) Select the WIFI hotspot you want to connect to, then use the Tab key to position the
cursor on Activate and press Enter
www.orangepi.cn 51 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
7) WIFI Then a dialog box for entering the password will pop up, enter the
corresponding password in Password and press Enter to start connecting to WIFI
8) After the WIFI connection is successful, a "*" will be displayed in front of the
connected WIFI name
www.orangepi.cn 52 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
10) Use the ping command to test the connectivity of the wifi network
root@orangepi:~# ping www.orangepi.org -I wlan0
PING www.orangepi.org (182.92.236.130) from 192.168.1.49 wlan0: 56(84) bytes of
data.
64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=1 ttl=52 time=43.5 ms
64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=2 ttl=52 time=41.3 ms
64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=3 ttl=52 time=44.9 ms
64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=4 ttl=52 time=45.6 ms
64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=5 ttl=52 time=48.8 ms
^C
--- www.orangepi.org ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 41.321/44.864/48.834/2.484 ms
2) In the pop-up drop-down box, click More networks to see all scanned WIFI hotspots,
and then select the WIFI hotspot you want to connect to
www.orangepi.cn 53 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
3) WIFI Then enter the password of the WIFI hotspot, and then click Connect to start
connecting to the WIFI
4) After connecting to the WIFI, you can open the browser to check whether you can surf
the Internet. The entrance of the browser is shown in the figure below
www.orangepi.cn 54 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
5) After opening the browser, if you can see the page of Orange Pi website, or you can
open other web pages, it means that the WIFI connection is normal
3) If the mouse or keyboard can operate normally, the USB interface is used normally
www.orangepi.cn 55 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
(the mouse can only be used in the desktop version image)
2) Then insert the U disk into the USB interface of the development board
3) Execute the following command, if you can see the output of sdX, it means that the U
disk has been recognized successfully
root@orangepi:~# cat /proc/partitions | grep "sd*"
major minor #blocks name
8 0 30044160 sda
8 1 30043119 sda1
4) Use the mount command to mount the U disk to /mnt, and then you can view the files
in the U disk
root@orangepi:~# mount /dev/sda1 /mnt/
root@orangepi:~# ls /mnt/
test.txt
5) After mounting, you can view the capacity usage and mount point of the U disk
through the df command
root@orangepi:~# df -h | grep "sd"
/dev/sda1 29G 208K 29G 1% /mnt
1) The USB Ethernet cards that have been tested and can be used are as follows. Among
them, the RTL8153 USB Gigabit network card is inserted into the USB 2.0 Host interface
of the development board. The test can be used normally, but the speed is not up to
Gigabit. Please pay attention to this point.
Serial number model
1 RTL8152B USB 100M network card
2 RTL8153 USB Gigabit Ethernet
www.orangepi.cn 56 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2) First insert the USB network card into the USB interface of the development board,
and then insert the network cable into the USB network card to ensure that the network
cable can normally access the Internet. If you can see the following log information
through the dmesg command, it means that the USB network card is recognized normally
root@orangepi:~# dmesg | tail
[ 121.985016] usb 3-1: USB disconnect, device number 2
[ 126.873772] sunxi-ehci 5311000.ehci3-controller: ehci_irq: highspeed device connect
[ 127.094054] usb 3-1: new high-speed USB device number 3 using sunxi-ehci
[ 127.357472] usb 3-1: reset high-speed USB device number 3 using sunxi-ehci
[ 127.557960] r8152 3-1:1.0 eth1: v1.08.9
[ 127.602642] r8152 3-1:1.0 enx00e04c362017: renamed from eth1
[ 127.731874] IPv6: ADDRCONF(NETDEV_UP): enx00e04c362017: link is not ready
[ 127.763031] IPv6: ADDRCONF(NETDEV_UP): enx00e04c362017: link is not ready
[ 129.892465] r8152 3-1:1.0 enx00e04c362017: carrier on
[ 129.892583] IPv6: ADDRCONF(NETDEV_CHANGE): enx00e04c362017: link
becomes ready
3) Then you can see the device node of the USB network card and the automatically
assigned IP address through the ifconfig command
root@orangepi:~# ifconfig
enx00e04c362017: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu
1500
inet 192.168.1.177 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::681f:d293:4bc5:e9fd prefixlen 64 scopeid 0x20<link>
ether 00:e0:4c:36:20:17 txqueuelen 1000 (Ethernet)
RX packets 1849 bytes 134590 (134.5 KB)
RX errors 0 dropped 125 overruns 0 frame 0
TX packets 33 bytes 2834 (2.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
www.orangepi.cn 57 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
1) First insert the USB camera into the USB port of the Orange Pi development board
2) Use lsmod to check whether the system has automatically loaded the uvcvideo kernel
module
root@orangepi:~# lsmod
Module Size Used by
uvcvideo 106496 0
3) Then use v4l2-ctl (note that l in v4l2 is a lowercase letter l, not a number 1) command
to view the device node of the USB camera. From the output below, you can see that the
device node corresponding to the USB camera is /dev/video2. If you look The
USB-related video node is not found, indicating that the USB camera cannot be
recognized
root@orangepi:~# apt update
root@orangepi:~# apt install v4l-utils
root@orangepi:~# v4l2-ctl --list-devices
sun6i-csi (platform:camera):
/dev/video1
cedrus (platform:cedrus):
/dev/video0
www.orangepi.cn 58 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
4) Install fswebcam
root@orangepi:~# apt update
root@orangepi:~# apt-get install fswebcam
5) After installing fswebcam, you can use the following command to take pictures
a. The -d option is used to specify the device node of the USB camera
b. --no-banner is used to remove watermark from photos
c. The -r option is used to specify the resolution of the photo
d. -S option is used to skip the previous frame number
root@orangepi:~# fswebcam -d /dev/video2 --no-banner -r 1280x720 -S 5 ./image.jpg
6) In the server version of the Linux system, you can use the scp command to transfer the
taken pictures to the image of Ubuntu PC after taking pictures.
root@orangepi:~# scp image.jpg [email protected]:/home/test // Need to be modified
to the corresponding path
7) In the desktop version of the linux system, you can directly view the captured pictures
through the HDMI display
2) Upload the audio file that needs to be played to the /root folder of the Linux system.
You can use the scp command to upload in the Ubuntu PC. The IP address in the
www.orangepi.cn 59 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
command is the IP address of the Orange Pi development board and needs to be
replaced
test@test:~/AudioTest$ scp audio.wav [email protected]:/root
3) Then use alsamixer to open the audio adjustment interface (press Esc to exit
alsamixer)
root@orangepi:~# alsamixer
a. The linux5.4 system needs to use the arrow keys to adjust the Line Out and DAC
to the maximum
b. The linux3.4 system first needs to use the arrow keys to move the cursor to the
Audio lineout, and then press the "M" key to open the Audio lineout. After
opening, the box on the Audio lineout will display 00
www.orangepi.cn 60 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
4) Then use the aplay command to play the audio headset to hear the sound
root@orangepi:~# aplay -D hw:0,0 audio.wav
2) After opening the recording channel, you can start recording. The recording
commands are as follows
root@orangepi:~# arecord -d 5 -f cd -t wav test.wav
Recording WAVE test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
root@orangepi:~#
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
www.orangepi.cn 61 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
root@orangepi:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Codec [H3 Audio Codec], device 0: CDC PCM Codec-0 [CDC PCM Codec-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: allwinnerhdmi [allwinner-hdmi], device 0: 1c22800.i2s-i2s-hifi i2s-hifi-0
[1c22800.i2s-i2s-hifi i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
2) HDMI audio playback does not require other settings, just use the aplay command to
play directly
root@orangepi:~# aplay -D hw:1,0 audio.wav
www.orangepi.cn 62 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
4) Enter the ir-keytable -c -p NEC -t command in the terminal, and then use the IR
remote control to press the button against the IR receiver of the Orange Pi development
board, and you can see the received key code in the terminal
root@orangepi:/# ir-keytable -c -p NEC -t
Old keytable cleared
Protocols changed to nec
Testing events. Please, press CTRL-C to abort.
5514.329534: lirc protocol(nec): scancode = 0x45c
5514.329619: event type EV_MSC(0x04): scancode = 0x45c
5514.329619: event type EV_SYN(0x00).
5514.832257: lirc protocol(nec): scancode = 0x45c
5514.832323: event type EV_MSC(0x04): scancode = 0x45c
www.orangepi.cn 63 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
ir_rc5_decoder 1444 0
ir_nec_decoder 1692 0
sunxi_cir 1609 0
rc_core 12714 10
ir_lirc_codec,ir_rc5_decoder,ir_nec_decoder,ir_sony_decoder,sunxi_cir,ir_mce_kbd_dec
oder,ir_jvc_decoder,ir_rc6_decoder,ir_sanyo_decoder
5) Enter the ir-keytable -t command in the terminal, and then use the IR remote control
to press the button against the IR receiving head of the Orange Pi development board to
see the received key code in the terminal
root@orangepi:/# ir-keytable -t
www.orangepi.cn 64 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2) Compile wiringOP
root@orangepi:~# cd wiringOP
root@orangepi:~/wiringOP# ./build clean
root@orangepi:~/wiringOP# ./build
www.orangepi.cn 65 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2) The serial numbers of the CSI interface pins are shown in the figure below
a. The No. 1 pin of the CSI interface is connected to the No. 24 pin of the camera
adapter board
b. The 24th pin of the CSI interface is connected to the 1st pin of the camera adapter
board
www.orangepi.cn 66 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
CON1-P06 CSI-RESET PE15
CON1-P07 CSI-VSYNC PE3
CON1-P08 CSI-STBY-EN PE15
CON1-P09 CSI-HSYNC PE2
CON1-P10 VDD1V8-CSI PG11
CON1-P11 AFCC_EN PG13
CON1-P12 CSI-D7 PE11
CON1-P13 CSI-MCLK PE1
CON1-P14 CSI-D6 PE10
CON1-P15 GND
CON1-P16 CSI-D5 PE9
CON1-P17 CSI-PCLK PE0
CON1-P18 CSI-D4 PE8
CON1-P19 CSI-D0 PE4
CON1-P20 CSI-D3 PE7
CON1-P21 CSI-D1 PE5
CON1-P22 CSI-D2 PE6
CON1-P23 GND
CON1-P24 DCIN-5V
www.orangepi.cn 67 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
3) Then insert the ribbon cable into another card slot of the adapter board
4) Then insert the other end of the cable into the CIS camera interface of the
development board. Start the linux system after connecting the camera (don’t plug in the
camera after power-on)
5) Then use the setsystem gc2035 command to initialize the configuration of gc2035
root@orangepi:~# setsystem gc2035
Set the csi camera used by the orangepipcplus as: gc2035
setsystem gc2035 The main things that the command does are:
a. Configure the kernel modules that need to be loaded for gc2035
root@orangepi:~# cat /etc/modules-load.d/modules.conf
gc2035
vfe_v4l2
b. Configure vip_dev0_mname in /boot/script.bin as gc2035
6) After restarting and entering the system, first confirm whether the kernel module
related to the gc2035 camera is automatically loaded
www.orangepi.cn 68 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
root@orangepi:~# lsmod
Module Size Used by
vfe_v4l2 1018545 0
videobuf_dma_contig 3513 1 vfe_v4l2
videobuf_core 14871 2 vfe_v4l2,videobuf_dma_contig
gc2035 19692 0
vfe_subdev 4531 2 vfe_v4l2,gc2035
cci 22869 2 vfe_v4l2,gc2035
vfe_os 4269 3 cci,vfe_v4l2,vfe_subdev
7) Then use v4l2-ctl (note that l in v4l2 is a lowercase letter l, not a number 1) command
to view the device node of the CSI camera. From the output below, we can see that the
device node corresponding to the camera is /dev/video0
root@orangepi:~# apt update
root@orangepi:~# apt install v4l-utils
root@orangepi:~# v4l2-ctl --list-devices
sunxi-vfe (sunxi_vfe sunxi_vfe.0):
/dev/video0
www.orangepi.cn 69 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
root@orangepi:~#
12) Before using motion, please make sure that the Orange Pi development board can be
connected to the network normally, and then obtain the IP address of the development
board through the ifconfig command
13) Then enter [development board IP address: 8081] in the Firefox browser to see the
image output by gc2035
2) Then use the setsystem ov5640 command to initialize the configuration of ov5640
root@orangepi:~# setsystem ov5640
www.orangepi.cn 70 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
setsystem ov5640 The main things that the command does are:
a. Configure the kernel modules that need to be loaded for ov5640
root@orangepi:~# cat /etc/modules-load.d/modules.conf
ov5640
vfe_v4l2
b. Configure vip_dev0_mname in /boot/script.bin as ov5640
3) After restarting and entering the system, first confirm whether the kernel module
related to the ov5640 camera is automatically loaded
root@orangepi:~# lsmod
Module Size Used by
vfe_v4l2 1018545 1
videobuf_dma_contig 3513 1 vfe_v4l2
videobuf_core 14871 2 vfe_v4l2,videobuf_dma_contig
ov5640 42317 0
vfe_subdev 4531 2 vfe_v4l2,ov5640
cci 22869 2 vfe_v4l2,ov5640
vfe_os 4269 3 cci,vfe_v4l2,vfe_subdev
4) Then use v4l2-ctl (note that l in v4l2 is a lowercase letter l, not a number 1) command
to view the device node of the CSI camera. From the output below, we can see that the
device node corresponding to the camera is /dev/video0
root@orangepi:~# apt update
root@orangepi:~# apt install -y v4l-utils
root@orangepi:~# v4l2-ctl --list-devices
sunxi-vfe (sunxi_vfe sunxi_vfe.0):
/dev/video0
www.orangepi.cn 71 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
to start_motion_daemon=yes
root@orangepi:~# sed -i "s/start_motion_daemon=no/start_motion_daemon=yes/" \
/etc/default/motion
9) Before using motion, please make sure that the Orange Pi development board can
connect to the network normally, and then obtain the IP address of the development board
through the ifconfig command
10) Then enter [development board IP address: 8081] in the Firefox browser to see the
image output by ov5640
www.orangepi.cn 72 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2) First connect the Ov5640 camera adapter board to the CIS camera interface of the
development board through a cable, and then start the linux system after connecting the
camera (don’t plug in the camera after powering on)
3) After entering the system, check the loading status of the ov5640 kernel module
root@orangepi:~# lsmod | grep "ov5640"
ov5640 28672 1
v4l2_fwnode 24576 2 ov5640,sun6i_csi
videodev 151552 7
ov5640,v4l2_fwnode,sunxi_cedrus,videobuf2_common,sun6i_csi,v4l2_mem2mem,video
buf2_v4l2
mc 36864 7
ov5640,sunxi_cedrus,videobuf2_common,videodev,sun6i_csi,v4l2_mem2mem,videobuf
2_v4l2
4) Then use v4l2-ctl (note that l in v4l2 is a lowercase letter l, not a number 1) command
to view the device node of the CSI camera. From the output below, we can see that the
device node corresponding to the USB camera is /dev/video0
root@orangepi:~# apt update
root@orangepi:~# apt install v4l-utils
root@orangepi:~# v4l2-ctl --list-devices
sun6i-csi (platform:camera):
/dev/video0
cedrus (platform:cedrus):
/dev/video1
www.orangepi.cn 73 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
9) Before using motion, please make sure that the Orange Pi development board can
connect to the network normally, and then obtain the IP address of the development board
through the ifconfig command
10) Then enter the [IP address of the development board: 8081] in the Firefox browser to
see the image output by the ov5640
www.orangepi.cn 74 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
1) Please refer to the figure below for the sequence of the 40 pin pins of the Orange Pi
PC Plus development board
2) The functions of the 40 pin pins of the Orange Pi PC Plus development board are
shown in the table below
GPIO GPIO Function Pin Pin Function GPIO GPIO No.
No.
3.3v 1 2 5v
www.orangepi.cn 75 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
12 PA12 SDA.0 3 4 5v
11 PA11 SCL.0 5 6 GND
6 PA6 PA6 7 8 TXD.3 PA13 13
GND 9 10 RXD.3 PA14 14
1 PA1 RXD.2 11 12 PD14 PD14 110
0 PA0 TXD.2 13 14 GND
3 PA3 CTS.2 15 16 PC4 PC4 68
3.3v 17 18 PC7 PC7 71
64 PC0 MOSI.0 19 20 GND
65 PC1 MISO.0 21 22 RTS.2 PA2 2
66 PC2 SCLK.0 23 24 CE.0 PC3 67
GND 25 26 PA21 PA21 21
19 PA19 SDA.1 27 28 SCL.1 PA18 18
7 PA7 PA7 29 30 GND
8 PA8 PA8 31 32 RTS.1 PG8 200
9 PA9 PA9 33 34 GND
10 PA10 PA10 35 36 CTS.1 PG9 201
20 PA20 PA20 37 38 TXD.1 PG6 198
GND 39 40 RXD.1 PG7 199
www.orangepi.cn 76 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
Wiring OP has been adapted to the Orange Pi development board, using wiringOP
can test the functions of GPIO, I2C, UART and SPI
Before starting the test, please make sure that wiringOP has been compiled and
installed by referring to the section Installing wiringOP
www.orangepi.cn 77 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2) First set the GPIO port to output mode, the third parameter needs to be the serial
number of the wPi corresponding to the input pin
root@orangepi:~# gpio mode 2 out
Use gpio readall to see that the Mode of pin 7 is displayed as OUT
3) Then set the GPIO port to output low level. After setting, you can use a multimeter to
measure the value of the pin voltage. If it is 0v, it means that the low level is set
successfully.
root@orangepi:~# gpio write 2 0
Use gpio readall to see that the value (V) of pin 7 has become 0
4) Then set the GPIO port to output high level. After setting, you can use a multimeter to
measure the value of the pin voltage. If it is 3.3v, it means that the high level is set
successfully.
root@orangepi:~# gpio write 2 1
Use gpio readall to see that the value (V) of pin 7 has become 1
www.orangepi.cn 78 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
5) The setting method of other pins is similar, just modify the serial number of wPi to the
serial number corresponding to the pin.
www.orangepi.cn 79 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
root@orangepi:~# ls /dev/spi*
/dev/spidev0.0
3) Do not short-circuit the mosi and miso pins of spi first, and the output result of
running spidev_test is as follows, you can see that the data sent and received are
inconsistent
a. The test commands and results of the linux5.4 system are
root@orangepi:~/wiringOP/examples# ./spidev_test -v -D /dev/spidev0.0
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)
TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF F0 0D | ......@....▒..................▒.
RX | FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF | ................................
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
www.orangepi.cn 80 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00
4) Then use the Dupont wire to short-circuit the two pins of spi's mosi (corresponding to
pin 19) and miso (corresponding to pin 21). The output of the retest is as follows. You can
see that the data sent and received are the same, indicating that the spi can be normal use
a. The test commands and results of the Linux5.4 system are
root@orangepi:~/wiringOP/examples# ./spidev_test -v -D /dev/spidev0.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 | ......@....▒..................▒.
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
DE AD BE EF BA AD
F0 0D
www.orangepi.cn 81 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
by default and no additional configuration is required. The linux5.4 system The opening
method of i2c is as follows
a. According to the 40pin schematic diagram, the i2c available for Orange Pi Pc
Plus are i2c0 and i2c1
c. Then restart the system. When starting, you can see the configuration output of
I2C DT overlays in the u-boot startup log
Found mainline kernel configuration
29940 bytes read in 6 ms (4.8 MiB/s)
374 bytes read in 8 ms (44.9 KiB/s)
Applying kernel provided DT overlay sun8i-h3-i2c0.dtbo
374 bytes read in 8 ms (44.9 KiB/s)
Applying kernel provided DT overlay sun8i-h3-i2c1.dtbo
d. After the system is started, if there are two more i2c device nodes under /dev, the
configuration is correct
root@orangepi:~# ls /dev/i2c*
/dev/i2c-0 /dev/i2c-1 /dev/i2c-2 /dev/i2c-3 /dev/i2c-4
www.orangepi.cn 82 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
a) I2c0 in 40pin corresponds to /dev/i2c-0
b) I2c1 in 40pin corresponds to /dev/i2c-1
4) Then use i2cdetect -y 0 (where 0 means i2c0, i2c1 needs to be modified to i2cdetect -y
1) command. If the address of the connected i2c device can be detected, it means that i2c
can be used normally
www.orangepi.cn 83 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
opening method of uart is as follows:
a. According to the 40pin schematic diagram, the uart available for Orange Pi Pc
Plus are uart1, uart2 and uart3
d. After the system is started, you can see the information of ttyS1, ttyS2 and ttyS3
under /sys/class/tty, where
a) uart1 in 40pin corresponds to /dev/ttyS1
b) uart2 in 40pin corresponds to /dev/ttyS2
c) uart3 in 40pin corresponds to /dev/ttyS3
www.orangepi.cn 84 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2) Then start to test the uart interface, first use the Dupont line to short-circuit the rx and
tx of the uart interface to be tested
uart1 uart2 uart3
Tx Pin Corresponding to pin 38 Corresponding to pin 13 Corresponding to pin 8
Rx Pin Corresponding to pin 40 Corresponding to pin 11 Corresponding to pin 10
5) Finally run the serialTest, if you can see the following print, it means that the serial
communication is normal
root@orangepi:~/wiringOP/examples# ./serialTest
Out: 0: -> 0
Out: 1: -> 1
Out: 2: -> 2
Out: 3: -> 3
www.orangepi.cn 85 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
Out: 4: -> 4
Out: 5: -> 5
Out: 6: -> 6
Out: 7: -> 7
Out: 8: -> 8^C
3.25. How to use 0.96 inch OLED module with I2C interface
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 40pin interface of the Orange Pi
development board through the DuPont cable. The wiring method is as follows
Pins of OLED module Description Development board 40pin
interface corresponding pin
GND Power ground 6 Pin
VCC 5V 2 Pin
SCL I2C clock line 5 Pin
SDA I2C data cable 3 Pin
RST Connect to 3.3V 1 Pin
DC Connect to GND 9 Pin
CS Connect to GND 25 Pin
www.orangepi.cn 86 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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@orangepi:~# apt update
root@orangepi:~# apt install i2c-tools
root@orangepi:~# i2cdetect -y 0
4) Then you can use the oled_demo in wiringOP to test the OLED module, the test steps
are as follows
root@orangepi:~# git clone https://github.com/orangepi-xunlong/wiringOP
root@orangepi:~# cd wiringOP
root@orangepi:~/wiringOP# ./build clean && ./build
root@orangepi:~/wiringOP# cd examples
root@orangepi:~/wiringOP/examples# make oled_demo
root@orangepi:~/wiringOP/examples# ./oled_demo /dev/i2c-0
---------start--------
----------end---------
www.orangepi.cn 87 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
5) After running oled_demo, you can see the following output on the OLED screen
Note: This method is only applicable to linux3.4 kernel systems, and linux5.4 kernel
systems cannot be used
2) The wiring method of the LCD display and the development board is as follows
TFT SPI module pins The corresponding pins of GPIO -- GPIO num
development board 40pin
VCC-5V 2 Pin
GND 6 Pin
CS 24 Pin
RESET 12 Pin PD14 -- 110
D/C 16 Pin PC4 -- 68
SDI(MOSI) 19 Pin
SCK 23 Pin
LED 1 Pin
SDO(MISO) 21 Pin
3) After connecting the display to the development board, use the following command to
www.orangepi.cn 88 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
load the fbtft_device kernel module
root@orangepi:~# modprobe fbtft_device custom name=fb_ili9341 busnum=0 cs=0
gpios=reset:110,dc:68 rotate=90 speed=65000000 bgr=1 txbuflen=65536
4) When the fbtft_device kernel module is loaded, the correct output log of the dmesg
command is shown below, and the log can know that the framebuffer used by the LCD
display is fb8
root@orangepi:~# dmesg | tail
root@orangepipcplus:~# dmesg | tail
[ 82.034708] fbtft_device: SPI devices registered:
[ 82.034751] fbtft_device: spidev spi0.0 33000kHz 8 bits mode=0x00
[ 82.034779] fbtft_device: 'fb' Platform devices registered:
[ 82.034931] fbtft_device: Deleting spi0.0
[ 82.036030] fbtft_device: GPIOS used by 'fb_ili9341':
[ 82.036054] fbtft_device: 'reset' = GPIO110
[ 82.036072] fbtft_device: 'dc' = GPIO68
[ 82.036088] fbtft_device: SPI devices registered:
[ 82.036117] fbtft_device: fb_ili9341 spi0.0 65000kHz 8 bits mode=0x00
[ 82.365862] graphics fb8: fb_ili9341 frame buffer, 320x240, 150 KiB video memory,
64 KiB buffer memory, fps=20, spi0.0 at 65 MHz
5) Then use the following command to display the Orange Pi logo picture on the LCD
display
root@orangepi:~# apt update
root@orangepi:~# apt -y install fbi
root@orangepi:~# fbi -vt 1 -noverbose -d /dev/fb8 /boot/boot.bmp
www.orangepi.cn 89 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
6) You can also map the output of tty1 to the fb device of the LCD display-fb8. After the
mapping is completed, HDMI will no longer have image output.
root@orangepi:~# con2fbmap 1 8
If you want to switch back to HDMI display, please use the following command
root@orangepi:~# con2fbmap 1 0
7) Because the default terminal font is too large, the screen cannot display too much
content, you can use the following method to reduce the terminal font
a. Run first dpkg-reconfigure console-setup
root@orangepi:~# apt-get update
www.orangepi.cn 90 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
f. After setting, you can see that the font on the LCD display becomes smaller
www.orangepi.cn 91 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
8) Method for setting system startup to automatically load fbtft_device module
a. Create a new /etc/modules-load.d/fbtft.con configuration file, the content of the
file is as follows
root@orangepi:~# cat /etc/modules-load.d/fbtft.conf
fbtft_device
9) If you want the linux system to automatically map the console to the LCD display
after booting, please add the following configuration to /boot/orangepiEnv.txt, and then
restart the system to see the LCD display output
root@orangepi:~# cat /boot/orangepiEnv.txt | grep "fbcon"
extraargs=fbcon=map:8
2) The wiring method of the LCD display and the development board is as follows
3) After connecting the LCD display to the development board, use the following
command to load the fbtft_device kernel module
root@orangepi:~# modprobe fbtft_device custom name=fb_ili9341 busnum=0 cs=0
www.orangepi.cn 92 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
gpios=reset:0,dc:3 rotate=90 speed=65000000 bgr=1 txbuflen=65536
4) When the fbtft_device kernel module is loaded, the correct output log of the dmesg
command is shown below, and the log can know that the framebuffer used by the LCD
screen is fb8
root@orangepipcplus:~# dmesg | tail
[ 99.471345] fbtft_device: SPI devices registered:
[ 99.471383] fbtft_device: spidev spi0.0 33000kHz 8 bits mode=0x00
[ 99.471405] fbtft_device: 'fb' Platform devices registered:
[ 99.471554] fbtft_device: Deleting spi0.0
[ 99.472469] fbtft_device: GPIOS used by 'fb_ili9341':
[ 99.472493] fbtft_device: 'reset' = GPIO0
[ 99.472510] fbtft_device: 'dc' = GPIO3
[ 99.472525] fbtft_device: SPI devices registered:
[ 99.472554] fbtft_device: fb_ili9341 spi0.0 65000kHz 8 bits mode=0x00
[ 99.796157] graphics fb8: fb_ili9341 frame buffer, 320x240, 150 KiB video memory,
64 KiB buffer memory, fps=20, spi0.0 at 65 MHz
5) Then use the following command to display the Orange Pi logo picture on the LCD
screen
root@orangepi:~# apt update
root@orangepi:~# apt -y install fbi
root@orangepi:~# fbi -vt 1 -noverbose -d /dev/fb8 /boot/boot.bmp
www.orangepi.cn 93 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
6) You can also map the output of tty1 to the fb device of the LCD screen-fb8. After the
mapping is completed, HDMI will no longer have image output.
root@orangepi:~# con2fbmap 1 8
If you want to switch back to HDMI display, please use the following command
root@orangepi:~# con2fbmap 1 0
www.orangepi.cn 94 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
7) Because the default terminal font is too large, the screen cannot display too much
content, you can use the following method to reduce the terminal font
a. Run first dpkg-reconfigure console-setup
root@orangepi:~# apt-get update
root@orangepi:~# apt-get install kbd
root@orangepi:~# dpkg-reconfigure console-setup
b. Terminal coding selection UTF-8
www.orangepi.cn 95 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
f. After setting, you can see that the font on the LCD screen becomes smaller
c. Then restart the linux system and you can see that the kernel modules related to
fbtft_device have been automatically loaded
9) If you want the linux system to automatically map the console to the LCD screen after
booting, please add the following configuration in /boot/orangepiEnv.txt, and then
restart the system to see the LCD screen output
root@orangepi:~# cat /boot/orangepiEnv.txt | grep "fbcon"
extraargs=fbcon=map:8
www.orangepi.cn 96 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2) The wiring method of the LCD display and the development board is as follows
TFT SPI module pins The corresponding pins of GPIO -- GPIO num
development board 40pin
VCC 1 Pin
GND 6 Pin
CS 24 Pin
RESET 12 Pin PD14 -- 110
DC/RS 16 Pin PC04 -- 68
SDI(MOSI) 19 Pin
SCK 23 Pin
LED 18 Pin PC7 -- 71
SDO(MISO) 21 Pin
3) After connecting the display to the development board, use the following command to
load the fbtft_device kernel module
root@orangepi:~# modprobe fbtft_device custom name=fb_ili9488 busnum=0 cs=0
gpios=reset:110,dc:68,led:71 rotate=270 speed=65000000 bgr=1 txbuflen=65536
4) When the fbtft_device kernel module is loaded, the correct output log of the dmesg
command is shown below, and the log can know that the framebuffer used by the LCD
display is fb8
root@orangepipcplus:~# dmesg | tail
[ 273.581459] fbtft_device: spidev spi0.0 33000kHz 8 bits mode=0x00
[ 273.581483] fbtft_device: 'fb' Platform devices registered:
[ 273.581628] fbtft_device: Deleting spi0.0
[ 273.582486] fbtft_device: GPIOS used by 'fb_ili9488':
[ 273.582509] fbtft_device: 'reset' = GPIO110
[ 273.582526] fbtft_device: 'dc' = GPIO68
[ 273.582543] fbtft_device: 'led' = GPIO71
[ 273.582563] fbtft_device: SPI devices registered:
[ 273.582598] fbtft_device: fb_ili9488 spi0.0 65000kHz 8 bits mode=0x00
[ 273.955952] graphics fb8: fb_ili9488 frame buffer, 480x320, 300 KiB video memory,
64 KiB buffer memory, fps=100, spi0.0 at 65 MHz
www.orangepi.cn 97 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
5) Then use the following command to display the Orange Pi logo picture on the LCD
display
root@orangepi:~# apt update
root@orangepi:~# apt -y install fbi
root@orangepi:~# fbi -vt 1 -noverbose -d /dev/fb8 /boot/boot.bmp
6) You can also map the output of tty1 to the fb device of the LCD display-fb8. After the
mapping is completed, the LCD screen will display the output of the terminal, and HDMI
will no longer have image output.
root@orangepi:~# con2fbmap 1 8
www.orangepi.cn 98 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
If you want to switch back to HDMI display, please use the following command
root@orangepi:~# con2fbmap 1 0
7) Set the method to automatically load the fbtft_device module at system startup
a. Create a new /etc/modules-load.d/fbtft.con configuration file, the content of the
file is as follows
root@orangepi:~# cat /etc/modules-load.d/fbtft.conf
fbtft_device
b. Create a new /etc/modprobe.d/fbtft.conf configuration file, the content of the
file is as follows
root@orangepi:~# cat /etc/modprobe.d/fbtft.conf
options fbtft_device custom name=fb_ili9488 busnum=0 cs=0
gpios=reset:110,dc:68,led:71 rotate=270 speed=65000000 bgr=1 txbuflen=65536
c. Then restart the linux system and you can see that the kernel modules related to
fbtft_device have been automatically loaded
8) If you want the linux system to automatically map the console to the LCD display
after booting, please add the following configuration to /boot/orangepiEnv.txt, and then
restart the system to see the LCD display output
root@orangepi:~# cat /boot/orangepiEnv.txt | grep "fbcon"
www.orangepi.cn 99 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
9) If you need to display the desktop version of the system to the LCD screen, first
modify the following configuration file, change fb0 to fb8, and you can see the desktop
displayed on the LCD screen after restarting
root@orangepipcplus:~# cat /etc/X11/xorg.conf.d/50-fbturbo.conf
Section "Device"
Identifier "Allwinner A10/A13 FBDEV"
Driver "fbturbo"
Option "fbdev" "/dev/fb8"
10) If you do not restart the system, you can execute the following command, after a few
seconds, the LCD screen can also see the desktop of the linux system
root@orangepi:~# FRAMEBUFFER=/dev/fb8 startx
2) Then enter the desktop of the linux system through the HDMI display, do not use ssh
to log in remotely or serial port to log in to the linux system
3) Run glmark2-es2
root@orangepi:~# glmark2-es2
4) It can be seen that OpenGL uses Mali-400 MP, indicating that the GPU can be used
normally
1) Burning the linux image to eMMC requires 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
4) Then a warning will pop up, the script will erase all data on the eMMC, select <Yes>
5) Then you will be prompted to select the type of file system, supporting five file
systems ext2/3/4, f2fs and btrfs
8) After burning, the following options will be prompted, you can select <Power off> to
shut down directly
9) Then pull out the TF card and power on again, the linux system in eMMC will be
started
Note: This method is only suitable for linux3.4 system, linux5.4 system cannot read
1) The command to view the chipid of the h3 chip is as follows, the chipid of each chip
is different, so you can use chipid to distinguish multiple development boards
root@orangepi:~# cat /sys/class/sunxi_info/sys_info | grep "chipid"
sunxi_chipid : 541c035348a0471c0000115000000000
Note: TV-OUT cannot be used in linux5.4 system, the following method is only
applicable to linux3.4 system
3) Then use the AV cable to connect the development board to the TV, the steps are as
follows
a. First, you need to prepare an AV cable, as shown in the figure below
4) Then the signal source at one end of the TV needs to select the video input. Different
TV setting methods may be different. Please refer to the corresponding instruction
manual. If the connection settings are correct, you can see the output of the linux system
TV-OUT on the TV. Up
2) You can also short press the power button on the development board to shut down
(The linux3.4 server version is temporarily unavailable)
3) After shutting down, you need to unplug and plug the power again to boot up
Function Status
HDMI video OK
HDMI audio OK
USB2.0 x 3 OK
TF card boot OK
Network card OK
Infrared OK
WIFI OK
WIFI hotsport OK
Headphone audio OK
TV-OUT OK
MIC recording OK
USB camera OK
OV5640 camera OK
GC2035 camera OK
button OK
LED lights OK
Temperature Sensor OK
ADB debugging OK
Mali GPU OK
Video codec OK
Function Status
HDMI video OK
HDMI audio OK
USB2.0 x 3 OK
TF card boot OK
Network card OK
Infrared OK
WIFI OK
WIFI hotsport OK
Headphone audio OK
TV-OUT OK
MIC recording OK
USB camera OK
OV5640 camera NO
GC2035 camera NO
Button OK
LED lights OK
Temperature Sensor OK
ADB debugging OK
Mali GPU OK
Video codec OK
2) Then find the developer option and make sure that USB debugging is turned on
1) First make sure that the USB debugging option has been turned on
2) Prepare a USB-to-Micro USB cable, insert the USB interface into the USB interface
of the computer, and insert one end of the Micro USB interface into the USB OTG
interface of the development board
5) Then you can log in to the android system through the adb shell on the Ubuntu PC
test@test:~$ adb shell
root@dolphin-fvd-p1:/ #
3) Make sure that the service.adb.tcp.port of the Android system is set to port number
5555
root@dolphin-fvd-p1:/ # getprop | grep "adb.tcp"
[service.adb.tcp.port]: [5555]
3) If service.adb.tcp.port is not set, you can use the following command to set the port
number of the network adb
root@dolphin-fvd-p1:/ # setprop service.adb.tcp.port 5555
root@dolphin-fvd-p1:/ # stop adbd
6) Finally, you can log in to the android system through the adb shell on the Ubuntu PC
test@test:~$ adb shell
root@dolphin-fvd-p1:/ #
1) Insert the USB camera into the USB interface of the development board to ensure that
the device node of the usb camera can be seen under /sys/class/videov4linux
3) Then install usbcamera.apk to the Android system, you can use U disk copy and
install, you can also use adb to install, use adb to install usbcamera.apk command is
test@test:~$ adb devices
List of devices attached
192.168.1.xxx:5555 device //First make sure that adb is properly connected
4) After installation, you can see the startup icon of the USB camera in all applications
5) Then open the USB camera APP and you can see the video output of the USB camera
2) The serial number of the CSI interface pins is shown in the figure below
a. The No. 1 pin of the CSI interface is connected to the No. 24 pin of the camera
adapter board
b. The 24th pin of the CSI interface is connected to the 1st pin of the camera
adapter board
1) The Gc2035 camera kit includes a gc2035 camera, an adapter board and a cable
3) Then insert the ribbon cable into another card slot of the adapter board
4) Then insert the other end of the cable into the CIS camera interface of the
development board. Start the Android system after connecting the camera (do not insert
the camera after power-on)
5) Android 4.4 system test gc2035 camera requires the following Android image
6) After the Android system is started, open the camera APP and you can see the output
of the gc2035 camera. The location of the camera APP is shown in the figure below
2) Android 4.4 system test ov5640 camera requires the following Android image
3) After the Android system is started, open the camera APP and you can see the output
of the ov5640 camera. The location of the camera APP is shown in the figure below
To download the code of orangepi-build through the git clone command, you do not
need to enter the username and password of the github account (the other codes in this
manual are also the same), if you enter the git clone command, the Ubuntu PC prompts
the user who needs to enter the github account Name and password, usually the address
of the orangepi-build warehouse behind git clone is entered incorrectly. First of all, please
check the spelling of the command carefully, instead of thinking that we forgot to provide
the username and password of the github account.
2) The legacy branch uses the BSP version of the kernel. The current branch generally
uses the u-boot and kernel close to the mainline version. The u-boot and linux kernel
currently used by the H3 series development boards are as follows
Branch u-boot version linux kernel version
legacy u-boot 2018.05 linux3.4.113
current u-boot 2020.04 linux5.4.65
3) After orangepi-build is downloaded, it will contain the following files and folders
a. build.sh: Compile the startup script
b. external: Contains the configuration files needed to compile the image, specific
2) The image URL of the cross-compilation tool chain in China is the open source
software mirror site of Tsinghua University
https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/
gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi
gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf
gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu
gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi
gcc-linaro-aarch64-none-elf-4.8-2013.11_linux
gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux
gcc-linaro-arm-none-eabi-4.8-2014.04_linux
4) The cross-compilation tool chain used to compile the H3 linux kernel source code is
a. linux3.4
gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf
b. linux5.4
gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf
5) The cross-compilation tool chain used to compile the H3 u-boot source code is
a. u-boot 2018.05
gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf
b. u-boot 2020.04
gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf
5.1.3. Description of the complete directory structure of
orangepi-build
1) After the orangepi-build repository is downloaded, it does not contain the linux kernel,
u-boot source code and cross-compilation tool chain. The source code of the linux kernel
and u-boot are stored in a separate git repository (please do not download and use the
kernel and u separately -boot source code to compile, unless you know how to use it)
a. The git repository stored in the linux kernel source code is as follows
a) linux3.4
https://github.com/orangepi-xunlong/linux-orangepi/tree/orange-pi-3.4-sun8i
b) linux5.4
https://github.com/orangepi-xunlong/linux-orangepi/tree/orange-pi-5.4
b. The git repository where u-boot source code is stored is as follows
a) u-boot 2018.05
https://github.com/orangepi-xunlong/u-boot-orangepi/tree/v2018.05-sun8i-linux3.4
b) u-boot 2020.04
https://github.com/orangepi-xunlong/u-boot-orangepi/tree/v2020.04
2) When orangepi-build runs for the first time, it will download the cross-compilation
tool chain, u-boot and linux kernel source code. After successfully compiling a linux
image, the files and folders that can be seen in orangepi-build are:
a. build.sh: Compile the startup script
b. external: Contains the configuration files needed to compile the image, scripts
for specific functions, and the source code of some programs. The rootfs
compressed package cached during the compiling of the image is also stored in
external
c. kernel: Store the source code of the Linux kernel. The folder named
orange-pi-3.4-sun8i stores the kernel source code of the legacy branch of the H3
development board, and the folder named orange-pi-5.4 stores the current branch
of the H3 development board. The kernel source code (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 kernel source code of the current branch can be seen), the kernel
Please do not modify the name of the source code folder manually. If the build
system is modified, the kernel source code will be downloaded again when the
system is running.
d. LICENSE: GPL 2 license file
e. README.md: orangepi-build documentation
f. output: Store the compiled u-boot, linux and other deb packages, compilation
logs, and compiled images and other files
g. scripts: General script for compiling linux image
h. toolchains: Store the cross-compilation tool chain
i. u-boot: Store the source code of u-boot, the folder named
v2018.05-sun8i-linux3.4 inside stores the u-boot source code of the legacy
branch of the H3 development board, and the folder named v2020.04 inside
stores the H3 development U-boot source code of the current branch of the board
(if only the linux image of the legacy branch is compiled, then you can only see
the u-boot source code of the legacy branch; if you only compile the linux image
of the current branch, then you can only see the current Branch u-boot source
code), please do not modify the name of the u-boot source code folder manually.
If the compilation system is modified, the u-boot source code will be
re-downloaded when the system is running.
j. userpatches: Store configuration files needed to compile scripts
test@test:~/orangepi-build$ ls
build.sh external kernel LICENSE output README.md scripts
toolchains u-boot userpatches
5) Then it will start to compile u-boot, some of the information prompted during
compilation are explained as follows
a. u-boot source version
[ o.k. ] Compiling u-boot [ v2020.04 ]
e. Compile time
[ o.k. ] Runtime [ 1 min ]
f. Repeat the command to compile u-boot, use the following command without
selecting through the graphical interface, you can directly start compiling u-boot
[ o.k. ] Repeat Build Options [ sudo ./build.sh BOARD=orangepipcplus
BRANCH=current BUILD_OPT=u-boot KERNEL_CONFIGURE=yes ]
7) The files contained in the generated u-boot deb package are as follows
a. Use the following command to unzip 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-orangepipcplus_2.1.0_armhf.deb .
test@test:~/orangepi_build/output/debs/u-boot$ ls
linux-u-boot-current-orangepipcplus_2.1.0_armhf.deb usr
3 directories, 4 files
8) When the orangepi-bulid compilation system compiles the u-boot source code, it will
first synchronize the u-boot source code with the u-boot source code of the github server,
so if you want to modify the u-boot source code, you first need to turn off the download
and update function of the source code (You need to compile u-boot once to turn off
this function, otherwise you will be prompted that u-boot's source code cannot be
found), otherwise the changes made 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"
9) When debugging u-boot code, you can use the following method to update 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-orangepipcplus_2.1.0_armhf.deb [email protected]:/root
b. Then log in to the development board and uninstall the installed deb package of
u-boot
root@orangepi:~# apt remove -y linux-u-boot-orangepipcplus-current
g. Press Enter again to start updating u-boot, and the following information will be
displayed after the update is complete
h. Then you can restart to test that the u-boot modification is effective
5) Then the kernel configuration interface opened through make menuconfig will pop
up. At this time, you can directly modify the kernel configuration. If you don’t need to
modify the kernel configuration, just exit directly. After exiting, the kernel source code
will be compiled.
a. If you do not need to modify the configuration options of the kernel, when you
run the build.sh script, pass in KERNEL_CONFIGURE=no to temporarily block the
pop-up kernel configuration interface.
test@test:~/orangepi-build$ sudo ./build.sh KERNEL_CONFIGURE=no
6) When compiling the kernel source code, the following information will be prompted
(take the current branch as an example)
a. The version of the kernel source code
[ o.k. ] Compiling legacy kernel [ 5.4.65 ]
b. The version of the cross-compilation tool chain used to compile the kernel
source code
[ o.k. ] Compiler version [ aarch64-none-linux-gnu-gcc 9.2.1 ]
i. 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-sunxi-current.config ]
j. The final configuration file .config used by the kernel (modified the default
kernel configuration file through make menuconfig) will be copied to
output/config. If the kernel configuration is not modified, the final configuration
file and the default configuration file are Consistent
[ o.k. ] Exporting new kernel config [ output/config/linux-sunxi-current.config ]
k. The path of the deb package related to the kernel generated by the compilation
[ o.k. ] Target directory [ output/debs/ ]
l. The package name of the deb package containing the kernel image and kernel
module generated by the compilation
m. Compile time
[ o.k. ] Runtime [ 4 min ]
n. At the end, it will display the compiling command to recompile the kernel
selected last time. Use the following command without selecting through the
graphical interface, you can directly start compiling the kernel source code
[ o.k. ] Repeat Build Options [ sudo ./build.sh BOARD=orangepipcplus
BRANCH=current BUILD_OPT=kernel KERNEL_CONFIGURE=yes ]
10) View the deb package related to the kernel image generated by the compilation
a. linux-dtb-current-sunxi_2.1.0_armhf.deb contains dtb files used by the kernel
b. linux-headers-current-sunxi_2.1.0_armhf.deb contains the header files used
by the kernel
c. linux-image-current-sunxi_2.1.0_armhf.deb contains kernel images and
kernel modules
test@test:~/orangepi-build$ ls output/debs/linux-*
output/debs/linux-dtb-current-sunxi_2.1.0_armhf.deb
output/debs/linux-image-current-sunxi_2.1.0_armhf.deb
output/debs/linux-headers-current-sunxi_2.1.0_armhf.deb
11) The files contained in the generated linux-image deb package are as follows
a. Use the following command to unzip 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-sunxi_2.1.0_armhf.deb test/
test@test:~/orangepi_build/output/debs$ cd test
test@test:~/orangepi_build/output/debs/test$ dpkg -x \
linux-image-current-sunxi_2.1.0_armhf.deb .
test@test:~/orangepi_build/output/debs/test$ ls
boot etc lib linux-image-current-sunxi_2.1.0_armhf.deb usr
test@test:~/orangepi_build/output/debs/test$ tree -L 2
.
├── boot
│ ├── config-5.4.65-sunxi //Configuration file used to compile the kernel
source code
│ ├── System.map-5.4.65-sunxi
│ └── vmlinuz-5.4.65-sunxi //Compile the generated kernel image file
├── etc
│ └── kernel
├── lib
│ └── modules //Compile the generated kernel module
├── linux-image-current-sunxi_2.1.0_armhf.deb
└── usr
├── lib
└── share
8 directories, 4 files
12) The files contained in the generated linux-dtb deb package are as follows
a. Use the following command to unzip 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-dtb-current-sunxi_2.1.0_armhf.deb test/
test@test:~/orangepi_build/output/debs$ cd test
test@test:~/orangepi_build/output/debs/test$ dpkg -x \
linux-dtb-current-sunxi_2.1.0_armhf.deb .
test@test:~/orangepi_build/output/debs/test$ ls
boot linux-image-current-sunxi_2.1.0_armhf.deb usr
├── linux-dtb-current-sunxi_2.1.0_armhf.deb
└── usr
└── share
4 directories, 1 file
13) When the orangepi-bulid compilation system compiles the linux kernel source code,
it first synchronizes the linux kernel source code with the linux kernel source code of the
github server, so if you want to modify the linux kernel source code, you need to turn off
the source code update function first (you need to compile the linux kernel once. This
function can only be turned off after the source code, otherwise it will be prompted
that the source code of the linux kernel cannot be found), otherwise the changes made
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"
14) If you modify the kernel, you can use the following method to update the kernel and
kernel modules of the Linux system on the development board
a. Upload the compiled linux deb package 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-sunxi_2.1.0_armhf.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-image-current-sunxi
d. Then restart the development board, and then check whether the kernel-related
changes have taken effect
b. Then log in to the development board and install the deb package of the linux
header file just uploaded
root@orangepi:~# dpkg -i linux-headers-current-sunxi_2.1.0_armhf.deb
c. After installation, you can see the contents of the kernel header file just installed
in /usr/src
root@orangepi:~# ls /usr/src
linux-headers-current-sunxi
root@orangepi:~# ls /usr/src/linux-headers-current-sunxi
Documentation Module.symvers certs firmware init lib net security usr
Kconfig arch crypto fs ipc mm samples sound virt Makefile block
drivers include kernel modules scripts tools
2) Select Rootfs and all deb packages, and then press Enter
6) If it is to compile the image of the server version, you can also choose to compile the
Standard version or the Minimal version. The pre-installed software of the Minimal
version will be much less than the Standard version.
7) After selecting the type of image, rootfs will be compiled, and the following
information will be prompted during compilation
a. Type of rootfs
[ o.k. ] local not found [ Creating new rootfs cache for bionic ]
b. Compilation time
[ o.k. ] Runtime [ 13 min ]
c.
d. Repeat the command to compile rootfs, use the following command without
selecting through the graphical interface, you can start compiling rootfs directly
[ o.k. ] Repeat Build Options [ sudo ./build.sh BOARD=orangepipcplus
BRANCH=current BUILD_OPT=rootfs RELEASE=bionic
BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=yes ]
9) 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 is
already Rootfs with cache available, if available, use it directly, which can save a lot of
downloading and compiling time
10) Since it takes a long time to compile rootfs, if you don’t want to compile rootfs from
scratch, or if there is a problem with compiling rootfs, you can directly download the
rootfs compressed package cached by Orange Pi. The download link of rootfs
compressed package Baidu cloud disk is shown below, download A good rootfs
compressed package (don’t decompress it) needs to be placed in the
external/cache/rootfs directory of orangepi-build before it can be used normally by the
compiled script
Link:https://pan.baidu.com/s/1vWQmCmSYdH7iCDFyKpJtVw
Code:zero
7) If it is to compile the image of the server version, you can also choose to compile the
Standard version or the Minimal version. The pre-installed software of the Minimal
version will be much less than the Standard version.
8) After selecting the type of image, it will start to compile the Linux image. The general
process of compiling the image is as follows
a. Compile u-boot source code and generate u-boot deb package
b. Compile linux source code, generate linux related deb package
c. Make deb package of linux firmware
d. Make deb package of orangepi-config tool
e. Make board-level support deb package
f. If it is to compile the desktop version image, the desktop related deb package
will also be made
g. Check whether the rootfs has been cached, if there is no cache, re-create the
rootfs, if it has been cached, just unzip and use
h. Install the previously generated deb package into rootfs
i. Make some specific settings for different development boards and different types
c. Repeat the command to compile the image, use the following command without
selecting through the graphical interface, you can directly start to compile the
image
[ o.k. ] Repeat Build Options [ sudo ./build.sh BOARD=orangepipcplus
BRANCH=current BUILD_OPT=image RELEASE=bionic BUILD_MINIMAL=no
BUILD_DESKTOP=no KERNEL_CONFIGURE=yes ]
3) Android 4.4 has more complete drivers than Android 7.0. Both versions of the SDK
are the original SDK released by the chip manufacturer. If you want to use the Android
images compiled by these SDKs on the Orange Pi development board, you need to target
different boards. Adaptation can ensure the normal use of all functions
6) After downloading the android source code, first check whether the MD5 checksum is
7) Then decompress the source code of android sdk, after decompressing the sdk, two
folders of android and lichee will be generated
a. android: Store android-related code
b. linchee: Store the linux kernel and u-boot code
test@test:~$ mkdir OrangePiH3
test@test:~$ tar -xf OrangePiH3.tar -C OrangePiH3
test@test:~$ cd OrangePiH3
test@test:~/OrangePiH3$ ls
android lichee
2) Install jdk, execute the following command, a folder named jdk1.6.0_31 will be
generated under /usr/lib/jvm/ b. Then select jdk-6u31-linux-x64.rar in the opened Baidu
cloud disk
5) The location where the cross-compilation tool chain used in the compilation process
is stored is
test@test:~$ cd OrangePiH3/lichee/brandy/gcc-linaro
test@test:~/OrangePiH3/lichee/brandy/gcc-linaro$ ls
arm-linux-gnueabi bin lib libexec
1) The compilation environment needs to be configured when compiling the kernel for
the first time. After the configuration, the kernel code will be compiled automatically
test@test:~/OrangePiH3$ cd lichee
test@test:~/OrangePiH3/lichee$ ./build.sh config
3) If you recompile the kernel code later, you only need to enter the ./build.sh command
to start compiling
test@test:~/OrangePiH3/lichee$ ./build.sh
2) The final output log of the packaged and generated android image is as follows
test@test:~/OrangePiH3/android$ pack
......
----------image is at----------
lichee/tools/pack/sun8iw7p1_android_dolphin-p2_uart0.img
pack finish
2) After entering the data page, find the data download link corresponding to the
development board, and select the Android source code option
6) After downloading the android source code, first check whether the MD5 checksum is
correct, if not, please download the source code again
test@test:~$ cd H3-Android7.0
7) Then add multiple compressed packages and merge them into one compressed file
test@test:~/H3-Android7.0$ cat H3-sdk7.0-2017-11-03.tar.gza* > OrangePiH3.tar
8) Then decompress the source code of android sdk, after decompressing the sdk, two
folders of android and lichee will be generated
a. android: Store android-related code
b. lichee: Store the linux kernel and u-boot code
test@test:~$ mkdir OrangePiH3
test@test:~$ tar -xf OrangePiH3.tar -C OrangePiH3
test@test:~$ cd OrangePiH3
test@test:~/OrangePiH3$ ls
android lichee
1) First configure the compilation environment, after the configuration, the kernel source
code will be compiled
test@test:~/H3-Android7.0 /OrangePiH3$ cd lichee
test@test:~/H3-Android7.0 /OrangePiH3/lichee$ ./build.sh config
./build.sh config
2. sun50iw6p1
3. sun8iw11p1
4. sun8iw12p1
5. sun8iw6p1
6. sun8iw7p1
7. sun8iw8p1
8. sun9iw1p1
Choice: 6
All available platforms:
0. android
1. dragonboard
2. linux
3. camdroid
Choice: 0
All available business:
0. dolphin
1. secure
2. karaok
Choice: 0
3) If you recompile the kernel code later, you only need to enter the ./build.sh command
to start compiling
test@test:~/OrangePiH3/lichee$ ./build.sh
2) The final output log of the packaged and generated android image is as follows
----------image is at----------
lichee/tools/pack/sun8iw7p1_android_dolphin-p1_uart0.img
pack finish