NanoPi R2S

From FriendlyARM WiKi
Revision as of 14:43, 10 February 2020 by Tzs (Talk | contribs)

Jump to: navigation, search

查看中文

1 Introduction

Overview
Front
Back
Case
  • The NanoPi R2S(as "R2S") is an open source platform with dual-Gbps Ethernet ports designed and developed by FriendlyElec for IoT applications.
  • The NanoPi R2S uses the RK3328 SoC. It has two Gbps Ethernet ports and 1G DDR4 RAM. FriendlyElec ported an OpenWrt system for it. It works with Docker CE. It is a good platform for developing IoT applications, NAS applications, smart home gateways etc.

2 Hardware Spec

  • CPU: Rockchip RK3328, Quad-core Cortex-A53
  • DDR4 RAM: 1GB
  • Network:
    • Internal 10/100/1000M Ethernet Port x 1
    • USB3.0 converted 10/100/1000M Ethernet Port x 1
  • USB2.0 Host: Type-A x1
  • MicroSD Slot x 1
  • MicroUSB: power input and USB Slave
  • Debug Serial Port: 3.3V TTL, 3-pin 2.54mm pitch connector
  • LED: LED x 3
  • KEY: KEY x 1 programmable
  • PC Size: 55.6 x 52mm
  • Power Supply: DC 5V/2A
  • Temperature measuring range: 0℃ to 80℃
  • OS/Software: U-boot,Ubuntu-Core,OpenWrt


  • Network Transmission Rates
TX RX
WAN 941 Mbps 941 Mbps
LAN 941 Mbps 941 Mbps
Notes: 1. test utility: iperf
2. use indepedent IP address section and test with a PC in simplex communication mode

3 Diagram, Layout and Dimension

3.1 Layout

NanoPi R2S Layout

  • GPIO 24-Pin Spec
Pin# Name Linux gpio Pin# Name Linux gpio
1 SYS_3.3V 2 VDD_5V
3 I2C0_SDA / GPIO2_D1 89 4 VDD_5V
5 I2C0_SCL / GPIO2_D0 88 6 GND
7 GPIO2_A2 / IR_RX 66 8 UART1_TX / GPIO3_A4 100
9 GND 10 UART1_RX / GPIOG3_A6 102
For more details refer to:NanoPi_R2S_V1.0_1912-Schematic.pdf
Dimensional Diagram:NanoPi R2S PCB file in dxf format

4 Get Started

4.1 Essentials You Need

Before starting to use your NanoPi R2S get the following items ready

  • NanoPi R2S
  • MicroSD Card/TF Card: Class 10 or Above, minimum 8GB SDHC
  • MicroUSB 5V/2A power adapter
  • A host computer running Ubuntu 16.04 64-bit system

4.2 TF Cards We Tested

To make your NanoPi R2S boot and run fast we highly recommend you use a Class10 8GB SDHC TF card or a better one. The following cards are what we used in all our test cases presented here:

  • SanDisk TF 8G Class10 Micro/SD High Speed TF card:

SanDisk microSD 8G

  • SanDisk TF128G MicroSDXC TF 128G Class10 48MB/S:

SanDisk microSD 128G

  • 川宇 8G C10 High Speed class10 micro SD card:

chuanyu microSD 8G

4.3 Install OS

4.3.1 Download Image Files

Go to download link to download the image files under the officail-ROMs directory and the flashing utility under the tools directory:

Image Files:
rk3328-sd-friendlycore-bionic-5.4-arm64-YYYYMMDD.img.zip Based on UbuntuCore 18.04 and Linux-5.4.12 Kernel
rk3328-sd-friendlywrt-5.4-YYYYMMDD.img.zip Based on OpenWrt and Linux-5.4.12 Kernel
Flashing Utility:
win32diskimager.rar Windows utility. Under Linux users can use "dd"

4.3.2 Linux

4.3.2.1 Flash to TF
  • FriendlyCore / Debian / Ubuntu / OpenWrt / DietPi are all based on a same Linux distribution and their installation methods are the same.
  • Extract the Linux image and win32diskimager.rar files. Insert a TF card(at least 8G) into a Windows PC and run the win32diskimager utility as administrator. On the utility's main window select your TF card's drive, the wanted image file and click on "write" to start flashing the TF card.


After it is installed you will see the following window:
win32disk-finish

  • Insert this card into your board's BOOT slot and power on (with a 5V/2A power source). If the PWR LED is on and the STAT LED is blinking this indicates your board has successfully booted.
    ;

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, smart home gateways etc.

5.2 Account & Password

By default the password is NULL. You can set a password for root for web and SSH login.

5.3 Network Connection

Use a network cable to connect NanoPi-R2S's WAN to a master router and the board will get an IP address via DHCP. Login into the router and check NanoPi-R2S's IP address.

5.4 Login FriendlyWrt

Type NanoPi-R2S's IP address or http://friendlywrt/ in a browser's address bar and enter to open FriendlyWrt's administration page or you can login into FriendlyWrt's administration page via SSH.
By default, the IP address of the LAN port is 192.168.2.1, and the WAN will dynamically obtain the IP address from your main router.

5.5 Install Software Packages

5.5.1 Update Package List

Before install software packages update the package list:

$ opkg update

5.5.2 List Available Packages

$ opkg list

5.5.3 List Installed Packages

$ opkg list-installed

5.5.4 Install Packages

$ opkg install <package names>

5.5.5 Remove Packages

$ opkg remove <package names>

5.6 Work with Docker Applications

5.6.1 Work with Docker: Install JellyBin

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.6.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.7 Enable Swap Partition

Run the following commands in a commandline utility and reboot:

/etc/enable-swap.sh
reboot

5.8 Mount smbfs

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


5.9 Compile u-boot,kernel or friendlywrt

6 Work with FriendlyCore

6.1 FriendlyCore User Account

  • Non-root User:
   User Name: pi
   Password: pi
  • Root:
   User Name: Root
   Password: fa

6.2 Update Software Packages

$ sudo apt-get update

6.3 Setup Network Configurations

By default "eth0" is assigned an IP address obtained via dhcp. If you want to change the setting you need to change the following file:

vi /etc/network/interfaces.d/eth0

For example if you want to assign a static IP to it you can run the following commands:

auto eth0
iface eth0 inet static
    address 192.168.1.231
    netmask 255.255.255.0
    gateway 192.168.1.1

To change the setting of "eth1" you can add a new file similar to eth0's configuration file under the /etc/network/interfaces.d/ directory.

7 Resources

7.1 Datasheets and Schematics

8 Update Logs

8.1 2020-05-14

8.1.1 FriendlyWrt更新说明:

  • 内核升至5.4.40内核, 增强防火墙稳定性
  • 增加usb wifi 的支持(rtl8812au)
  • 加强了 overlayfs 的稳定性

8.2 2020-02-28

8.2.1 FriendlyWrt更新说明:

  • 默认不启用 lan 口的dhcp ipv6
  • 增加usb wifi 的支持(RTL8821CU)

8.3 2020-02-25

8.3.1 FriendlyWrt更新说明:

8.3.1.1 更新代码到 openwrt v19.07.1 版本,请使用 master-v19.07.1 分支的代码,下载方法:
mkdir friendlywrt-rk3328
cd friendlywrt-rk3328
repo init -u https://github.com/friendlyarm/friendlywrt_manifests -b master-v19.07.1 -m rk3328.xml --repo-url=https://github.com/friendlyarm/repo --no-clone-bundle
repo sync -c --no-clone-bundle
8.3.1.2 修复初版固件发现的一些issues,如下:
  • 优化加载bpfilter 模块
  • 设置 dist-feeds 指向最新版本, 解决opkg update 异常

  • 缺省config中移除 modemmanager和mwan3 插件 (可自行添加)
  • 优化 cpu 调频策略和开机速度

8.4 2020-02-20

8.4.1 FriendlyWrt

  • 优化了 openssl 性能
  • 增加pwm风扇的支持,支持温控 (平台: rk3328/rk3399)