OrangePi 5 Pro 03 (302-432)
OrangePi 5 Pro 03 (302-432)
, Ltd
302
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
12) After successful opening, the USB-CAN software will display the serial number and
other information
303
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
d. If the development board can receive messages sent by the analyzer, it means
that the CAN bus can be used normally
orangepi@orangepi5pro:~$ sudo candump can0
can0 001 [8] 01 02 03 04 05 06 07 08
304
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
305
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
wiringOP first.
1) As can be seen from the following table, there are six pwm channels available on the
development board: pwm0, pwm1, pwm3, pwm13, pwm14 and pwm15. PWM14_M1
and PWM14_M2, PWM15_M1 and PWM15_M3 can only use one of them at the same
time, can not be used at the same time, they are the same PWM, but connected to
different pins, please do not think that they are two different PWM buses.
3) The command to set the pin to PWM mode is as follows, take PWM0_M2 as an
example, where the third parameter needs to enter the wPi number corresponding to the
PWM0_M2 pin.
orangepi@orangepi:~$ gpio mode 17 pwm
306
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) After the pin is set to PWM mode, a square wave with a frequency of 200Hz, a period
of 5ms, and a duty cycle of 50% will be output by default. At this time, we use an
oscilloscope to measure the corresponding PWM pin, and the following waveform can be
seen.
IN:
1. The default value for clock frequency is 24000000Hz。
2. The range of values for the frequency division coefficient is even numbers
between 2 ~ 512, with a default value of 120. If the set frequency division coefficient
is odd, the actual frequency division coefficient is the set value minus one.
3. The default value of the cycle register is 1000。
4. The default value for PWM frequency is 24000000 / (120 * 1000) = 200Hz。
307
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) We can use the following command to set the frequency division factor of PWM0_M2
pin to 4.
orangepi@orangepi:~$ gpio pwmc 17 4
2) According to the above formula, the calculated value of PWM frequency is 6000Hz,
and it can be observed that the measured value of PWM frequency is 6010Hz through the
oscilloscope, and the error can be ignored.
1) We can use the gpio pwmTone command to set the frequency of the PWM pin, for
example, the following command can be used to set the PWM frequency of the
PWM0_M2 pin to 500Hz.
orangepi@orangepi:~$ gpio pwmTone 17 500
308
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
For example, the default division factor is 120, and without modifying the
division factor, the set frequency value should be less than 100000Hz.
If the setting value is too large, the following error message will appear:
gpio: The PWM frequency you set is too high to be possible
2) Then, through an oscilloscope, it can be observed that the PWM frequency has
changed to 500Hz.
1) The calculation formula for PWM duty cycle is as follows. We can adjust the PWM
duty cycle by setting the values of the duty cycle register and the period register.
PWM Duty cycle = The value of the duty cycle register / The value of the periodic
register
IN:
The default value of the duty cycle register is 500.
The default value of the cycle register is 1000.
309
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
It should be noted that the value of the duty cycle register needs to be smaller
than the value of the cycle register, as the duty cycle cannot be greater than 1.
When the value of the duty cycle register is set to be greater than the value of
the cycle register, the following error message will be prompted:
gpio: CCR should be less than or equal to ARR (XXX)
When the value of the cycle register is set to be less than the value of the duty
cycle register, the following error message will be prompted:
gpio: ARR should be greater than or equal to CRR (XXX)
2) We can use the following command to set the value of the period register for the
PWM0_M2 pin to 2000.
orangepi@orangepi:~$ gpio pwmr 17 2000
3) After running the above command, it can be observed through the oscilloscope that
the PWM duty cycle has changed from the default 50% (500/1000) to 25% (500/2000).
4) We can use the following command to set the duty cycle register value of the
PWM0_M2 pin to 1000.
orangepi@orangepi:~$ gpio pwm 17 1000
5) After running the above command, it can be observed through the oscilloscope that
310
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
the PWM duty cycle changes from 25% (500/2000) to 50% (1000/2000).
3) Then you can execute the PWM test program. When executing the PWM test program,
you need to specify the PWM pin. For example, you can use the following command to
test the PWM0_M2 pin:
orangepi@orangepi:/usr/src/wiringOP/examples$ sudo ./pwm 17
4) After the pwm program is executed, the following contents will be tested sequentially:
a. Adjust the PWM duty cycle by setting the value of the cycle register.
b. Adjust the PWM duty cycle by setting the value of the duty cycle register.
c. Adjust the PWM frequency by setting the division factor.
d. Directly set the PWM frequency.
311
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) After completing each test, the output of pwm waveform will be stopped for 5 seconds.
After completing all test contents, a new round of testing will be restarted.
In addition, please note that all the following commands are operated under the
312
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
root user.
3.20.1. How to install wiringOP-Python
1) First install the dependency package
root@orangepi:~# sudo apt-get update
root@orangepi:~# sudo apt-get -y install git swig python3-dev python3-setuptools
2) Then use the following command to download the source code of wiringOP-Python
Note that the following git clone --recursive command will automatically
download the source code of wiringOP, because wiringOP-Python depends on
wiringOP. Please make sure that the download process does not report errors due to
network problems.
If there is a problem downloading the code from GitHub, you can directly use
the wiringOP-Python source code that comes with the Linux image. The storage
location is: /usr/src/wiringOP-Python.
root@orangepi:~# git clone --recursive https://github.com/orangepi-xunlong/wiringOP-Python -b next
root@orangepi:~# cd wiringOP-Python
root@orangepi:~/wiringOP-Python# git submodule update --init --remote
3) Then use the following command to compile wiringOP-Python and install it into the
Linux system of the development board
root@orangepi:~# cd wiringOP-Python
root@orangepi:~/wiringOP-Python# python3 generate-bindings.py > bindings.i
root@orangepi:~/wiringOP-Python# sudo python3 setup.py install
4) Then enter the following command, if there is help information output, it means that
wiringOP-Python is installed successfully, press the q key to exit the help information
interface
root@orangepi:~/wiringOP-Python# python3 -c "import wiringpi; help(wiringpi)"
Help on module wiringpi:
NAME
wiringpi
DESCRIPTION
313
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) The steps to test whether wiringOP-Python is successfully installed under the python
command line are as follows:
a. First use the python3 command to enter the command line mode of python3
root@orangepi:~# python3
b. Then import the python module of wiringpi
>>> import wiringpi;
c. Finally, enter the following command to view the help information of
wiringOP-Python, and press the q key to exit the help information interface
>>> help(wiringpi)
Help on module wiringpi:
NAME
wiringpi
DESCRIPTION
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
CLASSES
builtins.object
GPIO
I2C
Serial
nes
class GPIO(builtins.object)
314
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
| GPIO(pinmode=0)
|
>>>
3.20.2. 40pin GPIO Port Test
wiringOP-Python is the same as wiringOP, you can also determine which GPIO
pin to operate by specifying the wPi number, because there is no command to check
the wPi number in wiringOP-Python, so you can only use the gpio command in
wiringOP to check the correspondence between the board wPi number and the
physical pin.
315
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
316
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
pinMode function is the serial number of the wPi corresponding to the pin, and
the second parameter is the GPIO mode
>>> wiringpi.wiringPiSetup()
0
>>> wiringpi.pinMode(2, GPIO.OUTPUT)
d. Then set the GPIO port to output a low level. After setting, you can use a
multimeter to measure the voltage value of the pin. If it is 0v, it means that the
low level is set successfully.
>>> wiringpi.digitalWrite(2, GPIO.LOW)
e. Then set the GPIO port to output a high level. After setting, you can use a
multimeter to measure the voltage value of the pin. If it is 3.3v, it means that the
high level is set successfully.
>>> wiringpi.digitalWrite(2, GPIO.HIGH)
4) The method of wiringOP-Python to set GPIO high and low levels in python code can
refer to the blink.py test program in the examples below. The blink.py test program will
set the voltage of all GPIO ports in the 26 pins of the development board to change
continuously.
root@orangepi:~/wiringOP-Python# cd examples
root@orangepi:~/wiringOP-Python/examples# ls blink.py
blink.py
root@orangepi:~/wiringOP-Python/examples# python3 blink.py
3.20.3. 40pin SPI test
1) As can be seen from the following figure, the available spi of Orange Pi 5 Pro are spi0
and spi4
2) The corresponding pins of SPI0 and SPI4 in 40pin are shown in the table below.
SPI0_M2 corresponds to 40pin SPI4_M2 corresponds to 40pin
MOSI Pin 19 Pin 16
317
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) In the linux system, the SPI in 40 pin is turned off by default and needs to be opened
manually. The detailed steps are as follows:
a. First run orangepi-config, ordinary users remember to add sudo permission
orangepi@orangepi:~$ sudo orangepi-config
b. Then choose System
d. Then use the arrow keys on the keyboard to locate the position shown in the
following figure, and then use the space to select the SPI configuration that you
want to open
318
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
g. Then select <Reboot> to restart the system for the configuration to take effect
4) After the restart, go to the system and check whether spidevx.x device nodes exist in
the linux system. If nodes exist, the SPI is set and can be used directly.
orangepi@orangepi:~$ ls /dev/spidev*
/dev/spidev0.0 /dev/spidev0.1 /dev/spidev4.0
319
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) Then you can use the spidev_test.py program in the examples to test the loopback
function of the SPI. The spidev_test.py program needs to specify the following two
parameters:
a. --channel:Specifies the channel number of the SPI
b. --port:Specify the port number of the SPI
6) Do not short-circuit the mosi and miso pins of SPI4, the output result of running
spidev_test.py is as follows, you can see that the data of TX and RX are inconsistent
The x after the --channel and --port arguments needs to be replaced with the
channel number and the port number of the SPI specific.
root@orangepi:~/wiringOP-Python# cd examples
root@orangepi:~/wiringOP-Python/examples# python3 spidev_test.py \
--channel x --port x
spi mode: 0x0
max speed: 500000 Hz (500 KHz)
Opening device /dev/spidev0.0
TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF F0 0D |......@..........|
RX | FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF |.................|
7) Then use the Dupont wire to short connect the two pins of SPI txd (pin 19 in the 40pin
interface) and rxd (pin 21 in the 40pin interface) and run spidev_test.py as follows. You
can see that the sent and received data are the same, indicating that the SPI loop test is
normal
The x after the --channel and --port arguments needs to be replaced with the
channel number and the port number of the SPI specific.
root@orangepi:~/wiringOP-Python# cd examples
root@orangepi:~/wiringOP-Python/examples# python3 spidev_test.py \
--channel x --port x
spi mode: 0x0
max speed: 500000 Hz (500 KHz)
Opening device /dev/spidev0.0
TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF F0 0D |......@..........|
320
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
RX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF F0 0D |......@..........|
2) The pins corresponding to the four groups of I2C buses in the 40pin are shown in the
following table. I2C5_M2 and I2C5_M3 can only use one group at the same time, can not
be used at the same time, they are the same I2C5, just received a different pin up, please
do not think that they are two different groups of I2C5 bus.
I2C Bus SDA corresponds to SCL corresponds to Dtbo corresponding
40pin 40pin configuration
I2C1_M4 Pin 3 Pin 5 i2c1-m4
I2C4_M3 Pin 27 Pin 28 i2c4-m3
I2C5_M2 Pin 35 Pin 37 i2c5-m2
I2C5_M3 Pin 7 Pin 15 i2c5-m3
I2C8_M2 Pin 33 Pin 32 i2c8-m2
3) In Linux systems, the I2C bus in 40 pins is turned off by default and needs to be
manually turned on to use. The detailed steps are as follows:
a. First, run orangepi-config. Regular users should remember to add sudo
privileges
orangepi@orangepi:~$ sudo orangepi-config
b. Then choose System
321
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
d. Then use the directional keys on the keyboard to locate the position shown in the
figure below, and use the space to select the I2C configuration you want to open
322
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
f. Then select <Reboot> to restart the system for the configuration to take effect
4) After starting the Linux system, first confirm the existence of i2c device nodes in /dev
orangepi@orangepi:~$ ls /dev/i2c-*
5) Then connect an i2c device to the i2c pin of the 40pin connector, here we take the
ds1307 RTC module as an example
6) Then use the i2cdetect -y command, if the address of the connected i2c device can
be detected, it means that i2c can be used normally
orangepi@orangepi:~$ sudo i2cdetect -y 1 #i2c1 command
orangepi@orangepi:~$ sudo i2cdetect -y 4 #i2c4 command
orangepi@orangepi:~$ sudo i2cdetect -y 5 #i2c5 command
orangepi@orangepi:~$ sudo i2cdetect -y 8 #i2c8 command
323
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
7) Then you can run the ds1307.py test program in the examples to read the RTC time
root@orangepi:~/wiringOP-Python# cd examples
root@orangepi:~/wiringOP-Python/examples# python3 ds1307.py --device \
"/dev/i2c-1"
Thu 2023-01-05 14:57:55
Thu 2023-01-05 14:57:56
Thu 2023-01-05 14:57:57
^C
exit
3.20.5. 40pin UART test
1) As can be seen from the following table, there are five uart buses available for Orange
Pi 5 Pro: uart0, uart3, uart4, uart6 and uart7
2) The corresponding pins of the five UART buses in the 40 pin configuration are shown
in the table below
UART Bus RX corresponds to TX corresponds to Dtbo corresponding
40pin 40pin configuration
UART0_M2 Pin 38 Pin 36 uart0-m2
UART3_M2 Pin 37 Pin 40 uart3-m2
324
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) In Linux systems, UART in 40 pins is turned off by default and needs to be manually
turned on to use. The detailed steps are as follows:
a. First, run orangepi-config. Regular users should remember to add sudo
privileges
orangepi@orangepi:~$ sudo orangepi-config
b. Then choose System
d. Then use the directional keys on the keyboard to locate the position shown in the
figure below, and use the space to select the UART configuration you want to
turn on
325
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
g. Then choose <Reboot> to restart the system for the configuration to take effect
4) After entering the linux system, first confirm whether there is a device node
corresponding to uart in /dev
orangepi@orangepi:~$ ls /dev/ttyS*
5) Then start testing the uart interface, first use the DuPont wire to short-circuit the rx
and tx of the uart interface to be tested
326
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) Test the loopback function of the serial port using the serialTest.py program in the
examples as shown below. If you can see the print below, it indicates that the serial
communication is normal
/dev/ttySX needs to be replaced with the serial number of the specific uart device node.
Out: 0: -> 0
Out: 1: -> 1
Out: 2: -> 2
Out: 3: -> 3
Out: 4:^C
exit
327
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
keep alive
keep alive
The command to view the serial number of the RK3588S chip is as follows. The serial
number of each chip is different, so the serial number can be used to distinguish multiple
development boards
orangepi@orangepi:~$ cat_serial.sh
Serial : 1404a7682e86830c
1) The linux image provided by Orange Pi has Docker pre-installed, but the Docker
service is not turned on by default.
2) Use the enable_docker.sh script to enable the docker service, and then you can start
using the docker command, and the docker service will be automatically started the next
time you start the system.
orangepi@orangepi:~$ enable_docker.sh
3) Then you can use the following command to test docker. If hello-world can be run,
docker can be used normally.
orangepi@orangepi:~$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
256ab8fe8778: Pull complete
Digest:
sha256:7f0a9f93b4aa3022c3a4c147a449ef11e0941a1fd0bf4a8e6c9408b2600777c5
Status: Downloaded newer image for hello-world:latest
328
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
329
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
330
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) Then enter the following command in the linux system to start the installation of the
pagoda
orangepi@orangepi:~$ sudo install_bt_panel.sh
3) Then the Pagoda installation program will prompt whether to install Bt-Panel to the
/www folder. At this time, enter y
+----------------------------------------------------------------------
| Bt-WebPanel FOR CentOS/Ubuntu/Debian
+----------------------------------------------------------------------
| Copyright © 2015-2099 BT-SOFT(http://www.bt.cn) All rights reserved.
+----------------------------------------------------------------------
| The WebPanel URL will be http://SERVER_IP:8888 when installed.
+----------------------------------------------------------------------
4) The next thing to do is to wait patiently. When you see the terminal outputting the
following print information, it means that the Pagoda has been installed. The entire
installation process takes about 12 minutes. There may be some differences depending on
the network speed.
331
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) At this time, enter the panel address shown above in the browser to open the login
interface of the Pagoda Linux panel, and then enter the username and password shown
above in the corresponding positions to log in to the Pagoda
6) After successfully logging into the Pagoda, the following welcome interface will pop
up. First, please drag the user instructions in the middle to the bottom after reading them.
Then you can select "I have agreed and read the User Agreement", and then click "Enter
Panel" You can enter the pagoda
332
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
7) After entering the pagoda, you will first be prompted to bind an account on the
pagoda's official website. If you don't have an account, you can go to the pagoda's official
website (https://www.bt.cn) to register one.
8) The final displayed interface is as shown in the figure below. You can intuitively see
some status information of the development board's Linux system, such as load status,
CPU usage, memory usage, storage space usage, etc
333
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
334
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
10) In Pagoda’s software store, you can install software such as Apache, MySQL, and
PHP, and you can also deploy various applications with one click. Please explore these
functions by yourself, and I will not demonstrate them one by one here
335
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
12) You can refer to the following information to explore more functions of the pagoda
Manual:http://docs.bt.cn
Forum address:https://www.bt.cn/bbs
GitHub Link:https://github.com/aaPanel/BaoTa
Note, before installing the Chinese input method, please make sure that the
Linux system used by the development board is the desktop version.
3.26.1. Debian system installation method
1) First set the default locale to Chinese
a. Enter the following command to start configuring locale
orangepi@orangepi:~$ sudo dpkg-reconfigure locales
b. Then select zh_CN.UTF-8 UTF-8 in the pop-up interface (use the up and down
336
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
keys on the keyboard to move up and down, use the space bar to select, and
finally use the Tab key to move the cursor to <OK>, and then return Car is
enough)
d. After exiting the interface, the locale setting will begin. The output displayed on
the command line is as follows:
orangepi@orangepi:~$ sudo dpkg-reconfigure locales
Generating locales (this might take a while)...
en_US.UTF-8... done
zh_CN.UTF-8... done
Generation complete.
337
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) Then select OK
338
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) Then select OK
7) Then restart the Linux system to make the configuration take effect.
339
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
340
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
12) Then open the Geany editor to test the Chinese input method
341
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
14) You can switch between Chinese and English input methods through the Ctrl+Space
shortcut key
15) If you need the entire system to be displayed in Chinese, you can set all variables in
/etc/default/locale to zh_CN.UTF-8
orangepi@orangepi:~$ sudo vim /etc/default/locale
# File generated by update-locale
LC_MESSAGES=zh_CN.UTF-8
LANG=zh_CN.UTF-8
342
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
LANGUAGE=zh_CN.UTF-8
16) Then restart the system and you will see that the system is displayed in Chinese.
343
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) Then please use the left button of the mouse to select Chinese (China) and hold it
down, then drag it up to the starting position. After dragging, the display will be as shown
below:
Note that this step is not easy to drag, please be patient and try it a few times.
344
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Then select Apply System-Wide to apply the Chinese settings to the entire system
6) Then restart the Linux system to make the configuration take effect
7) After re-entering the system, please select Do not ask me again in the following
interface, and then please decide according to your own preferences whether the standard
345
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
9) Then we can open Geany to test the Chinese input method. The opening method is as
shown in the figure below
346
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
10) After opening Geany, the English input method is still the default. We can switch to
the Chinese input method through the Ctrl+Space shortcut key, and then we can input
Chinese.
347
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) Then please use the left button of the mouse to select Chinese (China) and hold it
down, then drag it up to the starting position. After dragging, the display will be as shown
below:
348
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Note that this step is not easy to drag, please be patient and try it a few times.
4) Then select Apply System-Wide to apply the Chinese settings to the entire system
5) Then restart the Linux system to make the configuration take effect
349
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) After re-entering the system, please select Do not ask me again on the following
interface, and then please decide whether the standard folder should also be updated to
Chinese according to your own preferences.
350
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
351
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
11) Then we can open Geany to test the Chinese input method. The opening method is
as shown in the figure below
12) After opening Geany, the English input method is still the default. We can switch to
the Chinese input method through the Ctrl+Space shortcut key, and then we can enter
Chinese.
352
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
The Ubuntu Gnome Wayland image does not support remote login to the
desktop using Nomachine and VNC as described here.
3.27.1. Remote login using NoMachine
Please ensure that the Ubuntu or Debian system installed on the development
board is a desktop version of the system. In addition, NoMachine also provides
detailed usage documentation. It is strongly recommended to read this document
thoroughly to become familiar with the use of NoMachine. The document link is as
follows:
https://knowledgebase.nomachine.com/DT10R00166
353
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Before operating, please make sure that the Windwos computer and the
development board are in the same LAN, and that you can log in to the Ubuntu or
Debian system of the development board through ssh normally.
1) First download the installation package of the NoMachine software Linux arm64 deb
version, and then install it into the Linux system of the development board
a. Since RK3588S is an ARMv8 architecture SOC, the system we use is Ubuntu or
Debian, so we need to download the NoMachine for ARM ARMv8 DEB
installation package. The download link is as follows:
Note that this download link may change, please look for the Armv8/Arm64
version of the deb package.
https://downloads.nomachine.com/download/?id=114&distro=ARM
b. In addition, you can also download the NoMachine installation package from
the official tool.
354
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) Then download the installation package of the Windows version of the NoMachine
software. The download address is as follows
Note that this download link may change.
https://downloads.nomachine.com/download/?id=9
5) After NoMachine is started, it will automatically scan other devices with NoMachine
355
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
installed on the LAN. After entering the main interface of NoMachine, you can see that
the development board is already in the list of connectable devices, and then click on the
location shown in the red box in the picture below You can now log in to the Linux
system desktop of the development board.
6) Then click OK
7) Then enter the username and password of the development board Linux system in the
corresponding positions in the figure below, and then click OK to start logging in.
356
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
9) Finally you can see the desktop of the development board Linux system
1) First run the set_vnc.sh script to set up vnc, remember to add sudo permissions
orangepi@orangepi:~$ sudo set_vnc.sh
You will require a password to access your desktops.
357
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) The steps to use MobaXterm software to connect to the development board Linux
system desktop are as follows::
a. First click Session, then select VNC, then fill in the IP address and port of the
development board, and finally click OK to confirm.
c. After successful login, the interface is displayed as shown below, and then you
can remotely operate the desktop of the development board Linux system.
358
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
int main(void)
{
printf("Hello World!\n");
359
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
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!
3) Debian Bullseye does not install Java compilation tools and operating environment by
default.
a. You can use the following command to install openjdk. The latest version in
Debian Bullseye is openjdk-17
orangepi@orangepi:~$ sudo apt install -y openjdk-17-jdk
b. After installation, you can check the Java version
orangepi@orangepi:~$ java --version
c. Write a hello_world.java of Java version
orangepi@orangepi:~$ vim hello_world.java
public class hello_world
{
public static void main(String[] args)
{
System.out.println("Hello World!");
360
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
}
}
d. Then compile and run hello_world.java
orangepi@orangepi:~$ javac hello_world.java
orangepi@orangepi:~$ java hello_world
Hello World!
3.28.2. Debian Bookworm system
1) Debian Bookworm is installed with the gcc compilation tool chain by default, which
can directly compile C language programs in the Linux system of the development board.
a. The version of gcc is as follows
orangepi@orangepi:~$ gcc --version
gcc (Debian 12.2.0-14) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
b. Write the hello_world.c program in C language
orangepi@orangepi:~$ vim hello_world.c
#include <stdio.h>
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!
361
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) Debian Bookworm does not install Java compilation tools and operating environment
by default.
a. You can use the following command to install openjdk. The latest version in
Debian Bookworm is openjdk-17
orangepi@orangepi:~$ sudo apt install -y openjdk-17-jdk
b. After installation, you can check the Java version.
orangepi@orangepi:~$ java --version
c. Write a Java version of hello_world.java
orangepi@orangepi:~$ vim hello_world.java
public class hello_world
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
d. Then compile and run hello_world.java
orangepi@orangepi:~$ javac hello_world.java
orangepi@orangepi:~$ java hello_world
Hello World!
3.28.3. Ubuntu Focal system
1) Ubuntu Focal is installed with the gcc compilation tool chain by default, which can
directly compile C language programs in the Linux system of the development board.
a. The version of gcc is as follows
orangepi@orangepi:~$ gcc --version
362
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
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!
3) Ubuntu Focal does not have Java compilation tools and running environment installed
363
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
by default.
a. You can use the following command to install openjdk-17
orangepi@orangepi:~$ sudo apt install -y openjdk-17-jdk
b. After installation, you can check the Java version.
orangepi@orangepi:~$ java --version
openjdk 17.0.2 2022-01-18
OpenJDK Runtime Environment (build 17.0.2+8-Ubuntu-120.04)
OpenJDK 64-Bit Server VM (build 17.0.2+8-Ubuntu-120.04, mixed mode, sharing)
c. Write a Java version of hello_world.java
orangepi@orangepi:~$ vim hello_world.java
public class hello_world
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
d. Then compile and run hello_world.java
orangepi@orangepi:~$ javac hello_world.java
orangepi@orangepi:~$ java hello_world
Hello World!
3.28.4. Ubuntu Jammy system
4) Ubuntu Jammy is installed with the gcc compilation tool chain by default, which can
directly compile C language programs in the Linux system of the development board.
a. The version of gcc is as follows
orangepi@orangepi:~$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
b. Write the hello_world.c program in C language
orangepi@orangepi:~$ vim hello_world.c
#include <stdio.h>
364
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
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!
6) Ubuntu Jammy does not install Java compilation tools and operating environment by
default.
a. You can use the following command to install openjdk-18
orangepi@orangepi:~$ sudo apt install -y openjdk-18-jdk
b. After installation, you can check the Java version.
orangepi@orangepi:~$ java --version
openjdk 18-ea 2022-03-22
OpenJDK Runtime Environment (build 18-ea+36-Ubuntu-1)
OpenJDK 64-Bit Server VM (build 18-ea+36-Ubuntu-1, mixed mode, sharing)
c. Write a Java version of hello_world.java
orangepi@orangepi:~$ vim hello_world.java
365
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
366
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
......
QMake version 3.1
Using Qt version 5.15.8 in /usr/lib/aarch64-linux-gnu
367
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
368
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) Then set up QT
a. Open first Help->About Plugins...
369
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
370
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
8) After clicking on the sample code, the corresponding instruction document will
automatically open. You can read the instructions carefully.
371
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
10) Then click the green triangle in the lower left corner to compile and run the sample
code
372
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
11) After waiting for a period of time, the interface shown in the figure below will pop
up, which means that QT can compile and run normally.
12) References
https://wiki.qt.io/Install_Qt_5_on_Ubuntu
https://download.qt.io/archive/qtcreator
https://download.qt.io/archive/qt
373
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
http://docs.ros.org
https://wiki.ros.org/Distributions
374
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) Before using the ROS tool, you first need to initialize rosdep. Then when compiling
the source code, you can quickly install some system dependencies and some core
components in ROS.
Note that when running the following command, you need to ensure that the
development board can access github normally, otherwise an error will be reported
due to network problems.
The install_ros.sh script will try to modify /etc/hosts and automatically run the
following commands. However, this method cannot guarantee that github can be
accessed normally every time. If install_ros.sh prompts the following error after
installing ros1, please find other ways to allow the linux system of the development
board to access github normally, and then manually run the following Order.
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
ERROR: error loading sources list:
The read operation timed out
orangepi@orangepi:~$ source /opt/ros/noetic/setup.bash
orangepi@orangepi:~$ sudo rosdep init
Wrote /etc/ros/rosdep/sources.list.d/20-default.list
Recommended: please run
375
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
rosdep update
orangepi@orangepi:~$ rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index
https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
Skip end-of-life distro "ardent"
Skip end-of-life distro "bouncy"
Skip end-of-life distro "crystal"
Skip end-of-life distro "dashing"
Skip end-of-life distro "eloquent"
Add distro "foxy"
Add distro "galactic"
Skip end-of-life distro "groovy"
Add distro "humble"
Skip end-of-life distro "hydro"
Skip end-of-life distro "indigo"
Skip end-of-life distro "jade"
Skip end-of-life distro "kinetic"
Skip end-of-life distro "lunar"
Add distro "melodic"
Add distro "noetic"
Add distro "rolling"
updated cache in /home/orangepi/.ros/rosdep/sources.cache
6) Then open a command line terminal window on the desktop, and then use the
test_ros.sh script to start a small turtle routine to test whether ROS can be used normally.
orangepi@orangepi:~$ test_ros.sh
7) After running the test_ros.sh script, a small turtle as shown in the picture below will
pop up.
376
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
8) Then please keep the terminal window you just opened at the top
9) At this time, press the direction keys on the keyboard to control the little turtle to
move up, down, left, and right.
377
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
378
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
http://docs.ros.org
http://docs.ros.org/en/galactic/Releases.html
5) The install_ros.sh script will automatically run the ros2 -h command after installing
ros2. If you can see the following print, it means that the ros2 installation is complete.
usage: ros2 [-h] Call `ros2 <command> -h` for more detailed usage. ...
379
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
optional arguments:
-h, --help show this help message and exit
Commands:
action Various action related sub-commands
bag Various rosbag related sub-commands
component Various component related sub-commands
daemon Various daemon related sub-commands
doctor Check ROS setup and other potential issues
interface Show information about ROS interfaces
launch Run a launch file
lifecycle Various lifecycle related sub-commands
multicast Various multicast related sub-commands
node Various node related sub-commands
param Various param related sub-commands
pkg Various package related sub-commands
run Run a package specific executable
security Various security related sub-commands
service Various service related sub-commands
topic Various topic related sub-commands
wtf Use `wtf` as alias to `doctor`
6) Then you can use the test_ros.sh script to test whether ROS 2 is installed successfully.
If you can see the following print, it means ROS 2 can run normally.
orangepi@orangepi5pro:~$ test_ros.sh
[INFO] [1671174101.200091527] [talker]: Publishing: 'Hello World: 1'
[INFO] [1671174101.235661048] [listener]: I heard: [Hello World: 1]
[INFO] [1671174102.199572327] [talker]: Publishing: 'Hello World: 2'
[INFO] [1671174102.204196299] [listener]: I heard: [Hello World: 2]
[INFO] [1671174103.199580322] [talker]: Publishing: 'Hello World: 3'
[INFO] [1671174103.204019965] [listener]: I heard: [Hello World: 3]
380
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) The install_ros.sh script will automatically run the ros2 -h command after installing
ros2. If you can see the following print, it means that the ros2 installation is complete.
usage: ros2 [-h] Call `ros2 <command> -h` for more detailed usage. ...
optional arguments:
-h, --help show this help message and exit
Commands:
action Various action related sub-commands
bag Various rosbag related sub-commands
381
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) Then you can use the test_ros.sh script to test whether ROS 2 is successfully installed.
If you can see the following print, it means ROS 2 can run normally.
orangepi@orangepi5pro:~$ test_ros.sh
[INFO] [1671174101.200091527] [talker]: Publishing: 'Hello World: 1'
[INFO] [1671174101.235661048] [listener]: I heard: [Hello World: 1]
[INFO] [1671174102.199572327] [talker]: Publishing: 'Hello World: 2'
[INFO] [1671174102.204196299] [listener]: I heard: [Hello World: 2]
[INFO] [1671174103.199580322] [talker]: Publishing: 'Hello World: 3'
[INFO] [1671174103.204019965] [listener]: I heard: [Hello World: 3]
382
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) Reference documentation
http://docs.ros.org/en/humble/index.html
http://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html
1) The Linux image released by OPi comes with the deb package of the kernel header
file by default, and the storage location is /opt/
orangepi@orangepi:~$ ls /opt/linux-headers*
/opt/linux-headers-legacy-rockchip-rk3588_x.x.x_arm64.deb
2) Use the following command to install the deb package of the kernel header file
The name of the kernel header file deb package needs to be replaced with the
actual name, please do not copy it.
orangepi@orangepi:~$ sudo dpkg -i /opt/linux-headers-legacy-rockchip-rk3588_1.x.x_arm64.deb
3) After installation, you can see the folder where the kernel header file is located under
/usr/src.
orangepi@orangepi:~$ ls /usr/src
linux-headers-5.10.160-rockchip-rk3588
383
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Then you can write a hello kernel module to test the kernel header file
a. First write the code of hello kernel module, as shown below:
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 that compiles the hello kernel module, as shown below:
orangepi@orangepi:~$ vim Makefile
ifneq ($(KERNELRELEASE),)
obj-m:=hello.o
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
384
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
endif
c. Then use the make command to compile the hello kernel module. The output of
the compilation process is as follows:
If you have problems compiling the code you copied here, please download the
source code from the official tool and upload it to the Linux system of the
development board for testing.
orangepi@orangepi:~$ make
make -C /lib/modules/5.10.160-rockchip-rk3588/build M=/home/orangepi modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.160-rockchip-rk3588'
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-5.10.160-rockchip-rk3588'
d. After compilation, the hello.k 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:~$ 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:~$ dmesg | grep "Hello"
[ 2871.893988] Hello Orange Pi -- init
[ 3173.800892] Hello Orange Pi -- exit
385
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) Connect the 12pin touch screen cable, 31pin to 40pin cable, and 30pin MIPI cable to
the screen adapter board as shown below. Note that the blue insulated side of the touch
screen cable is facing down, and the insulated side of the other two cables is facing up. ,
386
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3) Place the adapter board connected with the cable on top of the MIPI LCD screen as
shown below, and connect the MIPI LCD screen and the adapter board through a 31pin to
40pin cable.
4) Then connect the touch screen and the adapter board through the 12pin touch screen
cable, paying attention to the orientation of the insulation surface
5) Finally, connect it to the LCD interface of the development board through a 30pin
MIPI cable.
387
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) The location of the interface of the mipi lcd screen on the development board is as
shown in the figure below
388
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
d. Then use the keyboard ’ s arrow keys to locate opi5pro-lcd and then use the
space to select it.
g. Then select <Reboot> to restart the system to make the configuration take
effect.
389
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) After startup, you can see the LCD screen display as follows (default is vertical
screen):
3.32.3. How to rotate the display direction of the server version image
1) Add extraargs=fbcon=rotate: the direction of rotation to /boot/orangepiEnv.txt to
set the direction displayed by the server version of Linux system, where fbcon=rotate:
The following number can be set to:
390
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) Then restart the Linux system and you will see that the direction of the LCD screen
display has rotated.
3.32.4. How to mirror the rotation display and touch direction of the
desktop version
1) First open the Display settings in the linux system
391
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5) At this point, the screen display has been rotated, and then close the Display program.
6) The above steps will only select the display direction, and will not rotate the touch
direction. Use the set_lcd_rotate.sh script to rotate the touch direction. After this script is
set, it will automatically restart, and then you can test whether the touch can be used
392
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
normally
a. None: No rotation
orangepi@orangepi:~$ set_lcd_rotate.sh none
b. Left: Rotate 90 degrees to the left
orangepi@orangepi:~$ set_lcd_rotate.sh left
c. Inverted: Flip up and down, equivalent to rotating 180 degrees
orangepi@orangepi:~$ set_lcd_rotate.sh inverted
d. Right: Rotate 90 degrees to the right
orangepi@orangepi:~$ set_lcd_rotate.sh right
3.33. Instructions for using the logo on and off the machine
1) The power on/off logo will only be displayed on the desktop version of the system by
default.
2) Set the bootlogo variable to false in /boot/orangepiEnv.txt to turn off the switch
logo.
orangepi@orangepi:~$ vim /boot/orangepiEnv.txt
verbosity=1
393
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
bootlogo=false
3) Set the bootlogo variable to true in /boot/orangepiEnv.txt to enable the power on/off
logo.
orangepi@orangepi:~$ vim /boot/orangepiEnv.txt
verbosity=1
bootlogo=true
5) After replacing the boot logo image, you need to run the following command to take
effect
orangepi@orangepi:~$ sudo update-initramfs -u
Currently, the development board supports two MIPI cameras, OV13850 and
OV13855. The specific pictures are as follows:
a. OV13850 camera with 13 million MIPI interface
The adapter board and FPC cable used by the OV13850 and OV13855 cameras are
394
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
the same, but the locations where the two cameras are connected to the adapter board are
different. The FPC cable is shown in the figure below. Please note that the FPC cable has
a direction. The end marked TO MB needs to be plugged into the camera interface of the
development board, and the end marked TO CAMERA needs to be plugged into the
camera adapter board.
There are a total of 3 camera interfaces on the camera adapter board, and only one
can be connected and used at the same time, as shown in the figure below, among which:
a. Connect the OV13850 camera to interface 1
b. Connect the OV13855 camera to interface 2
c. Interface No. 3 is not used, just ignore it.
There are a total of 2 camera interfaces on the Orange Pi 5 Pro development board.
We define the positions of Cam1 and Cam2 as shown in the figure below:
The method of plugging the camera into the Cam1 interface of the development
395
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
board is as follows:
The method of plugging the camera into the Cam2 interface of the development
board is as follows:
After connecting the camera to the development board, we can use the following
method to test the camera:
a. First run orangepi-config. Ordinary users remember to add sudo permissions.
orangepi@orangepi:~$ sudo orangepi-config
b. Then select System
396
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
d. Then use the keyboard's arrow keys to locate the position shown in the figure
below, and then use the space to select the camera you want to open, where
opi5pro-cam1 means using the ov13850 or ov13855 camera in the Cam1
interface of the development board, and opi5pro-cam2 means Use the ov13850
or ov13855 camera in the Cam2 interface of the development board.
g. Then select <Reboot> restart the system to make the configuration take effect
h. Then open a terminal on the desktop system and run the following script
397
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
orangepi@orangepi:~$ test_camera.sh
i. Then you can see the preview screen of the camera
In addition to a single camera, we can also use two cameras at the same time
(supporting ov13850 and ov13855 mix and match). After connecting the dual cameras,
open the configuration of Cam1+Cam2 through orangepi-config as in the previous steps,
then restart the system, then open the terminal on the desktop and run the test_camera.sh
script to see the previews of the two cameras, as follows As shown in the figure:
398
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Please refer to the link below for camera dts configuration. You can modify it
yourself if necessary;
https://github.com/orangepi-xunlong/linux-orangepi/blob/orange-pi-5.10-rk35xx/arc
h/arm64/boot/dts/rockchip/rk3588s-orangepi-5-pro-camera1.dtsi
https://github.com/orangepi-xunlong/linux-orangepi/blob/orange-pi-5.10-rk35xx/arc
h/arm64/boot/dts/rockchip/rk3588s-orangepi-5-pro-camera2.dtsi
Before installing zfs, you first need to install the kernel header files. For how to
install the kernel header files, please refer to the instructions in the section "How to
Install the Kernel Header Files".
In Ubuntu20.04, Ubuntu22.04 and Debian11 systems, zfs cannot be installed directly
through apt. This is because the zfs version in the default apt source is lower than 2.1.6
and is incompatible with the rk linux5.10 kernel. This problem is fixed in zfs 2.1.6 and
later versions.
In order to solve this problem, we provide a deb package of zfs that can be installed
normally, which can be downloaded from the official tool of the development board.
Open the official tool and enter the zfs related deb package folder used by Ubuntu and
Debian systems. You can see three types of deb packages for Ubuntu20.04, Ubuntu22.04
and Debian11. Please download the required version.
399
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
After downloading the corresponding version of the zfs deb package, please upload
them to the Linux system of the development board. For the upload method, please refer
to the instructions in the Methods of Uploading Files to the Development Board Linux
System.
After the upload is completed, use the cd command on the command line of the
development board Linux system to enter the directory of the deb package, and then use
the following command to install the zfs deb package.
orangepi@orangepi:~$ sudo apt install ./*.deb
After the installation is complete, use the following command to see the zfs-related
kernel modules:
orangepi@orangepi:~$ ls /lib/modules/5.10.160-rockchip-rk3588/updates/dkms/
icp.ko spl.ko zavl.ko zcommon.ko zfs.ko zlua.ko znvpair.ko zunicode.ko
zzstd.ko
Then restart the Linux system and you will see that the zfs kernel module will be
automatically loaded.:
orangepi@orangepi:~$ lsmod | grep "zfs"
zfs 2801664 0
zunicode 327680 1 zfs
zzstd 471040 1 zfs
zlua 139264 1 zfs
zcommon 69632 1 zfs
znvpair 61440 2 zfs,zcommon
zavl 16384 1 zfs
icp 221184 1 zfs
spl 77824 6 zfs,icp,zzstd,znvpair,zcommon,zavl
400
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
In Debian12, the default version of zfs is 2.1.11, so we can install zfs directly through
the following command. Again, before installation, you need to ensure that the system
has installed the deb package of the kernel header file.
orangepi@orangepi:~$ sudo apt install -y zfsutils-linux zfs-dkms
3.35.2. How to create a ZFS pool
ZFS is based on storage pools. We can add multiple physical storage devices to
the pool and then allocate storage space from this pool.
The following content is demonstrated based on the development board being
connected to an NVMe SSD and a USB flash drive.
1) First, we can use the lsblk command to view all storage devices on the development
board. Currently, the development board is connected to an NVMe SSD and a USB flash
drive. The output is as follows:
2) Then enter the following command to create a ZFS pool, including two storage
devices: NVMe SSD and USB flash drive.
orangepi@orangepi:~$ sudo zpool create -f pool1 /dev/nvme0n1 /dev/sda
3) Then use the zpool list command to see that the system has created a ZFS pool named
pool1, and the size of ZFS pool pool1 is the size of the NVME SSD plus the size of the
USB flash drive.
401
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Then execute df -h and you can see that pool1 is mounted to the /pool1 directory.
orangepi@orangepi:~$ df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 1.6G 18M 1.6G 2% /run
/dev/mmcblk0p2 29G 6.0G 22G 22% /
tmpfs 7.7G 46M 7.7G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 7.7G 944K 7.7G 1% /tmp
/dev/mmcblk0p1 1022M 115M 908M 12% /boot
/dev/zram1 188M 4.5M 169M 3% /var/log
tmpfs 1.6G 80K 1.6G 1% /run/user/1000
pool1 489G 9.3M 489G 1% /pool1
5) Use the following command to see that the file system type of pool1 is zfs
orangepi@orangepi:~$ mount | grep pool1
pool1 on /pool1 type zfs (rw,xattr,noacl)
2) Then do a simple test, first enter pool1, and then execute the following command to
generate a random file of 1G size
orangepi@orangepi:~$ cd /pool1/
root@orangepi:/pool1$ sudo dd if=/dev/urandom of=test.1g bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 5.04367 s, 213 MB/s
3) Then use the following command to copy 1000 copies of a random file of 1G size
root@orangepi:/pool1$ for ((i=0; i<1000; i++)); do sudo cp test.1g $i.test.1g; done
402
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Then use du -lh to see that there is currently a total of 1002G of data in the pool, but
in fact the size of the ZFS pool is only 504GB (the total capacity of SSD + U disk),
which cannot hold such large data.
root@orangepi:/pool1$ du -lh
1002G
5) Then use the zpool list command to see that only 1.01G is actually occupied, because
these 1001 files are duplicates, indicating that the data deduplication function is effective.
2) Then the file size that can be seen through the ls -lh command and the space occupied
in the ZFS pool are both 27M
4) Then execute the following command again to package the /var/log/ and /etc/
directories into a tar package
root@orangepi:/pool1$ sudo tar -cf text.tar /var/log/ /etc/
5) At this time, you can see that the text.tar file size is still 27M, but it only occupies
9.47M space in the ZFS pool, indicating that the file is compressed.
403
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
CasaOS is an open source home cloud system based on the Docker ecosystem,
which allows you to run a variety of home applications on your own development
board, such as NAS, home automation, media servers, etc.
2) Then enter the following command in the linux system to start the installation of
CasaOS
orangepi@orangepi:~$ curl -fsSL https://get.casaos.io | sudo bash
3) When you see the terminal outputting the following print information, it means that
CasaOS has been installed.
404
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) After opening CasaO, the following welcome interface will pop up. Click "Go" to
proceed to the next step.
3) When you log in to CasaOS for the first time, the login interface is the interface for
setting the account and password. When you log in again, only the interface for entering
the account and password will appear. After setting the account and password, click
405
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
4) Click "Accept" directly in the interface below to proceed to the next step.
5) Now enter the main page of CasaOS. There are three icons in the upper left corner for
function settings. On the left is the performance panel, which can display the current time
and status information of CPU, RAM, storage, and network. On the right is the function
panel. It has functions such as search, application recommendation, application store and
file management.
406
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6) You can click the first icon in the upper left corner to modify the account number and
password
407
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
8) The third icon in the upper left corner mainly has two functions, namely switching to
command line mode and printing log information. When switching to command line
mode, you need to enter your account and password. The account and password here refer
to the development board. Linux system account and password, the port system defaults
to number 22
408
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
10) Another function under the third icon is to print CasaOS logs. Click "Logs" to enter.
The interface is as follows:
11) Click "Widget settings" in the lower left corner to set whether to display the widgets
of the performance panel on the main page.
409
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
12) Click "APP Store" on the main interface to open the app store. Currently, there are a
total of 70+ APPs available in the app store.
13) Here we take Home Assistant as an example to download, find Home Assistant in
the APP Store, and then click the corresponding "install"
410
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
14) After the download is completed, HostAssitant will appear on the main page.
15) Click "Files" in the main interface to open the file system that comes with CasaOS,
and then you can upload and save files.
Please ensure that other devices and the development board are in the same
LAN.
411
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
16) When uploading files, you need to switch to the target folder, then drag the local file
to the indicated area in the picture, or click "Upload or Create" in the upper right corner
to select the file to upload.
412
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
17) If you want to uninstall CasaOS, you can use the following command:
orangepi@orangepi5pro:~$ casaos-uninstall
413
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) On the Ubuntu PC side, open a command-line window and enter the following
command to install python3 and pip3
test@test:~$ sudo apt-get install python3 python3-dev python3-pip
2) You can use the following command to view the installed version of python3
test@test:~$ python3 --version
Python 3.8.10
5) Then enter the following command to install the dependency package for the
corresponding version of python3. This command will use the dependencies listed in the
pip3 installation file requirements_cp38-1.5.2.txt. If the dependency installation is
incomplete, do not specify the installation source and install each package separately.
test@test:~$ pip3 install -r rknn-toolkit2/doc/requirements_cp38-1.5.2.txt -i \
414
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
https://mirror.baidu.com/pypi/simple
6) Then enter the following command to use pip3 to install the RKNN-Toolkit2 package.
After installation, you can use RKNN-Toolkit2
test@test:~$ pip3 install rknn-toolkit2/packages/rknn_toolkit2-1.5.2+b642f30c-cp38-cp38-linux_x86_64.whl
2) Then run the test.py script, which first converts the yolov5s_relu.onnx model into an
RKNN model that can be run on the simulator, and then uses the simulator to simulate
and run the model to infer the bus.jpg image in the current directory
test@test:~/rknn-toolkit2/examples/onnx/yolov5$ python3 test.py
3) After the test. py script runs successfully, the following print message will be seen,
indicating that the model has successfully detected four people and a bus in the bus.jpg
image
done
--> Running model
415
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
W inference: The 'data_format' has not been set and defaults is nhwc!
done
class: person, score: 0.884139358997345
box coordinate left,top,right,down: [209.1040009856224, 244.4304337501526, 286.5742521882057,
506.7466902732849]
class: person, score: 0.8676778078079224
box coordinate left,top,right,down: [478.5757632255554, 238.58572268486023, 559.5273861885071,
526.479279756546]
class: person, score: 0.8246847987174988
box coordinate left,top,right,down: [110.57257843017578, 238.58099019527435,
230.54625701904297, 534.0008579492569]
class: person, score: 0.3392542004585266
box coordinate left,top,right,down: [79.96397459506989, 354.9062474966049, 122.13020265102386,
516.2529321908951]
class: bus , score: 0.7012234926223755
box coordinate left,top,right,down: [94.43931484222412, 129.53470361232758, 553.1492471694946,
468.0852304697037]
D NPUTransfer: Transfer client closed, fd = 3
4) The converted model file yolov5s_relu.rknn and the inferred image result result.jpg
are saved in the current directory
5) The result.jpg image shows the object categories and confidence rates detected in the
bus.jpg image using the yolov5s_relu.rknn model
416
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
Operate the development board through adb on Ubuntu PC, please refer to the
section on ADB usage for instructions on how to use adb
417
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) Then, on the Ubuntu PC side, enter the following command to update the rknn_server
of the development board through the adb tool
test@test:~$ adb push rknpu2/runtime/RK3588/Linux/rknn_server/aarch64/usr/bin/* /usr/bin
3) Then enter the following command on Ubuntu PC to update the librknnrt.so library of
the development board through adb tool
test@test:~$ adb push rknpu2/runtime/RK3588/Linux/librknn_api/aarch64/librknnrt.so /usr/lib
4) Open the terminal of the development board through the adb tool
test@test:~$ adb shell
6) You can use the following command to check. If the process ID of rknn_server
appears, it means that rknn_server is already open, and the running environment of the
development board is set up
root@orangepi:/# pgrep rknn_server
418
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
3131
1) On the Ubuntu PC side, you can view the device ID of the development board
connected to the Ubuntu PC using the following command. This ID will be used below
test@test:~$ adb devices
List of devices attached
4f9f859e5a120324 device
419
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) Enter the following command to run the test.py script, which first converts the
yolov5s_relu.onnx model to an RKNN model, and then loads the model onto the NPU of
the development board to infer the out.jpg image in the current directory
test@test:~/rknn-toolkit2/examples/onnx/yolov5$ python3 test.py
2) Enter the following command to run the test. py script, which first converts the
yolov5s_relu.onnx model to an RKNN model, and then loads the model onto the NPU of
the development board to infer the out.jpg image in the current directory
--> Init runtime environment
I target set by user is: rk3588
I Check RK3588 board npu runtime version
I Starting ntp or adb, target is RK3588
I Device [4f9f859e5a120324] not found in ntb device list.
I Start adb...
I Connect to Device success!
I NPUTransfer: Starting NPU Transfer Client, Transfer version 2.1.0
(b5861e7@2020-11-23T11:50:36)
3) After the test.py script runs successfully, the converted model file yolov5s_relu.rknn
and the inferred image result result.jpg are saved in the current directory
4) The result of running is the same as the section on simulating the running model on
Ubuntu PC
420
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2) Modify the contents of the build-linux_RK3588.sh file using the vim editor
test@test:~/rknpu2/examples/rknn_yolov5_demo$ vim build-linux_RK3588.sh
421
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
On the Ubuntu PC side, the following command can be used to upload the r
knn_yolov5_demo_Linux folder to the development board through the adb tool, the
reby achieving the deployment of rknn_yolov5_demo on the development board
test@test:~/rknpu2/examples/rknn_yolov5_demo$ adb push \
install/rknn_yolov5_demo_Linux /data/rknn_yolov5_demo_Linux
422
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1) Accessing the file system of the development board through adb shell on Ubuntu PC
test@test:~$ adb shell
root@orangepi:/#
3) Then run the rknn_yolov5_demo program for inference. In the following command,
the program uses the yolov5s-640-640.rknn model to infer bus.jpg images. The entire
running process will be completed on the development board
root@orangepi:/data/rknn_yolov5_demo_Linux# ./rknn_yolov5_demo \
./model/RK3588/yolov5s-640-640.rknn ./model/bus.jpg
4) After running, the inference result out.jpg image is saved in the current directory
root@orangepi:/data/rknn_yolov5_demo_Linux# ls
lib model out.jpg rknn_yolov5_demo rknn_yolov5_video_demo
5) On the Ubuntu PC side, we can use the following command to download out.jpg
images through the adb tool, and then use an image viewer to view them
test@test:~$ adb pull /data/rknn_yolov5_demo_Linux/out.jpg ~/Desktop/
/data/rknn_yolov5_demo_Linux/out.jpg: ...led. 1.9 MB/s (191507 bytes in 0.095s)
6) The out.jpg image shows the object categories and confidence rates detected in the
bus.jpg image using the yolov5s-640-640.rknn model
423
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1)Open a browser on Ubuntu PC and enter the following URL in the address bar to
424
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
download and install the Anaconda3 script. After downloading, you will receive the
Anaconda3-2023.07-1-Linux-x86_64.sh file
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2023.07-1-Linux
-x86_64.sh
3)Then the installation script will output the following prompt message. Click the enter
key to continue the installation
4)After clicking the enter key, some introduction information about Anaconda3 will
appear. Keep clicking the "↓" key
425
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
5)Then the installation script will prompt whether to accept the license terms. At this
point, enter yes and press enter to proceed
6)Then the installation script will remind you to install Anaconda3 to your home
directory. Press Enter to confirm
426
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
7)Then the installation script will prompt whether to initialize Anaconda3. Enter yes
and press enter
8)When the following print appears on the terminal, it indicates that Anaconda3 has
been successfully installed
1)Open the terminal on Ubuntu PC and create an environment with Python version 3.8
using Anaconda3 tool
(base)test@test:~$ conda create -n fastdeploy python=3.8
3)Then install the pip3 development tool and package management tool
(fastdeploy)test@test:~$ sudo apt-get install python3-dev python3-pip
427
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
428
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
1)Open a browser on the board and enter the following URL in the address bar to
download and install the Anaconda3 script. After downloading, you will receive the
Anaconda3-2023.07-1-Linux-aarch64.sh
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2023.07-1-Linux
-aarch64.sh
3)Then the installation script will output the following prompt message, click enter to
continue the installation
4)After clicking the enter key, some introduction information about Anaconda3 will
appear. Keep clicking the "↓" key
5)Then the installation script will prompt whether to accept the license terms. At this
point, enter 'yes' and press enter to proceed
429
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
6)Then the installation script will remind you to install Anaconda3 to your home
directory. Press Enter to confirm
7)Then the installation script will prompt whether to initialize Anaconda3. Enter yes
and press enter
8)When the following print appears on the terminal, it indicates that Anaconda3 has
been successfully installed
9)If you use the conda command on the terminal and it shows that the command does
not exist, you need to modify the ~/.bashrc file
orangepi@orangepi:~$ vi ~/.bashrc
11)Then enter the following command in the terminal to make the previous
modification effective
orangepi@orangepi:~$ source ~/.bashrc
430
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
13)Then close the current terminal and reopen another terminal, and you can use the
conda command normally now
1)Open the terminal on the board and create an environment with python version 3.9
using the Anaconda3 tool
(base)orangepi@orangepi:~$ conda create -n fastdeploy python=3.9
6)There is the rknn_install_rk3588.sh script in this directory. Running this script will
complete the installation of the rknpu2 driver on the board
(fastdeploy)orangepi@orangepi:~/rknpu2_device_install_1.4.0$ sudo bash rknn_install_r
k3588.sh
1)During compilation, the cmake command is required. You can execute the following
command to install the cmake tool
(fastdeploy)orangepi@orangepi:~$ sudo apt-get install -y cmake
431
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
2)Then download the FastDeploy SDK, and after the command is executed, you will
receive the FastDeploy folder
(fastdeploy)orangepi@orangepi:~$ git clone https://github.com/PaddlePaddle/FastD
eploy.git
5)Before compilation, cmake needs to be used to configure the project information that
needs to be compiled. After executing the following command, some additional files will
appear in the current directory, including the Makefile file file used for compilation
(fastdeploy)orangepi@orangepi:~/FastDeploy/build$ cmake .. -DENABLE_ORT_BACKEND=ON \
-DENABLE_RKNPU2_BACKEND=ON \
-DENABLE_VISION=ON \
-DRKNN2_TARGET_SOC=RK3588 \
-DCMAKE_INSTALL_PREFIX=${PWD}/fastdeploy-0.0.3
7)After compilation, use the following command to install the compiled file to the
specified path
(fastdeploy)orangepi@orangepi:~/FastDeploy/build$ make install
432