OrangePi R2S X1 User Manual v1.0
OrangePi R2S X1 User Manual v1.0
, Ltd
Orange Pi R2S
User Manual
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Catalogue
1. Basic characteristics of Orange Pi R2S ........................................................................... 6
1.1. What is Orange Pi R2S ........................................................................................................ 6
2.2. Download the image of the development board and related materials ..........................11
2.5.1. Method of burning Linux images to eMMC using KyDevTool tool .....20
2.6. Method for burning Linux images to USB storage devices ...............................................23
3.7.1. SSH remote login to the development board under Ubuntu ..................47
3.7.2. SSH remote login development board under Windows ........................ 48
3.8. How to upload files to the Linux system of the development board ............................... 50
3.8.1. How to upload files from Ubuntu PC to the Linux system of the
development board .............................................................................................. 50
3.8.2. How to upload files from Windows PC to the Linux system of the
development board .............................................................................................. 54
3.9. USB interface test ............................................................................................................. 59
3.14. How to shut down and restart the development board ................................................ 67
5.8.1. Mounting USB storage devices in the command line ......................... 100
5.8.2. Mount USB storage device in LuCI management interface ................101
5.9. USB wireless network card test ...................................................................................... 103
5.9.1. How to connect to WIFI hotspot using USB wireless network card ...104
5.9.2. How to create a WIFI hotspot using a USB wireless network card .... 107
5.10. Installing software packages through the command line ............................................ 111
5.11.1. Viewing the List of Available Software Packages in the System ...... 112
5.11.2. Example of Installing Software Packages ......................................... 113
5.11.3. Example of Removing Software Packages ........................................115
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
7. Appendix ......................................................................................................................126
7.1. User Manual Update History .......................................................................................... 126
The Orange Pi R2S adopts an open chip micro Ky X1 8-core RISC-V AI processor,
providing universal computing power with 2TOPS CPU fusion. It has 2GB/4GB/8GB
LPDDR4X operating memory and supports 8GB eMMC.
Orange Pi R2S has a wide range of interfaces, including 2.5G high-speed dual
network ports, dual gigabit network interfaces, USB 2.0, USB 3.0, Type-C power supply,
TF card slot, debugging serial port, etc.
Orange Pi R2S is exquisite and compact, with a size of only 79.2*46*1.6 mm,
making it easy to install in various small spaces. Orange Pi R2S supports OpenWrt and
Ubuntu, and can be widely used in enterprise gateways, industrial control hosts, industrial
automation, energy management, smart transportation, smart cities, and other fields.
A router
One switch
Of course, there are many other features as well. With a powerful ecosystem and
various expansion accessories, Orange Pi can help users easily achieve delivery from
creativity to prototype to mass production. It is an ideal creative platform for
makers, dreamers, and hobbyists.
6
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
• Ky X1 8 Core RISC-V AI
CPU
• 2.0T computing power
Memory 2GB/4GB/8GB(LPDDR4X)
Onboard storage • 8GB eMMC
2 * Gigabit Ethernet port(YT8531C )
Ethernet
2 * PCIe 2.5G Ethernet ports(RTL8125BG )
• 1 * USB 2.0 supports Device or HOST mode
USB interface
• 1 * USB3.0 HOST
Debug UART 3 PIN debugging serial port
7
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
8
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
9
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) For the Orange Pi R2S power adapter, it is recommended to use a 5V3A Type-C
power supply.
The Type-C power interface of the development board does not support PD
negotiation function and only supports a fixed 5V voltage input.
10
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) 100Mbps or 1G Ethernet cable, used to connect the development board to the Internet.
5) USB 2.0 male to male data cable, used for burning image function.
6) When using the serial port debugging function, a 3.3V USB to TTL module and
DuPont cable are required to connect the development board and computer.
11
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Note that the Linux image referred to here specifically refers to Linux
distribution images such as Ubuntu and OpenWRT downloaded from the Orange Pi
data download page.
2.3.1. Method of burning Linux images using balenaEtcher
1) Firstly, prepare a 16GB or larger TF card with a transfer speed of class10 or above. It
is recommended to use TF cards from brands such as SanDisk.
2) Then use a card reader to insert the TF card into the computer.
3) Download the compressed file of the Linux operating system image that you want to
burn from the Orange Pi's download page, and then use decompression software to
decompress it. In the decompressed file, the file ending with ".img" is the operating
system image file, which is usually over 2GB in size.
4) Then download the Linux image burning software -- balenaEtcher, from the
following download link:
https://www.balena.io/etcher/
5) After entering the balenaEtcher download page, clicking the green download button
will jump to the software download location.
12
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) Then you can choose to download the Portable version of BalenaEtcher software,
which does not require installation and can be used by double clicking.
13
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
8) The specific steps for burning a Linux image using balenaEtcher are as follows:
a. Firstly, select the path of the Linux image file to be burned.
b. Then select the drive letter of the TF card.
c. Finally, clicking Flash will start burning the Linux image onto the TF card.
9) The interface displayed during the process of burning a Linux image by balenaEtcher
is shown in the following figure. In addition, the progress bar displaying purple indicates
that the Linux image is being burned to the TF card.
14
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
10) After the Linux image is burned, balenaEtcher will also verify the image burned to
the TF card by default to ensure that there are no problems during the burning process. As
shown in the following figure, a green progress bar indicates that the image has been
burned and balenaEtcher is verifying the burned image.
11) After successful burning, the display interface of balenaEtcher is shown in the
following figure. If a green indicator icon is displayed, it indicates that the image burning
is successful. At this time, you can exit balenaEtcher, then unplug the TF card and insert
it into the TF card slot of the development board for use.
15
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Note that the Linux image referred to here specifically refers to Linux
distribution images such as Ubuntu and OpenWRT downloaded from the Orange Pi
data download page, while Ubuntu PC refers to a personal computer with the
Ubuntu system installed.
1) Firstly, prepare a 16GB or larger TF card with a transfer speed of class10 or above. It
is recommended to use TF cards from brands such as SanDisk.
2) Then use a card reader to insert the TF card into the computer.
4) After entering the balenaEtcher download page, clicking the green download button
will jump to the software download location.
16
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) Download the compressed file of the Linux operating system image that you want to
burn from the Orange Pi's download page, and then use decompression software to
decompress it. In the decompressed file, the file ending with ".img" is the operating
system image file, which is usually over 2GB in size.
7) After decompressing the image, you can first use the sha256sum -c *.sha command
to calculate if the checksum is correct. If the prompt is successful, it means that the
downloaded image is correct and can be safely burned to the TF card. If the prompt is
that the checksum does not match, it means that there is a problem with the downloaded
17
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
9) The specific steps for burning a Linux image using balenaEtcher are as follows:
a. Firstly, select the path of the Linux image file to be burned.
b. Then select the drive letter of the TF card.
c. Finally, clicking Flash will start burning the Linux image onto the TF card.
18
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
10) The interface displayed during the process of burning a Linux image by balenaEtcher
is shown in the following figure. In addition, the progress bar displaying purple indicates
that the Linux image is being burned to the TF card.
12) After the Linux image is burned, balenaEtcher will also verify the image burned to
the TF card by default to ensure that there are no problems during the burning process. As
shown in the following figure, a green progress bar indicates that the image has been
burned and balenaEtcher is verifying the burned image.
13) After successful burning, the display interface of balenaEtcher is shown in the
following figure. If a green indicator icon is displayed, it indicates that the image burning
is successful. At this time, you can exit balenaEtcher, then unplug the TF card and insert
it into the TF card slot of the development board for use.
19
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1)Firstly, it is necessary to prepare a high-quality USB 2.0 male to male data cable
2)Then download the KyDevTool.zip tool from the Orange Pi's download page, and
open KyDevTool.exe in the decompressed folder.
20
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
b. Then ensure that the development board is not connected to a power source.
c. Then hold down the BOOT button on the development board. The BOOT button
is located on the development board as shown in the following figure:
21
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
d. Then connect the Type-C interface power supply to the development board and
power it on.
g. Then click the Select Image button and choose the path of the Linux image you
want to burn.
h. Then check the checkbox shown in the figure below, so that the burning system
will automatically start after completion.
22
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
i. Finally, click the Start Flashing button to start burning the image, and the
printed image after burning is shown in the following figure.
Note that the Linux image referred to here specifically refers to Linux
distribution images such as Ubuntu and OpenWRT downloaded from the Orange Pi
data download page.
1) eMMC comes pre installed with Linux system at the factory, so it supports booting
from USB by default. If the system on eMMC has been formatted, you need to refer to
the method of burning a Linux image to eMMC to burn the Linux image to eMMC.
2) Then you need to prepare a USB storage device, such as a USB flash drive.
23
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) Then please refer to the instructions in two sections: the method of burning Linux
images to TF cards based on Windows PC and the method of burning Linux images
to TF cards based on Ubuntu PC to burn Linux images to USB storage devices. There
is no difference between burning a Linux image to a USB storage device and burning a
Linux image to a TF card (when the TF card is inserted into the card reader, the card
reader is actually equivalent to a USB flash drive).
4) Then insert the USB storage device that has burned the Linux system into the blue
USB interface of the development board.
5) Then inserting the Type C power supply will start the linux system in the USB storage
device.
6) After starting the system in the USB storage device, use the df -h command to see the
actual capacity of the USB storage device.
orangepi@orangepi:~$ df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 784M 9.8M 774M 2% /run
/dev/sda1 15G 1.6G 13G 11% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /tmp
orangepi-ramlog 50M 1.4M 49M 3% /var/log
tmpfs 784M 4.0K 784M 1% /run/user/1001
24
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) The eMMC of the development board comes pre installed with the OpenWRT system,
which can be used to test the full functionality of the development board.
2) The development board has an Ethernet port that can be plugged into a network cable
for internet access.
5) Please connect the development board to the computer using a serial port cable. For
instructions on how to connect the serial port, please refer to the section on debugging
serial port usage.
25
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
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 DuPont cables.
a. Connect the GND of the USB to TTL module to the GND of the development
board.
b. Connect the RX pin of the USB-to-TTL module to the TX pin of the
development board.
c. Connect the TX pin of the USB-to-TTL module to the RX pin of the
development board.
4) The connection diagram of the USB-to-TTL module between the computer and the
Orange Pi development board is shown below:
1) First, insert the USB-to-TTL module into your Ubuntu computer's USB port. If the
module is properly detected, you should see its corresponding device node under /dev/
directory. Note down this device name as it will be needed when configuring the serial
26
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) After executing the putty command, the following interface will pop up.
27
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
7) After completing the settings on the serial port settings interface, return to the Session
28
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
interface.
a. First select Connection type as Serial.
b. Then click the Open button to connect the serial port.
8) After starting the development board, you can see the log information output by the
system from the opened serial port terminal.
29
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) Download MobaXterm.
a. Download MobaXterm from the following URL:
https://mobaxterm.mobatek.net
b. Go to the MobaXterm download page and click GET XOBATERM NOW!.
30
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
d. Then select the Portable version. After downloading, you don’t need to install it.
You can use it directly by opening it.
3) After opening the software, the steps to set up the serial port connection are as
follows:
a. Open the session settings interface.
b. Select the serial port type.
c. Select the serial port number (select the corresponding port number according to
the actual situation). If you cannot see the port number, use Driver Master to
scan and install the USB to TTL serial port chip driver.
d. Select the serial port baud rate as 115200.
e. Finally, click the "OK" button to complete the settings.
31
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Click the "OK" button to enter the following interface. Now start the development
board and you can see the output information of the serial port.
32
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Function Ubuntu24.04
USB2.0x1 OK
USB3.0x1 OK
USB boot system OK
3pin debug serial port OK
eMMC Start OK
Gigabit Ethernet port x2 OK
2.5G Ethernet port x2 OK
Ethernet port status light OK
Watchdog test OK
1) All commands in this manual that need to be entered in the Linux system will be
framed with the following boxes.
As shown below, the contents in the yellow box indicate the contents that require
special attention, except for the commands inside.
33
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
below. This part is not part of the Linux command, so when entering a command
in the Linux system, please do not enter the content in red font.
orangepi@orangepi:~$ sudo apt update
root@orangepi:~# vim /boot/boot.cmd
test@test:~$ ssh [email protected]
root@test:~# ls
b. root@orangepi:~$ The prompt indicates that this command is entered in the
Linux system of the development board. The$ at the end of the prompt indicates
that the current user of the system is a normal user. When executing privileged
commands, you need to add sudo.
c. root@orangepi:~# The prompt indicates that this command is entered in the
Linux system of the development board. The # at the end of the prompt indicates
that the current user of the system is the root user and can execute any command
he wants.
d. test@test:~$ The prompt indicates that this command is entered in an Ubuntu
PC or Ubuntu virtual machine, not in the Linux system of the development board.
The $ at the end of the prompt indicates that the current user of the system is a
normal user. When executing privileged commands, sudo needs to be added.
e. root@test:~# The prompt indicates that this command is entered in an Ubuntu
PC or Ubuntu virtual machine, not in the Linux system of the development board.
The # at the end of the prompt indicates that the current user of the system is the
root user and can execute any command you want.
34
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
orangepi@orangepi:~$ echo \
"deb [arch=$(dpkg --print-architecture) \
signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \
https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Please note that when you enter the password, the specific content of the
password will not be displayed on the screen. Please do not think that there is any
malfunction. Just press Enter after entering it.
If you get an error message when entering the password, or there is a problem
with the ssh connection, please note that as long as you are using the Linux image
provided by Orange Pi, do not doubt that the password above is incorrect, but look
for other reasons.
3.4.2. How to set up automatic login for Linux system terminal
1) The Linux system automatically logs in to the terminal by default, and the default
login username is orangepi.
2) Use the following command to set the root user to automatically log in to the terminal.
35
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Use the following command to set the orangepi user to automatically log in to the
terminal again.
orangepi@orangepi:~$ sudo auto_login_cli.sh orangepi
1) There are five LED lights on the development board, one power light, two 2.5G
network port lights, and two Gigabit network port lights. The locations are shown in the
figure below:
2) As long as the development board is powered on, the power light will be on. This is
controlled by hardware and cannot be turned off by software. The red LED light can be
used to determine whether the power of the development board has been turned on
normally.
3) The network port light will flash when data transmission occurs at the corresponding
network port, which is also controlled by the network port chip itself.
36
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) After the system starts, the IP address will be automatically assigned to the Ethernet
card through DHCP, and no other configuration is required.
3) The command to check the IP address in the Linux system of the development board
is as follows:
orangepi@orangepi:~$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: end0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:e0:4c:68:00:13 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.241/24 brd 192.168.2.255 scope global dynamic noprefixroute end0
37
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4: enP1p1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen
1000
link/ether 00:e0:4c:68:00:01 brd ff:ff:ff:ff:ff:ff
5: enP2p1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen
1000
link/ether 00:e0:4c:68:00:02 brd ff:ff:ff:ff:ff:ff
When using ifconfig to check the IP address, if the following message is displayed, it
is because sudo is not added. The correct command is: sudo ifconfig.
orangepi@orangepi:~$ ifconfig
Command 'ifconfig' is available in the following places
* /sbin/ifconfig
* /usr/sbin/ifconfig
The command could not be located because '/sbin:/usr/sbin' is not included in the PATH
environment variable.
This is most likely caused by the lack of administrative privileges associated with your
user account.
ifconfig: command not found
There are two ways to check the IP address after the development board is
started:
1. Enter the ip addr show command in the debugging serial port terminal to view the IP
address.
2. If there is no debugging serial port, you can also view the IP address of the
38
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) The command to test network connectivity is as follows. The ping command can be
interrupted by pressing the Ctrl+Cshortcut key.
orangepi@orangepi:~$ ping www.baidu.com -I end0 #Test command for one of
the network ports
PING www.a.shifen.com (183.2.172.42) from 192.168.2.241 end0: 56(84) bytes of data.
64 bytes from 183.2.172.42: icmp_seq=1 ttl=53 time=10.1 ms
64 bytes from 183.2.172.42: icmp_seq=2 ttl=53 time=10.0 ms
64 bytes from 183.2.172.42: icmp_seq=3 ttl=53 time=9.91 ms
^C
--- www.a.shifen.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 9.910/10.017/10.126/0.088 ms
3.6.2. How to set a static IP address
Please do not set a static IP address by modifying the /etc/network/interfaces
configuration file.
39
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) Then select the network interface for which you want to set a static IP address. For
example, to set a static IP address for an Ethernet interface, select one of the interfaces in
the figure below.
5) Then use the Tab key to move the cursor to the <Automatic> position shown in the
figure below to configure IPv4.
40
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) Press Enter, use the up and down arrow keys to select Manual, and then press Enter to
confirm.
41
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
9) Then press Enter, and the following setting interface will pop up.
10) Then you can set the IP address (Addresses), gateway (Gateway) and DNS server
address as shown in the figure below (there are many other setting options, please explore
them yourself). Please set them according to your specific needs. The value set in the
figure below is just an example.
42
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
11) After setting, move the cursor to <OK> in the lower right corner and press Enter to
confirm.
13) Then select Activate a connection, move the cursor to <OK>, and press Enter.
43
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
14) Then select the network interface you want to configure, such as Wired connection
2, move the cursor to <Deactivate>, and press Enter to disable Wired connection 2.
15) Then please do not move the cursor and press the Enter key to re-enable Wired
connection 2, so that the static IP address set previously will take effect.
16) Then you can exit nmtui using the<Back> and Quit buttons.
44
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
17) Then use ip addr show enP2p1s0 to see that the IP address of the network port has
become the static IP address set previously.
orangepi@orangepi:~$ ip addr show enP2p1s0
3: enP2p1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel
state UP group default qlen 1000
link/ether 00:e0:4c:68:00:14 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.2/24 brd 192.168.2.255 scope global noprefixroute end1
valid_lft forever preferred_lft forever
inet6 fdcd:e671:36f4::49e/128 scope global dynamic noprefixroute
valid_lft 42950sec preferred_lft 42950sec
inet6 fdcd:e671:36f4:0:2139:e484:d595:deda/64 scope global temporary dynamic
valid_lft 604550sec preferred_lft 85735sec
inet6 fdcd:e671:36f4:0:7d9:7510:ccc5:fac9/64 scope global mngtmpaddr
noprefixroute
valid_lft forever preferred_lft forever
inet6 fe80::db62:da89:a277:2ff0/64 scope link noprefixroute
valid_lft forever preferred_lft forever
18) Then you can test the network connectivity to check whether the IP address is
configured OK. The ping command can be interrupted by pressing the Ctrl+C shortcut
key.
orangepi@orangepi:~$ ping www.baidu.com -I enP2p1s0
PING www.a.shifen.com (183.2.172.42) from 192.168.2.2 enP2p1s0: 56(84) bytes of
data.
64 bytes from 183.2.172.42: icmp_seq=1 ttl=53 time=10.2 ms
64 bytes from 183.2.172.42: icmp_seq=2 ttl=53 time=9.89 ms
45
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) If you want to set a static IP address for the network port, please plug the network
cable into the development board first, and then start setting the static IP address.
2) Then use the nmcli con show con show command to view the name of the network
device
orangepi@orangepir2s:~$ nmcli con show
NAME UUID TYPE DEVICE
Wired connection 1 941e80ac-17e7-36e4-9f0e-4ecf7da96763 ethernet --
Wired connection 2 8ade3ff0-195b-335a-9937-2da136afbadf ethernet --
Wired connection 3 df139a10-a820-32bb-8df0-76811709a268 ethernet --
Wired connection 4 ed9ce37f-bada-3d6f-9379-a4583cbab247 ethernet --
46
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) Then re-enter the Linux system and use ip addr showcommand to see that the IP
address has been set to the desired value.
orangepi@orangepi:~$ ip addr show
2: enP1p1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state
UP group default qlen 1000
link/ether 00:e0:4c:68:00:26 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.110/24 scope global noprefixroute enP3p49s0
valid_lft forever preferred_lft forever
inet6 fe80::9005:95ac:b9c0:2beb/64 scope link noprefixroute
valid_lft forever preferred_lft forever
By default, Linux systems have SSH remote login enabled, and allow the root
user to log in to the system. Before SSH login, you must first ensure that the
Ethernet or WiFi network is connected, and then use the ip addr command or check
the router to obtain the IP address of the development board.
3.7.1. SSH remote login to the development board under Ubuntu
1) 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
Note that when you enter the password, the screen will not display the specific
content of the password you entered. Please do not think that there is any
malfunction. Just press Enter after entering it.
If the prompt refuses to connect, as long as you are using the image provided by
Orange Pi, please do not doubt whether the password orangepi is wrong, but look
for other reasons.
47
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) After successfully logging into the system, the display is as shown below:
If ssh cannot log in to the Linux system normally, first check whether the IP
address of the development board can be pinged. If the ping is successful, you can
log in to the Linux system through the serial port and then enter the following
command on the development board to try to connect:
root@orangepi:~# reset_ssh.sh
2) Under Windows, you can use MobaXterm to remotely log in to the development
board. First, create a new ssh session.
a. Open Session.
b. Select SSH in Session Setting.
c. Enter the IP address of the development board in Remote host.
d. Enter the Linux user name root or root in Specify username.
e. Click OK.
48
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) You will then be prompted to enter a password. The default password for both root
and orangepi users is orangepi.
Please note that when you enter the password, the specific content of the
password will not be displayed on the screen. Please do not think that there is any
malfunction. Just press Enter after entering it.
4) After successfully logging into the system, the display is as shown below:
49
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3.8.1. How to upload files from Ubuntu PC to the Linux system of the
development board
1) Use the scp command to upload files from the Ubuntu PC to the Linux system of the
development board. The specific commands are as follows:
a. file_path:Need to be replaced with the path to the file to be uploaded.
b. orangepi:is the user name of the development board's Linux system. It can also
be replaced with other names, such as root.
c. 192.168.xx.xx: It is the IP address of the development board. Please modify it
according to the actual situation.
d. /home/orangepi:The path in the Linux system of the development board can
also be changed to other paths.
test@test:~$ scp file_path [email protected]:/home/orangepi/
50
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) There are more uses for scp. Please use the following command to view the man
manual.
test@test:~$ man scp
3) The interface after opening filezilla is as shown below. At this time, the remote site on
the right is empty.
51
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) The method of connecting the development board is shown in the figure below:
7) After the connection is successful, you can see the directory structure of the
development board's Linux file system on the right side of the filezilla software.
52
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
8) Then select the path to be uploaded to the development board on the right side of the
filezilla software, then select the file to be uploaded in the Ubuntu PC on the left side of
the filezilla software, right-click the mouse, and then click the upload option to start
uploading the file to the development board.
53
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
9) After uploading is complete, you can go to the corresponding path in the Linux system
of the development board to view the uploaded files.
10) The method for uploading a folder is the same as that for uploading a file, so I will
not go into details here.
3.8.2. How to upload files from Windows PC to the Linux system of
the development board
1) First download the installation file of the Windows version of the filezilla software.
The download link is as follows:
https://filezilla-project.org/download.php?type=client
54
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) The downloaded installation package is as shown below, and you can double-click it
to install it directly.
FileZilla_Server_1.5.1_win64-setup.exe
During the installation process, select Decline on the following installation interface,
and then select Next>.
55
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) The interface after opening filezilla is as shown below. At this time, the remote site on
the right is empty.
4) The method of connecting the development board is shown in the figure below:
56
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
7) After the connection is successful, you can see the directory structure of the
development board's Linux file system on the right side of the filezilla software.
57
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
8) Then select the path to be uploaded to the development board on the right side of the
filezilla software, then select the file to be uploaded in the Windows PC on the left side of
the filezilla software, right-click the mouse, and then click the upload option to start
uploading the file to the development board.
58
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
9) After uploading is complete, you can go to the corresponding path in the Linux system
of the development board to view the uploaded files.
10) The method for uploading a folder is the same as that for uploading a file, so I will
not go into details here.
The USB port can be connected to a USB hub to expand the number of USB
ports.
3.9.1. Test by connecting USB storage device
1) First, insert the USB flash drive or USB mobile hard disk into the USB port of the
Orange Pi development board.
2) Execute the following command. If you can see the output of sdX, it means that the
USB disk has been successfully recognized.
orangepi@orangepi:~$ cat /proc/partitions | grep "sd*"
59
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) Use the mount command to mount the USB drive to /mnt, and then you can view the
files in the USB drive.
orangepi@orangepi:~$ sudo mount /dev/sda1 /mnt/
orangepi@orangepi:~$ ls /mnt/
test.txt
4) After mounting, you can use the df -h command to view the capacity usage and mount
point of the USB drive.
orangepi@orangepi:~$ df -h | grep "sd"
/dev/sda1 29G 208K 29G 1% /mnt
3.9.2. USB camera test
1) First, you need to prepare a USB camera that supports UVC protocol as shown in the
figure below or similar, and then insert the USB camera into the USB port of the Orange
Pi development board.
2) Through the v4l2-ctl command, you can see that the device node information of the
USB camera is /dev/video20
orangepi@orangepi:~$ v4l2-ctl --list-devices | grep -A 3 "Q8 HD Webcam"
Q8 HD Webcam: Q8 HD Webcam (usb-fc880000.usb-1):
/dev/video20
/dev/video21
/dev/media1
60
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
In addition, the serial number of the video is not necessarily video20, please
refer to the actual one you see.
cluster1_thermal-virtual-0
Adapter: Virtual device
temp1: +60.0°C
61
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
The Linux system released by Orange Pi has the watchdog_test program pre-installed,
which can be used for direct testing.
62
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
int main(void)
{
printf("Hello World!\n");
return 0;
}
c. Then compile and run hello_world.c
orangepi@orangepi:~$ gcc -o hello_world hello_world.c
orangepi@orangepi:~$ ./hello_world
Hello World!
>>>
b. Write the hello_world.py program in Python
orangepi@orangepi:~$ vim hello_world.py
print('Hello World!')
c. The result of running hello_world.py is as follows
orangepi@orangepi:~$ python3 hello_world.py
Hello World!
3) Ubuntu Noble does not install Java compilation tools and runtime environment by
default
63
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) The Linux image released by OPi comes with a deb package of kernel header files by
default, which is stored in /opt/
The names of the deb packages of kernel header files of different kernel versions
may be different. Please refer to the actual ones you see.
orangepi@orangepi:~$ ls /opt/linux-headers*
/opt/linux-headers-current-ky_x.x.x_riscv64.deb
2) Use the following command to install the kernel header file deb package
The name of the kernel header file deb package needs to be replaced with the
64
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) After installation, you can see the folder where the kernel header files are located
under /usr/src
orangepi@orangepi:~$ ls /usr/src
linux-headers-6.6.36-ky
4) Then you can write a hello kernel module to test the kernel header file
a. First, write the code for the hello kernel module as follows:
orangepi@orangepi:~$ vim hello.c
#include <linux/init.h>
#include <linux/module.h>
return 0;
}
static void hello_exit(void)
{
printk("Hello Orange Pi -- exit\n");
return;
}
module_init(hello_init);
module_exit(hello_exit);
MODULE_LICENSE("GPL");
b. Then write the Makefile file to compile the hello kernel module as follows:
orangepi@orangepi:~$ vim Makefile
ifneq ($(KERNELRELEASE),)
obj-m:=hello.o
65
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
else
KDIR :=/lib/modules/$(shell uname -r)/build
PWD :=$(shell pwd)
all:
make -C $(KDIR) M=$(PWD) modules
clean:
rm -f *.ko *.o *.mod.o *.mod *.symvers *.cmd *.mod.c *.order
endif
c. Then use the make command to compile the hello kernel module. The output of
the compilation process is as follows:
If there is a problem compiling the copied code here, you can directly use the
source code pre-installed in the Linux system. The path of the hello source code is:
/usr/src/hello.
orangepi@orangepi:~$ sudo make
make -C /lib/modules/6.6.36-ky/build M=/home/orangepi modules
make[1]: Entering directory '/usr/src/linux-headers-6.6.36-ky'
CC [M] /home/orangepi/hello.o
MODPOST /home/orangepi/Module.symvers
CC [M] /home/orangepi/hello.mod.o
LD [M] /home/orangepi/hello.ko
make[1]: Leaving directory '/usr/src/linux-headers-6.6.36-ky'
d. After compilation, the hello.ko kernel module will be generated
orangepi@orangepi:~$ ls *.ko
hello.ko
e. Use the insmod command to insert the hello.ko kernel module into the kernel
orangepi@orangepi:~$ sudo insmod hello.ko
f. Then use the demsg command to view the output of the hello.ko kernel module.
If you can see the following output, it means that the hello.ko kernel module is
loaded correctly.
orangepi@orangepi:~$ sudo dmesg | grep "Hello"
[ 2871.893988] Hello Orange Pi -- init
g. Use the rmmod command to uninstall the hello.ko kernel module
orangepi@orangepi:~$ sudo rmmod hello
orangepi@orangepi:~$ sudo dmesg | grep "Hello"
[ 2871.893988] Hello Orange Pi -- init
66
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) When the Linux system is running, if you unplug the Type-C power directly to cut off
the power, the file system may lose some data or be damaged. Therefore, please use the
poweroff command to shut down the Linux system of the development board before
unplugging the power.
orangepi@orangepi:~$ sudo poweroff
67
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Codename: jammy
2) If your computer is running Windows and you don't have Ubuntu 22.04 installed, you
can consider using VirtualBox or VMware to install an Ubuntu 22.04 virtual machine in
Windows. But please note that you should not compile orangepi-build on a WSL virtual
machine, because orangepi-build has not been tested in a WSL virtual machine, so it is
not guaranteed that orangepi-build can be used normally in WSL.
3) The installation image download address of Ubuntu 22.04 amd64 version is:
https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04/ubuntu-22.04.3-desktop-amd64.iso
or
https://repo.huaweicloud.com/ubuntu-releases/22.04/ubuntu-22.04.3-desktop-amd64.iso
4) After installing Ubuntu 22.04 on your computer or in a virtual machine, please set the
software source of Ubuntu 22.04 to Tsinghua source first, otherwise it is easy to get errors
due to network reasons when installing software later
a. For the method of replacing Tsinghua source, please refer to the instructions on
this page
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
b. Note that the Ubuntu version needs to be switched to 22.04
68
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
d. After the replacement, you need to update the package information and ensure
that there is no error
test@test:~$ sudo apt update
e. In addition, since the source codes of the kernel and U-boot are stored on
GitHub, it is very important to ensure that the computer can download the
code from GitHub normally when compiling the image.
Note that the Orange Pi R2S development board needs to download the next
branch source code of orangepi-build. The above git clone command needs to
specify the branch of orangepi-build source code as next.
69
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
You do not need to enter the username and password of your GitHub account
when you download the orangepi-build code through the git clone command (the
same applies to downloading other codes in this manual). If your Ubuntu PC
prompts you to enter the username and password of your GitHub account after
entering the git clone command, it is usually because the address of the
orangepi-build repository after git clone is entered incorrectly. Please check the
command spelling carefully for any errors, instead of thinking that we forgot to
provide the username and password of our GitHub account.
2) The u-boot and linux kernel versions currently used by the development board are as
follows
Branches u-boot Version linuxKernel version
current u-boot 22.10 Linux6.6
The branch mentioned here is not the same as the branch of orangepi-build
source code, please do not confuse them. This branch is mainly used to distinguish
different kernel source code versions.
3) After orangepi-build is downloaded, it will contain the following files and folders
a. build.sh: Compile the startup script
b. external: Contains configuration files, specific scripts, and source code of some
70
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
If you download the orangepi-build code from github, you may find that
orangepi-build does not contain the source code of u-boot and linux kernel, nor the
cross-compilation toolchain required to compile u-boot and linux kernel. This is
normal because these things are stored in other separate github repositories or some
servers (the addresses will be detailed below). orangepi-build will specify the
addresses of u-boot, linux kernel and cross-compilation toolchain in the script and
configuration file. When running orangepi-build, if it finds that these things are not
available locally, it will automatically download them from the corresponding
places.
4.2.2. Download the cross-compilation toolchain
The cross-compilation toolchain will only be downloaded when you compile the
image using orangepi-build on an x64 computer. Compiling the Linux image of the
development board in Ubuntu 22.04 on the development board will not download
the cross-compilation toolchain, and orangepi-build/toolchains will be an empty
folder.
1) When orangepi-build is run for the first time, it will automatically download the
cross-compilation toolchain and put it in the toolchains folder. Each time you run the
build.sh script of orangepi-build, it will check whether the cross-compilation toolchain in
toolchains exists. If not, it will restart the download. If it exists, it will be used directly
without repeated download.
71
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) The mirror website of the cross-compilation tool chain in China is the open source
software mirror website of Tsinghua University
https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/
4) The cross-compilation tool chain used to compile the Linux kernel source code is
a. Linux6.6
riscv64-unknown-linux-gnu-gcc
72
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) The cross-compilation tool chain used to compile the u-boot source code is
a. v2022.10
riscv64-unknown-linux-gnu-gcc
4.2.3. orangepi-build complete directory structure description
1) After downloading the orangepi-build repository, it does not contain the source code
of the Linux kernel, u-boot, and the cross-compilation toolchain. The source code of the
Linux kernel and u-boot is stored in a separate git repository.
a. The git repository where the Linux kernel source code is stored is as follows:
https://github.com/orangepi-xunlong/linux-orangepi/tree/orange-pi-6.6-ky
b. The git repository where the u-boot source code is stored is as follows:
https://github.com/orangepi-xunlong/u-boot-orangepi/tree/v2022.10-ky
2) When orangepi-build is run for the first time, it will download the cross-compilation
toolchain, u-boot and Linux kernel source code. After successfully compiling a Linux
image, the files and folders that can be seen in orangepi-build are
a. build.sh: Compile the startup script
b. external: Contains configuration files, scripts for specific functions, and source
code for some programs needed to compile the image. The rootfs compressed
package cached during the image compilation process is also stored in external
c. kernel: The source code of the Linux kernel is stored in the folder named
orange-pi-6.6-ky, which is the kernel source code of the current branch of the
Orange Pi R2S development board. Please do not manually modify the name of
the kernel source code folder. If modified, the kernel source code will be
downloaded again when the compile 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, compiled images and other files
g. scripts: Generic script for compiling linux images
h. toolchains: Store cross-compilation toolchain
i. u-boot: The u-boot source code is stored in the folder named v2022.10-ky,
which stores the u-boot source code of the current branch of the Orange Pi R2S
series development board. Please do not manually modify the name of the u-boot
73
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
source code folder. If modified, the u-boot source code will be re-downloaded
when the compilation system is running.
j. userpatches: Store the configuration files needed to compile the script
test@test:~/orangepi-build$ ls
build.sh external kernel LICENSE output README.md scripts
toolchains u-boot userpatches
4) Then u-boot will start to compile. Some of the information prompted during
compilation is as follows
a. u-boot source code version
74
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) The files contained in the generated u-boot deb package are as follows
a. Use the following command to decompress the deb package
test@test:~/orangepi-build$ cd output/debs/u-boot
test@test:~/orangepi_build/output/debs/u-boot$ $ dpkg -x \
linux-u-boot-current-orangepir2s_1.0.0_riscv64.deb . (Note that there is a“.”)
test@test:~/orangepi_build/output/debs/u-boot$ ls
linux-u-boot-current-orangepir2s_1.0.0_riscv64.deb usr
b. The decompressed files are as follows
test@test:~/orangepi-build/output/debs/u-boot$ tree usr
usr
└── lib
├── linux-u-boot-current-orangepir2s_1.0.0_riscv64
│ ├── bootinfo_emmc.bin
│ ├── bootinfo_sd.bin
│ ├── bootinfo_spinor.bin
│ ├── FSBL.bin
│ ├── u-boot-env-default.bin
75
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
│ └── u-boot-opensbi.itb
└── u-boot
├── LICENSE
├── platform_install.sh
└── x1_defconfig
3 directories, 9 files
7) 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 on the github server.
So if you want to modify the u-boot source code, you first need to turn off the source
code download and update function (you need to fully compile u-boot once before
turning off this function, otherwise it will prompt that the u-boot source code cannot
be found. If the source code compression package is downloaded from Baidu Cloud
Disk, there will be no such problem, because the u-boot source code has been
cached), 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"
8) When debugging the u-boot code, you can use the following method to update the
u-boot in the Linux image for testing
a. Upload the compiled u-boot deb package to the Linux system of the
development board
test@test:~/orangepi-build$ cd output/debs/u-boot
test@test:~/orangepi_build/output/debs/u-boot$ scp \
linux-u-boot-current-orangepir2s_1.0.0_riscv64.deb [email protected]:/root
b. Then log in to the development board and uninstall the installed u-boot deb
package
root@orangepi:~# apt purge -y linux-u-boot-orangepir2s-current
c. Install the new u-boot deb package just uploaded
root@orangepi:~# dpkg -i linux-u-boot-current-orangepir2s_1.0.0_riscv64.deb
d. Then run the nand-sata-install script
root@orangepi:~# nand-sata-install
e. Then select 5 Install/Update the bootloader on SD/eMM to update the u-boot
76
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
g. Press the Enter key again to start updating u-boot. After the update, the following
information will be displayed
h. Then you can restart the development board to test whether the changes to
u-boot are effective.
77
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Then you will be prompted whether you need to display the kernel configuration
interface. If you do not need to modify the kernel configuration, select the first one. If
you need to modify the kernel configuration, select the second one.
5) If you selected the option to display the kernel configuration menu (the second option)
in step 4), the kernel configuration interface opened by make menuconfig will pop up.
You can modify the kernel configuration directly at this time. After modifying, save and
exit. After exiting, the kernel source code will be compiled.
78
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
a. If you do not need to modify the kernel configuration options, when running the
build.sh script, pass in KERNEL_CONFIGURE=no to temporarily block the kernel
configuration interface from popping up.
test@test:~/orangepi-build$ sudo ./build.sh KERNEL_CONFIGURE=no
b. You can also set KERNEL_CONFIGURE=no in the
orangepi-build/userpatches/config-default.conf configuration file to permanently
disable this feature
c. If the following error message appears when compiling the kernel, it is because
the terminal interface of the Ubuntu PC is too small, which causes the make
menuconfig interface to fail to display. Please adjust the terminal of the Ubuntu PC
to the maximum size and re-run the build.sh script.
79
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) Some of the information prompted when compiling the kernel source code is as
follows
a. Linux kernel source code version
[ o.k. ] Compiling current kernel [ 6.6.63 ]
b. Version of the cross-compilation toolchain used
[ o.k. ] Compiler version [ riscv64-unknown-linux-gnu-gcc 13.2.1 ]
c. The default configuration file used by the kernel and the path where it is stored
[ o.k. ] Using kernel config file [ config/kernel/linux-ky-current.config ]
d. The path of the compiled kernel-related deb package
[ o.k. ] Target directory [ orangepi-build/output/debs/ ]
e. The package name of the compiled kernel image deb package
[ o.k. ] File name [ linux-image-current-ky_1.0.0_riscv64.deb ]
f. Compilation time
[ o.k. ] Runtime [ 5 min ]
g. Finally, the compilation command for the last selected kernel will be displayed.
Use the following command to directly start compiling the kernel source code
without selecting through the graphical interface.
[ o.k. ] Repeat Build Options [ sudo ./build.sh BOARD=orangepir2s
BRANCH=current BUILD_OPT=kernel KERNEL_CONFIGURE=no ]
80
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
test@test:~/orangepi-build$ ls output/debs/linux-*
output/debs/linux-dtb-current-ky_1.0.0_riscv64.deb
output/debs/linux-image-current-ky_1.0.0_riscv64.deb
output/debs/linux-headers-current-ky_1.0.0_riscv64.deb
9) When the orangepi-bulid compilation system compiles the Linux kernel source code,
it will first synchronize the Linux kernel source code with the Linux kernel source code
on the GitHub server. So if you want to modify the Linux kernel source code, you first
81
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
need to turn off the source code update function (you need to fully compile the Linux
kernel source code once before turning off this function, otherwise it will prompt
that the Linux kernel source code cannot be found. If the source code compression
package is downloaded from Baidu Cloud Disk, there will be no such problem
because the Linux source code has been cached), 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"
10) If the kernel is modified, you can use the following method to update the kernel and
kernel modules of the development board Linux system
a. Upload the compiled Linux kernel 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-ky_1.0.0_riscv64.deb [email protected]:/root
b. Then log in to the development board and uninstall the installed linux kernel deb
package
root@orangepi:~# apt purge -y linux-image-current-ky
c. Then install the new Linux kernel deb package just uploaded
root@orangepi:~# dpkg -i linux-image-current-ky_1.0.0_riscv64.deb
d. Then restart the development board and check whether the kernel-related
modifications have taken effect.
root@orangepi:~# reboot
82
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) Then choose to compile the Standard version or Minimal version. The Minimal
version will have much less pre-installed software than the Standard version (please do
not choose the Minimal version if you do not have special needs, because many
things are not pre-installed by default and some functions may not be used)
83
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) Then it will start compiling rootfs. Some of the information prompted during
compilation is as follows
a. Type of rootfs
[ o.k. ] local not found [ Creating new rootfs cache for noble]
b. Storage path of the compiled rootfs compressed package
[ o.k. ] Target directory [ external/cache/rootfs ]
c. The name of the rootfs compressed package generated by compilation
[ o.k. ] File name [ noble-cli-riscv64.ef7fa533e64f5a838939560d81632155.tar.lz4 ]
d. Compilation time
[ o.k. ] Runtime [ 13 min ]
84
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
85
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) Then choose to compile the Standard version or Minimal version. The Minimal
version will have much less pre-installed software than the Standard version (please do
not choose the Minimal version if you do not have special needs, because many
things are not pre-installed by default and some functions may not be used)
6) Then the Linux image will be compiled. The general process of compilation is as
follows
a. Initialize the compilation environment of Ubuntu PC and install the software
packages required for the compilation process
b. Download the source code of u-boot and linux kernel (if already cached, just
update the code)
c. Compile the u-boot source code and generate the deb package of u-boot
d. Compile the Linux source code and generate Linux-related deb packages
e. Make a deb package for Linux firmware
f. Make the deb package of orangepi-config tool
g. Make a deb package for board-level support
h. If you compile a desktop version image, you will also create a desktop-related
deb package
i. Check if the rootfs is already cached. If not, re-create the rootfs. If it is already
cached, decompress it and use it directly.
j. Install the deb package generated previously to rootfs
k. Make some specific settings for different development boards and different types
of images, such as pre-installing additional software packages, modifying system
configuration, etc.
l. Then create an image file and format the partition. The default type is ext4
m. Then copy the configured rootfs to the mirrored partition
86
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
87
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Function OpenWRT
USB2.0x1 OK
USB3.0x1 OK
3pin Debug serial port OK
2.5G PCIe Network port*2 OK
Gigabit Ethernet*2 OK
Network port status light OK
RTL8821CU USB Network Card OK
RTL8723BU USB Network Card OK
eMMC OK
1) When you start the OpenWRT system for the first time, the resize-rootfs.sh script will
be executed to expand the rootfs, and it will automatically restart after the expansion is
completed
2) After logging into 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 storage device (TF card, eMMC or
NVME SSD), it means that the automatic expansion is running correctly.
root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 14.8G 14.7G 91.6M 99% /
tmpfs 495.5M 6.1M 489.4M 1% /tmp
tmpfs 512.0K 0 512.0K 0% /dev
/dev/root 14.8G 14.7G 91.6M 99% /opt/docker
88
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) The LAN port is used to connect local devices, such as computers. The DHCP server
is enabled by default, the network segment is 192.168.2.0/24, and the default gateway is
192.168.2.1.
2) The OpenWrt system will automatically log in as the root user by default, and the
display interface is as follows
89
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) The default network segment of the LAN port in the OpenWRT system is configured
as 192.168.2.0/24 (the gateway address is 192.168.2.1), so the computer will be assigned
an IP address within this network segment.
3) If the computer is installed with Ubuntu system, you can directly use SSH to log in to
the board through the following command. No password is required by default.
test@ubuntu:~$ ssh [email protected]
4) After successfully logging into the system, the display is as shown below
90
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) If the computer is installed with Windows system, you can refer to the method
described in the section "SSH remote login development board under Windows" to
log in
5.5.3. Log in to the LuCI management interface
1) First, use a network cable to connect the LAN port of the development board to the
computer network port. Under normal circumstances, the computer will automatically
obtain an IP address from the development board through DHCP.
2) The default network segment of the LAN port in the OpenWRT system is configured
as 192.168.2.0/24 (the gateway address is 192.168.2.1), so the computer will be assigned
an IP address within this network segment.
3) After the computer obtains the IP address, enter the IP address of the development
board LAN port 192.168.2.1 in the browser on the computer and you can see the login
interface shown in the figure below.
91
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) The OpenWrt system does not have a password by default, so just click the login
button. After a successful login, the interface is displayed as shown below
2) The default network segment of the LAN port in the OpenWRT system is configured
as 192.168.2.0/24 (the gateway address is 192.168.2.0/24), so the computer will be
assigned an IP address within this network segment.
3) After the computer obtains the IP address, enter the IP address of the development
board LAN port 192.168.2.1 in the computer browser and you can see the login interface
shown in the figure below.
92
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) The OpenWrt system does not have a password by default, so just click the login
button. After a successful login, the interface is displayed as shown below
4) Then select "Terminal" in the "Service" column of the navigation bar of the interface
and click to enter
93
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
94
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) The default network segment of the LAN port in the OpenWRT system is configured
as 192.168.2.0/24 (the gateway address is 192.168.2.1), so the computer will be assigned
an IP address within this network segment.
3) After the computer obtains the IP address, enter 192.168.2.1:7681 in the browser to
log in to the OpenWRT command line.
95
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) First, use the following command to obtain the network configuration. The
corresponding configuration file is /etc/config/network. You can see that the value of
network.lan.ipaddr is 192.168.2.1
root@OpenWrt:~# uci show network
...
network.lan=interface
network.lan.device='br-lan'
network.lan.proto='static'
network.lan.ipaddr='192.168.2.1'
network.lan.netmask='255.255.255.0'
network.lan.ip6assign='60'
....
3) Use the following command to modify the network.lan.ipaddr item to a new value
(for example, 192.168.100.1).
96
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Then execute the submit command, and the above configuration will be written to
/etc/config/network
root@OpenWrt:~# uci commit
5) Check the configuration file to confirm whether the modification is successful. If the
IP address in red font is consistent with the one to be set, it means the modification is
successful.
root@OpenWrt:~# cat /etc/config/network
...
config interface 'lan'
option device 'br-lan'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.100.1'
...
6) Then restart the network through ubus to make the configuration take effect. For
instructions on using ubus, please refer to the official documentation
root@OpenWrt:~# ubus call network restart
7) At this point, enter the command and you can see that the IP of the LAN port is
already 192.168.100.1
root@OpenWrt:~# ifconfig br-lan
br-lan Link encap:Ethernet HWaddr FE:55:13:A3:EF:E7
inet addr:192.168.100.1 Bcast:192.168.100.255 Mask:255.255.255.0
inet6 addr: fd60:c4cd:1033::1/60 Scope:Global
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:370 (370.0 B)
97
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) You will be prompted to re-enter your password. Enter the password again to confirm
and press Enter.
Retype password:
98
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Note: In the "Password" and "Confirm Password" dialog boxes, the passwords
entered twice must be consistent.
4) After the password is successfully changed, a pop-up box will pop up saying "System
password has been changed successfully". At this time, you need the password to log in
to OpenWRT
99
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) Execute the following command. If you can see the output of sdX, it means that the
USB disk has been successfully recognized.
root@OpenWrt:~# cat /proc/partitions | grep "sd*"
major minor #blocks name
8 0 15126528 sda
3) Use the mount command to mount the USB drive to /mnt, and then you can view the
files in the USB drive.
root@OpenWrt:~# mount /dev/sda /mnt/
root@OpenWrt:~# ls /mnt/
test.txt
4) After mounting, you can use the df -h command to view the capacity usage and mount
point of the USB drive.
root@OpenWrt:~# df -h | grep "sd"
/dev/sda 14.4G 187.2M 14.2G 1% /mnt
100
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) Then follow the steps to log in to the LuCI management interface to enter the LuCI
management interface
3) Then in the LuCI management interface, click "System->Mount Point" to enter the
mount point configuration interface
101
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) Then you will return to the mount point global settings page. Click "Save and Apply"
in the lower left corner of the page to make the mount point take effect.
102
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) After saving, you can see in the "Mounted file system" that the storage device has
been mounted successfully
The currently tested USB wireless network cards are shown below. Please test other
types of USB wireless network cards by yourself. If they cannot be used, you need to
transplant the corresponding USB wireless network card driver.
Serial number model
103
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1 RTL8723BU
support 2.4G WIFI+BT4.0
2 RTL8821CU
support 2.4G +5G WIFI
support BT 4.2
3 RTL8811
support 2.4G +5G WIFI
2)After the system is started, click Network -> Wireless to enter the wireless WiFi
configuration interface.
104
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4)Then click Save in the lower right corner of the page to make the configuration take
effect.
5)Then click the Scan button to scan the surrounding WiFi hotspots.
6)Then the following window will pop up showing the available WiFi hotspots. Click
the Join Network button on the right side of the WiFi hotspot you want to connect to to
connect to the WiFi hotspot.
105
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
7)Then a WiFi hotspot connection interface will pop up. Enter the hotspot password as
shown in the picture below and click the Submit button.
8)Then the following interface will pop up, click the Save button in the lower right
corner.
9)Finally, you will return to the main interface of wireless configuration. Click Save
and Apply and wait for the configuration to be applied.
106
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
10)After successfully connecting to the WiFi hotspot, the interface will be displayed as
shown below.
2)After the system is started, click Network -> Wireless to enter the wireless WiFi
configuration interface.
107
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4)Then click Save in the lower right corner of the page to make the configuration take
effect.
108
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6)In the pop-up tab Device Configuration, we set the parameters as shown in the figure
below.
7)Then in Interface Configuration -> General Settings, set the mode to Access Point
AP, ESSID (wireless network name) to OpenWrt, and the network to lan
109
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
9)After completing the above settings, click Save in the lower right corner of the page,
and then exit the tab page
10)Then click Save and Apply in the lower right corner of the page and wait for the
configuration to be applied.
11)The display interface of successfully creating a hotspot is shown in the figure below
110
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
12)Then use your mobile phone or computer to search for the WiFi corresponding to the
SSID and connect. After the connection is successful, it will be shown as follows
111
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) Uninstall software
root@OpenWrt:/# opkg remove <Package Name>
If you need to add software packages, you can install them through the
OpenWRT management interface.
5.11.1. Viewing the List of Available Software Packages in the System
1) First, enter the software package management page
a. Find the "System" option in the navigation bar and click to enter
b. In the vertical bar options below the system, select "Software Package" and
click to enter
2) Then the main page of the software package will appear, as shown in the following
figure, to obtain the list of available software
a. In the "Operation" option of the software package, click "Update List" to
obtain the list of available software packages
b. On the tab page, click "Available" to view the currently available software
packages
c. View the current number of available software packages
112
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
c. Then the following pop-up window will appear, click "Install" to proceed
113
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
114
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
115
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
There are two main software options for implementing OpenWRT LAN file
sharing: Samba and NFS. Samba system has good compatibility, while NFS
performs better. For users who need to use Windows devices, it is recommended to
choose Samba.
116
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
117
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
118
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) After setting up, enter \ \ OpenWrt in the address bar of the resource manager to
access the shared directory. The username is root and the password is the password set by
the development board host
The OpenWRT system has pre installed the zerotier client. After creating a
119
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
virtual LAN on the zerotier official website, the client can directly join it through the
Network ID. The specific operation is shown below.
2) Click to enter the network console page, where you can set the privacy option to
public, so that network nodes that join do not need to be verified
3) Below, the address will be automatically assigned. Here, you can choose your own
network segment, and the selected one is 172.27. **
120
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Enter the following command on the OpenWRT terminal to join the virtual LAN
created above, where 8286ac0e47d53bb5 is the Network ID of the virtual LAN
created above
root@OpenWrt:/# zerotier-one -d #Start the zerotier client
root@OpenWrt:/# zerotier-cli join 8286ac0e47d53bb5 #Join the network
5) By entering ifconfig on the terminal, it can be seen that there is already a newly
added ztks54inm2 device with an IP address of 172.27.214.213
root@OpenWrt:/# ifconfig
ztks54inm2 Link encap:Ethernet HWaddr F6:4E:DE:BF:D8:52
inet addr:172.27.214.213 Bcast:172.27.255.255 Mask:255.255.0.0
inet6 addr: fe80::e82f:d0ff:fe5a:867e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:2800 Metric:1
RX packets:18 errors:0 dropped:0 overruns:0 frame:0
TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1720 (1.6 KiB) TX byte81 (8.2 KiB)
121
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
9) Then install the zerotier client on another device (using Ubuntu 18.04 as an example),
execute the following command to install, and restart the computer after installation is
complete
test@ubuntu:~$ curl -s https://install.zerotier.com | sudo bash
10) After restarting, join the virtual LAN based on the Network ID, and you can also see
that the IP address assigned by zerotier has been obtained. At this time, the Ubuntu PC
and OrangePi R1 Plus LTS are in the same LAN, and they can communicate freely
test@ubuntu:~$ sudo zerotier-cli join 8286ac0e47d53bb5
test@ubuntu:~$ ifconfig
ztks54inm2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 2800
122
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
123
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) First, execute the following command to download the openwrt-24.10 branch code
test@test:~$ sudo apt update
test@test:~$ sudo apt install -y git
test@test:~$ git clone https://github.com/orangepi-xunlong/openwrt.git -b openwrt-24.10
2) After downloading the OpenWRT code, the following files and folders will be
included
test@test:~/openwrt$ ls
BSDmakefile Config.in include Makefile README.md scripts toolchain
Config feeds.conf.default LICENSE package rules.mk target tools
1) Firstly, install the following dependency packages (currently only tested for
compilation on Ubuntu 22.04. If compiling on other versions of the system, please install
the dependency packages yourself according to the error message)
test@test:~/openwrt$ sudo apt update
test@test:~/openwrt$ sudo apt install -y ack antlr3 asciidoc autoconf \
automake autopoint binutils bison build-essential \
bzip2 ccache cmake cpio curl device-tree-compiler fastjar \
flex gawk gettext gcc-multilib g++-multilib git gperf haveged \
help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev \
libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev \
libncurses5-dev \libncursesw5-dev libreadline-dev libssl-dev \
libtool lrzsz mkisofs msmtp nano ninja-build p7zip p7zip-full \
patch pkgconf python2.7 python3 python3-pyelftools \
libpython3-dev qemu-utils rsync scons squashfs-tools \
subversion swig texinfo uglifyjs upx-ucl unzip \
vim wget xmlto xxd zlib1g-dev
124
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) Execute the following command to start compiling the openwrt source code
test@test:~/openwrt$ make V=s
2 directories, 8 files
125
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
7. Appendix
* Initial version
126