NanoPi R6S

From FriendlyELEC WiKi
Jump to: navigation, search

查看中文

Contents

1 Introduction

Overview
Front
Back
Case
Case
Case
Case

The NanoPi R6S (as “R6S”) is an open-sourced mini IoT gateway device with two 2.5G and one Gbps Ethernet ports, designed and developed by FriendlyElec.It is integrated with a Rockchip RK3588S CPU, 8GB LPDDR4x RAM and 32GB eMMC flash. It supports booting with TF cards and works with operating systems such as FriendlyWrt etc.

The NanoPi R6S has rich hardware resources with a compact size of 90 x 62 mm. FriendlyElec has released a carefully-designed custom CNC housing for it. It has one HDMI port. It works with Android, Debian Desktop and Ubuntu etc and works with headless systems as well. It supports decoding 8K60 H.265/VP9 formatted videos.

The NanoPi R6S has two USB ports, and supports USB type-C power delivery. It is an ideal portable drive for saving images and videos.

All in all, the NanoPi R6S is a board featured with multiple Ethernet ports, light NAS and video playing. It is a cannot-miss platform with infinite possibilities for geeks, fans and developers.

2 Hardware Spec

  • SoC: Rockchip RK3588S
    • CPU: Quad-core ARM Cortex-A76(up to 2.4GHz) and quad-core Cortex-A55 CPU (up to 1.8GHz)
    • GPU: Mali-G610 MP4, compatible with OpenGLES 1.1, 2.0, and 3.2, OpenCL up to 2.2 and Vulkan1.2
    • VPU: 8K@60fps H.265 and VP9 decoder, 8K@30fps H.264 decoder, 4K@60fps AV1 decoder, 8K@30fps H.264 and H.265 encoder
    • NPU: 6TOPs, supports INT4/INT8/INT16/FP16
  • RAM: 64-bit 8GB LPDDR4X at 2133MHz
  • Flash: 32GB eMMC, at HS400 mode
  • Ethernet: one Native Gigabit Ethernet, and two PCIe 2.5G Ethernet
  • USB: one USB 3.0 Type-A and one USB 2.0 Type-A
  • HDMI:
    • compatible with HDMI2.1, HDMI2.0, and HDMI1.4 operation
    • support up to 7680x4320@60Hz
    • Support RGB/YUV(up to 10bit) format
  • microSD: support up to SDR104 mode
  • GPIO:
    • 12-pin 0.5mm FPC connector
    • with up to 1x SPI, up to 3x UARTs, up to 1x I2Cs, up to 8x GPIOs
  • Debug: one Debug UART, 3 Pin 2.54mm header, 3.3V level, 1500000bps
  • LEDs: 4 x GPIO Controlled LED (SYS, WAN, LAN1, LAN2)
  • others:
    • 2 Pin 1.27/1.25mm RTC battery input connector for low power RTC IC HYM8563TS
    • one IR receiver and the carrier frequency is 38Khz
    • MASK button for eMMC update
    • one user button
    • one 5V Fan connector
  • Power supply: USB-C, support PD, 5V/9V/12V/20V input
  • PCB: 8 Layer, 62x90x1.6mm
  • Ambient Operating Temperature: 0℃ to 70℃

3 Diagram, Layout and Dimension

3.1 Layout

NanoPi R6S Layout
  • 12-pin GPIO
Pin# GPIO SPI UART I2C POWER Description
1 VCC3V3_SYS_S3 3.3V power output
2 VCC3V3_SYS_S3 3.3V power output
3 GPIO1_B3 SPI0_CLK_M2 UART4_TX_M2 3.3V level
4 GND
5 GPIO1_B1 SPI0_MISO_M2 3.3V level
6 GPIO1_B4 SPI0_CS0_M2 3.3V level
7 GPIO1_B2 SPI0_MOSI_M2 UART4_RX_M2 3.3V level
8 GND
9 GPIO1_B7 UART1_RX_M1 I2C5_SDA_M3 3.3V level
10 GPIO1_B6 UART1_TX_M1 I2C5_SCL_M3 3.3V level
11 GPIO3_C4 UART5_TX_M1 3.3V level
12 GPIO3_C5 UART5_RX_M1 3.3V level
  • Debug UART Pin Spec
3.3V level signals, 1500000bps
Pin# Assignment Description
1 GND 0V
2 UART2_TX_M0_DEBUG output
3 UART2_RX_M0_DEBUG intput
  • USB Port
Each USB Type-A port has 1.4A overcurrent protection.
  • RTC
RTC backup current is 0.25μA TYP (VDD =3.0V, TA =25℃).
Connector P/N: Molex 53398-0271
  • IR receiver
Connected to PWM3_IR_M0
38Khz carrier frequency
compatible with NEC protocol, User code is 3B4C
Support power on via IR controller
Support FriendlyELEC RC100 IR controller

4 Get Started

4.1 Essentials You Need

Before starting to use your NanoPi-R6S get the following items ready

  • NanoPi-R6S
  • MicroSD Card/TF Card: Class 10 or Above, minimum 8GB SDHC
  • USB C PD Charger (10W & above)
  • If you need to develop and compile,you need a computer that can connect to the Internet. It is recommended to install Ubuntu 18.04 64-bit system and use the following script to initialize the development environment:

4.2 TF Cards We Tested

Refer to: TFCardsWeTested

4.3 PD Power Adapters We Tested

Refer to: PD Power Adapters We Tested

4.4 Configure parameters for serial port

Use the following serial parameters:

Baud rate 1500000
Data bit 8
Parity check None
Stop bit 1
Flow control None

4.5 Install OS

4.5.1 Flash to TF

Visit download linkto download image files (in the "01_Official images/01_SD card images" directory) and utilities (in the "05_Tools" directory):

Image Files
rk3588-sd-friendlywrt-21.02-YYYYMMDD.img.gz FriendlyWrt lite image file, based on OpenWrt 21.02, kernel version 5.10.y
rk3588-sd-friendlywrt-21.02-docker-YYYYMMDD.img.gz FriendlyWrt with Docker image file, based on OpenWrt 21.02, kernel version 5.10.y
rk3588-sd-friendlywrt-22.03-YYYYMMDD.img.gz FriendlyWrt lite image file, based on OpenWrt 22.03, kernel version 5.10.y
rk3588-sd-friendlywrt-22.03-docker-YYYYMMDD.img.gz FriendlyWrt with Docker image file, based on OpenWrt 22.03, kernel version 5.10.y
rk3588-sd-ubuntu-jammy-desktop-arm64-YYYYMMDD.img.gz Ubuntu 22.04 with GNOME and Wayland
Pre-installed web browser and other recommended software
kernel version 5.10.y
rk3588-sd-ubuntu-jammy-minimal-arm64-YYYYMMDD.img.gz Lightweight Ubuntu 22.04 with GNOME and Wayland
Recommended software is not included
kernel version 5.10.y
Other Image
Github Actions FriendlyWrt
Flash Utility:
win32diskimager.rar Windows utility. Under Linux users can use "dd"

The detailed steps are as follows:

  • Get an 8G SDHC card and backup its data if necessary;
  • Download and extract the xxx.img.gz and win32diskimager;
  • Run the win32diskimager utility under Windows as administrator. On the utility's main window select your SD card's drive, the wanted image file and click on "write" to start flashing the SD card. Under Linux run "dd" to flash the rkXXXX-sd-OSNAME-YYYYMMDD.img file to your SD card;
  • Take out the SD and insert it to NanoPi-R6S's microSD card slot;
  • Power on NanoPi-R6S and it will be booted from your TF card;

4.5.2 Install OS to eMMC

4.5.2.1 Option 1: Install OS on Web Page

Get a TF card which has been installed with FriendlyWrt, log in FriendlyWrt on the web page, click on “System” ->”eMMC Tools”. Click on “Select file” to select your wanted image file, either an official image (the name might start with “rk3588-sd”) or a third party image. The file should be a “.gz” or “.img” file.
After a file is selected, click on “Upload and Write” to start installing an OS.
Friendlywrt-emmctools2-en.png
After installation is done, eject the SD card, the system will automatically reboot and load the OS from eMMC. After the OS begins to load, if the system LED is flashing and the network LED is on, it means the the OS has loaded successfully. If the OS is FriendlyWrt, you can click on “Go to Homepage” to enter the homepage.
Note that if you are burning the FriendlyElec firmware, you need to use an image file with the "-sd-" file name, similar to the one below:

rk3588-sd-friendlywrt-21.02-YYYYMMDD.img.gz
rk3588-sd-friendlywrt-21.02-docker-YYYYMMDD.img.gz
rk3588-sd-friendlywrt-22.03-YYYYMMDD.img.gz
rk3588-sd-friendlywrt-22.03-docker-YYYYMMDD.img.gz

If the file is in 7z, zip or rar format, you will need to extract it first. If the file is too large to write, you can compress it into .gz format and try again.

4.5.2.2 Option 2: Install OS via TF Card
4.5.2.2.1 Install OS to eMMC
  • This method firstly boots a mini Linux from a TF card and then automatically runs an EFlasher utility to install the OS to eMMC.
  • You can connect your system to an HDMI monitor and watch its progress. This is optional. You can watch its progress by observing its LEDs as well.

Visit download link to download the needed utilities and image file:

Image File
rk3588-eflasher-friendlywrt-21.02-YYYYMMDD.img.gz FriendlyWrt
Based on OpenWrt 21.02
Kernel version 5.10.y
rk3588-eflasher-friendlywrt-21.02-docker-YYYYMMDD.img.gz FriendlyWrt
Pre-installed Docker
Based on OpenWrt 21.02
Kernel version 5.10.y
rk3588-eflasher-friendlywrt-22.03-YYYYMMDD.img.gz FriendlyWrt
Based on OpenWrt 22.03
Kernel version 5.10.y
rk3588-eflasher-friendlywrt-22.03-docker-YYYYMMDD.img.gz FriendlyWrt
Pre-installed Docker
Based on OpenWrt 22.03
Kernel version 5.10.y
rk3588-eflasher-debian-buster-desktop-arm64-YYYYMMDD.img.gz Debian 10(buster) Desktop
Uses LXDE as default desktop
Pre-installed mpv, smplayer and chromium brower
Supports hardware acceleration
Kernel version 5.10.y
rk3588-eflasher-androidtv-YYYYMMDD.img.zip Android TV
rk3588-eflasher-ubuntu-jammy-desktop-arm64-YYYYMMDD.img.gz Ubuntu 22.04 with GNOME and Wayland
Pre-installed web browser and other recommended software
kernel version 5.10.y
rk3588-eflasher-ubuntu-jammy-minimal-arm64-YYYYMMDD.img.gz Lightweight Ubuntu 22.04 with GNOME and Wayland
Recommended software is not included
kernel version 5.10.y
Flash Utility:
win32diskimager.rar Windows utility. Under Linux users can use "dd"

Here are the steps:

  • Get an SDHC card with a minimum capacity of 8G
  • Download a rk3588-eflasher-OSNAME-YYYYMMDD.img.gz image file and a win32diskimager;
  • Under Windows, run win32diskimager as administrator, select your SD card and extracted EFlasher image file, and click on “Write” to write image file on the SD card; or under Linux, you use the dd command to write the rk3588-eflasher-OSNAME-YYYYMMDD.img file to the SD card.
  • Eject your SD card and insert it to NanoPi-R6S’s microSD card slot.
  • Turn on NanoPi-R6S, it will boot from the SD card and automatically run EFlasher to install the OS to the board’s eMMC. You connect your board to an HDMI monitor or observer the board’s LEDs to watch its installation progress
Progress SYS LED(Red) LAN LED(Green) WAN LED(Green)
Power On Solid On Off Off
System Boot Slow Flashing Off Off
Installation in Progress Fast Flashing Off Off
Installation Done Slow Flashing Solid On Solid On
  • After installation is done, power off the board, eject the SD card from NanoPi-R6S, power on the board again, NanoPi-R6S will load the OS from its eMMC
4.5.2.2.2 Install Flash Image File to eMMC
  • Auto Install (Default Behavior)

1) Download an “eflasher” firmware from network drive, extract it and install it to a TF card ;
2) Eject and insert the TF card to your PC, after a “FriendlyARM” device shows up(Under Linux, it is a “FriendlyARM” directory), copy an .img or .gz file to the TF card.
3) Open the eflasher.conf file on the TF card, set “autoStart=” to the name of your image file, such as:

autoStart=openwrt-rockchip-armv8_nanopi-ext4-sysupgrade.img.gz

Anyone of the files that contain “-sd-” will work. Here is a list:

rk3588-sd-friendlywrt-22.03-YYYYMMDD.img.gz
rk3588-sd-friendlywrt-22.03-docker-YYYYMMDD.img.gz
rk3588-sd-friendlywrt-21.02-YYYYMMDD.img.gz
rk3588-sd-friendlywrt-21.02-docker-YYYYMMDD.img.gz
rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221029.img.gz

4) Eject the TF card, insert the TF card to NanoPi-R6S, power it on it will automatically install your firmware. You can watch the installation progress by observing the LEDs’ status.

  • Disable Auto Installation

If you want to disable auto installation, please open the eflasher.conf file, set “autoStart=” to empty:

autoStart=

In this case, after the system boots, it will stay at the step where you are expected to select an image file. You need to connect an HDMI monitor and a USB mouse to your board and install a firmware on its UI;

4.5.2.3 Option 3: Install OS via USB
4.5.2.3.1 Step 1: Install USB Driver and Tools/Utilities

Download a driver file DriverAssitant_v5.1.1.zip under the “tools” directory from network drive, extract and install it.
Under the same directory, download a utility RKDevTool_Release_v2.84.zip and extract it.

4.5.2.3.2 Step 2: Connect NanoPi-R6S to PC and Enter Installation Mode

1) Disconnect the connected USB cable and the power cord from NanoPi-R6S, eject the TF card;
2) Press and hold the “Mask” key, power on the board. After the status LED has been on for at least 3 seconds, release the Mask key.
3) Use a USB A-to-A cable, connect NanoPi-R6S to a PC as follows. Note: please pay attention to the USB port the USB cable is connected to in the screenshot.
Nanopir6s-usba-to-usba2.jpg

4.5.2.3.3 Step 3: Install image to eMMC

A firmware in general is packaged in either of the two options: the first is an whole image (ie, update.img) which is often offered by third party developers, the second is that an image is packaged and placed in multiple partition images. FriendlyElec offers an image in the latter option.

  • Option 1: Install whole image (ie, update.img)

On a PC which has the extracted RKDevTool_Release_v2.84 utility, go to the RKDevTool_Release_v2.84 directory, run the RKDevTool.exe file. If everything works, you will see a “Found a new Maskrom device” message on the utility;
Go to “Upgrade Firmware(升级固件)”, click on “Firmware(固件)”, select your wanted image file, and click on “Upgrade(升级)” to install. After installation is done, your board will reboot automatically and load the system from eMMC;

  • Option 2: Install OS that is packaged & placed in multiple partition images

Go to network drive to download your needed package and extract it.

Image File
rk3588-usb-friendlywrt-21.02-YYYYMMDD.img.gz FriendlyWrt
Based on OpenWrt 21.02
Kernel version 5.10.y
rk3588-usb-friendlywrt-21.02-docker-YYYYMMDD.img.gz FriendlyWrt
Pre-installed Docker
Based on OpenWrt 21.02
Kernel version 5.10.y
rk3588-usb-friendlywrt-22.03-YYYYMMDD.img.gz FriendlyWrt
Based on OpenWrt 22.03
Kernel version 5.10.y
rk3588-usb-friendlywrt-22.03-docker-YYYYMMDD.img.gz FriendlyWrt
Pre-installed Docker
Based on OpenWrt 22.03
Kernel version 5.10.y
rk3588-usb-debian-buster-desktop-arm64-YYYYMMDD.img.gz Debian 10(buster) Desktop
Uses LXDE as default desktop
Pre-installed mpv, smplayer and chromium brower
Supports hardware acceleration
Kernel version 5.10.y
rk3588-usb-androidtv-YYYYMMDD.img.zip Android TV
rk3588-usb-ubuntu-jammy-desktop-arm64-YYYYMMDD.img.gz Ubuntu 22.04 with GNOME and Wayland
Pre-installed web browser and other recommended software
kernel version 5.10.y
rk3588-usb-ubuntu-jammy-minimal-arm64-YYYYMMDD.img.gz Lightweight Ubuntu 22.04 with GNOME and Wayland
Recommended software is not included
kernel version 5.10.y

After it is extracted, you will see some utilities and a configuration file under the directory. double click on RKDevTool.exe, you will see a “Found a new Maskrom device” message on the utility. Click on the “Execute”, wait a moment and it will be installed. After installation is done your system will automatically reboot and load the system from eMMC.

4.6 The Boot order between eMMC and SD card

By default, the system will be booted from the TF card first, but this is not the case under all conditions. This section will explain all situations in detail;

Refer to rockchip official document [1], there are two types of loader program:
1) U-Boot TPL/SPL (i.e. upsream U-Boot, also called mainline U-Boot)
2) Rockchip MiniLoader

Things to note:
1) FriendlyELEC's image uses Rockchip MiniLoader
2) The third-party image usually uses U-Boot TPL/SPL

The following situations will always start from eMMC:
If the system in the eMMC, or the system in the TF card uses the first Loader type U-Boot TPL/SPL, it will always boot from the eMMC;
If you want to boot from the TF card, there are the following methods:
Method 1: Clear the Loader on the eMMC, the clearing method is as follows, after starting from the eMMC, enter the following command on the command line to clear the Loader on the eMMC:

dd if=/dev/zero of=/dev/mmcblk2 bs=8M count=1

Method 2: Insert the TF card, Press Maskrom Key (or short-circuit the Maskrom contacts) and then power on (need to keep the short-circuit for about 3 seconds), it will start from the TF card

The summary is as follows:

eMMC current system TF card current system Boot priority
No system Any image TF card
FriendlyELEC's image FriendlyELEC's image TF card
FriendlyELEC's image Image with Mainline U-boot eMMC
Image with Mainline U-boot FriendlyELEC's image eMMC
Image with Mainline U-boot Image with Mainline U-boot eMMC

5 Work with FriendlyWrt

5.1 Introduction to FriendlyWrt

FriendlyWrt is a customized system made by FriendlyElec based on an OpenWrt distribution. It is open source and well suitable for developing IoT applications, NAS applications etc.

5.2 First boot

For the first boot, the system needs to do the following initialization work:
1)Extended root file system
2)Initial setup(will execute /root/setup.sh)
So you need to wait for a while (about 2~3 minutes) to boot up for the first time, and then set FriendlyWrt, you can enter the ttyd terminal on the openwrt webpage, when the prompt is displayed as root@FriendlyWrt, it means the system has been initialized.

root@FriendlyWrt

5.3 Account & Password

The default password is password (empty password in some versions). Please set or change a safer password for web login and ssh login. It is recommended to complete this setting before connecting NanoPi-R6S to the Internet.

5.4 Login FriendlyWrt

Connect the PC to the LAN port of NanoPi-R6S. If your PC without a built-in ethernet port, connect the LAN port of the wireless AP to the LAN port of NanoPi-R6S, and then connect your PC to the wireless AP via WiFi , Enter the following URL on your PC's browser to access the admin page:

The above is the LAN port address of NanoPi-R6S. The IP address of the WAN port will be dynamically obtained from your main router through DHCP.

5.5 Recommended security settings

The following settings are highly recommended to complete before connecting NanoPi-R6S to the Internet。

  • Set a secure password
  • Only allow access to ssh from lan, change the port
  • Only allow local devices to access luci

Edit /etc/config/uhttpd,Change the original 0.0.0.0 and [::] addresses to the local lan address, for example:

	# HTTP listen addresses, multiple allowed
	list listen_http	192.168.2.1:80
	list listen_http	[fd00:ab:cd::1]:80
 
	# HTTPS listen addresses, multiple allowed
	list listen_https	192.168.2.1:443
	list listen_https	[fd00:ab:cd::1]:443

Restart the service:

/etc/init.d/uhttpd restart
  • Check the firewall settings

Set up as you wish.

5.6 Safe shutdown operation

Enter the "Services" -> "Terminal", enter the "poweroff" command and hit enter, wait until the led light is off, and then unplug the power supply.

5.7 Soft Factory Reset

Enter "System"->"Backup/Flash firmware",Click “Perform reset“ Button, Your device's settings will be reset to defaults like when FriendlyWrt was first installed.
You can also do this in the terminal:

firstboot && reboot

5.8 Install Software Packages

5.8.1 Set up openwrt official opkg source

sed -i -e 's/mirrors.cloud.tencent.com/downloads.openwrt.org/g' /etc/opkg/distfeeds.conf
opkg update

5.8.2 Update Package List

Before install software packages update the package list:

$ opkg update

5.8.3 List Available Packages

$ opkg list

5.8.4 List Installed Packages

$ opkg list-installed

5.8.5 Install Packages

$ opkg install <package names>

5.8.6 Remove Packages

$ opkg remove <package names>

5.9 Disable IPv6

. /root/setup.sh
disable_ipv6
reboot

5.10 Configure the function of the user button

By default, the user button is configured to reboot the device, as shown below:

echo 'BTN_1 1 /sbin/reboot' >> /etc/triggerhappy/triggers.d/example.conf

You can change its behavior by changing the configuration file above.

5.11 Some common issues of FriendlyWrt

  • Unable to dial up
    • Go to "Network" -> "Firewall" and set "Inbound Data", "Outbound Data" and "Forwarding" in "WAN Zone" to "Accept";
    • If you still cannot access the Internet, you can try to turn off IPV6;
  • Dial-up successful, but no outgoing traffic
    • Go to "Services" -> "Terminal" and type "fw4 reload" to try to reload the firewall settings again;
  • Unable to power on
    • Try to replace the power adapter and cable. It is recommended to use a power supply with specifications above 5V/2A;
    • Note that some fast chargers with Type-C interface will have a delay, it may take a few seconds to start providing power;
  • When doing secondary routing, the computer cannot connect to the Internet
    • If your main network is IPv4, and NanoPi-R6S works in IPv6, the computer may not be able to connect to the Internet. It is recommended to turn off IPv6 (the method is described later in this WiKi), or switch the main route to IPv6;
  • If you have questions or have better suggestions, please send an email to techsupport@friendlyarm.com;

5.12 Use USB2LCD to view IP and temperature

Plug the USB2LCD module to the USB interface ofNanoPi-R6S and power on, the IP address and CPU temperature will be displayed on the LCD:
Xxx-usb2lcd-01.png

5.13 Work with USB WiFi Device

5.13.1 Check USB WiFi Device with Command Line Utility

(1) Click on "services>ttyd" to start the command line utility

(2) Make sure no USB devices are connected to your board and run the following command to check if any USB devices are connected or not

lsusb

(3) Connect a USB WiFi device to the board and run the command again

lsusb

You will see a new device is detected. In our test the device's ID was 0BDA:C811

(4) Type your device's ID (in our case it was "0BDA:C811" or "VID_0BDA&PID_C811") in a search engine and you may find a device that matches the ID. In our case the device we got was Realtek 8811CU.

5.13.2 Configure a USB WiFi Device as AP

(1) Connect a USB WiFi device to the NanoPi-R6S. We recommend you to use the following devices:
R2swrt+usbwifi-20210831.jpg
Note: devices that match these VID&PIDs would most likely work.
(2) Click on "System>Reboot" and reboot your NanoPi-R6S

(3) Click on "Network>Wireless" to enter the WiFi configuration page

(4) Click on "Edit" to edit the configuration

(5) On the "Interface Configuration" page you can set the WiFi mode and SSID, and then go to "Wireless Security" to change the password. By default the password is "password". After you make your changes click on "Save" to save

(6) After you change the settings you can use a smartphone or PC to search for WiFi

5.13.3 Common USB WiFi issues

1) It is recommended to plug in the usb wifi in the off state, then power it on, FriendlyWrt will automatically generate the configuration file /etc/config/wireless, if not, see if there is wlan0 by ifconfig -a, if there is no wlan0, usually there is no driver.
2) If ifconfig -a sees wlan0, but the hotspot is not working properly, try changing the channel and country code, an inappropriate country code can also cause the WiFi to not work.
3) Some USB WiFis (e.g. MTK MT7662) work in CD-ROM mode by default and need to be switched by usb_modeswitch, you can try to add usb_modeswitch configuration to the following directory: /etc/usb_modeswitch.d.

5.13.4 Change the default WiFi hotspot configuration

FriendlyWrt sets the country, hotspot name and other parameters for USB WiFi by default, with the aim of being as plug-and-play as possible, but this does not guarantee that all modules will be compatible with this setting, you can change these behaviors by modifying the following file:

/lib/wifi/mac80211.sh

5.14 Work with Docker Applications

5.14.1 Work with Docker: Install JellyFin

mkdir -p /jellyfin/config
mkdir -p /jellyfin/videos
docker run --restart=always -d -p 8096:8096 -v /jellyfin/config:/config -v /jellyfin/videos:/videos jellyfin/jellyfin:10.1.0-arm64 -name myjellyfin

After installation, visit port 8096 and here is what you would find:
FriendlyWrt+JerryFin

5.14.2 Work with Docker: Install Personal Nextcloud

mkdir /nextcloud -p
docker run -d -p 8888:80  --name nextcloud  -v /nextcloud/:/var/www/html/ --restart=always --privileged=true  arm64v8/nextcloud

After installtion, visit port 8888.

5.14.3 Expand Docker Storage

  • Stop docker service first:
/etc/init.d/dockerd stop
  • Rename the original /opt directory, create an empty /opt directory:
mv /opt /opt-old && mkdir /opt
  • Format your drive as ext4, and mount it to the /opt directory:

Friendlywrt mount nvme opt-en.jpg

  • Enter the command "mount | grep /opt" to check the mount status:
root@FriendlyWrt:~# mount | grep /opt
/dev/nvme0n1p1 on /opt type ext4 (rw,relatime)
root@FriendlyWrt:~#
  • Copy the files from the original /opt directory to the new /opt directory:
cp -af /opt-old/* /opt/ && rm -rf /opt-old
  • Reboot the device
reboot
  • After reboot, go to the "Docker" -> "Overview" page, check the information in the "Docker Root Dir" line, you can see that the Docker space has been expanded:

Friendlywrt docker info-en.jpg

5.14.4 Docker FAQ and solutions

5.14.4.1 Unable to access the network services provided by the Docker container

Solution:

  • Go to the "Firewall" settings and set "Forwarding" to "Accept";
  • Turn off "Software Offload";

5.15 Mount smbfs

mount -t cifs //192.168.1.10/shared /movie -o username=xxx,password=yyy,file_mode=0644

5.16 Use sdk to compile the package

5.16.1 Install the compilation environment

Download and run the following script on 64-bit Ubuntu (version 18.04+): How to setup the Compiling Environment on Ubuntu bionic

5.16.2 Download and decompress sdk from the network disk

The sdk is located in the toolchain directory of the network disk:

tar xvf openwrt-sdk-*-rockchip-armv8_gcc-11.2.0_musl.Linux-x86_64.tar.xz
# If the path is too long, it will cause some package compilation errors, so change the directory name here
mv openwrt-sdk-*-rockchip-armv8_gcc-11.2.0_musl.Linux-x86_64 sdk
cd sdk
./scripts/feeds update -a
./scripts/feeds install -a

5.16.3 Compile the package

download the source code of the example (a total of 3 examples are example1, example2, example3), and copy to the package directory:

git clone https://github.com/mwarning/openwrt-examples.git
cp -rf openwrt-examples/example* package/
rm -rf openwrt-examples/

Then enter the configuration menu through the following command:

make menuconfig

In the menu, select the following packages we want to compile (actually selected by default):

"Utilities" => "example1"
"Utilities" => "example3"
"Network" => "VPN" => "example2"

execute the following commands to compile the three software packages:

make package/example1/compile V=99
make package/example2/compile V=99
make package/example3/compile V=99

After the compilation is successful, you can find the ipk file in the bin directory, as shown below:

$ find ./bin -name example*.ipk
./bin/packages/aarch64_generic/base/example3_1.0.0-220420.38257_aarch64_generic.ipk
./bin/packages/aarch64_generic/base/example1_1.0.0-220420.38257_aarch64_generic.ipk
./bin/packages/aarch64_generic/base/example2_1.0.0-220420.38257_aarch64_generic.ipk

5.16.4 Install the ipk to NanoPi

You can use the scp command to upload the ipk file to NanoPi:

cd ./bin/packages/aarch64_generic/base/
scp example*.ipk root@192.168.2.1:/root/

Then use the opkg command to install them:

cd /root/
opkg install example3_1.0.0-220420.38257_aarch64_generic.ipk
opkg install example1_1.0.0-220420.38257_aarch64_generic.ipk
opkg install example2_1.0.0-220420.38257_aarch64_generic.ipk

5.17 Build FriendlyWrt using GitHub Actions

Please refre this link: https://github.com/friendlyarm/Actions-FriendlyWrt

6 Work with Ubuntu 22.04 Desktop

6.1 Introduction to Ubuntu 22.04 Desktop

Ubuntu 22.04 Desktop has the following features:

  • Uses GNOME 42 as default desktop;
  • Uses Wayland as default display server;
  • Mali GPU-based OpenGL ES support;
  • Support Rockhip MPP video hard coding and hard decoding;
  • Pre-installed mpv and kodi, support video hardware decoding;
  • Compatible with Docker and Plex server;

Ubuntu2204desktop.png

6.2 Account & Password

Regular Account:
    User Name: pi
    Password: pi

Root:
    the root user account is disabled by default, you may configure the root password through the 'sudo passwd root' command.

6.3 View IP address

Since the hostname is FriendlyElec.lan by default, you can use the ping command to get the IP address:

ping FriendlyElec.lan

6.4 Connect to Ubuntu via SSH

ssh pi@FriendlyElec.lan

The default password is: pi

6.5 Update Software Packages

$ sudo apt-get update

6.6 Install Ubuntu software center

$ sudo apt-get install snapd
$ sudo snap install snap-store

6.7 Install the kernel-header package

sudo dpkg -i /opt/linux-headers-*.deb

6.8 Change time zone

6.8.1 Check the current time zone

timedatectl

6.8.2 List all available time zones

timedatectl list-timezones

6.8.3 Set the time zone (e.g. Shanghai)

sudo timedatectl set-timezone Asia/Shanghai

6.9 Change startup LOGO and Wallpaper

Replace the following two files in the kernel source code directory and recompile the kernel:
kernel/logo.bmp
kernel/logo_kernel.bmp
Or use the script to operate, as shown below:

  • Download scripts:
git clone https://github.com/friendlyarm/sd-fuse_rk3588.git -b master
cd sd-fuse_rk3588
  • Compile kernel and repackage firmware
convert files/logo.jpg -type truecolor /tmp/logo.bmp
convert files/logo.jpg -type truecolor /tmp/logo_kernel.bmp
LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh ubuntu-jammy-desktop-arm64
./mk-emmc-image.sh ubuntu-jammy-desktop-arm64

6.10 Soft Factory Reset

Execute the following command in a terminal:

sudo firstboot && sudo reboot

6.11 Start the program automatically at startup(For example Firefox)

Put the desktop file in the ~/.config/autostart/ directory, for example:

mkdir ~/.config/autostart/
cp /usr/share/applications/firefox.desktop ~/.config/autostart/

6.12 Disable auto-mounting

sudo systemctl mask udisks2
sudo reboot

6.13 Setup Chinese language and Input method

6.13.1 Setup Chinese language

Enter the following command and select 'zh_CN.UTF-8':

sudo dpkg-reconfigure locales

Add environment variables to .bashrc:

echo "export LC_ALL=zh_CN.UTF-8" >> ~/.bashrc
echo "export LANG=zh_CN.UTF-8" >> ~/.bashrc
echo "export LANGUAGE=zh_CN.UTF-8" >> ~/.bashrc

Reboot device:

sudo reboot

6.14 Video playback with hardware decoding

6.14.1 GUI

  • Locate the video file in the file browser, right click and select "Play with mpv media player"
  • Using Kodi player
  • Using Chromium web browser, you can play videos on the web with hardware decoding (limited to the video formats supported by the CPU)

6.14.2 Command line

  • Play local video file
export DISPLAY=:0.0
mpv --fs /home/pi/Videos/demo.mp4
  • Play web-video
export DISPLAY=:0.0
mpv --fs https://www.youtube.com/watch?v=lK-nYDmC1Dk

6.15 How to Install Plex Media Server

Run the following command to install:

echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -
sudo apt update
sudo apt install plexmediaserver

After successful installation, enable Plex (starts automatically at system startup):

sudo systemctl enable plexmediaserver
sudo systemctl start plexmediaserver
sudo systemctl status plexmediaserver

After installation, login to Plex server by entering the following address in your computer browser: http://IPAddress:32400/web/

6.16 Install Docker Engine

6.16.1 Install Docker Engine

sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin

Let’s verify:

sudo docker info

6.16.2 Run Docker as a non-root user

sudo groupadd docker
sudo gpasswd -a ${USER} docker
sudo systemctl restart docker
sudo chmod a+rw /var/run/docker.sock

Let’s verify:

docker images

6.16.3 Testing Docker: Installing Nextcloud with docker

mkdir ~/nextcloud -p
docker run -d -p 8888:80  --name nextcloud  -v ~/nextcloud/:/var/www/html/ --restart=always --privileged=true  arm64v8/nextcloud

After installation, visit: http://Device-IP-Address:8888 on your computer browser to view the nextcloud web page.

6.17 WiFi Connection

6.17.1 Gui

Click on the icon on the top right in the FriendlyDesktop's main window, select your wanted WiFi hotspot and proceed with prompts

6.17.2 Console

Please visit: Use NetworkManager to configure network settings

6.18 Test OpenGL ES

First, change the CPU governor to performance:

sudo sh -c 'echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor'
sudo sh -c 'echo performance > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor'
sudo sh -c 'echo performance > /sys/devices/system/cpu/cpufreq/policy6/scaling_governor'

Start glmark2-es2-wayland:

glmark2-es2-wayland

7 Android TV Guide

Android TV is an Android version specially created for TV with the following features:

  • Support infrared remote control;
  • Support wired network;
  • Support video hard decoding;

AndroidTV12.png

8 Work with Debian10 Desktop

8.1 Introduction to Debian10 Desktop

Debian10 Desktop is a light-weighted debian desktop system,it has the following features:

  • Uses LXDE as default desktop;
  • Mali GPU-based OpenGL support;
  • Support Rockhip MPP video hard coding and hard decoding;
  • Pre-installed mpv and smplayer, both support 4K video hardware decoding;
  • Pre-installed Chromium browser, support vpu/gpu hardware acceleration (video hard decoding limited to h264/mp4 format);
  • Compatible with Plex Server and Docker;

Debian10-lxde.png

8.2 Account & Password

Regular Account:
    User Name: pi
    Password: pi

Root:
    the root user account is disabled by default, you may configure the root password through the 'sudo passwd root' command.

8.3 View IP address

Since the Debian Buster hostname is FriendlyElec.lan by default, you can use the ping command to get the IP address:

ping FriendlyElec.lan

8.4 Connect to Debian via SSH

ssh pi@FriendlyElec.lan

The default password is: pi

8.5 Update Software Packages

$ sudo apt-get update

8.6 Install x11vnc Server on Debian for Remote Access

8.6.1 Install x11vnc server

The following command to install x11vnc server:

sudo apt-get install x11vnc

8.6.2 Set your password

sudo x11vnc -storepasswd /etc/x11vnc.pwd

8.6.3 Setup x11vnc server with systemd auto start up

Create service configuration file:

sudo vi /lib/systemd/system/x11vnc.service

Let’s copy and paste the following configuration into our newly create service file:

[Unit]
Description=Start x11vnc at startup.
Requires=display-manager.service
After=syslog.target network-online.target
Wants=syslog.target network-online.target
 
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -display :0 -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pwd -rfbport 5900 -shared -capslock -nomodtweak
ExecStop=/usr/bin/x11vnc -R stop
Restart=on-failure
 
[Install]
WantedBy=multi-user.target

The following commands to reload the systmd system and to enable and start the x11vnc service:

sudo systemctl daemon-reload
sudo systemctl enable x11vnc.service
sudo systemctl start x11vnc

8.6.4 Testing remote access

Start the VNC client software, input IP:5900 to connect:
Debian10-x11vnc.png

8.7 Install the kernel-header package

sudo dpkg -i /opt/linux-headers-*.deb

8.8 Change time zone

8.8.1 Check the current time zone

timedatectl

8.8.2 List all available time zones

timedatectl list-timezones

8.8.3 Set the time zone (e.g. Shanghai)

sudo timedatectl set-timezone Asia/Shanghai

8.9 Change startup LOGO and Wallpaper

8.9.1 Change startup LOGO

Replace the following two files in the kernel source code directory and recompile the kernel:
kernel/logo.bmp
kernel/logo_kernel.bmp
Or use the script to operate, as shown below:

  • Download scripts:
git clone https://github.com/friendlyarm/sd-fuse_rk3588.git -b master
cd sd-fuse_rk3588
  • Compile kernel and repackage firmware
convert files/logo.jpg -type truecolor /tmp/logo.bmp
convert files/logo.jpg -type truecolor /tmp/logo_kernel.bmp
LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh debian-buster-desktop-arm64
./mk-emmc-image.sh debian-buster-desktop-arm64

8.9.2 Change Wallpaper

Modify the following configuration file:

/home/pi/.config/pcmanfm/LXDE/desktop-items-0.conf

8.10 Soft Factory Reset

Execute the following command in a terminal:

sudo firstboot && sudo reboot

8.11 Start the program automatically at startup(For example Kodi)

Put the desktop file in the ~/.config/autostart/ directory, for example:

mkdir ~/.config/autostart/
cp /usr/share/applications/kodi.desktop ~/.config/autostart/

8.12 Disable auto-mounting

sudo systemctl mask udisks2
sudo reboot

8.13 Setup Chinese language and Input method

8.13.1 Setup Chinese language

Enter the following command and select 'zh_CN.UTF-8':

sudo dpkg-reconfigure locales

Add environment variables to .bashrc:

echo "export LC_ALL=zh_CN.UTF-8" >> ~/.bashrc
echo "export LANG=zh_CN.UTF-8" >> ~/.bashrc
echo "export LANGUAGE=zh_CN.UTF-8" >> ~/.bashrc

Reboot device:

sudo reboot

8.13.2 Installing Chinese input method

Enter the following command to install fcitx and Pinyin input method:

sudo apt update
sudo apt-get install fcitx fcitx-pinyin
sudo apt-get install im-config
sudo apt-get install fcitx-table*
sudo apt-get install fcitx-ui-classic fcitx-ui-light
sudo apt-get install fcitx-frontend-gtk2 fcitx-frontend-gtk3 fcitx-frontend-qt4
sudo apt-get remove --purge scim* ibus*
sudo reboot

After reboot, press Ctrl+Space to switch between Chinese and English input methods, and the input method icon will appear in the upper right corner, right-click the input method icon in the upper right corner to switch input methods in the pop-up menu, as shown below:
Debian10-chinese-im.png


8.14 Install Docker Engine on Debian

The docker installer uses iptables for nat, unfortunately Debian uses nftables, here we just setup Debian to use the legacy iptables:

sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

8.14.1 Install Docker Engine

curl -fsSL https://get.docker.com | bash

Let’s verify:

sudo docker info

8.14.2 Run Docker as a non-root user

sudo groupadd docker
sudo gpasswd -a ${USER} docker
sudo systemctl restart docker
sudo chmod a+rw /var/run/docker.sock

Let’s verify:

docker images

8.14.3 Testing Docker: Installing Nextcloud with docker

mkdir ~/nextcloud -p
docker run -d -p 8888:80  --name nextcloud  -v ~/nextcloud/:/var/www/html/ --restart=always --privileged=true  arm64v8/nextcloud

After installation, visit: http://Device-IP-Address:8888 on your computer browser to view the nextcloud web page.

8.15 WiFi Connection

8.15.1 Gui

Click on the icon on the top right in the FriendlyDesktop's main window, select your wanted WiFi hotspot and proceed with prompts

8.15.2 Console

Please visit: Use NetworkManager to configure network settings

8.16 Test OpenGL ES

You can test it by clicking on the Terminator icon to start a commandline utility in the System Tools and run the following commands:

glmark2-es2

8.17 HDMI/DP LCD Resolution

Open the system's menu and go to Perferences -> Monitor Settings to customize your settings.
Recommended resolution: 1920x1080@60Hz

8.18 Adjust HDMI overscan

Open the command line terminal and enter the command to operate, Note:
1) You need to login to the desktop;
2) If you are using ssh terminal, please use the same username as the desktop login. The default is pi. You cannot use the root user. you also need to assign the DISPLAY variable:

export DISPLAY=:0.0

8.18.1 Query which resolutions the display supports

xrandr -q

8.18.2 Set resolution

For example set to 1920X1080@60Hz:

xrandr --output HDMI-1 --mode 1920x1080 --refresh 60

8.18.3 Adjust the HDMI overscan

For example, the transformation scaling horizontal coordinates by 0.8, vertical coordinates by 1.04 and moving the screen by 35 pixels right and 19 pixels down:

xrandr --output HDMI-1 --transform 0.80,0,-35,0,1.04,-19,0,0,1

8.18.4 Automatic adjustment at boot

Edit ~/.config/autostart/lxrandr-autostart.desktop,Write the full xrandr command to the key at the beginning of "Exec= as shown below:

[Desktop Entry]
Type=Application
Name=LXRandR autostart
Comment=Start xrandr with settings done in LXRandR
Exec=sh -c 'xrandr --output HDMI-1 --mode 1920x1080 --refresh 50 --transform 1.04,0,-35,0,1.05,-30,0,0,1'
OnlyShowIn=LXDE

9 How to Compile

9.1 Build Openwrt/Friendlywrt

9.1.1 Download Code

Two versions are available, please choose as required:

9.1.1.1 FriendlyWrt 22.03.2
mkdir friendlywrt22-rk3588
cd friendlywrt22-rk3588
git clone https://github.com/friendlyarm/repo --depth 1 tools
tools/repo init -u https://github.com/friendlyarm/friendlywrt_manifests -b master-v22.03 \
        -m rk3588.xml --repo-url=https://github.com/friendlyarm/repo  --no-clone-bundle
tools/repo sync -c  --no-clone-bundle
9.1.1.2 FriendlyWrt 21.02.5
mkdir friendlywrt21-rk3588
cd friendlywrt21-rk3588
git clone https://github.com/friendlyarm/repo --depth 1 tools
tools/repo init -u https://github.com/friendlyarm/friendlywrt_manifests -b master-v21.02 \
        -m rk3588.xml --repo-url=https://github.com/friendlyarm/repo  --no-clone-bundle
tools/repo sync -c  --no-clone-bundle

9.1.2 First compilation step

./build.sh rk3588.mk  # or rk3588-docker.mk

All the components (including u-boot, kernel, and friendlywrt) are compiled and the sd card image will be generated, then execute the following command to generate the image file for installing the system into the emmc:

./build.sh emmc-img

After making changes to the project, the sd card image needs to be repackaged by running the following command:

./build.sh sd-img

9.1.3 Secondary compilation steps

cd friendlywrt
make menuconfig
rm -rf ./tmp
make -j${nproc}
cd ../
./build.sh sd-img
./build.sh emmc-img

9.2 Build u-boot only

./build.sh uboot

9.3 Build kernel only

./build.sh kernel

9.4 Build friendlywrt only

./build.sh friendlywrt

Or go to the friendlywrt directory and follow the standard openwrt commands. If you get an error with the above command, try using the following command to compile in a single thread:

cd friendlywrt
make -j1 V=s

9.5 Configuring kernel command line parameters

9.5.1 eMMC Boot

Here are the steps:
Make an eflahser bootable SD card (use the firmware file starting with rk3xxxx-eflasher-),
Insert the SD card into your computer, go to the SD card's OS-related directory, and edit the file parameter.txt, which is a text file containing command-line parameters,
Then boot from the SD card and burn the system to the eMMC.

9.5.2 SD Boot

To modify the command line parameters of the SD card, you need to repackage the SD card image file,
you can use the sd-fuse script we provide to assist packaging, here take rk3568 as an example,
other CPUs also have the corresponding sd-fuse repository, replace the word rk3568 with other cpu models:

git clone https://github.com/friendlyarm/sd-fuse_rk3568.git
cd sd-fuse_rk3568
wget --no-proxy http://112.124.9.243/dvdfiles/RK3568/images-for-eflasher/debian-buster-desktop-arm64-images.tgz
tar xvzf debian-buster-desktop-arm64-images.tgz
vim debian-buster-desktop-arm64/parameter.txt # Edit command-line parameters
./mk-sd-image.sh debian-buster-desktop-arm64  # Repackage sd image file

10 Make Your Own OS Image

11 Link to Rockchip Resources

12 Schematic, PCB CAD File

13 Update Logs

13.1 2022-11-17

13.1.1 FriendlyWrt:

  • Fix 1G LAN port not working issue

13.1.2 Ubuntu jammy desktop:

  • Add chromium video hardware decoding support
  • Add hardware cursor support

13.2 2022-10-25

Initial Release