Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Difference between revisions of "Rock5/guide/radxa-debian"

< Rock5‎ | guide
(WiFi)
 
(22 intermediate revisions by 8 users not shown)
Line 11: Line 11:
 
This guide is available for official ROCK 5 Debian images.
 
This guide is available for official ROCK 5 Debian images.
 
   
 
   
ROCK 5 Debian is an easy to use desktop system. While working with ROCK 5 Debian, you will find it do well on playing music, Internet, Bluetooth, AI and so on.
+
ROCK 5 Debian is an easy to use desktop system. While working with ROCK 5 Debian, you will find it do well on playing music, Internet, BT, AI and so on.
  
 
ROCK 5 Debian uses '''systemd''' to manage system.
 
ROCK 5 Debian uses '''systemd''' to manage system.
Line 100: Line 100:
 
             <div class="tab-pane active" id="5b-ethernet">
 
             <div class="tab-pane active" id="5b-ethernet">
 
==== 5B LED ====
 
==== 5B LED ====
On the rock5,  one LED is configured as LED class device.
+
On ROCK 5B one blue LED is configured as LED class device.  When the blue LED is not active a green LED will show to indicate the board has power.
  
You can control it  via /sys/class/leds/
+
You can control the behavior mode of the blue LED by writing to <code>/sys/class/leds/blue:status/trigger</code>.  By default only root users can write to the device.
  
The default status of the three on board led is flash
+
The default mode of the blue LED is heartbeat.
  
  root@rock-5b:/home/rock# echo none > /sys/class/leds/sta/trigger
+
  root@rock-5b:/home/rock# echo activity > /sys/class/leds/blue:status/trigger
root@rock-5b:/home/rock# echo activity > /sys/class/leds/sta/trigger
+
  root@rock-5b:/home/rock# echo timer > /sys/class/leds/blue:status/trigger
  root@rock-5b:/home/rock# echo timer > /sys/class/leds/sta/trigger
+
  
You can use cat on the trigger property to list all the available values.
+
You can use cat on the trigger property to list all the available LED modes.  The value in brackets is the currently active mode.
  
  root@rock-5b:/home/rock# cat /sys/class/leds/sta/trigger  
+
  root@rock-5b:/home/rock# cat /sys/class/leds/blue:status/trigger  
  none rfkill-any rfkill-none kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock tcpm-source-psy-4-0022-online timer oneshot disk-activity disk-read disk-write ide-disk mtd nand-disk heartbeat backlight gpio cpu cpu0 cpu1 cpu2 cpu3 cpu4 cpu5 cpu6 cpu7 mmc0 mmc2 activity [default-  
+
  none rfkill-any rfkill-none kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock tcpm-source-psy-4-0022-online timer oneshot disk-activity disk-read disk-write ide-disk mtd nand-disk [heartbeat] backlight gpio cpu cpu0 cpu1 cpu2 cpu3 cpu4 cpu5 cpu6 cpu7 activity default-on transient flash torch panic netdev mmc1 mmc0
on] transient flash torch panic netdev
+
 
 +
In the None mode, writing to /sys/class/leds/blue:status/brightness can manually control the status of the blue LED.
 +
 
 +
root@rock-5b:/home/rock# echo none > /sys/class/leds/blue:status/trigger
 +
root@rock-5b:/home/rock# echo 1 > /sys/class/leds/blue:status/brightness
 +
root@rock-5b:/home/rock# echo 0 > /sys/class/leds/blue:status/brightness
 
             </div> <!--  id="5b-leds" end-->
 
             </div> <!--  id="5b-leds" end-->
 
         </div>
 
         </div>
Line 144: Line 148:
 
  root@rock-5b:/home/rock# date
 
  root@rock-5b:/home/rock# date
 
  Wed Jun 22 10:17:01 CST 2022
 
  Wed Jun 22 10:17:01 CST 2022
 
=== FAN ===
 
Control PWM Fan
 
There is one  PWM Fan header on ROCK 5B.
 
 
To control it, try the following codes:
 
 
root@rock-5b:/home/rock# ls /sys/devices/platform/fd8b0010.pwm/
 
driver driver_override  modalias  of_node  power  pwm subsystem  supplier:platform:pinctrl  uevent
 
 
root@rock-5b:/home/rock# echo 0 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/export
 
root@rock-5b:/home/rock# echo 10000 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/pwm0/period
 
root@rock-5b:/home/rock# echo 5000 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/pwm0/duty_cycle
 
root@rock-5b:/home/rock# echo normal > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/pwm0/polarity
 
root@rock-5b:/home/rock#  echo 1 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/pwm0/enable  //  Turn on fan
 
root@rock-5b:/home/rock#  echo 0 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/pwm0/enable  //Turn off fan
 
 
use the bash script to  Set PWM period, duty_cycle, polarity and enable with root permission
 
 
#! /bin/bash
 
echo 0 > /sys/class/pwm/pwmchip1/export
 
sleep 0.2
 
echo 40000 > /sys/class/pwm/pwmchip1/pwm0/period
 
sleep 0.2
 
echo 40000 > /sys/class/pwm/pwmchip1/pwm0/duty_cycle
 
sleep 0.2
 
echo normal >  /sys/class/pwm/pwmchip1/pwm0/polarity
 
sleep 0.2
 
echo 1 > /sys/class/pwm/pwmchip1/pwm0/enable
 
sleep 0.2
 
turn off the fan
 
root@rock-5b:/home/rock# echo 0 > /sys/class/pwm/pwmchip1/pwm0/enable
 
  
 
=== Ethernet ===
 
=== Ethernet ===
Line 211: Line 183:
 
             </div> <!--  id="5b-ethernet" end-->
 
             </div> <!--  id="5b-ethernet" end-->
 
         </div>
 
         </div>
 +
 +
=== WiFi ===
 +
ROCK 5 Model B doesn't come with on board WiFi/BT. Currently the following WiFi Cards are tested and supported by the ROCK 5 Model B.
 +
{| class="wikitable"
 +
|- style="font-weight:bold; background-color:#373A3C; color:#ECEEEF;"
 +
| style="vertical-align:middle;" | NO.
 +
| style="vertical-align:middle;" | Model
 +
| style="vertical-align:middle;" | Chip
 +
| style="vertical-align:middle;" | WiFi
 +
| style="vertical-align:middle;" | BT
 +
| WIFI  Throughput
 +
| Remark
 +
|-
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 1
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | ROCK Pi Wireless Module A1 (SDIO+UART) --- AP6236
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | BCM43436B0
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 2.4G
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 4.2
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | up:23.5 Mbits/sec down:40.4 Mbits/sec
 +
|
 +
|-
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 2
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | ROCK Pi Wireless Module A2 (SDIO+UART) --- AP6256
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | BCM43456
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 2.4G&5G
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 5.0
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | up:196 Mbits/sec down: 187 Mbits/sec
 +
|
 +
|-
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 3
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | ROCK Pi Wireless Module A3 (SDIO+UART) --- AP6398S
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | BCM43598
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 2.4G&5G
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 5.0
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | up:336 Mbits/sec down: 315 Mbits/sec
 +
|
 +
|-
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 4
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | ROCK Pi Wireless Module A6s (SDIO+UART) --- AP6275S
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | BCM43752
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 2.4G&5G
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 5.0
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | up:234 Mbits/sec down: 273 Mbits/sec
 +
|
 +
|-
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 5
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | Radxa wireless A8
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | RTL8852BE
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 2.4G&5G&WIFI6
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 5.0
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | up:600Mbits/sec down:900 Mbits/sec
 +
|
 +
|-
 +
| style="vertical-align:middle; background-color:#F5F5F5; color:#212529;" | 6
 +
| style="vertical-align:middle; background-color:#F5F5F5; color:#212529;" | Intel 0MHK36 (PCIE+USB)
 +
| style="vertical-align:middle; background-color:#F5F5F5; color:#212529;" | Intel 3165
 +
| style="vertical-align:middle; background-color:#F5F5F5; color:#212529;" | 2.4G&5G
 +
| style="vertical-align:middle; background-color:#F5F5F5; color:#212529;" | 4.2
 +
| style="vertical-align:middle; background-color:#F5F5F5; color:#212529;" | up:283 Mbits/sec down: 334 Mbits/sec
 +
|
 +
|-
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 7
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | Intel 7265NGW (PCIE+USB)
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | Intel 7265
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 2.4G&5G
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 4.2
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | up:363 Mbits/sec down: 619 Mbits/sec
 +
|
 +
|-
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 8
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | Intel AX210 (PCIE+USB)
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | Intel AX210
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | WiFi 6
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 5.2
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | up: 859 Mbits/sec down: 813 Mbits/sec
 +
|
 +
|}
 +
==== To test the WIFI performance, we need to follow the steps: ====
 +
 +
* Switch to super user mode
 +
$ sudo su
 +
 +
* Open the WIFI
 +
$ nmcli r wifi on
 +
 +
* Scan WIFI
 +
$ nmcli dev wifi
 +
 +
* Connect to WIFI network
 +
$ nmcli dev wifi connect "wifi_name" password "wifi_password"
 +
 +
* Test WIFI throughput by tool iperf3.
 +
 +
=== BT ===
 +
ROCK 5 Model B doesn't come with on board WiFi/BT. Currently the following WiFi Cards are tested and supported by the ROCK 5 Model B.
 +
{| class="wikitable"
 +
|- style="font-weight:bold; background-color:#373A3C; color:#ECEEEF;"
 +
| style="vertical-align:middle;" | NO.
 +
| style="vertical-align:middle;" | Model
 +
| style="vertical-align:middle;" | Chip
 +
| style="vertical-align:middle;" | WiFi
 +
| style="vertical-align:middle;" | BT
 +
| WIFI  Throughput
 +
| Remark
 +
|-
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 1
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | ROCK Pi Wireless Module A1 (SDIO+UART) --- AP6236
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | BCM43436B0
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 2.4G
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 4.2
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | up:23.5 Mbits/sec down:40.4 Mbits/sec
 +
|
 +
|-
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 2
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | ROCK Pi Wireless Module A2 (SDIO+UART) --- AP6256
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | BCM43456
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 2.4G&5G
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 5.0
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | up:196 Mbits/sec down: 187 Mbits/sec
 +
|
 +
|-
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 3
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | ROCK Pi Wireless Module A3 (SDIO+UART) --- AP6398S
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | BCM43598
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 2.4G&5G
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 5.0
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | up:336 Mbits/sec down: 315 Mbits/sec
 +
|
 +
|-
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 4
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | ROCK Pi Wireless Module A6s (SDIO+UART) --- AP6275S
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | BCM43752
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 2.4G&5G
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 5.0
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | up:234 Mbits/sec down: 273 Mbits/sec
 +
|
 +
|-
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 5
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | Radxa wireless A8
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | RTL8852BE
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 2.4G&5G&WIFI6
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 5.0
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | up:600Mbits/sec down:900 Mbits/sec
 +
|
 +
|-
 +
| style="vertical-align:middle; background-color:#F5F5F5; color:#212529;" | 6
 +
| style="vertical-align:middle; background-color:#F5F5F5; color:#212529;" | Intel 0MHK36 (PCIE+USB)
 +
| style="vertical-align:middle; background-color:#F5F5F5; color:#212529;" | Intel 3165
 +
| style="vertical-align:middle; background-color:#F5F5F5; color:#212529;" | 2.4G&5G
 +
| style="vertical-align:middle; background-color:#F5F5F5; color:#212529;" | 4.2
 +
| style="vertical-align:middle; background-color:#F5F5F5; color:#212529;" | up:283 Mbits/sec down: 334 Mbits/sec
 +
|
 +
|-
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 7
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | Intel 7265NGW (PCIE+USB)
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | Intel 7265
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 2.4G&5G
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 4.2
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | up:363 Mbits/sec down: 619 Mbits/sec
 +
|
 +
|-
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 8
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | Intel AX210 (PCIE+USB)
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | Intel AX210
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | WiFi 6
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | 5.2
 +
| style="vertical-align:middle; background-color:#FFF; color:#212529;" | up: 859 Mbits/sec down: 813 Mbits/sec
 +
| Just WIFI Support
 +
|}
 +
Radxa APT includes '''broadcom-wifibt-firmware''' package for Broadcom wireless modules and '''intel-wifibt-firmware''' package for Intel wireless modules.
 +
Take a look at your module and download the corresponding packages.
 +
 +
For example:
 +
 +
root@rock-5b:~# apt-get update -y
 +
root@rock-5b:~# apt-get install -y broadcom-wifibt-firmware intel-wifibt-firmware
 +
 +
Below is the example of testing Broadcom modules BT.
 +
 +
*Check BT service.
 +
root@rock-5b:~# systemctl status bluetooth
 +
*Run BT service if the BT service is inactive.
 +
root@rock-5b:~# systemctl start bluetooth
 +
*Check BT device.
 +
root@rock-5b:~# hciconfig
 +
hci0:  Type: Primary  Bus: UART
 +
        BD Address: 10:2C:6B:49:D5:53  ACL MTU: 1021:8  SCO MTU: 64:1
 +
        UP RUNNING
 +
        RX bytes:850 acl:0 sco:0 events:58 errors:0
 +
        TX bytes:2814 acl:0 sco:0 commands:58 errors:0
 +
*Example: Connect to BT Speaker.
 +
*Install pulseaudio packages.
 +
root@rock-5b:~# apt-get install -y pulseaudio-module-bluetooth pulseaudio
 +
*Run pulseaudio.
 +
root@rock-5b:~# pulseaudio --start
 +
*Connect using bluetoothctl.
 +
root@rock-5b:~# bluetoothctl
 +
[bluetooth]# default-agent
 +
[bluetooth]# power on
 +
[bluetooth]# scan on
 +
[bluetooth]# trust 41:42:1A:8D:A9:65      #BT-280
 +
[bluetooth]# pair 41:42:1A:8D:A9:65
 +
[bluetooth]# connect 41:42:1A:8D:A9:65
 +
*Play songs and enjoy it.
 +
 +
===== '''BT Tip:''' =====
 +
When you use Radxa Wireless A8 Module, you must add some blacklist as follow to make BT work.
 +
<pre>
 +
root@rock-5b:~# cat /etc/modprobe.d/blacklist.conf
 +
blacklist pgdrv
 +
blacklist btusb
 +
blacklist btrtl
 +
blacklist btbcm
 +
blacklist btintel
 +
 +
root@rock-5b:~# reboot
 +
</pre>
 +
 +
=== Audio ===
 +
 +
==== DP Sound ====
 +
1. List existing sound cards via aplay
 +
<pre>
 +
root@rock-5b:/# aplay -l
 +
**** List of PLAYBACK Hardware Devices ****
 +
card 0: rockchipdp0 [rockchip,dp0], device 0: rockchip,dp0 spdif-hifi-0 [rockchip,dp0 spdif-hifi-0]
 +
  Subdevices: 1/1
 +
  Subdevice #0: subdevice #0
 +
card 1: rockchiphdmi0 [rockchip-hdmi0], device 0: rockchip-hdmi0 i2s-hifi-0 [rockchip-hdmi0 i2s-hifi-0]
 +
  Subdevices: 1/1
 +
  Subdevice #0: subdevice #0
 +
card 2: rockchiphdmi1 [rockchip-hdmi1], device 0: rockchip-hdmi1 i2s-hifi-0 [rockchip-hdmi1 i2s-hifi-0]
 +
  Subdevices: 1/1
 +
  Subdevice #0: subdevice #0
 +
card 3: rockchipes8316 [rockchip-es8316], device 0: fe470000.i2s-ES8316 HiFi es8316.7-0011-0 [fe470000.i2s-ES8316 HiFi es8316.7-00
 +
11-0]
 +
  Subdevices: 1/1
 +
  Subdevice #0: subdevice #0
 +
</pre>
 +
 +
2. Specify the sound card to play audio fiile
 +
 +
'''hw:0,0''' means card 0,device 0. Here it refers to rockchipdp0 (DP sound)
 +
 +
<pre>
 +
root@rock-5b:/# aplay -D hw:0,0 /mnt/test.wav
 +
Playing WAVE '/mnt/test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
 +
</pre>
  
 
=== Storage device ===
 
=== Storage device ===
Line 252: Line 472:
 
|}
 
|}
  
=== Acceries Configuration ===
+
==== GPU ====
 +
 
 +
Run commands.
 +
 
 +
# test_gpu_glmark2_fullscreen.sh
 +
 
 +
# test_gpu_glmark2_offscreen.sh
 +
 
 +
=== Accessories Configuration ===
 +
 
 +
==== Fan ====
 +
 
 +
There is one  PWM Fan connector on ROCK 5B.
 +
 
 +
Execute shell script <code>test_fan_run.sh</code> to turn on fan.
 +
 
 +
<pre>
 +
# test_fan_run.sh
 +
</pre>
 +
 
 +
The content of script test_fan_run.sh is
 +
 
 +
<pre>
 +
# cat usr/local/bin/test_fan_run.sh
 +
#!/bin/bash
 +
echo "Trun on Fan"
 +
echo 0 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip*/export
 +
echo 10000 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip*/pwm0/period
 +
echo 5000 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip*/pwm0/duty_cycle
 +
echo normal > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip*/pwm0/polarity
 +
echo 1 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip*/pwm0/enable
 +
#echo 0 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip*/pwm0/enable
 +
</pre>
  
 
==== HDMI 8K ====
 
==== HDMI 8K ====
Line 259: Line 511:
  
 
==== Radxa Camera 4K ====
 
==== Radxa Camera 4K ====
 +
 +
See [[rock5/accessories/radxa-camera-4k | Radxa Camera 4K]].
  
 
==== Radxa Wireless Module A8 ====
 
==== Radxa Wireless Module A8 ====
Line 294: Line 548:
 
For more detail about Radxa APT, please see [[rock5/linux/radxa-apt | Radxa APT]].
 
For more detail about Radxa APT, please see [[rock5/linux/radxa-apt | Radxa APT]].
  
==== Display Power Management ====
+
==== /boot/config.txt ====
  
Add the following lines to file /etc/X11/xorg.conf.d/10-monitor.conf
+
/boot/config.txt is designed for kernel parameters and hardware configuration.
 +
Please note that execute "update_extlinux.sh" after changing file /boot/config.txt.
  
<pre>
+
===== kernel parameters =====
Section "ServerLayout"
+
 
    Option "BlankTime" "0" # Disable blank Screen
+
kernel command line: started with "cmdline:"
    Option "StandbyTime" "0" # Disable standby
+
 
    Option "SuspendTime" "0" # Disable syspend
+
For example:
    Option "OffTime" "0"
+
 
EndSection
+
# For console
</pre>
+
cmdline: earlycon=uart8250,mmio32,0xfeb50000 console=ttyFIQ0 console=tty1 consoleblank=0 loglevel=7
 +
# For rootfs
 +
cmdline: panic=10 rootwait rw init=/sbin/init rootfstype=ext4
 +
 
 +
===== device tree overlay =====
 +
 
 +
dt overlay line: started with "dtoverlay=". One dt overlay one line.
 +
 
 +
For example:
 +
 
 +
dtoverlay=rk3588-uart7-m2
 +
 
 +
 
 +
==== <span id="common_hardware_interface">Common Hardware Interfaces, GPIO, I2C, PWM, SPI, UART, CAN, etc</span> ====
 +
 
 +
The ROCK 5 system images use configuration file /boot/config.txt.
 +
 
 +
'''Please note that execute "update_extlinux.sh" to update /boot/extlinux/extlinux.conf after changing file /boot/config.txt.'''
 +
 
 +
DT overlays provided by the kernel are located in /boot/dtbs/$(uname -r)/amlogic/overlay/
 +
 
 +
===== GPIO =====
 +
 
 +
===== I2C =====
 +
====== I2C0_M1 ======
 +
 
 +
To enable I2C0_M1 (/dev/i2c-0), add one line "dtoverlay=rk3588-i2c0-m1".
 +
 
 +
dtoverlay=rk3588-i2c0-m1
 +
====== I2C3_M1 ======
 +
 
 +
To enable I2C3_M1 (/dev/i2c-3), add one line "dtoverlay=rk3588-i2c3-m1".
 +
 
 +
dtoverlay=rk3588-i2c3-m1
 +
====== I2C7_M3 ======
 +
 
 +
To enable I2C7_M3 (/dev/i2c-7), add one line "dtoverlay=rk3588-i2c7-m3".
 +
 
 +
dtoverlay=rk3588-i2c7-m3
 +
====== I2C8_M4 ======
 +
 
 +
To enable I2C8_M4 (/dev/i2c-8), add one line "dtoverlay=rk3588-i2c8-m4".
 +
 
 +
dtoverlay=rk3588-i2c8-m4
 +
 
 +
===== PWM =====
 +
 
 +
====== PWM2-M1 ======
 +
 
 +
To enable PWM2-M1 (/sys/class/pwm/pwmchip2), add one line "dtoverlay=rk3588-spi0-m2-cs0-spidev".
 +
 
 +
dtoverlay=rk3588-pwm2-m1
 +
 
 +
====== PWM3-M1 ======
 +
 
 +
To enable PWM2-M1 (/sys/class/pwm/pwmchip3), add one line "dtoverlay=rk3588-spi0-m2-cs0-spidev".
 +
 
 +
dtoverlay=rk3588-pwm3-m1
 +
 
 +
===== SPI =====
 +
 
 +
====== SPI0-M2-CS0 ======
 +
 
 +
To enable SPI0-M2-CS0 (/dev/spidev0.0), add one line "dtoverlay=rk3588-spi0-m2-cs0-spidev".
 +
 
 +
dtoverlay=rk3588-spi0-m2-cs0-spidev
 +
 
 +
====== SPI0 M2 with CS1 ======
 +
 
 +
To enable SPI0-M2-CS1 (/dev/spidev0.1), add one line "dtoverlay=rk3588-spi0-m2-cs1-spidev".
 +
 
 +
dtoverlay=rk3588-spi0-m2-cs1-spidev
 +
 
 +
====== SPI1 M1 with CS0 ======
 +
 
 +
To enable SPI1-M1-CS0 (/dev/spidev1.0), add one line "dtoverlay=rk3588-spi1-m1-cs0-spidev".
 +
 
 +
dtoverlay=rk3588-spi1-m1-cs0-spidev
 +
 
 +
====== SPI1 M1 with CS1 ======
 +
 
 +
To enable SPI1-M1-CS1 (/dev/spidev1.1), add one line "dtoverlay=rk3588-spi1-m1-cs1-spidev".
 +
 
 +
dtoverlay=rk3588-spi1-m1-cs1-spidev
 +
 
 +
===== UART =====

Latest revision as of 06:15, 9 May 2023

    ROCK 5 >  Guide >  How to use Debian

Introduction to ROCK 5 Debian

This guide is available for official ROCK 5 Debian images.

ROCK 5 Debian is an easy to use desktop system. While working with ROCK 5 Debian, you will find it do well on playing music, Internet, BT, AI and so on.

ROCK 5 Debian uses systemd to manage system.

Command prepended by $ means the command may be executed by an unprivileged user. And command prepended by # means the command may be executed by an privileged user. But the symbol, $ or #, is not part of the command.

List of boards supported

  • ROCK 5B

Access from the Host PC/Laptop

Option 1: HDMI monitor and Mouse

You would see Desktop on HDMI monitor.

Option 2: Serial console

See Serial Console

Option 3: SSH

SSH server is enabled on port 22 of ROCK 5 default image.

Please use angryip to find your board IP address.

$ ping ip-of-device
$ ssh rock@ip-of-device

Default User Account

Non-root User:

User Name : rock
Password  : rock

Switch to root user

rock is sudo user and switch to root can be done with the following command as user rock:

sudo su

For example:

rock@rock-5b:~$ 
rock@rock-5b:~$ sudo su
[sudo] password for rock: 
root@rock-5b:/home/rock# 

There is no password for root user by default. You can set the password via 'passwd root'.

root@rock-5b:/home/rock# passwd root
New password: 
Retype new password: 
passwd: password updated successfully
root@rock-5b:/home/rock#

Partition table

Part Number Offset Name Description
(raw) 32KB loader1 First stage loader
(raw) 8MB loader2 U-boot image
1 16MB boot Kernel partition, bootable
2 528MB rootfs Rootfs

Offset when writing using dd

dd if=idbloader.img   of=/dev/sdx seek=64
dd if=u-boot.itb      of=/dev/sdx seek=16384 
dd if=boot.img        of=/dev/sdx seek=32768 
dd if=rootfs.img      of=/dev/sdx seek=1081344

LED

5B LED

On ROCK 5B one blue LED is configured as LED class device. When the blue LED is not active a green LED will show to indicate the board has power.

You can control the behavior mode of the blue LED by writing to /sys/class/leds/blue:status/trigger. By default only root users can write to the device.

The default mode of the blue LED is heartbeat.

root@rock-5b:/home/rock# echo activity > /sys/class/leds/blue:status/trigger
root@rock-5b:/home/rock# echo timer > /sys/class/leds/blue:status/trigger

You can use cat on the trigger property to list all the available LED modes. The value in brackets is the currently active mode.

root@rock-5b:/home/rock# cat /sys/class/leds/blue:status/trigger 
none rfkill-any rfkill-none kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock tcpm-source-psy-4-0022-online timer oneshot disk-activity disk-read disk-write ide-disk mtd nand-disk [heartbeat] backlight gpio cpu cpu0 cpu1 cpu2 cpu3 cpu4 cpu5 cpu6 cpu7 activity default-on transient flash torch panic netdev mmc1 mmc0

In the None mode, writing to /sys/class/leds/blue:status/brightness can manually control the status of the blue LED.

root@rock-5b:/home/rock# echo none > /sys/class/leds/blue:status/trigger
root@rock-5b:/home/rock# echo 1 > /sys/class/leds/blue:status/brightness
root@rock-5b:/home/rock# echo 0 > /sys/class/leds/blue:status/brightness

RTC Device

ROCK 5B is equipped with one RTC IC hym8563.

Firstly, plug in RTC battery to give power to RTC IC. Please note that we should keep the RTC battery in the RTC connector.

Plug in power adaper to power on ROCK 5B.

And confirm that the rtc hym8563 device is created.

root@rock-5b:/home/rock#  dmesg | grep rtc
[    6.407133] rtc-hym8563 6-0051: rtc information is valid
[    6.412731] rtc-hym8563 6-0051: registered as rtc0
[    6.413779] rtc-hym8563 6-0051: setting system clock to 2022-06-22T01:22:26 UTC (1655860946)

Secondly, use the following commands to set the system time and synchronize it to rtc0.

root@rock-5b:/home/rock# hwclock -r
2021-06-12 08:10:02.613381+08:00
root@rock-5b:/home/rock# date
Wed Jun 22 10:06:10 CST 2022
root@rock-5b:/home/rock# hwclock -w
root@rock-5b:/home/rock# hwclock -r 
root@rock-5b:/home/rock# poweroff

take the RTC battery off,after 10minute or longer,insert the rtc battery and power on rock5b,check whether the RTC is synchronized with the system clock

root@rock-5b:/home/rock# hwclock -r
2022-06-22 10:09:59.214788+08:00
root@rock-5b:/home/rock# date
Wed Jun 22 10:17:01 CST 2022

Ethernet

5B Ethernet

ROCK 5B is equipped with one 2.5G Ethernet port. You can use a network cable (one end connected to the external network port or route) to connect your ROCK 5B to the network. The ROCK 5B will automatically configure the network for your surfing on the Internet.

Manually configure Ethernet
  • Switch to super user mode by command
$ sudo su
  • Check whether the Ethernet is normal by command, ifconfig, which would show us a network card, eth0 or enP4p65s0 , and the Ethernet IP address. Also, use tool, ping, to connect to a normal domain.
$ ifconfig
$ ping www.baidu.com
  • If failed to connect to a normal domain. , try
$ sudo dhclient eth0
or
$ sudo dhclient enP4p65s0

WiFi

ROCK 5 Model B doesn't come with on board WiFi/BT. Currently the following WiFi Cards are tested and supported by the ROCK 5 Model B.

NO. Model Chip WiFi BT WIFI Throughput Remark
1 ROCK Pi Wireless Module A1 (SDIO+UART) --- AP6236 BCM43436B0 2.4G 4.2 up:23.5 Mbits/sec down:40.4 Mbits/sec
2 ROCK Pi Wireless Module A2 (SDIO+UART) --- AP6256 BCM43456 2.4G&5G 5.0 up:196 Mbits/sec down: 187 Mbits/sec
3 ROCK Pi Wireless Module A3 (SDIO+UART) --- AP6398S BCM43598 2.4G&5G 5.0 up:336 Mbits/sec down: 315 Mbits/sec
4 ROCK Pi Wireless Module A6s (SDIO+UART) --- AP6275S BCM43752 2.4G&5G 5.0 up:234 Mbits/sec down: 273 Mbits/sec
5 Radxa wireless A8 RTL8852BE 2.4G&5G&WIFI6 5.0 up:600Mbits/sec down:900 Mbits/sec
6 Intel 0MHK36 (PCIE+USB) Intel 3165 2.4G&5G 4.2 up:283 Mbits/sec down: 334 Mbits/sec
7 Intel 7265NGW (PCIE+USB) Intel 7265 2.4G&5G 4.2 up:363 Mbits/sec down: 619 Mbits/sec
8 Intel AX210 (PCIE+USB) Intel AX210 WiFi 6 5.2 up: 859 Mbits/sec down: 813 Mbits/sec

To test the WIFI performance, we need to follow the steps:

  • Switch to super user mode
$ sudo su
  • Open the WIFI
$ nmcli r wifi on
  • Scan WIFI
$ nmcli dev wifi
  • Connect to WIFI network
$ nmcli dev wifi connect "wifi_name" password "wifi_password"
  • Test WIFI throughput by tool iperf3.

BT

ROCK 5 Model B doesn't come with on board WiFi/BT. Currently the following WiFi Cards are tested and supported by the ROCK 5 Model B.

NO. Model Chip WiFi BT WIFI Throughput Remark
1 ROCK Pi Wireless Module A1 (SDIO+UART) --- AP6236 BCM43436B0 2.4G 4.2 up:23.5 Mbits/sec down:40.4 Mbits/sec
2 ROCK Pi Wireless Module A2 (SDIO+UART) --- AP6256 BCM43456 2.4G&5G 5.0 up:196 Mbits/sec down: 187 Mbits/sec
3 ROCK Pi Wireless Module A3 (SDIO+UART) --- AP6398S BCM43598 2.4G&5G 5.0 up:336 Mbits/sec down: 315 Mbits/sec
4 ROCK Pi Wireless Module A6s (SDIO+UART) --- AP6275S BCM43752 2.4G&5G 5.0 up:234 Mbits/sec down: 273 Mbits/sec
5 Radxa wireless A8 RTL8852BE 2.4G&5G&WIFI6 5.0 up:600Mbits/sec down:900 Mbits/sec
6 Intel 0MHK36 (PCIE+USB) Intel 3165 2.4G&5G 4.2 up:283 Mbits/sec down: 334 Mbits/sec
7 Intel 7265NGW (PCIE+USB) Intel 7265 2.4G&5G 4.2 up:363 Mbits/sec down: 619 Mbits/sec
8 Intel AX210 (PCIE+USB) Intel AX210 WiFi 6 5.2 up: 859 Mbits/sec down: 813 Mbits/sec Just WIFI Support

Radxa APT includes broadcom-wifibt-firmware package for Broadcom wireless modules and intel-wifibt-firmware package for Intel wireless modules. Take a look at your module and download the corresponding packages.

For example:

root@rock-5b:~# apt-get update -y
root@rock-5b:~# apt-get install -y broadcom-wifibt-firmware intel-wifibt-firmware

Below is the example of testing Broadcom modules BT.

  • Check BT service.
root@rock-5b:~# systemctl status bluetooth
  • Run BT service if the BT service is inactive.
root@rock-5b:~# systemctl start bluetooth
  • Check BT device.
root@rock-5b:~# hciconfig
hci0:   Type: Primary  Bus: UART
       BD Address: 10:2C:6B:49:D5:53  ACL MTU: 1021:8  SCO MTU: 64:1
       UP RUNNING 
       RX bytes:850 acl:0 sco:0 events:58 errors:0
       TX bytes:2814 acl:0 sco:0 commands:58 errors:0
  • Example: Connect to BT Speaker.
  • Install pulseaudio packages.
root@rock-5b:~# apt-get install -y pulseaudio-module-bluetooth pulseaudio
  • Run pulseaudio.
root@rock-5b:~# pulseaudio --start
  • Connect using bluetoothctl.
root@rock-5b:~# bluetoothctl
[bluetooth]# default-agent 
[bluetooth]# power on
[bluetooth]# scan on
[bluetooth]# trust 41:42:1A:8D:A9:65       #BT-280
[bluetooth]# pair 41:42:1A:8D:A9:65
[bluetooth]# connect 41:42:1A:8D:A9:65
  • Play songs and enjoy it.
BT Tip:

When you use Radxa Wireless A8 Module, you must add some blacklist as follow to make BT work.

root@rock-5b:~# cat /etc/modprobe.d/blacklist.conf 
blacklist pgdrv
blacklist btusb
blacklist btrtl
blacklist btbcm
blacklist btintel

root@rock-5b:~# reboot

Audio

DP Sound

1. List existing sound cards via aplay

root@rock-5b:/# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: rockchipdp0 [rockchip,dp0], device 0: rockchip,dp0 spdif-hifi-0 [rockchip,dp0 spdif-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: rockchiphdmi0 [rockchip-hdmi0], device 0: rockchip-hdmi0 i2s-hifi-0 [rockchip-hdmi0 i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: rockchiphdmi1 [rockchip-hdmi1], device 0: rockchip-hdmi1 i2s-hifi-0 [rockchip-hdmi1 i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: rockchipes8316 [rockchip-es8316], device 0: fe470000.i2s-ES8316 HiFi es8316.7-0011-0 [fe470000.i2s-ES8316 HiFi es8316.7-00
11-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

2. Specify the sound card to play audio fiile

hw:0,0 means card 0,device 0. Here it refers to rockchipdp0 (DP sound)

root@rock-5b:/# aplay -D hw:0,0 /mnt/test.wav 
Playing WAVE '/mnt/test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

Storage device

  • microSD card: /dev/mmcblk0
  • eMMC: /dev/mmcblk1
  • NVME M.2 SDD: /dev/nvme0n1

Benchmark

Ethernet

Ethernet throughput test result table.

Direction Bitrate
Upstream 2.34 Gbits/sec
Downstream 2.35 Gbits/sec

SD card

This is the test result of 128GB Sandisk card on ROCK 5B.

Operation Speed
Read 87.9MB/s
Write 66.3MB/s

GPU

Run commands.

# test_gpu_glmark2_fullscreen.sh
# test_gpu_glmark2_offscreen.sh

Accessories Configuration

Fan

There is one PWM Fan connector on ROCK 5B.

Execute shell script test_fan_run.sh to turn on fan.

# test_fan_run.sh

The content of script test_fan_run.sh is

# cat usr/local/bin/test_fan_run.sh 
#!/bin/bash
echo "Trun on Fan"
echo 0 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip*/export 
echo 10000 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip*/pwm0/period 
echo 5000 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip*/pwm0/duty_cycle 
echo normal > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip*/pwm0/polarity 
echo 1 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip*/pwm0/enable 
#echo 0 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip*/pwm0/enable 

HDMI 8K

Radxa Display 8HD

Radxa Camera 4K

See Radxa Camera 4K.

Radxa Wireless Module A8

Wireless Module Intel AX210

OS

Device Serial Number

root@rock-5b:~# cat /proc/cpuinfo | grep Serial
Serial		: 099b83b055b47b27

System update

Radxa APT

Radxa APT source includes stable one and testing one. Stable source includes stable packages while testing source includes latest but maybe unstable packages.

Radxa APT stable source is added by default while testing source is not added.

You can uncomment line like "deb http://apt.radxa.com/bullseye-testing/ bullseye main" in file /etc/apt/sources.list.d/apt-radxa-com.list to add testing source.

See file /etc/apt/sources.list.d/apt-radxa-com.list

deb http://apt.radxa.com/bullseye-stable/ bullseye main
deb http://apt.radxa.com/bullseye-testing/ bullseye main

After adding testing source, you need to update APT and install your needed packages.

$ sudo apt-get update

For more detail about Radxa APT, please see Radxa APT.

/boot/config.txt

/boot/config.txt is designed for kernel parameters and hardware configuration. Please note that execute "update_extlinux.sh" after changing file /boot/config.txt.

kernel parameters

kernel command line: started with "cmdline:"

For example:

# For console
cmdline: earlycon=uart8250,mmio32,0xfeb50000 console=ttyFIQ0 console=tty1 consoleblank=0 loglevel=7
# For rootfs
cmdline: panic=10 rootwait rw init=/sbin/init rootfstype=ext4
device tree overlay

dt overlay line: started with "dtoverlay=". One dt overlay one line.

For example:

dtoverlay=rk3588-uart7-m2


Common Hardware Interfaces, GPIO, I2C, PWM, SPI, UART, CAN, etc

The ROCK 5 system images use configuration file /boot/config.txt.

Please note that execute "update_extlinux.sh" to update /boot/extlinux/extlinux.conf after changing file /boot/config.txt.

DT overlays provided by the kernel are located in /boot/dtbs/$(uname -r)/amlogic/overlay/

GPIO
I2C
I2C0_M1

To enable I2C0_M1 (/dev/i2c-0), add one line "dtoverlay=rk3588-i2c0-m1".

dtoverlay=rk3588-i2c0-m1
I2C3_M1

To enable I2C3_M1 (/dev/i2c-3), add one line "dtoverlay=rk3588-i2c3-m1".

dtoverlay=rk3588-i2c3-m1
I2C7_M3

To enable I2C7_M3 (/dev/i2c-7), add one line "dtoverlay=rk3588-i2c7-m3".

dtoverlay=rk3588-i2c7-m3
I2C8_M4

To enable I2C8_M4 (/dev/i2c-8), add one line "dtoverlay=rk3588-i2c8-m4".

dtoverlay=rk3588-i2c8-m4
PWM
PWM2-M1

To enable PWM2-M1 (/sys/class/pwm/pwmchip2), add one line "dtoverlay=rk3588-spi0-m2-cs0-spidev".

dtoverlay=rk3588-pwm2-m1
PWM3-M1

To enable PWM2-M1 (/sys/class/pwm/pwmchip3), add one line "dtoverlay=rk3588-spi0-m2-cs0-spidev".

dtoverlay=rk3588-pwm3-m1
SPI
SPI0-M2-CS0

To enable SPI0-M2-CS0 (/dev/spidev0.0), add one line "dtoverlay=rk3588-spi0-m2-cs0-spidev".

dtoverlay=rk3588-spi0-m2-cs0-spidev
SPI0 M2 with CS1

To enable SPI0-M2-CS1 (/dev/spidev0.1), add one line "dtoverlay=rk3588-spi0-m2-cs1-spidev".

dtoverlay=rk3588-spi0-m2-cs1-spidev
SPI1 M1 with CS0

To enable SPI1-M1-CS0 (/dev/spidev1.0), add one line "dtoverlay=rk3588-spi1-m1-cs0-spidev".

dtoverlay=rk3588-spi1-m1-cs0-spidev
SPI1 M1 with CS1

To enable SPI1-M1-CS1 (/dev/spidev1.1), add one line "dtoverlay=rk3588-spi1-m1-cs1-spidev".

dtoverlay=rk3588-spi1-m1-cs1-spidev
UART