Difference between revisions of "Template:FriendlyWrt21"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
(updated by API)
 
(14 intermediate revisions by the same user not shown)
Line 22: Line 22:
 
* Set a secure password
 
* Set a secure password
 
* Only allow access to ssh from lan, change the port
 
* 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:
 
<syntaxhighlight lang="text">
 
# 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
 
</syntaxhighlight>
 
Restart the service:
 
<syntaxhighlight lang="text">
 
/etc/init.d/uhttpd restart
 
</syntaxhighlight>
 
 
* Check the firewall settings
 
* Check the firewall settings
 
Set up as you wish.
 
Set up as you wish.
 +
===Change LAN IP in LuCI===
 +
1) Click on Network → Interfaces, then click on the Edit button of the LAN Network; <br />
 +
2) In General Setup tab, input new IP address (for example: 192.168.11.1), click "Save" and then click "Save & Apply"; <br />
 +
3) On the pop-up window with the title “Connectivity change“, click "Apply and revert on connectivity loss"; <br />
 +
4) Wait a moment, enter the new address in your computer's browser and login to FriendlyWrt; <br />
 
===Safe shutdown operation===
 
===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.
 
Enter the "Services" -> "Terminal", enter the "poweroff" command and hit enter, wait until the led light is off, and then unplug the power supply.
Line 48: Line 38:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
===Install Software Packages===
 
===Install Software Packages===
 +
====Set up openwrt official opkg source====
 +
<syntaxhighlight lang="text">
 +
sed -i -e 's/mirrors.cloud.tencent.com/downloads.openwrt.org/g' /etc/opkg/distfeeds.conf
 +
opkg update
 +
</syntaxhighlight>
 
====Update Package List====
 
====Update Package List====
 
Before install software packages update the package list:
 
Before install software packages update the package list:
Line 85: Line 80:
 
You can change its behavior by changing the configuration file above.
 
You can change its behavior by changing the configuration file above.
 
}}
 
}}
 +
===Configuring Quectel EC20 (4G module) dial-up networking===
 +
* Go to "Network" -> "Interfaces"
 +
* Click "Delete" next to "WAN6", then click "Save & Apply"
 +
* Click "Edit" next to "WAN", in the "Device" drop-down menu, select "Ethernet Adapter: wwan0", in the "Protocol" drop-down menu, select "QMI Cellular" and click "Switch Protocol"
 +
* Click the "Modem Device" drop-down menu, select "/dev/cdc-wdm0", fill in the APN information (e.g. for China Mobile, enter "cmnet")
 +
* Click "Save" to close the dialog, Finally, click "Save & Apply" at the bottom of the page to initiate the dial-up process
 +
* Devices connected to LAN will have access to the Internet, If your device has a WiFi module, you can enable wireless AP functionality on the "Wireless" page and connect to the Internet via devices connected wirelessly
 
===Some common issues of FriendlyWrt===
 
===Some common issues of FriendlyWrt===
 
* Unable to dial up
 
* Unable to dial up
Line 102: Line 104:
 
  | NanoPi-R2S
 
  | NanoPi-R2S
 
  | NanoPi-R2C-Plus
 
  | NanoPi-R2C-Plus
 +
| NanoPi-R2S-Plus
 
  | NanoPi-R2C =
 
  | NanoPi-R2C =
 
[[File:R2S-usb2lcd-01.jpg|frameless|600px]]<br />
 
[[File:R2S-usb2lcd-01.jpg|frameless|600px]]<br />
Line 133: Line 136:
 
  | #default =
 
  | #default =
 
}}
 
}}
===Work with USB WiFi Device===
+
{{#switch: {{{1}}}
 +
| NanoPi-R2S-Plus =
 +
===How to use SDIO WiFi===
 +
====AP Mode====
 +
* FriendlyWrt's wireless function is disabled by default, to enable WiFi, you can click "Network > Wireless", and then click the "Enable" button.<br />
 +
* Search for a WiFi hotspot with a name like FriendlyWrt-xx:yy:zz on your phone, enter the default password "password" to connect.<br />
 +
* SDIO WiFi models supported: rtl8822cs<br />
 +
====Wireless Repeater Mode====
 +
[[File:R2S-Plus-RepeaterMode.jpg|frameless|600px]]
 +
* Connect to the wireless router
 +
Click "Network" -> "Wireless", Click the "Scan" button next to "Generic MAC80211 802.11ac/b/g/n" to scan for networks, select the router you want to connect and then click the "Join Network" button, <br />
 +
In the network joining configuration page, turn on "Replace wireless configuration", enter the key in the "WPA passphrase" field, keep other configurations as default, click "Submit", <br />
 +
Click "Advanced Settings", input "wlan0" in "Interface Name" field, and then click "Save", <br />
 +
Finally, click "Save and Apply", if normal, you can see the IP address on the FriendlyWrt homepage.
 +
* Create wireless hotspot
 +
Click "Network" -> "Wireless", Click the "Add" button next to "Generic MAC80211 802.11ac/b/g/n",the "Edit wireless network" page will pop up,<br />
 +
Set the wireless channel in the "Operating frequency" field (e.g., "40 (5200 MHz)"),<br />
 +
In the "ESSID" field, input the hotspot name, <br />
 +
In the "Network" field, select "lan", <br />
 +
Click on "Wireless Security", set the encryption type, <br />
 +
Click "Advanced Settings", input "wlan1" in "Interface Name" field, then click "Save" and "Save and Apply", <br />
 +
It requires a reboot to take effect, click on "System" menu, then select "Reboot". <br />
 +
| #default =
 +
}}
 +
{{#switch: {{{1}}}
 +
| NanoPC-T6
 +
| NanoPi-R5C =
 +
===How to use M.2 WiFi===
 +
* M.2 WiFi models supported: rtl8822ce
 +
====AP Mode====
 +
* FriendlyWrt's wireless function is disabled by default, to enable WiFi, you can click "Network > Wireless", and then click the "Enable" button.<br />
 +
* Search for a WiFi hotspot with a name like FriendlyWrt-xx:yy:zz on your phone, enter the default password "password" to connect.<br />
 +
====Wireless Repeater Mode====
 +
[[File:NanoPiAPMode.jpg|frameless|600px]]
 +
* Connect to the wireless router
 +
Click "Network" -> "Wireless", Click the "Scan" button next to "Generic MAC80211 802.11ac/b/g/n" to scan for networks, select the router you want to connect and then click the "Join Network" button, <br />
 +
In the network joining configuration page, turn on "Replace wireless configuration", enter the key in the "WPA passphrase" field, keep other configurations as default, click "Submit", <br />
 +
Click "Advanced Settings", input "wlan0" in "Interface Name" field, and then click "Save", <br />
 +
Finally, click "Save and Apply", if normal, you can see the IP address on the FriendlyWrt homepage.
 +
* Create wireless hotspot
 +
Click "Network" -> "Wireless", Click the "Add" button next to "Generic MAC80211 802.11ac/b/g/n",the "Edit wireless network" page will pop up,<br />
 +
Set the wireless channel in the "Operating frequency" field (e.g., "40 (5200 MHz)"),<br />
 +
In the "ESSID" field, input the hotspot name, <br />
 +
In the "Network" field, select "lan", <br />
 +
Click on "Wireless Security", set the encryption type, <br />
 +
Click "Advanced Settings", input "wlan1" in "Interface Name" field, then click "Save" and "Save and Apply", <br />
 +
It requires a reboot to take effect, click on "System" menu, then select "Reboot". <br />
 +
| #default =
 +
}}
 +
===How to use USB WiFi===
 
====Check USB WiFi Device with Command Line Utility====
 
====Check USB WiFi Device with Command Line Utility====
 
(1) Click on "services>ttyd" to start the command line utility<br />
 
(1) Click on "services>ttyd" to start the command line utility<br />
Line 139: Line 191:
 
  | NanoPi-R2S
 
  | NanoPi-R2S
 
  | NanoPi-R2C-Plus
 
  | NanoPi-R2C-Plus
 +
| NanoPi-R2S-Plus
 
  | NanoPi-R2C =
 
  | NanoPi-R2C =
 
[[File:R2s-wrt-jellyfin-002.jpg|frameless|800px]]<br />
 
[[File:R2s-wrt-jellyfin-002.jpg|frameless|800px]]<br />
Line 150: Line 203:
 
  | NanoPi-R2S
 
  | NanoPi-R2S
 
  | NanoPi-R2C-Plus
 
  | NanoPi-R2C-Plus
 +
| NanoPi-R2S-Plus
 
  | NanoPi-R2C =
 
  | NanoPi-R2C =
 
[[File:R2swrt+usbwifi-09.jpg|frameless|800px]]<br />
 
[[File:R2swrt+usbwifi-09.jpg|frameless|800px]]<br />
Line 162: Line 216:
 
  | NanoPi-R2S
 
  | NanoPi-R2S
 
  | NanoPi-R2C-Plus
 
  | NanoPi-R2C-Plus
 +
| NanoPi-R2S-Plus
 
  | NanoPi-R2C =
 
  | NanoPi-R2C =
 
[[File:R2swrt+usbwifi-10.jpg|frameless|800px]]<br />
 
[[File:R2swrt+usbwifi-10.jpg|frameless|800px]]<br />
Line 175: Line 230:
 
  | NanoPi-R2S
 
  | NanoPi-R2S
 
  | NanoPi-R2C-Plus
 
  | NanoPi-R2C-Plus
 +
| NanoPi-R2S-Plus
 
  | NanoPi-R2C =
 
  | NanoPi-R2C =
 
[[File:R2swrt+usbwifi-01.jpg|frameless|800px]]<br />
 
[[File:R2swrt+usbwifi-01.jpg|frameless|800px]]<br />
Line 185: Line 241:
 
  | NanoPi-R2S
 
  | NanoPi-R2S
 
  | NanoPi-R2C-Plus
 
  | NanoPi-R2C-Plus
 +
| NanoPi-R2S-Plus
 
  | NanoPi-R2C =
 
  | NanoPi-R2C =
 
[[File:R2swrt+usbwifi-03.jpg|frameless|800px]]<br />
 
[[File:R2swrt+usbwifi-03.jpg|frameless|800px]]<br />
Line 193: Line 250:
 
  | NanoPi-R2S
 
  | NanoPi-R2S
 
  | NanoPi-R2C-Plus
 
  | NanoPi-R2C-Plus
 +
| NanoPi-R2S-Plus
 
  | NanoPi-R2C =
 
  | NanoPi-R2C =
 
[[File:R2swrt+usbwifi-04.jpg|frameless|800px]]<br />
 
[[File:R2swrt+usbwifi-04.jpg|frameless|800px]]<br />
Line 201: Line 259:
 
  | NanoPi-R2S
 
  | NanoPi-R2S
 
  | NanoPi-R2C-Plus
 
  | NanoPi-R2C-Plus
 +
| NanoPi-R2S-Plus
 
  | NanoPi-R2C =
 
  | NanoPi-R2C =
 
[[File:R2swrt+usbwifi-05.jpg|frameless|800px]]<br />
 
[[File:R2swrt+usbwifi-05.jpg|frameless|800px]]<br />
Line 211: Line 270:
 
  | NanoPi-R2S
 
  | NanoPi-R2S
 
  | NanoPi-R2C-Plus
 
  | NanoPi-R2C-Plus
 +
| NanoPi-R2S-Plus
 
  | NanoPi-R2C =
 
  | NanoPi-R2C =
 
[[File:R2swrt+usbwifi-07.png|frameless|277px]]<br />
 
[[File:R2swrt+usbwifi-07.png|frameless|277px]]<br />
Line 247: Line 307:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
-->
 
-->
{{#switch: {{{1}}}
+
====Expand Docker Storage====
| NanoPi-R2S
+
* Stop docker service first:
| NanoPi-R2C-Plus
+
| NanoPi-R2C =
+
===挂载外接存储设备===
+
(1) 把移动硬盘连接{{{1}}}作为外接存储设备,将移动硬盘插入{{{1}}}的USB接口,在FriendlyWrt中点击“系统->挂载点”进入挂载点设置界面:<br />
+
[[File:R2s-wrt-jellyfin-006.jpg|frameless|800px]]<br />
+
(2) 在界面下方找到挂载点存储设备设置,点击“添加”按钮:<br />
+
[[File:R2s-wrt-jellyfin-007.jpg|frameless|800px]]<br />
+
(3) 在弹出的对话框中UUID一栏选中刚刚接入的移动硬盘 /dev/sda1(实际情况请根据自身设备选择,如硬盘有多个分区可能会显示sda1/sda2……等):<br />
+
[[File:R2s-wrt-jellyfin-008.jpg|frameless|800px]]<br />
+
(4) 在挂载点一栏中使用自定义,填入要挂载到的目标目录,这里以/jellyfin/videos 目录为例,勾选上方的“已启用”,然后点击“保存”:<br />
+
[[File:R2s-wrt-jellyfin-009.jpg|frameless|800px]]<br />
+
[[File:R2s-wrt-jellyfin-010.jpg|frameless|800px]]<br />
+
(5) 设置完后点击“系统->重启”重启{{{1}}}使挂载点生效:<br />
+
[[File:R2s-wrt-jellyfin-011.jpg|frameless|800px]]<br />
+
(6) 重启后再回到“挂载点”界面可看到“已挂载的文件系统”中显示刚刚挂载的移动硬盘信息,即设置成功(以后需要再新增或删减编辑挂载点都可以在下面的“挂载点”设置中操作):<br />
+
'''注:每次操作后都需要重启后才能生效'''<br />
+
[[File:R2s-wrt-jellyfin-012.jpg|frameless|800px]]<br />
+
| #default =
+
}}
+
<!--
+
TODO
+
====使用外接硬盘来扩展Docker可用空间====
+
* 先停止docker服务:
+
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
/etc/init.d/dockerd stop
 
/etc/init.d/dockerd stop
 
</syntaxhighlight>
 
</syntaxhighlight>
* 把原来的/opt目录改个名, 建一个空的/opt目录:
+
* Rename the original /opt directory, create an empty /opt directory:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
mv /opt /opt-old && mkdir /opt
 
mv /opt /opt-old && mkdir /opt
 
</syntaxhighlight>
 
</syntaxhighlight>
* 参考章节“8 初始化NVME固态硬盘和USB移动硬盘”, 将你的硬盘格式化为ext4, 然后挂载至 /opt 目录:
+
* Format your drive as ext4, and mount it to the /opt directory:
[[File:Friendlywrt mount nvme opt-zh.jpg|frameless|500px]]
+
[[File:Friendlywrt mount nvme opt-en.jpg|frameless|500px]]
<!-- [[File:Friendlywrt mount nvme opt-en.jpg|frameless|400px]] -->
+
* Enter the command "mount | grep /opt" to check the mount status:
* 输入命令 "mount | grep /opt" 确实一下硬盘被正常挂载到 /opt 下:
+
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
root@FriendlyWrt:~# mount | grep /opt
 
root@FriendlyWrt:~# mount | grep /opt
Line 288: Line 324:
 
root@FriendlyWrt:~#
 
root@FriendlyWrt:~#
 
</syntaxhighlight>
 
</syntaxhighlight>
* 把原来 /opt 目录下的文件复制到新的 /opt 目录:
+
* Copy the files from the original /opt directory to the new /opt directory:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
cp -af /opt-old/* /opt/ && rm -rf /opt-old
 
cp -af /opt-old/* /opt/ && rm -rf /opt-old
 
</syntaxhighlight>
 
</syntaxhighlight>
* 操作完后, 重启
+
* Reboot the device
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
reboot
 
reboot
 
</syntaxhighlight>
 
</syntaxhighlight>
* 重启后, 进入"Docker"->"概览"页面, 查看"Docker根目录"这一行的信息, 可以确认Docke空间已扩容:
+
* 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:
<!-- Docker->Overview, View "Docker Root Dir" -->
+
[[File:Friendlywrt docker info-en.jpg|frameless|500px]]
[[File:Friendlywrt docker info-zh.jpg|frameless|500px]]
+
====Docker FAQ and solutions====
<!-- [[File:Friendlywrt docker info-en.jpg|frameless|500px]] -->
+
=====Unable to access the network services provided by the Docker container=====
====Docker的常见问题与解决办法====
+
Solution: <br />
=====无法访问Docker提供的网络服务=====
+
* Go to the "Firewall" settings and set "Forwarding" to "Accept";
解决办法: <br />
+
* Turn off "Software Offload";
* 进入  "防火墙" 的设置,把 "转发" 设置成 "接受";
+
* 关闭 ”软件流量分载“;
+
-->
+
 
===Mount smbfs===
 
===Mount smbfs===
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 367: Line 400:
 
opkg install example2_1.0.0-220420.38257_aarch64_generic.ipk
 
opkg install example2_1.0.0-220420.38257_aarch64_generic.ipk
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
===Build FriendlyWrt using GitHub Actions===
 +
Please refre this link: https://github.com/friendlyarm/Actions-FriendlyWrt

Latest revision as of 09:35, 4 February 2024

1 Work with FriendlyWrt

1.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.

1.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

1.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 {{{1}}} to the Internet.

1.4 Login FriendlyWrt

Connect the PC to the LAN port of {{{1}}}. If your PC without a built-in ethernet port, connect the LAN port of the wireless AP to the LAN port of {{{1}}}, 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 {{{1}}}. The IP address of the WAN port will be dynamically obtained from your main router through DHCP.

1.5 Recommended security settings

The following settings are highly recommended to complete before connecting {{{1}}} to the Internet。

  • Set a secure password
  • Only allow access to ssh from lan, change the port
  • Check the firewall settings

Set up as you wish.

1.6 Change LAN IP in LuCI

1) Click on Network → Interfaces, then click on the Edit button of the LAN Network;
2) In General Setup tab, input new IP address (for example: 192.168.11.1), click "Save" and then click "Save & Apply";
3) On the pop-up window with the title “Connectivity change“, click "Apply and revert on connectivity loss";
4) Wait a moment, enter the new address in your computer's browser and login to FriendlyWrt;

1.7 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.

1.8 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

1.9 Install Software Packages

1.9.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

1.9.2 Update Package List

Before install software packages update the package list:

$ opkg update

1.9.3 List Available Packages

$ opkg list

1.9.4 List Installed Packages

$ opkg list-installed

1.9.5 Install Packages

$ opkg install <package names>

1.9.6 Remove Packages

$ opkg remove <package names>

1.10 Disable IPv6

. /root/setup.sh
disable_ipv6
reboot

1.11 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.

1.12 Configuring Quectel EC20 (4G module) dial-up networking

  • Go to "Network" -> "Interfaces"
  • Click "Delete" next to "WAN6", then click "Save & Apply"
  • Click "Edit" next to "WAN", in the "Device" drop-down menu, select "Ethernet Adapter: wwan0", in the "Protocol" drop-down menu, select "QMI Cellular" and click "Switch Protocol"
  • Click the "Modem Device" drop-down menu, select "/dev/cdc-wdm0", fill in the APN information (e.g. for China Mobile, enter "cmnet")
  • Click "Save" to close the dialog, Finally, click "Save & Apply" at the bottom of the page to initiate the dial-up process
  • Devices connected to LAN will have access to the Internet, If your device has a WiFi module, you can enable wireless AP functionality on the "Wireless" page and connect to the Internet via devices connected wirelessly

1.13 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 {{{1}}} 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;

1.14 Use USB2LCD to view IP and temperature

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


1.15 How to use USB WiFi

1.15.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.

1.15.2 Configure a USB WiFi Device as AP

(1) Connect a USB WiFi device to the {{{1}}}. 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 {{{1}}}

(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

1.15.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.

1.15.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

1.16 Work with Docker Applications

1.16.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

1.16.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.

1.16.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

1.16.4 Docker FAQ and solutions

1.16.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";

1.17 Mount smbfs

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

1.18 Use sdk to compile the package

1.18.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

1.18.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

1.18.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

1.18.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

1.19 Build FriendlyWrt using GitHub Actions

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