Template:FriendlyWrt19/zh

From FriendlyELEC WiKi
Revision as of 08:25, 18 January 2020 by Tzs (Talk | contribs) (updated by API)

Jump to: navigation, search

1 FriendlyWrt的使用

1.1 FriendlyWrt简介

FriendlyWrt是友善电子基于OpenWrt定制的系统,完全开源,用于企业物联网二次开发,个人定制NAS,家庭物联网网关等。

1.2 帐户与密码

默认是空密码,请为root设置一个密码用于web登录与ssh登录。

1.3 软件包管理

FriendlyWrt使用opkg工具来管理软件包,执行如下命令可以获取opkg的帮助信息:

$ opkg
Package Manipulation:
        update                  Update list of available packages
        upgrade <pkgs>          Upgrade packages
        install <pkgs>          Install package(s)
        configure <pkgs>        Configure unpacked package(s)
        remove <pkgs|regexp>    Remove package(s)
        flag <flag> <pkgs>      Flag package(s)
         <flag>=hold|noprune|user|ok|installed|unpacked (one per invocation)
 
Informational Commands:
        list                    List available packages
        list-installed          List installed packages
        list-upgradable         List installed and upgradable packages
        list-changed-conffiles  List user modified configuration files
        files <pkg>             List files belonging to <pkg>
        search <file|regexp>    List package providing <file>
        find <regexp>           List packages whose name or description matches <regexp>
        info [pkg|regexp]       Display all info for <pkg>
        status [pkg|regexp]     Display all status for <pkg>
        download <pkg>          Download <pkg> to current directory
...

上面只截取了部分帮助信息,请自行查阅完整的帮助信息,下面会描述几个常用的opkg命令。

  • 更新可用软件包列表

第一次安装软件前,建议先更新可用软件包列表:

$ opkg update
  • 查看可安装的软件包:
$ opkg list

本WiKi编写时,可安装的软件包共有3241个。

  • 查看已安装的软件:
$ opkg list-installed

本WiKi编写时,已安装的软件包共有124个。

  • 安装/删除软件:
$ opkg install <pkgs>
$ opkg remove <pkgs>
  • 查看已安装的软件包含什么文件:
$ opkg files <pkg>
  • 安装LuCI中文语言包:
$ opkg install luci-i18n-base-zh-cn
  • 查看当前系统中哪些配置文件被修改过:
$ opkg list-changed-conffiles

1.4 查看系统状态

  • 命令行查看CPU温度和频率
$ cpu_freq 
Aavailable frequency(KHz):
        480000 624000 816000 1008000
Current frequency(KHz):
        CPU0 online=1 temp=26548C governor=ondemand freq=624000KHz
        CPU1 online=1 temp=26548C governor=ondemand freq=624000KHz
        CPU2 online=1 temp=26548C governor=ondemand freq=624000KHz
        CPU3 online=1 temp=26548C governor=ondemand freq=624000KHz

上述信息表示当前有4个CPU核在线, 温度均约为26.5摄氏度, 运行的策略均为根据需求来决定运行频率, 当前的运行频率均为624MHz,设置频率的命令如下:

$ cpu_freq -s 1008000
Aavailable frequency(KHz):
        480000 624000 816000 1008000
Current frequency(KHz):
        CPU0 online=1 temp=36702C governor=userspace freq=1008000KHz
        CPU1 online=1 temp=36702C governor=userspace freq=1008000KHz
        CPU2 online=1 temp=36702C governor=userspace freq=1008000KHz
        CPU3 online=1 temp=36702C governor=userspace freq=1008000KHz

上述命令将4个CPU核的频率设置为1008MHz。

  • LuCI Web界面查看系统状态

登录LuCI界面后,点击顶部的 Statistics ---> Graphs,可以查看系统的各种软硬件状态信息(即statistics),例如:
1) 系统负载:
statistics_system_load
2) 内存:
statistics_memory
3) CPU温度:
statistics_thermal
Statistics界面对应软件包luci-app-statistics,luci-app-statistics软件包用Collectd工具收集状态数据并且用RRDtool工具将数据渲染为图表。
你可以通过安装额外的collectd-mod-*软件包去使能更多的statistics. 所有的collectd-mod-*软件包对应同一个配置文件: /etc/config/luci_statistics。

1.5 查看Network->Interfaces的配置

  • 登录LuCI界面后,点击顶部的 Network ---> Interfaces ,可以查看当前的网络设置:
  • Network -> Interfaces 界面的配置保存在/etc/config/network中。




1.6 使用USB WiFi

目前仅支持 RTL8821CU,即插即用,插入后默认设置为AP模式,热点名称为 "rtl8821cu-mac地址",密码为"password";

1.7 使用华为随行WiFi 2 mini(E8372H-155)

即插即用,插入后,热点名称为 "HUAWEI-8DA5",其他设备连接上该热点后就可以使用4G的流量上网了。