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

Difference between revisions of "Rock3/Debian"

(WIFI Connection)
Line 11: Line 11:
 
=== Introduction to ROCK 3 Debian ===
 
=== Introduction to ROCK 3 Debian ===
  
ROCK 3 Debian is an easy to use desktop system. While working with ROCK 3 Debian, you will find it do well on playing music, Internet, Bluetooth, AI and so on.
+
This guide is available for official ROCK 3 Debian images.
 +
 
 +
ROCK 3 Debian is an easy to use desktop system. While working with ROCK 3 Debian, you will find it do well on playing music, Internet, Bluetooth, AI and so on.
  
 
ROCK 3 Debian uses '''systemd''' to manage system.
 
ROCK 3 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.
+
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.
  
 
=== Access from the Host PC/Laptop ===
 
=== Access from the Host PC/Laptop ===
Line 21: Line 23:
 
==== Option 1: Serial console ====
 
==== Option 1: Serial console ====
  
Check [[rock3/dev/serial-console | Serial Console]]
+
See [[rock3/dev/serial-console | Serial Console]]
  
 
==== Option 2: SSH ====
 
==== Option 2: SSH ====
 +
 
SSH server  is enabled on port 22 of ROCK 3 default image.  
 
SSH server  is enabled on port 22 of ROCK 3 default image.  
  
Line 38: Line 41:
 
  Password  : rock
 
  Password  : rock
  
===Desktop ===
+
=== Desktop ===
  
 
The preinstalled Desktop is xfce4.
 
The preinstalled Desktop is xfce4.
  
=== Install and update  necessary packages ===
+
=== Radxa APT ===
  
Add Radxa APT, see [[rock3/radxa-apt | 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.
  
Install 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/buster-testing/ buster 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/buster-stable/ buster main
 +
#deb http://apt.radxa.com/buster-testing/ buster 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 [[rock3/radxa-apt | Radxa APT]].
 +
 
 +
=== Upgrade necessary packages ===
  
 
  $ sudo apt-get update
 
  $ sudo apt-get update
 
  $ sudo apt-get install -y rockchip-overlay
 
  $ sudo apt-get install -y rockchip-overlay
  $ sudo apt-get install -y linux-4.4-rock-3-latest
+
  $ sudo apt-get install -y linux-4.19-rock-3-latest
  
 
=== Network Connection ===
 
=== Network Connection ===
Line 57: Line 75:
  
 
==== Ethernet Connection ====
 
==== Ethernet Connection ====
 +
 
You can use a network cable (one end connected to the external network port or route)  to connect your ROCK 3 to the network. The ROCK 3 will automatically configure the network for your surfing on the Internet.
 
You can use a network cable (one end connected to the external network port or route)  to connect your ROCK 3 to the network. The ROCK 3 will automatically configure the network for your surfing on the Internet.
  
 
===== To test the Ethernet, we need to follow the steps: =====
 
===== To test the Ethernet, we need to follow the steps: =====
 +
 
* Switch to super user mode by command
 
* Switch to super user mode by command
 
  $ sudo su
 
  $ sudo su
Line 76: Line 96:
 
When there is not a network cable for your ROCK 3 the WIFI connection is another good choice. See [[rock3/hardware/wifi | Supported WiFi Cards]] list.
 
When there is not a network cable for your ROCK 3 the WIFI connection is another good choice. See [[rock3/hardware/wifi | Supported WiFi Cards]] list.
  
=====To test the WIFI performance, we need to follow the steps:=====
+
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@rock3a:~# apt-get update
 +
root@rock3a:~# apt-get install broadcom-wifibt-firmware
 +
root@rock3a:~# apt-get install intel-wifibt-firmware
 +
 
 +
===== To test the WIFI performance, we need to follow the steps: =====
  
 
* Switch to super user mode
 
* Switch to super user mode
Line 92: Line 121:
 
* Test WIFI perpormance by tool iperf.
 
* Test WIFI perpormance by tool iperf.
  
===Bluetooth===
+
=== Bluetooth ===
*Update necessary packages.
+
 
 +
See [[rock3/hardware/wifi | Supported WiFi Cards]] list to get tested wireless modules.
 +
 
 +
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@rock3a:~# apt-get update
 
  root@rock3a:~# apt-get update
  root@rock3a:~# apt-get install broadcom-wifibt-firmware
+
  root@rock3a:~# apt-get install broadcom-wifibt-firmware
 +
root@rock3a:~# apt-get install intel-wifibt-firmware
 +
 
 +
Below is the example of testing Broadcom modules bluetoth.
 +
 
 
*Check Bluetooth service.
 
*Check Bluetooth service.
 
  root@rock3a:~# systemctl status bluetooth
 
  root@rock3a:~# systemctl status bluetooth
Line 123: Line 163:
  
 
=== Check DDR size ===
 
=== Check DDR size ===
ROCK 3 has several different DDR sizes, such as 2G, 4G, 8G.
+
 
 +
ROCK 3 has several different DDR sizes, such as 2G, 4G, 8G, etc.
 +
 
 
  $ free -h
 
  $ free -h
 
               total        used        free      shared  buff/cache  available
 
               total        used        free      shared  buff/cache  available
Line 132: Line 174:
  
 
=== Storage device ===
 
=== Storage device ===
 +
 
* eMMC: /dev/mmcblk0
 
* eMMC: /dev/mmcblk0
 
* uSD Card: /dev/mmcblk1
 
* uSD Card: /dev/mmcblk1
Line 137: Line 180:
  
 
=== Test RTC Device ===
 
=== Test RTC Device ===
First, plug in RTC battery and power on.Check the rtc device:
+
 
 +
Firstly, plug in RTC battery and power on.Check the rtc device:
 
  root@rock3a:~# dmesg | grep rtc
 
  root@rock3a:~# dmesg | grep rtc
 
  [    0.749597] rk808-rtc rk808-rtc: registered as rtc0
 
  [    0.749597] rk808-rtc rk808-rtc: registered as rtc0
 
  [    0.751404] rk808-rtc rk808-rtc: setting system clock to 2017-08-04 09:00:02 UTC (1501837202)
 
  [    0.751404] rk808-rtc rk808-rtc: setting system clock to 2017-08-04 09:00:02 UTC (1501837202)
  
Second, use the follow commands to set the system time and synchronization to the rtc clock.
+
Secondly, use the follow commands to set the system time and synchronization to the rtc clock.
 
  $ date -s "2021-08-17 20:03:00"
 
  $ date -s "2021-08-17 20:03:00"
 
  $ hwclock -w
 
  $ hwclock -w
Line 150: Line 194:
 
  $ poweroff
 
  $ poweroff
 
and then disconnect the power supply
 
and then disconnect the power supply
Third, back to power after 10 mins and check whether the rtc clock run the same time
+
 
 +
Finally, 10 minutes later,power on ROCK 3 A via Type-C Port and check the rtc clock.
 
  $ hwclock -r
 
  $ hwclock -r
 
  root@rock3a:~# hwclock -r
 
  root@rock3a:~# hwclock -r
 
  2021-08-17 20:10:14.745124+00:00
 
  2021-08-17 20:10:14.745124+00:00
 +
 +
We see that rtc runs about minutes also. That's good.
  
 
=== Test Audio Player===
 
=== Test Audio Player===
 +
 
Download a wav audio file, and use the command to test the HP player.
 
Download a wav audio file, and use the command to test the HP player.
  
Line 175: Line 223:
 
   
 
   
 
  $ aplay -D plughw:1,0 test.wav
 
  $ aplay -D plughw:1,0 test.wav
  Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
+
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
 
   
 
   
  
To test the Mic recordding, please follow:
+
To test the Mic recording, please follow:
 
  $ amixer -c 1 cset numid=2 1
 
  $ amixer -c 1 cset numid=2 1
 
  $ arecord -Dhw:1,0 -d 10 -f cd -r 44100 -c 2 -t wav ./mic_test.wav      #this is a record command
 
  $ arecord -Dhw:1,0 -d 10 -f cd -r 44100 -c 2 -t wav ./mic_test.wav      #this is a record command
Line 185: Line 233:
  
 
=== Test USB Host ===
 
=== Test USB Host ===
 +
 
Plug in the U dish and use the command by serial console.
 
Plug in the U dish and use the command by serial console.
 
  $ '''dmesg | tail'''
 
  $ '''dmesg | tail'''
Line 206: Line 255:
 
If  /dev/sda1 is successfully mounted, this usb host is working properly.
 
If  /dev/sda1 is successfully mounted, this usb host is working properly.
  
===Test fan on / off===
+
=== Test fan on / off===
 +
 
 
Please execute with root permission
 
Please execute with root permission
  

Revision as of 03:29, 13 November 2021

    ROCK 3 >  Debian

Work with ROCK 3 Debian

Introduction to ROCK 3 Debian

This guide is available for official ROCK 3 Debian images.

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

ROCK 3 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.

Access from the Host PC/Laptop

Option 1: Serial console

See Serial Console

Option 2: SSH

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

Please use angryip to find your board IP address.

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

Debian Default User Account

Non-root User:

User Name : rock
Password  : rock

Desktop

The preinstalled Desktop is xfce4.

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/buster-testing/ buster 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/buster-stable/ buster main
#deb http://apt.radxa.com/buster-testing/ buster 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.

Upgrade necessary packages

$ sudo apt-get update
$ sudo apt-get install -y rockchip-overlay
$ sudo apt-get install -y linux-4.19-rock-3-latest

Network Connection

There are two methods for network connection. One is Ethernet and the other is WIFI.

Ethernet Connection

You can use a network cable (one end connected to the external network port or route) to connect your ROCK 3 to the network. The ROCK 3 will automatically configure the network for your surfing on the Internet.

To test the Ethernet, we need to follow the steps:
  • 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, 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

WIFI Connection

When there is not a network cable for your ROCK 3 the WIFI connection is another good choice. See Supported WiFi Cards list.

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@rock3a:~# apt-get update
root@rock3a:~# apt-get install broadcom-wifibt-firmware
root@rock3a:~# apt-get install intel-wifibt-firmware
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 perpormance by tool iperf.

Bluetooth

See Supported WiFi Cards list to get tested wireless modules.

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@rock3a:~# apt-get update
root@rock3a:~# apt-get install broadcom-wifibt-firmware
root@rock3a:~# apt-get install intel-wifibt-firmware

Below is the example of testing Broadcom modules bluetoth.

  • Check Bluetooth service.
root@rock3a:~# systemctl status bluetooth
  • Run Bluetooth service if the Bluetooth service is inactive.
root@rock3a:~# systemctl start bluetooth
  • Check Bluetooth device.
root@rock3a:~# 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 Bluetooth Speaker.
  • Install pulseaudio packages.
root@rock3a:~# apt-get install -y pulseaudio-module-bluetooth pulseaudio
  • Run pulseaudio.
root@rock3a:~# pulseaudio --start
  • Connect using bluetoothctl.
root@rock3a:~# bluetoothctl
[bluetooth]# default-agent 
[bluetooth]# power on
[bluetooth]# scan on
[bluetooth]# trust 77:EC:79:4F:6B:AC
[bluetooth]# pair 77:EC:79:4F:6B:AC
[bluetooth]# connect 77:EC:79:4F:6B:AC
  • Play songs and enjoy it.

Check DDR size

ROCK 3 has several different DDR sizes, such as 2G, 4G, 8G, etc.

$ free -h
              total        used        free      shared  buff/cache   available
Mem:          7.4Gi        72Mi       7.1Gi        16Mi       182Mi       7.2Gi 
Swap:            0B          0B          0B

For example, the size of DDR on this board is 8G.

Storage device

  • eMMC: /dev/mmcblk0
  • uSD Card: /dev/mmcblk1
  • NVME M.2 SDD: /dev/nvme0n1

Test RTC Device

Firstly, plug in RTC battery and power on.Check the rtc device:

root@rock3a:~# dmesg | grep rtc
[    0.749597] rk808-rtc rk808-rtc: registered as rtc0
[    0.751404] rk808-rtc rk808-rtc: setting system clock to 2017-08-04 09:00:02 UTC (1501837202)

Secondly, use the follow commands to set the system time and synchronization to the rtc clock.

$ date -s "2021-08-17 20:03:00"
$ hwclock -w
$ hwclock -r
root@rock3a:~# hwclock -r
2021-08-17 20:00:04.745124+00:00
$ poweroff

and then disconnect the power supply

Finally, 10 minutes later,power on ROCK 3 A via Type-C Port and check the rtc clock.

$ hwclock -r
root@rock3a:~# hwclock -r
2021-08-17 20:10:14.745124+00:00

We see that rtc runs about minutes also. That's good.

Test Audio Player

Download a wav audio file, and use the command to test the HP player.

$ amixer -c 1 cset numid=1 3
   numid=1,iface=MIXER,name='Playback Path'
 ; type=ENUMERATED,access=rw------,values=1,items=11
 ; Item #0 'OFF'
 ; Item #1 'RCV'
 ; Item #2 'SPK'
 ; Item #3 'HP'
 ; Item #4 'HP_NO_MIC'
 ; Item #5 'BT'
 ; Item #6 'SPK_HP'
 ; Item #7 'RING_SPK'
 ; Item #8 'RING_HP'
 ; Item #9 'RING_HP_NO_MIC'
 ; Item #10 'RING_SPK_HP'
 : values=3

$ aplay -D plughw:1,0 test.wav
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

To test the Mic recording, please follow:

$ amixer -c 1 cset numid=2 1
$ arecord -Dhw:1,0 -d 10 -f cd -r 44100 -c 2 -t wav ./mic_test.wav      #this is a record command
  Recording WAVE './mic_test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
$ aplay -D plughw:1,0 mic_test.wav

Test USB Host

Plug in the U dish and use the command by serial console.

$ dmesg | tail
[  133.773558] usb 2-1: SerialNumber: CCYYB18M1CFKO4H4
[  133.774332] usb-storage 2-1:1.0: USB Mass Storage device detected
[  133.774657] scsi host0: usb-storage 2-1:1.0
[  134.841096] scsi 0:0:0:0: Direct-Access     aigo     U350             1100 PQ: 0 ANSI: 6
[  134.846394] sd 0:0:0:0: [sda] 30720000 512-byte logical blocks: (15.7 GB/14.6 GiB)
[  134.847554] sd 0:0:0:0: [sda] Write Protect is off
[  134.847635] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[  134.848824] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  134.858173]  sda: sda1
[  134.861161] sd 0:0:0:0: [sda] Attached SCSI removable disk
$ sudo mount /dev/sda1 /mnt
$ lsblk
root@linaro-alip:~# lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda            8:0    1 14.7G  0 disk 
└─sda1         8:1    1 14.7G  0 part /mnt

If /dev/sda1 is successfully mounted, this usb host is working properly.

Test fan on / off

Please execute with root permission

echo 0 > /sys/class/pwm/pwmchip0/export
echo 10000 > /sys/class/pwm/pwmchip0/pwm0/period
echo 5000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle
echo normal >  /sys/class/pwm/pwmchip0/pwm0/polarity

echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable        // on  
echo 0 > /sys/class/pwm/pwmchip0/pwm0/enable       //  off

Changelogs

2021.09.15

rock3a_debian_buster_xfce4_arm64_20210914_0334-gpt.img

  • Kernel version: 4.19.193-10-rockchip-g152e34a538b4
  • Package broadcom-wifibt-firmware version: 1.3
  • Package rockchip-overlay version: 2.9
  • Package rtl8723be-firmware version: 0.1

2021.08.24

rock3a_debian_buster_xfce4_arm64_20210824_0136-gpt.img

  • Kernel version: 4.19.193-2-rockchip-g7cf7399ddb5c
  • U-Boot version: 2017.09-gbd2fa07970e-210525