Official OrangePi-Zero2 User Guide
Official OrangePi-Zero2 User Guide
on
iti
THE OFFICIAL
Orange Pi
User's Guide
Orange Pi
THE OFFICIAL ORANGE PI USER'S GUIDE
THE OFFICIAL
Orange Pi
User's Guide
3
4 THE OFFICIAL ORANGE PI USER'S GUIDE
THE OFFICIAL ORANGE PI USER'S GUIDE
Contents
Chapter 1: Getting familiar with your Orange Pi 6
APPENDICES
Appendix A: Installing an OS to a microSD card 46
5
Chapter 1
O
range Pi is an open-source single board computer, a new generation of arm64
development board, which can run systems such as Android 10, Ubuntu and
Debian and so on. Orange Pi Zero 2 uses the Allwinner H616 system-on-chip
and has 512MB/1GB DDR3 memory.
Orange Pi Zero 2 is for anyone who wants to start creating with technology not just
consuming it. It's a simple, fun, useful tool that you can use to start taking control of
the world around you.
Hardware Overview
7
Hardware Specification
Pinout Diagram
Expansion board
The expansion board is an easy way to expand the functionalities of the Orange Pi
Zero2 board by providing two extra USB ports, One IR receiver, and an audio/video
composite port.
Note: The Orange Pi Zero2 does not support MIC Input on the expansion board.
9
Chapter 2
O
range Pi boards are easy to set up and beginners friendly. The Orange Pi
boards are mostly self-contained and only required a few extra components
to get it working. This mini-computer only needs a computer monitor or TV
with an HDMI connection for display. If you want it to run as a mini headless server
then you don't need a display screen either.
The Orange Pi Zero2 is very compact and offers only two USB ports out-of-box. The
USB Type-C port used for powering the board and the USB Type-A port is available
for use. We can get additional two USB Type-A ports with the Orange Pi Zero Addon
board.
As we generally have only one USB port is available to use. We recommend using the
Orange Pi Zero Addon board to get access to more USB ports and other features like
an Audio/Video composite port and an IR receiver.
Optionally, you can use a USB Hub to get more USB ports to connect different
peripherals.
Peripheral Requirements
If you have only bought the Orange Pi Zero2 board then you will need the following
items.
USB power supply – A 5V 3amps(3A) power supply with a USB Type-C connector.
The official OrangePi power supply is recommended for this board.
microSD card with OrangePi OS – The microSD card acts as an primary permanent
storage for the OrnagePi Zero2 board. A minimum of 8GB class 10 card is required.
Although 16GB microSD card is recommended. You need to write the OrangePi OS
into this blank microSD card. follow Appendix A for instructions.
11
A keyboard and mouse – The keyboard and mouse are used to control your Orange
Pi. Any wired or wireless keyboard and mouse will work. Although wired USB
keyboard and mouse are preferred as they are most likely to work without any driver
issues.
USB Hub – The Orange Pi Zero2 has only one USB Type-A port that you may need to
use a USB Hub if you want to use more the one USB device.
Orange Pi Zero expansion board(Optional) – The expansion board can provide two
extra USB Type-A ports and some other functionalities.
13
Connect your OrangePi Zero2
Insert the SD card – Insert the SD card into the microSD card slot on the underside
of your OrangePi Zero2.
Connect USB Mouse & Keyboard – Connect the mouse to a USB port on OrangePi
Zero2 (You can use either a USB Hub or OrangePi Addon board).
Connect HDMI cable – Connect your moniter to the Micro HDMI port of OrangePi
Zero2.
15
Connect USB-C Power Supply – Connect a USB-C Power supply to the Orange Pi
Zero2. This board doesn't have a power switch, so it will start booting as soon as you
connect it to a power supply.
Finally, supply power to the USB-C power adapter, and OrangePi Zero2 will start
booting.
After boot-up is complete, you will be greeted with the login screen. The default
password for OrangePi OS is "orangepi". Enter the password and hit return.
Congratulations! You have booted your first Operating System on the OrangePi
Zero2.
17
Chapter 3
O
range Pi Zero2 can run a wide range of Operating Systems like Ubuntu,
Debian, and Android 10, including server editions of Ubuntu and Debian.
In this chapter, we will learn some basic configurations like changing the screen
resolution, adjusting Linux log levels, setting up an SSH connection, etc.
The log level of the Linux system is set to 1 by default. When using the serial port to
view the boot logs, it only shows minimal information. We can increase the log levels
to get more detailed system logs for debugging.
We need to change the values of fb0_width, fb0_height, and disp_mode in the /boot/
orangepiEnv.txt file according to the following table.
19
After a successful SSH login system, you can get access to the system remotely.
You will be prompted to enter a password, the default passwords for root and
orangepi users are orangepi
21
Connecting to the WiFi
Click the network configuration icon in the upper right corner of the desktop (please
do not connect the network cable when testing WIFI)
Click More networks in the pop-up drop-down box to see all scanned WIFI hotspots,
then select the WIFI hotspot you want to connect to
Then enter the password of the WiFi hotspot, and then click Connect to start
connecting to WiFi
root@orangepi:~# nmtui
23
Select Activate a connection and press Enter.
Select the WiFi hotspot you want to connect to, then use the Tab key to position the
cursor on Activate and press Enter
A dialog box for entering the password will pop up, enter the corresponding
password in Password and press Enter to start connecting to WiFi.
After the WiFi connection is successful, a "*" will be displayed before the connected
WiFi name
25
Connecting to the Bluetooth
Click the Bluetooth icon in the upper right corner of the desktop
Set Visibility Setting to Always visible in the Bluetooth adapter setting interface, and
then click close
27
Then select the Bluetooth device you want to connect to, and then click the right
mouse button to pop up the operation interface of the Bluetooth device. Select Pair
to start pairing. Here is a demonstration of pairing with an Android phone
When pairing with a mobile phone, a pairing confirmation box will pop up in the
upper right corner of the desktop, select Confirm to confirm. At this time, the mobile
phone also needs to be confirmed
After pairing with the phone, you can select the paired Bluetooth device, then right-
click and select Send a File to start sending a picture to the phone
29
13 pin header for Addon board
Please refer to the figure below for the sequence of the Orange Pi Zero 2 dev board
13 pin adapter board interface pins
The schematic diagram of the 13pin interface of the Orange Pi Zero 2 development
board is shown below
Please refer to the figure below for the sequence of the 26 pin of the Orange Pi Zero2
development board
The function of the 26 pin of the Orange Pi Zero2 development board is shown in the
table below
31
Chapter 4
Using Android on
your Orange Pi
Learn about the Android 10 Operating System.
O
range Pi Zero2 can run a wide range of Operating Systems like Ubuntu,
Debian, and Android 10, including server editions of Ubuntu and Debian.
Prepare a USB Typc C interface data cable. One end of the USB interface is inserted
into the USB interface of the computer, and the other end of the Type C interface is
inserted into the power interface of the development board. In this case, the USB
interface of the computer supplies power to the development board, so please
ensure that the USB interface of the computer can provide the most power to drive
the development board.
33
Install adb tool on Ubuntu using following commands
$ sudo apt update
$ sudo apt install adb
Then you can log in to the android system through adb shell on the Ubuntu PC
$ adb shell
cupid-p2:/ #
3) Make sure that the service.adb.tcp.port of the Android system is set to port
number 5555
cupid-p2:/ # getprop | grep "adb.tcp"
[service.adb.tcp.port]: [5555]
4) If service.adb.tcp.port is not set, you can use the following command to set the
port number of the network adb
cupid-p2:/ # setprop service.adb.tcp.port 5555
cupid-p2:/ # stop adbd
cupid-p2:/ # start adbd
7) Then you can log in to the android system through adb shell on the Ubuntu PC
test@test:~$ adb shell
cupid-p2:/ #
1) First insert the USB camera into the USB interface of the development board, and
then confirm that the kernel module related to the USB camera has been loaded
normally
console:/ # lsmod
Module Size Used by
sprdwl_ng 405504 0
sprdbt_tty 36864 2
uwe5622_bsp_sdio 274432 2 sprdwl_ng,sprdbt_tty
uvcvideo 102400 0
videobuf2_v4l2 28672 1 uvcvideo
videobuf2_vmalloc 16384 1 uvcvideo
videobuf2_memops 16384 1 videobuf2_vmalloc
videobuf2_core 49152 2 uvcvideo,videobuf2_v4l2
mali_kbase 532480 7
35
2) If the USB camera is recognized normally, the corresponding video device node
will be generated under /dev
3) Then make sure that the adb connection between the Ubuntu PC and the
development board is normal
4) Download the USB camera test APP from the official tool on the page below the
Orange Pi Zero 2 information
5) Then use the adb command to install the USB camera test APP to the Android
system, of course, you can also use the U disk copy method to install
test@test:~$ adb install usbcamera.apk
6) After installation, you can see the startup icon of the USB camera on the Android
desktop
7) Then double-click to open the USB camera APP and you can see the output video
of the USB camera
The Android 10.0 system released by Orange Pi is already ROOT, you can use the
following method to test
1) Download rootcheck.apk from the official tool on the Orange Pi Zero 2 data
download page
2) Then make sure that the adb connection between the Ubuntu PC and the
development board is normal
3) Then use the adb command to install rootcheck.apk to the Android system, of
course, you can also use the U disk copy to install
test@test:~$ adb install rootcheck.apk
4) After installation, you can see the startup icon of the ROOT test tool on the
Android desktop
6) Open the ROOT test tool and click "Check now" to start the inspection of the ROOT
status of the Android system. The display after the inspection is as follows, you can
see that the Android system has obtained ROOT permission
37
Chapter 5
L
inux images for Orange Pi Zero2 can be easily built by the build script
specially made for Orange Pi boards. The build script can make server and
desktop versions of Debian and Ubuntu.
Orange Pi build script based upon Armbian build script. We will make a few different
images as an example.
The compilation of the Linux is done on a PC with Ubuntu 18.04 installed. Other
versions of Ubuntu systems may have some differences
We will need Git tool for download the source repository. You can install Git using
following commands
test@test:~$ sudo apt update
test@test:~$ sudo apt install git
Orangepi-build will contain the following files and folders after downloading
build.sh: Compile the startup script
external: Contains the configuration files needed to compile the image, specific
scripts, and the source code of some programs, etc.
LICENSE: GPL 2 license file
README.md: orangepi-build instruction file
scripts: general scripts for compiling linux images
39
5) Then select the type of Image you wanna build.
B. Compilation time
[ o.k. ] Runtime [ 19 min ]
C. Repeat the command to compile the image, use the following command without
selecting through the graphical interface, you can directly start to compile the image
[ o.k. ] Repeat Build Options [ sudo ./build.sh BOARD=orangepizero2
BRANCH=legacy BUILD_OPT=image RELEASE=bionic BUILD_MINIMAL=no
BUILD_DESKTOP=no KERNEL_CONFIGURE=yes ]
Building Android
from source
Build your own Android image with
customizations
A
ndroid images for Orange Pi Zero2 can be easily built by the vendor
provided BSP sources. This features a latest version of Android with all
drivers for GPU and media playback.
2) Android SDK is the original SDK released by the chip manufacturer. If you want to
use the Android image compiled by the Android SDK on the Orange Pi development
board, you need to adapt to different boards to ensure that all functions are used
normally
3) Use Ubuntu 14.04 to compile the source code of android 10, you need to ensure
that Ubuntu 14.04 uses the linux 4.4 kernel, otherwise an error will be reported when
compiling, if the kernel is not linux 4.4, please upgrade the kernel
test@test:~$ uname -a
Linux ubuntu 4.4.0-142-generic #168~14.04.1-Ubuntu SMP Sat Jan 19 11:26:28
UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
43
All available board:
0. fpga
1. ft
2. p1
3. p2
4. perf1
5. perf1_axp152
6. perf2
7. perf3
8. qa
Choice [p2]: 3
INFO: kernel defconfig: generate /wspace2/H616/Android_10/longan/kernel/linux-
4.9/.config/wspace2/H616/Android_10/longan/kernel/linux-4.9/arch/arm64/
configs/sun50iw9p1smp_h616_android_defconfig
*** Default configuration is based on 'sun50iw9p1smp_h616_android_defconfig'
#
# configuration written to .config
3) Then use the pack command to package and generate the android image
test@test:~/android$ pack
......
----------image is at----------
longan/out/h616_android10_p2_uart0.img
pack finish
use pack4dist for release
45
Appendix A
Install an OS to a
microSD card
47
4. Perform the Write opration
Click on the Flash! button to write OS image to MicroSD card.
Sometimes Etcher gives you a warnning about MicroSD card being unusually large if
you use a large size MicroSD card.
You may have to give Root permission to perform the write opration.
49
5. Success!
If you see 1 Successful target then this MicroSD card is ready to boot on Orange Pi
SBC.
The corresponding relationship between the debug serial port GND, TX, and RX pins
of the development board is shown in the figure below
The schematic diagram of connecting the USB to TTL module to the computer and
the Orange Pi development board is shown below
1) If the USB to TTL module is connected normally, you can see the corresponding
device node name under /dev of Ubuntu PC, remember this node name, you will use
it when setting up the serial port software later
test@test:~$ ls /dev/ttyUSB*
/dev/ttyUSB0
2) Many serial debugging tools that can be used under Linux, such as putty,
minicom, etc. The following shows how to use putty
5) After executing the putty command, the following interface will pop up
53
8)After setting the serial port setting interface, return to the Session interface
a. First, select the Connection type as Serial
b. Then click the Open button to connect to the serial port
9)After starting the development board, you can see the Log information output by
the OS from the opened serial terminal
2) Download MobaXterm
Download MobaXterm from here.
3) After opening the software, the steps to set the serial connection are as follows
a. Open the session setting interface
b. Select the serial port type
c. Select the port number of the serial port (choose the corresponding port number
according to the actual situation), if you cannot see the port number, please use the
360 driver master to scan and install the driver for the USB to TTL serial chip
55
4)After clicking the "OK" button, you will enter the following interface, and you can
see the output information of the serial port after starting the development board
57
A USER GUIDE FOR ORANGE PI ZERO 2
Orange Pi 4B
Orange Pi 4B is a high-performance SBC specifically designed for
Artificial intelligence tasks, outfitted with a 6-core RK3399 64-Bit
processor and a powerful 9.3Tops NPU suitable for AI-related
projects and perfect for demanding embedded tasks.
Orange Pi 3
Orange Pi 3 is an All-in-One SBC suitable for most embedded needs,
comes with plenty of USB-3 ports for peripherals. It comes with a
modern PCIe interface for high-speed devices.
Orange Pi R1+
Orange Pi R1+ is a high-performance IoT SBC with dual Gigabit
Ethernet and Quad-core 64bit ARM CPU, suitable for most
demanding IoT tasks.