Difference between revisions of "Template:OfficialUbuntuCore"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
(updated by API)
 
(20 intermediate revisions by the same user not shown)
Line 12: Line 12:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
===Setup Network Configurations===
 
===Setup Network Configurations===
 +
====Set static IP address====
 
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:
 
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:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 24: Line 25:
 
     gateway 192.168.1.1
 
     gateway 192.168.1.1
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
{{#switch: {{{1}}}
 +
| NanoPi-R5S
 +
| NanoPi-R6S =
 +
The other two ethernet ports are set up with static IP addresses, as follows:<br/>
 +
eth1: 192.168.2.1<br/>
 +
eth2: 192.168.3.1 (Note: if there are three network ports)<br/>
 +
| NanoPi-R6C
 +
| NanoPC-T6
 +
| NanoPi-R5C =
 +
The other ethernet port are set up with static IP addresses, as follows:<br/>
 +
eth1: 192.168.2.1<br/>
 +
| #default =
 +
}}
 +
====Set a DNS====
 
You also need to modify the following file to add the DNS configuration:
 
You also need to modify the following file to add the DNS configuration:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
vi /etc/systemd/resolved.conf
 
vi /etc/systemd/resolved.conf
 
</syntaxhighlight>
 
</syntaxhighlight>
例如设置为192.168.1.1:
+
For example, set to 192.168.1.1:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
[Resolve]
 
[Resolve]
Line 38: Line 53:
 
sudo systemctl enable systemd-resolved.service
 
sudo systemctl enable systemd-resolved.service
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
====Set up to use another network interface====
 
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.
 
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.
 +
===Setup Wi-Fi===
 +
First, use the following command to check if Network-Manager is installed on your system:
 +
<syntaxhighlight lang="bash">
 +
which nmcli
 +
</syntaxhighlight>
 +
If you have installed it, refer to this link to connect to WiFi: [[Use NetworkManager to configure network settings]], If you do not have Network-Manager installed on your system, please refer to the following method to configure WiFi, <br />
 +
By default the WiFi device is "wlan0". You need to create a configuration file under "/etc/network/interfaces.d/" for WiFi:
 +
<syntaxhighlight lang="bash">
 +
vi /etc/network/interfaces.d/wlan0
 +
</syntaxhighlight>
 +
Here is a sample wlan0 file:
 +
<syntaxhighlight lang="bash">
 +
auto lo
 +
iface lo inet loopback
 +
auto wlan0
 +
iface wlan0 inet dhcp
 +
wpa-driver wext
 +
wpa-ssid YourWiFiESSID
 +
wpa-ap-scan 1
 +
wpa-proto RSN
 +
wpa-pairwise CCMP
 +
wpa-group CCMP
 +
wpa-key-mgmt WPA-PSK
 +
wpa-psk YourWiFiPassword
 +
</syntaxhighlight>
 +
Please replace "YourWiFiESSID" and "YourWiFiPassword" with your WiFiESSID and password. After save and close the file you can connect to your WiFi source by running the following command:
 +
<syntaxhighlight lang="bash">
 +
sudo systemctl daemon-reload
 +
sudo systemctl restart networking
 +
</syntaxhighlight>
 +
After you power on your board it will automatically connect to your WiFi source.<br />
 +
Please note that if you use one TF card to boot multiple boards the WiFi device name will likely be named to "wlan1", "wlan2" and etc. You can reset it to "wlan0" by deleting the contents of the following file and reboot your board:
 +
/etc/udev/rules.d/70-persistent-net.rules
 +
{{#switch: {{{1}}}
 +
| NanoPi-R4S
 +
| NanoPi-R4SE
 +
| NanoPi-R2S
 +
| NanoPi-R2C
 +
| NanoPi-R2C-Plus
 +
| NanoPi-R2S-Plus
 +
| NanoPi-R5C
 +
| NanoPi-R5S
 +
| NanoPi-R6C
 +
| NanoPC-T6
 +
| NanoPi-R6S =
 +
====WiFi models supported====
 +
=====M.2 WiFi Module=====
 +
* RTL8822CE
 +
=====Usb Dongle=====
 +
* RTL8821CU  (Vid: 0BDA, Pid: C811)  (Test sample:TP-Link TL-WDN5200H)
 +
* RTL8812AU  (Vid: 0BDA, Pid: 8812)
 +
* MediaTek MT7662 (Vid: 0E8D, Pid: 7612)  (Test sample:COMFAST CF-WU782AC V2)
 +
| #default =
 +
}}
 
===Install the kernel-header package===
 
===Install the kernel-header package===
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 45: Line 115:
 
<!-- Build kernel header -->
 
<!-- Build kernel header -->
 
{{#switch: {{{1}}}
 
{{#switch: {{{1}}}
  | NanoPi-R4S =
+
  | NanoPi-R4S
 +
| NanoPi-R4SE =
 
===Build kernel-header deb package===
 
===Build kernel-header deb package===
 
Please refre to: https://github.com/friendlyarm/sd-fuse_rk3399/blob/kernel-5.15.y/test/test-build-kernel-header-deb.sh <br />
 
Please refre to: https://github.com/friendlyarm/sd-fuse_rk3399/blob/kernel-5.15.y/test/test-build-kernel-header-deb.sh <br />
 
  | NanoPi-R2S
 
  | NanoPi-R2S
 
  | NanoPi-R2C-Plus
 
  | NanoPi-R2C-Plus
 +
| NanoPi-R2S-Plus
 
  | NanoPi-R2C =
 
  | NanoPi-R2C =
 
===Build kernel-header deb package===
 
===Build kernel-header deb package===
Line 58: Line 130:
 
{{#switch: {{{1}}}
 
{{#switch: {{{1}}}
 
  | NanoPi-R4S
 
  | NanoPi-R4S
 +
| NanoPi-R4SE
 
  | NanoPi-R2S
 
  | NanoPi-R2S
 
  | NanoPi-R2C-Plus
 
  | NanoPi-R2C-Plus
 +
| NanoPi-R2S-Plus
 +
| NanoPi-R5C
 
  | NanoPi-R2C =
 
  | NanoPi-R2C =
 
===Config status LEDs===
 
===Config status LEDs===
Set the following kernel modules to be loaded automatically on boot:<br />
+
First determine whether the system already exists the leds initialization service:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
echo ledtrig-netdev > /etc/modprobe.d/ledtrig.conf
+
sudo systemctl status leds
 +
</syntaxhighlight>
 +
If the leds service already exists, change the default behavior of the LEDs by editing the following file:
 +
<syntaxhighlight lang="bash">
 +
/etc/init.d/leds.sh
 +
</syntaxhighlight>
 +
Since there is no leds service in the early firmware, you need to refer to the following guide to manually configure the LEDs. First, set the following kernel modules to be automatically loaded at boot:<br />
 +
<syntaxhighlight lang="bash">
 +
modprobe ledtrig-netdev
 +
echo ledtrig-netdev > /etc/modules-load.d/ledtrig-netdev.conf
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Put the following into the autorun script to associate the status leds with the ethernet interface, and you can configure it to behave in other ways by referring to these content:<br />
 
Put the following into the autorun script to associate the status leds with the ethernet interface, and you can configure it to behave in other ways by referring to these content:<br />
Line 76: Line 160:
 
echo 1 > /sys/class/leds/lan_led/link
 
echo 1 > /sys/class/leds/lan_led/link
 
  </syntaxhighlight>
 
  </syntaxhighlight>
  | NanoPi-R5S =
+
  | NanoPi-R5S
 +
| NanoPi-R6S =
 
===Config status LEDs===
 
===Config status LEDs===
 +
First determine whether the system already exists the leds initialization service:
 +
<syntaxhighlight lang="bash">
 +
sudo systemctl status leds
 +
</syntaxhighlight>
 +
If the leds service already exists, change the default behavior of the LEDs by editing the following file:
 +
<syntaxhighlight lang="bash">
 +
/etc/init.d/leds.sh
 +
</syntaxhighlight>
 +
Since there is no leds service in the early firmware, you need to refer to the following guide to manually configure the LEDs. First, set the following kernel modules to be automatically loaded at boot:<br />
 +
<syntaxhighlight lang="bash">
 +
modprobe ledtrig-netdev
 +
echo ledtrig-netdev > /etc/modules-load.d/ledtrig-netdev.conf
 +
</syntaxhighlight>
 
Put the following into the autorun script to associate the status leds with the ethernet interface, and you can configure it to behave in other ways by referring to these content:<br />
 
Put the following into the autorun script to associate the status leds with the ethernet interface, and you can configure it to behave in other ways by referring to these content:<br />
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 91: Line 189:
 
echo eth2 > /sys/class/leds/lan2_led/device_name
 
echo eth2 > /sys/class/leds/lan2_led/device_name
 
echo 1 > /sys/class/leds/lan2_led/link
 
echo 1 > /sys/class/leds/lan2_led/link
 +
</syntaxhighlight>
 +
| NanoPi-R6C =
 +
===Config status LEDs===
 +
First determine whether the system already exists the leds initialization service:
 +
<syntaxhighlight lang="bash">
 +
sudo systemctl status leds
 +
</syntaxhighlight>
 +
If the leds service already exists, change the default behavior of the LEDs by editing the following file:
 +
<syntaxhighlight lang="bash">
 +
/etc/init.d/leds.sh
 +
</syntaxhighlight>
 +
Since there is no leds service in the early firmware, you need to refer to the following guide to manually configure the LEDs. First, set the following kernel modules to be automatically loaded at boot:<br />
 +
<syntaxhighlight lang="bash">
 +
modprobe ledtrig-netdev
 +
echo ledtrig-netdev > /etc/modules-load.d/ledtrig-netdev.conf
 +
</syntaxhighlight>
 +
Put the following into the autorun script to associate the status leds with the ethernet interface, and you can configure it to behave in other ways by referring to these content:<br />
 +
<syntaxhighlight lang="bash">
 +
echo netdev > /sys/class/leds/wan_led/trigger
 +
echo eth0 > /sys/class/leds/wan_led/device_name
 +
echo 1 > /sys/class/leds/wan_led/link
 +
 +
echo netdev > /sys/class/leds/lan1_led/trigger
 +
echo eth1 > /sys/class/leds/lan1_led/device_name
 +
echo 1 > /sys/class/leds/lan1_led/link
 +
</syntaxhighlight>
 +
The onboard LED1 can be configured as needed, the node is /sys/class/leds/usr_led.
 +
| NanoPC-T6 =
 +
===Config status LEDs===
 +
First determine whether the system already exists the leds initialization service:
 +
<syntaxhighlight lang="bash">
 +
sudo systemctl status leds
 +
</syntaxhighlight>
 +
If the leds service already exists, change the default behavior of the LEDs by editing the following file:
 +
<syntaxhighlight lang="bash">
 +
/etc/init.d/leds.sh
 +
</syntaxhighlight>
 +
Since there is no leds service in the early firmware, you need to refer to the following guide to manually configure the LEDs. First, set the following kernel modules to be automatically loaded at boot:<br />
 +
<syntaxhighlight lang="bash">
 +
modprobe ledtrig-netdev
 +
echo ledtrig-netdev > /etc/modules-load.d/ledtrig-netdev.conf
 +
</syntaxhighlight>
 +
Put the following into the autorun script to associate the status leds with the ethernet interface, and you can configure it to behave in other ways by referring to these content:<br />
 +
<syntaxhighlight lang="bash">
 +
echo netdev > /sys/class/leds/usr_led/trigger
 +
echo eth0 > /sys/class/leds/usr_led/device_name
 +
echo 1 > /sys/class/leds/usr_led/link
 
</syntaxhighlight>
 
</syntaxhighlight>
 
  | #default =
 
  | #default =
 
}}
 
}}

Latest revision as of 10:53, 4 December 2023

1 Work with FriendlyCore

1.1 FriendlyCore User Account

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

1.2 Update Software Packages

$ sudo apt-get update

1.3 Setup Network Configurations

1.3.1 Set static IP address

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

1.3.2 Set a DNS

You also need to modify the following file to add the DNS configuration:

vi /etc/systemd/resolved.conf

For example, set to 192.168.1.1:

[Resolve]
DNS=192.168.1.1

Restart the systemd-resolved service with the following command:

sudo systemctl restart systemd-resolved.service
sudo systemctl enable systemd-resolved.service

1.3.3 Set up to use another network interface

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.

1.4 Setup Wi-Fi

First, use the following command to check if Network-Manager is installed on your system:

which nmcli

If you have installed it, refer to this link to connect to WiFi: Use NetworkManager to configure network settings, If you do not have Network-Manager installed on your system, please refer to the following method to configure WiFi,
By default the WiFi device is "wlan0". You need to create a configuration file under "/etc/network/interfaces.d/" for WiFi:

vi /etc/network/interfaces.d/wlan0

Here is a sample wlan0 file:

auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet dhcp
wpa-driver wext
wpa-ssid YourWiFiESSID
wpa-ap-scan 1
wpa-proto RSN
wpa-pairwise CCMP
wpa-group CCMP
wpa-key-mgmt WPA-PSK
wpa-psk YourWiFiPassword

Please replace "YourWiFiESSID" and "YourWiFiPassword" with your WiFiESSID and password. After save and close the file you can connect to your WiFi source by running the following command:

sudo systemctl daemon-reload
sudo systemctl restart networking

After you power on your board it will automatically connect to your WiFi source.
Please note that if you use one TF card to boot multiple boards the WiFi device name will likely be named to "wlan1", "wlan2" and etc. You can reset it to "wlan0" by deleting the contents of the following file and reboot your board: /etc/udev/rules.d/70-persistent-net.rules

1.5 Install the kernel-header package

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