Orange Pi PC User Manual - v3.2
Orange Pi PC User Manual - v3.2
Orange Pi PC User Manual - v3.2
Content
1. Basic features of Orange Pi PC........................................................................................1
1.1. What’s Orange Pi PC?...............................................................................................1
2.2. Download the image and related information of the development board................. 8
3.7. The first time the Linux5.4 system starts to automatically expand rootfs.............. 29
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 1 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
Interface Definition
www.orangepi.cn 2 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
Top View:
Bottom View:
www.orangepi.cn 3 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
www.orangepi.cn 4 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 5 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 6 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 7 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
www.orangepi.cn 8 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.
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
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
www.orangepi.cn 9 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
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
www.orangepi.cn 10 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
5) Use Win32Diskimager to burn Linux image to TF card
a. The download page of Win32Diskimager is
http://sourceforge.net/projects/win32diskimager/files/Archive/
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
2) Then use a card reader to insert the TF card into the computer
www.orangepi.cn 11 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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 12 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
b. Then select the device number of the TF card
c. Finally click Flash to start burning
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 13 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 14 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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 15 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
8) Then start to write the Android firmware to the TF card
a. First select the path of Android firmware in the firmware column
b. Select the startup card in the card type
c. Then click the burn card button to start burning
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 16 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,
www.orangepi.cn 17 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
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
www.orangepi.cn 18 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
board
4) The schematic diagram of connecting the USB to TTL module to the computer and
the Orange Pi development board is shown below
2.7.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 19 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
www.orangepi.cn 20 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
c. Set Flow control to None
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
www.orangepi.cn 21 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
9) After starting the development board, you can see the Log information output by the
system from the opened serial terminal
2) Download MobaXterm
www.orangepi.cn 22 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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 23 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
3) After downloading, use the decompression software to decompress the downloaded
compressed package, you can get the executable software of MobaXterm, and then
double-click to open it
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
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 24 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
Function Status
HDMI video OK
HDMI Audio OK
USB2.0 x 3 OK
TF card boot OK
Network card OK
IR receiver OK
www.orangepi.cn 25 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
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
Network card OK
IR receiver 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
www.orangepi.cn 26 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
GC2035 camera OK
Mali GPU OK
TV-OUT OK
Account Password
root orangepi
orangepi orangepi
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
www.orangepi.cn 27 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
root@orangepi:/sys/class/leds/red_led# echo none > trigger
1) The linux5.4 desktop version system will automatically log in to the desktop after it is
started by default, without entering a password
www.orangepi.cn 28 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
/etc/lightdm/lightdm.conf.d/22-orangepi-autologin.conf is as follows
root@orangepis:~# cat /etc/lightdm/lightdm.conf.d/22-orangepi-autologin.conf
[Seat:*]
#autologin-user=orangepi
autologin-user-timeout=0
user-session=xfce
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
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
www.orangepi.cn 29 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
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
www.orangepi.cn 30 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
tmpfs 997M 4.0K 997M 1% /tmp
/dev/zram0 49M 1.5M 44M 4% /var/log
tmpfs 200M 0 200M 0% /run/user/0
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
www.orangepi.cn 31 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
tmpfs 101M 2.1M 99M 3% /run
/dev/mmcblk0p1 2.0G 1.6G 335M 84% /
tmpfs 501M 140K 501M 1% /dev/shm
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
www.orangepi.cn 32 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
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
www.orangepi.cn 33 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
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
www.orangepi.cn 34 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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...
[ OK ] Started Update UTMP about System Runlevel Changes.
[ OK ] Started Authorization Manager.
orangepi login:
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.10.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 root@192.168.1.36 // Need to be replaced with the IP address of
the development board
root@192.168.1.36's password: // Enter the password here, the default
www.orangepi.cn 35 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
password is orangepi
3) The display after successfully logging in to the system is as shown in the figure below
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.10.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
www.orangepi.cn 36 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
3) Then you will be prompted to enter a password, the default passwords for both root
and orangepi users are orangepi
4) The display after successfully logging in to the system is as shown in the figure below
www.orangepi.cn 37 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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 38 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
1) Use HDMI to HDMI cable to connect Orange Pi development board and HDMI
display
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
www.orangepi.cn 39 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
development board
3) If the mouse or keyboard can operate normally, the USB interface is used normally
(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
www.orangepi.cn 40 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
Gigabit. Please pay attention to this point.
Serial number model
1 RTL8152B USB 100M network card
2 RTL8153 USB Gigabit Ethernet
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 41 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
4) The command to test network connectivity is as follows
root@orangepi:~# ping www.baidu.com -I enx00e04c362017
PING www.a.shifen.com (14.215.177.38) from 192.168.1.12 eth0: 56(84) bytes of data.
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=1 ttl=56 time=6.74 ms
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=2 ttl=56 time=6.80 ms
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=3 ttl=56 time=6.26 ms
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=4 ttl=56 time=7.27 ms
^C
--- www.a.shifen.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3002ms
rtt min/avg/max/mdev = 6.260/6.770/7.275/0.373 ms
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 42 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 test@192.168.1.55:/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
www.orangepi.cn 43 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
Subdevices: 1/1
Subdevice #0: subdevice #0
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
command is the IP address of the Orange Pi development board and needs to be
replaced
test@test:~/AudioTest$ scp audio.wav root@192.168.1.47:/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 44 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
www.orangepi.cn 45 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
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 46 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
www.orangepi.cn 47 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
4) 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
Testing events. Please, press CTRL-C to abort.
1602840581.225093: event type EV_MSC(0x04): scancode = 0x45c
1602840581.225105: event type EV_SYN(0x00).
www.orangepi.cn 48 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2) Compile wiringOP
root@orangepi:~# cd wiringOP
root@orangepi:~/wiringOP# ./build clean
root@orangepi:~/wiringOP# ./build
www.orangepi.cn 49 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 50 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 51 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 orangepipc 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
www.orangepi.cn 52 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
related to the gc2035 camera is automatically loaded
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 53 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
www.orangepi.cn 54 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 55 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
6) Modify the configuration of /etc/default/motion, change start_motion_daemon=no
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
www.orangepi.cn 56 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
1) linux5.4 system currently only supports ov5640 camera, not gc2035
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 57 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 58 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 development board
2) The functions of the 40 pin pins of the Orange Pi PC development board are shown in
the table below
GPIO GPIO Function Pin Pin Function GPIO GPIO No.
No.
3.3v 1 2 5v
12 PA12 SDA.0 3 4 5v
11 PA11 SCL.0 5 6 GND
www.orangepi.cn 59 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
www.orangepi.cn 60 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 61 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
www.orangepi.cn 62 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
successfully.
root@orangepi:~# gpio write 2 1
Use gpio readall to see that the value (V) of pin 7 has become 1
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 63 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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 | ................................
www.orangepi.cn 64 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 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 65 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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*
www.orangepi.cn 66 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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 67 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
d. After the system is started, you can see the information of ttyS1, ttyS2 and ttyS3
www.orangepi.cn 68 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
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
www.orangepi.cn 69 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
Out: 0: -> 0
Out: 1: -> 1
Out: 2: -> 2
Out: 3: -> 3
Out: 4: -> 4
Out: 5: -> 5
Out: 6: -> 6
Out: 7: -> 7
Out: 8: -> 8^C
3.24. 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 70 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 71 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 72 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@orangepipc:~# 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 73 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 74 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
f. After setting, you can see that the font on the LCD display becomes smaller
www.orangepi.cn 75 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 76 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@orangepipc:~# 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 77 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 78 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 79 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 80 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@orangepipc:~# 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 81 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 82 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 83 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@orangepipc:~# 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
www.orangepi.cn 84 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
www.orangepi.cn 85 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
2) Then you need to restart the system for the configuration of orangepipc-tvout.bin to
www.orangepi.cn 86 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
take effect
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
www.orangepi.cn 87 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
TV-OUT on the TV. Up
3) After shutting down, you need to unplug and plug the power again to boot up
www.orangepi.cn 88 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
Function Status
HDMI video OK
HDMI audio OK
USB2.0 x 3 OK
TF card boot OK
Network card OK
Infrared OK
CVBS audio OK
CVBS video 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
www.orangepi.cn 89 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
Function Status
HDMI video OK
HDMI audio OK
USB2.0 x 3 OK
TF card boot OK
Network card OK
Infrared OK
CVBS audio OK
CVBS video 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
www.orangepi.cn 90 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2) Then find the developer option and make sure that USB debugging is turned on
www.orangepi.cn 91 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
www.orangepi.cn 92 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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:/ #
www.orangepi.cn 93 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2) Then turn on the USB debugging option
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
root@dolphin-fvd-p1:/ # start 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
www.orangepi.cn 94 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
2) Download the USB camera test APP in Baidu cloud disk
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
www.orangepi.cn 95 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
www.orangepi.cn 96 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
www.orangepi.cn 97 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
www.orangepi.cn 98 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
www.orangepi.cn 99 www.xunlong.tv
range Pi 用户手册 深圳市迅龙软件有限公司版权所有
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
scripts, and the source code of some programs, etc.
c. LICENSE: GPL 2 license file
d. README.md: d.orangepi-build documentation
e. scripts: General script for compiling linux image
test@test:~/orangepi-build$ ls
build.sh external LICENSE README.md scripts
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/
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
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=orangepipc
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-orangepipc_2.1.0_armhf.deb .
test@test:~/orangepi_build/output/debs/u-boot$ ls
linux-u-boot-current-orangepipc_2.1.0_armhf.deb usr
├── LICENSE
├── orangepi_pc_plus_defconfig //编译 u-boot 源码使用的配置文件
└── platform_install.sh //u-boot 的烧录脚本
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-orangepipc_2.1.0_armhf.deb root@192.168.1.207:/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-orangepipc-current
g. Press Enter again to start updating u-boot, and the following information will be
displayed after the update is complete
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
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 ]
h. 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 ]
i. 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 ]
j. The path of the deb package related to the kernel generated by the compilation
[ o.k. ] Target directory [ output/debs/ ]
k. The package name of the deb package containing the kernel image and kernel
module generated by the compilation
[ o.k. ] File name [ linux-image-current-sunxi_2.1.0_armhf.deb ]
l. Compile time
[ o.k. ] Runtime [ 4 min ]
m. 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=orangepipc
BRANCH=current BUILD_OPT=u-boot KERNEL_CONFIGURE=yes ]
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
├── 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
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
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 root@192.168.1.207:/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
15) The method of installing the kernel header file into the linux system is as follows
a. Upload the deb package of the compiled linux header file to the linux system of
the development board
test@test:~/orangepi-build$ cd output/debs
test@test:~/orangepi-build/output/debs$ scp \
linux-headers-current-sunxi_2.1.0_armhf.deb root@192.168.1.207:/root
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
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=orangepipc
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
of images, such as pre-installing additional software packages and modifying
configuration files
j. Then make an image file and format the partition, the default type is ext4
k. Then copy the configured rootfs to the image partition
l. Then update the initramfs
m. Finally, write the bin file of u-boot to the image through the dd command
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=orangepipc
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
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:~$ md5sum -c OrangepiH3.tar.md5sum
OrangepiH3.tar: 确定
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
test@test:~$ sudo cp jdk-6u31-linux-x64.bin /usr/lib/jvm/
test@test:~$ cd /usr/lib/jvm/
test@test:~ /usr/lib/jvm$ sudo chmod a+x ./jdk-6u31-linux-x64.bin
test@test:~ /usr/lib/jvm$ sudo ./jdk-6u31-linux-x64.bin
test@test:~ /usr/lib/jvm$ ls
jdk1.6.0_31 jdk-6u31-linux-x64.bin
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
0. android
1. dragonboard
2. linux
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
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
test@test:~/H3-Android7.0$ md5sum -c md5sum.txt
H3-sdk7.0-2017-11-03.tar.gzaa: 确定
H3-sdk7.0-2017-11-03.tar.gzab: 确定
H3-sdk7.0-2017-11-03.tar.gzac: 确定
H3-sdk7.0-2017-11-03.tar.gzad: 确定
H3-sdk7.0-2017-11-03.tar.gzae: 确定
H3-sdk7.0-2017-11-03.tar.gzaf: 确定
H3-sdk7.0-2017-11-03.tar.gzag: 确定
H3-sdk7.0-2017-11-03.tar.gzah: 确定
H3-sdk7.0-2017-11-03.tar.gzai: 确定
H3-sdk7.0-2017-11-03.tar.gzaj: 确定
H3-sdk7.0-2017-11-03.tar.gzak: 确定
H3-sdk7.0-2017-11-03.tar.gzal: 确定
H3-sdk7.0-2017-11-03.tar.gzam: 确定
H3-sdk7.0-2017-11-03.tar.gzan: 确定
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
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