Difference between revisions of "Template:FriendlyCoreGeneral/zh"

From FriendlyELEC WiKi
Jump to: navigation, search
(Work with FriendlyCore)
(updated by API)
Line 1: Line 1:
==Work with FriendlyCore==
+
==FriendlyCore的使用==
===Introduction===
+
===介绍===
FriendlyCore is a light Linux system without X-windows, based on ubuntu core, It uses the Qt-Embedded's GUI and is popular in industrial and enterprise applications.
+
FriendlyCore,是一个没有X-windows环境,基于Ubuntu core构建的系统,使用Qt-Embedded作为图形界面的轻量级系统,兼容Ubuntu系统软件源,非常适合于企业用户用作产品的基础OS。
  
Besides the regular Ubuntu core's features our FriendlyCore has the following additional features:
+
本系统除了保留Ubuntu Core的特性以外,还包括以下特性:
* it supports our LCDs with both capacitive touch and resistive touch(S700, X710, HD702, S430, HD101 and S70)
+
* 支持电容和电阻触摸屏 (型号:S700, X710, S70, HD702, S430, HD101, S70等友善推出的LCD屏)
* it supports WiFi
+
* 支持WiFi连接
* it supports Ethernet
+
* 支持以太网连接
* it supports Bluetooth and has been installed with bluez utilities
+
* 支持蓝牙,已预装bluez等相关软件包
* it supports audio playing
+
* 支持音频播放
* it supports Qt5.9 EGLES and OpenGL ES1.1/2.0 (Only for S5P4418/S5P6818)
+
* 支持Qt5.9 EGLES和OpenGL ES1.1/2.0 (限S5P4418/S5P6818平台)
  
===FriendlyCore's User Accounts===
+
===运行FriendlyCore===
* If your board is connected to an HDMI monitor you need to use a USB mouse and keyboard.
+
* 要在电视上进行操作,你需要连接USB鼠标和键盘。
* If you want to do kernel development you need to use a serial communication board, ie a PSU-ONECOM board, which will allow you to operate the board via a serial terminal.Here is a setup where we connect a board to a PC via the PSU-ONECOM and you can power on your board from either the PSU-ONECOM or its MicroUSB:
+
* 如果您需要进行内核开发,你最好选购一个串口配件,连接了串口,则可以通过串口终端对开发板进行操作。<br />
 +
以下是串口配件的接法,接上串口,即可调试。<br />
 +
接上串口后,你可以选择从串口模块的DC口或者从MicroUSB口 (如果有) 进行供电:<br />
 
[[File:PSU-ONECOM-NEO-Plus2.jpg|frameless|400px|PSU-ONECOM-NEO_Plus2]]<br>
 
[[File:PSU-ONECOM-NEO-Plus2.jpg|frameless|400px|PSU-ONECOM-NEO_Plus2]]<br>
You can use a USB to Serial conversion board too. <br>
+
也可以使用USB转串口模块调试,请注意需要使用5V/2A电源从NanoPi NEO Plus2的MicroUSB口给NEO Plus2供电:<br>
Make sure you use a 5V/2A power to power your board from its MicroUSB port:<br>
+
 
[[File:USB2UART-NEO-Plus2.jpg|frameless|400px|USB2UART-NEO-Plus2]]
 
[[File:USB2UART-NEO-Plus2.jpg|frameless|400px|USB2UART-NEO-Plus2]]
  
* FriendlyCore User Accounts:
+
* FriendlyCore默认帐户:
Non-root User:
+
普通用户:
     User Name: pi
+
     用户名: pi
     Password: pi
+
     密码: pi
Root:
+
    User Name: root
+
    Password: fa
+
  
The system is automatically logged in as "pi". You can do "sudo npi-config" to disable auto login.
+
Root用户:
 +
    用户名: root
 +
    密码: fa
  
* Update packages
+
默认会以 pi 用户自动登录,你可以使用 sudo npi-config 命令取消自动登录。
 +
 
 +
* 更新软件包:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ sudo apt-get update
 
$ sudo apt-get update
 
</syntaxhighlight>
 
</syntaxhighlight>
  
===Configure System with npi-config===
+
===使用npi-config配置系统===
The npi-config is a commandline utility which can be used to initialize system configurations such as user password, system language, time zone, Hostname, SSH switch , Auto login and etc. Type the following command to run this utility.
+
npi-config是一个命令行下的系统配置工具,可以对系统进行一些初始化的配置,可配置的项目包括:用户密码、系统语言、时区、Hostname、SSH开关、自动登录选项等,在命令行执行以下命令即可进入:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ sudo npi-config
 
$ sudo npi-config
 
</syntaxhighlight>
 
</syntaxhighlight>
Here is how npi-config's GUI looks like:<br />
+
npi-config的显示界面如下所示:<br />
 
[[File:npi-config.jpg|frameless|500px|npi-config]]<br />
 
[[File:npi-config.jpg|frameless|500px|npi-config]]<br />
  
===Extend TF Card's Section===
+
===扩展TF卡文件系统===
When FriendlyCore is loaded the TF card's section will be automatically extended.You can check the section's size by running the following command:
+
第一次启动FriendlyCore系统时,系统会自动扩展文件系统分区,请耐心等待,TF卡/eMMC的容量越大,需要等待的时间越长,进入系统后执行下列命令查看文件系统分区大小:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
$ df -h
+
df -h
 
</syntaxhighlight>
 
</syntaxhighlight>
  
===WiFi===
+
===连接WiFi===
You can use the NetworkManager utility in FriendlyCore to manager its network. You can run "nmcli" in the commandline utility to start it. Here are the commands to start a WiFi connection:
+
 
* Check device list
+
FriendlyCore 使用 NetworkManager 工具来管理网络,其在命令行下对应的命令是 nmcli,要连接WiFi,相关的命令如下:
 +
* 查看网络设备列表
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
sudo nmcli dev
+
$ sudo nmcli dev
 
</syntaxhighlight>
 
</syntaxhighlight>
Note: if the status of a device is "unmanaged" it means that device cannot be accessed by NetworkManager. To make is accessed you need to clear the settings under "/etc/network/interfaces" and reboot your system.
+
注意,如果列出的设备状态是 unmanaged 的,说明网络设备不受NetworkManager管理,你需要清空 /etc/network/interfaces下的网络设置,然后重启.
  
* Start WiFi
+
* 开启WiFi
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
sudo nmcli r wifi on
+
$ sudo nmcli r wifi on
 
</syntaxhighlight>
 
</syntaxhighlight>
  
* Scan Surrounding WiFi Sources
+
* 扫描附近的 WiFi 热点
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
sudo nmcli dev wifi
+
$ sudo nmcli dev wifi
 
</syntaxhighlight>
 
</syntaxhighlight>
  
* Connect to a WiFi Source
+
* 连接到指定的 WiFi 热点
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
sudo nmcli dev wifi connect "SSID" password "PASSWORD"
+
$ sudo nmcli dev wifi connect "SSID" password "PASSWORD"
 
</syntaxhighlight>
 
</syntaxhighlight>
The "SSID" and "PASSWORD" need to be replaced with your actual SSID and password.If you have multiple WiFi devices you need to specify the one you want to connect to a WiFi source with iface<br />
+
请将 SSID和 PASSWORD 替换成实际的 WiFi名称和密码。<br />
If a connection succeeds it will be automatically setup on next system reboot.<br />
+
连接成功后,下次开机,WiFi 也会自动连接。<br />
 
<br />
 
<br />
For more details about NetworkManager refer to this link: [[Use NetworkManager to configure network settings]]<br />
+
更详细的NetworkManager使用指南可参考这篇文章: [[Use NetworkManager to configure network settings]]<br />
  
* Use USB WiFi
+
* 使用USB WiFi
Our OS system has support for popular USB WiFi drivers. Many USB WiFi modules are plug and play with our system. Here is a list of models we tested;
+
系统已经支持市面上众多常见的USB WiFi,已测试过的USB WiFi型号如下:
 
::{| class="wikitable"
 
::{| class="wikitable"
 
|-
 
|-
|Number||Model        
+
|序号||型号        
 
|-
 
|-
|1  ||  RTL8188CUS 802.11n WLAN Adapter     
+
|1  ||  RTL8188CUS/8188EU 802.11n WLAN Adapter     
 
|-
 
|-
 
|2  ||  RT2070 Wireless Adapter     
 
|2  ||  RT2070 Wireless Adapter     
Line 89: Line 92:
 
|4  ||  RTL8192CU Wireless Adapter
 
|4  ||  RTL8192CU Wireless Adapter
 
|-
 
|-
|5  ||  mi WiFi mt7601
+
|5  ||  小米WiFi mt7601
 
|}
 
|}
  
===Ethernet Connection===
+
===连接以太网===
If a board is connected to a network via Ethernet before it is powered on it will automatically obtain an IP with DHCP activated after it is powered up. If you want to set up a static IP refer to: [[Use NetworkManager to configure network settings]].
+
  
===Bluetooth===
+
默认插上网线开机,会自动连接并通过DHCP获取IP地址,如需要配置静态IP地址,请参考 NetworkManager 的相关文档:  [[Use NetworkManager to configure network settings]]。
If your board has an onboard bluetooth module you can search for surrounding bluetooth devices by running the following command:<br/>
+
 
 +
===使用蓝牙===
 +
 
 +
如果你的开发板板载有蓝牙模块,可输入以下命令搜索周边的蓝牙设备:<br />
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
hcitool scan
 
hcitool scan
 
</syntaxhighlight>
 
</syntaxhighlight>
You can run "hciconfig" to check bluetooth's status.
 
  
===Play Audio===
+
使用hciconfig命令来了解接口的状态。
You can play an audio file by running the following command:
+
 
 +
 
 +
===播放音频===
 +
 
 +
在串口终端执行以下aplay命令播放一段音频:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
aplay -t raw -c 2 -f S16_LE -r 44100 /root/test.pcm
 
aplay -t raw -c 2 -f S16_LE -r 44100 /root/test.pcm
 
</syntaxhighlight>
 
</syntaxhighlight>
  
===HDMI Audio Output===
+
===HDMI输出声音===
Our system's default audio output is the 3.5mm audio jack. You can turn on the HDMI audio by editing the /etc/asound.conf file:
+
系统默认从3.5mm耳机座输出声音,想从HDMI输出需要修改文件系统上的配置文件/etc/asound.conf如下:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
pcm.!default {
 
pcm.!default {
Line 122: Line 130:
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
card 0 points to the 3.5mm audio jack and card 1 points to the HDMI audio. You need to save your changes and reboot your system to make your changes take effect.
+
card 0代表3.5mm耳机孔,card 1代表HDMI音频。设置完成后需要重启系统才能生效。
  
===Connect to USB Camera(FA-CAM202)===
+
===连接USB摄像头模块(FA-CAM202)===
The FA-CAM202 is a 200M USB camera.<br>
+
FA-CAM202是一款200万像素的USB摄像头模块。<br>
Refer to this link for more details on how to connect to a FA-CAM202:
+
连接测试USB摄像头的方法请参考:[[NanoPi_M1/zh#.E8.BF.9E.E6.8E.A5DVP.E6.91.84.E5.83.8F.E5.A4.B4.E6.A8.A1.E5.9D.97.28CAM500B.29_2|连接DVP摄像头模块(CAM500B)]] <br>
[[NanoPi_M1#Connect_NanoPi_M1_to_DVP_Camera_CAM500B|Connect NanoPi M1 to DVP Camera CAM500B]] <br>
+
  
===Develop Qt Application===
+
===开发自已的Qt应用===
Please refer to:  [[How to build Qt application]]
+
请参考 [[How to build Qt application]]
  
===Setup Program to AutoRun===
+
===开机自动运行Qt示例程序===
You can setup a program to autorun on system boot with npi-config:
+
使用npi-config工具进行开启:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
sudo npi-config
 
sudo npi-config
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Go to Boot Options -> Autologin -> Qt/Embedded, select Enable and reboot.
+
进入Boot Options -> Autologin -> Qt/Embedded,选择Enable然后重启即可。

Revision as of 07:14, 25 December 2017

1 FriendlyCore的使用

1.1 介绍

FriendlyCore,是一个没有X-windows环境,基于Ubuntu core构建的系统,使用Qt-Embedded作为图形界面的轻量级系统,兼容Ubuntu系统软件源,非常适合于企业用户用作产品的基础OS。

本系统除了保留Ubuntu Core的特性以外,还包括以下特性:

  • 支持电容和电阻触摸屏 (型号:S700, X710, S70, HD702, S430, HD101, S70等友善推出的LCD屏)
  • 支持WiFi连接
  • 支持以太网连接
  • 支持蓝牙,已预装bluez等相关软件包
  • 支持音频播放
  • 支持Qt5.9 EGLES和OpenGL ES1.1/2.0 (限S5P4418/S5P6818平台)

1.2 运行FriendlyCore

  • 要在电视上进行操作,你需要连接USB鼠标和键盘。
  • 如果您需要进行内核开发,你最好选购一个串口配件,连接了串口,则可以通过串口终端对开发板进行操作。

以下是串口配件的接法,接上串口,即可调试。
接上串口后,你可以选择从串口模块的DC口或者从MicroUSB口 (如果有) 进行供电:
PSU-ONECOM-NEO_Plus2
也可以使用USB转串口模块调试,请注意需要使用5V/2A电源从NanoPi NEO Plus2的MicroUSB口给NEO Plus2供电:
USB2UART-NEO-Plus2

  • FriendlyCore默认帐户:

普通用户:

   用户名: pi
   密码: pi

Root用户:

   用户名: root
   密码: fa

默认会以 pi 用户自动登录,你可以使用 sudo npi-config 命令取消自动登录。

  • 更新软件包:
$ sudo apt-get update

1.3 使用npi-config配置系统

npi-config是一个命令行下的系统配置工具,可以对系统进行一些初始化的配置,可配置的项目包括:用户密码、系统语言、时区、Hostname、SSH开关、自动登录选项等,在命令行执行以下命令即可进入:

$ sudo npi-config

npi-config的显示界面如下所示:
npi-config

1.4 扩展TF卡文件系统

第一次启动FriendlyCore系统时,系统会自动扩展文件系统分区,请耐心等待,TF卡/eMMC的容量越大,需要等待的时间越长,进入系统后执行下列命令查看文件系统分区大小:

df -h

1.5 连接WiFi

FriendlyCore 使用 NetworkManager 工具来管理网络,其在命令行下对应的命令是 nmcli,要连接WiFi,相关的命令如下:

  • 查看网络设备列表
$ sudo nmcli dev

注意,如果列出的设备状态是 unmanaged 的,说明网络设备不受NetworkManager管理,你需要清空 /etc/network/interfaces下的网络设置,然后重启.

  • 开启WiFi
$ sudo nmcli r wifi on
  • 扫描附近的 WiFi 热点
$ sudo nmcli dev wifi
  • 连接到指定的 WiFi 热点
$ sudo nmcli dev wifi connect "SSID" password "PASSWORD"

请将 SSID和 PASSWORD 替换成实际的 WiFi名称和密码。
连接成功后,下次开机,WiFi 也会自动连接。

更详细的NetworkManager使用指南可参考这篇文章: Use NetworkManager to configure network settings

  • 使用USB WiFi

系统已经支持市面上众多常见的USB WiFi,已测试过的USB WiFi型号如下:

序号 型号
1 RTL8188CUS/8188EU 802.11n WLAN Adapter
2 RT2070 Wireless Adapter
3 RT2870/RT3070 Wireless Adapter
4 RTL8192CU Wireless Adapter
5 小米WiFi mt7601

1.6 连接以太网

默认插上网线开机,会自动连接并通过DHCP获取IP地址,如需要配置静态IP地址,请参考 NetworkManager 的相关文档: Use NetworkManager to configure network settings

1.7 使用蓝牙

如果你的开发板板载有蓝牙模块,可输入以下命令搜索周边的蓝牙设备:

hcitool scan

使用hciconfig命令来了解接口的状态。


1.8 播放音频

在串口终端执行以下aplay命令播放一段音频:

aplay -t raw -c 2 -f S16_LE -r 44100 /root/test.pcm

1.9 HDMI输出声音

系统默认从3.5mm耳机座输出声音,想从HDMI输出需要修改文件系统上的配置文件/etc/asound.conf如下:

pcm.!default {
    type hw
    card 1
    device 0
}
 
ctl.!default {
    type hw
    card 1
}

card 0代表3.5mm耳机孔,card 1代表HDMI音频。设置完成后需要重启系统才能生效。

1.10 连接USB摄像头模块(FA-CAM202)

FA-CAM202是一款200万像素的USB摄像头模块。
连接测试USB摄像头的方法请参考:连接DVP摄像头模块(CAM500B)

1.11 开发自已的Qt应用

请参考 How to build Qt application

1.12 开机自动运行Qt示例程序

使用npi-config工具进行开启:

sudo npi-config

进入Boot Options -> Autologin -> Qt/Embedded,选择Enable然后重启即可。