Difference between revisions of "Matrix - USB WiFi"

From FriendlyELEC WiKi
Jump to: navigation, search
(Created page with "English * NanoPi 2 Fire使用的固件跟NanoPi 2通用,为了不跟NanoPi 2的SD WiFi产生冲突,内核暂时不支持USB WiFi。如果需要给fi...")
 
(Download linux-firmware)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Matrix - USB WiFi|English]]
+
[[Matrix - USB WiFi/zh|查看中文]]
  
* NanoPi 2 Fire使用的固件跟NanoPi 2通用,为了不跟NanoPi 2的SD WiFi产生冲突,内核暂时不支持USB WiFi。如果需要给fire使用USB WiFi,可单独把USB WiFi编译进内核;
+
==Introduction==
* 由于市面上USB WiFi型号多达上百种,如果把全部USB WiFi驱动选上不太现实,所以这里只介绍一种的方法,其他USB WiFi型号 方法一样,可参看此处自行编译支持;
+
* Note: the following method applies to NanoPi M2 too。
 +
NanoPi 2 Fire runs the same image files the NanoPi 2 runs. In order not to conflict with the NanoPi 2's SD WiFi by default our kernel doesn't include support for USB WiFi. If you want to enable the support for USB WiFi you need to include this option in the kernel<br>
 +
We take one USB WiFi model as an example here to show how to enable its support in the kernel:
 +
* USB WiFi chip: RT3070;<br>
 +
* WiFi protocol: - IEEE 802.11b/g/n;<br>
 +
* OS: Debian;
 +
* Before you start it please make an installation TF card for the NanoPi 2 Fire by following the instructions on the wiki:[NanoPi_2_Fire]
  
此处使用的USB WiFi接口:2.0
+
==Download Kernel Source Code==
芯片:RTL8192CU
+
无线标准: - IEEE 802.11b/g/n
+
  
1、根据维基教程把开发环境搭建好后,把NanoPi 2 Fire 的内核源码克隆回来:<br>
+
Please download the NanoPi 2 Fire's kernel source code:<br>
编译Debian内核:
+
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
git clone https://github.com/friendlyarm/linux-3.4.y.git
 
git clone https://github.com/friendlyarm/linux-3.4.y.git
Line 15: Line 18:
 
git checkout nanopi2-lollipop-mr1
 
git checkout nanopi2-lollipop-mr1
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
The NanoPi 2 Fire's kernel source code lies in the "nanopi2-lollipop-mr1" branch<br>
  
NanoPi2内核所属的分支是nanopi2-lollipop-mr1,在开始编译前先切换分支。<br>
+
==Add USB WiFi in Menuconfig==
<syntaxhighlight lang="bash">
+
Add the WIFI support in the kernel and compile
make nanopi2_linux_defconfig
+
touch .scmversion
+
make uImage
+
</syntaxhighlight>
+
 
+
编译成功结束后,新生成的内核烧写文件为 arch/arm/boot/uImage,此内核支持HDMI 720p输出,用于替换掉SD卡boot分区下的uImage.hdmi,拷贝完之后,记住执行sync确保拷贝成功。<br>
+
 
+
2、如果需要支持USB WiFi,则重新配置内核配置单后编译:
+
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
touch .scmversion
 
touch .scmversion
 
make nanopi2_linux_defconfig
 
make nanopi2_linux_defconfig
 
make menuconfig
 
make menuconfig
      Device Drivers  -->
+
  [*] Networking support  -->                               
              [ * ] Network device support  -->                     
+
      -*- Wireless  -->
                      [ * ] Wireless LAN   -->                                   
+
          [*] Generic IEEE 802.11 Networking Stack (mac80211)
                              [ * ] Ralink driver support  -->
+
  Device Drivers  -->
                                      [M] Ralink rt27xx/rt28xx/rt30xx (USB) support                   
+
      [*] Network device support  -->                     
                                      [ * ] rt2800usb - Include support for rt33xx devices
+
          [*] Wireless LAN -->                                   
                                      [ * ] rt2800usb - Include support for rt35xx devices
+
              [*] Ralink driver support  -->
 
+
                  [*] Ralink rt27xx/rt28xx/rt30xx (USB) support                   
         
+
                  [*]   rt2800usb - Include support for rt33xx devices
        [*] Networking support  -->                               
+
                  [*]   rt2800usb - Include support for rt35xx devices
                -*- Wireless  -->
+
                            [ * ] Generic IEEE 802.11 Networking Stack (mac80211)
+
 
make uImage
 
make uImage
 
</syntaxhighlight>
 
</syntaxhighlight>
 
+
After your compilation succeeds a uImage will be generated in the "arch/arm/boot/uImage" directory. You can use it to replace the existing uImage.hdmi.<br>
+
<syntaxhighlight lang="bash">
使用新生成的uImage替换掉SD卡boot分区下的uImage.hdmi即可获得HDMI 1080p输出。<br>
+
sync
 
+
</syntaxhighlight>
如果要编译支持LCD显示的内核,则需要修改内核配置:
+
If you want to generate a kernel for LCD you can do it this way:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
touch .scmversion
 
touch .scmversion
make nanopi2_linux_defconfig
 
 
make menuconfig
 
make menuconfig
        Device Drivers -->
+
  Device Drivers -->
                Graphics support -->
+
    Graphics support -->
                        Nexell Graphics -->
+
      Nexell Graphics -->
                                  [*] LCD
+
        [*] LCD
                                  [ ] HDMI
+
        [ ] HDMI
 
mak uImage
 
mak uImage
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
After your compilation succeeds a uImage will be generated for LCD. You can use it to replace the existing uImage.<br>
  
 
+
==Download linux-firmware==
启用LCD,同时取消HDMI,然后退出并保存配置,编译后即可获得支持LCD显示的uImage,用于替换SD卡boot分区下的uImage。<br>
+
Insert your SD card to the board, connect the board to the internet and run the following commands to install RT3070's firmware:<br>
 
+
3、将做好的启动卡根据维基的方法进行分区,分区后启动把卡插进开发板上电启动(板子需要接上网线);<br>
+
 
+
4、我们提供的是标准的Debian jessie系统,需要先运行以下步骤:
+
 
+
* 板子启动后,先更改Debian系统的源,需要编辑 /etc/apt/sources.list 更换一个更快的源服务器,这个网址[http://www.debian.org/mirror/list]有一份完整的源镜像服务器列表,注意要选用一个带armhf架构的。
+
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
apt-get update
 
apt-get update
apt-get install linux-firmware
+
apt-get install firmware-ralink
 +
</syntaxhighlight>
 +
If your USB WiFi is not based on RT3070 you may try installing all the firmwares:<br>
 +
<syntaxhighlight lang="bash">
 +
apt-get install firmware-*
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
After your compilation succeeds plug a USB WiFi and you can play with it now
  
5、安装成功后,接上USB WiFi,板子即能识别到USB WiFi。
+
==Update Log==
 +
===Mar-09-2016===
 +
* Released English version

Latest revision as of 11:01, 9 March 2016

查看中文

1 Introduction

  • Note: the following method applies to NanoPi M2 too。

NanoPi 2 Fire runs the same image files the NanoPi 2 runs. In order not to conflict with the NanoPi 2's SD WiFi by default our kernel doesn't include support for USB WiFi. If you want to enable the support for USB WiFi you need to include this option in the kernel
We take one USB WiFi model as an example here to show how to enable its support in the kernel:

  • USB WiFi chip: RT3070;
  • WiFi protocol: - IEEE 802.11b/g/n;
  • OS: Debian;
  • Before you start it please make an installation TF card for the NanoPi 2 Fire by following the instructions on the wiki:[NanoPi_2_Fire]

2 Download Kernel Source Code

Please download the NanoPi 2 Fire's kernel source code:

git clone https://github.com/friendlyarm/linux-3.4.y.git
cd linux-3.4.y
git checkout nanopi2-lollipop-mr1

The NanoPi 2 Fire's kernel source code lies in the "nanopi2-lollipop-mr1" branch

3 Add USB WiFi in Menuconfig

Add the WIFI support in the kernel and compile

touch .scmversion
make nanopi2_linux_defconfig
make menuconfig
  [*] Networking support  -->                                 
      -*- Wireless  -->
          [*] Generic IEEE 802.11 Networking Stack (mac80211) 
  Device Drivers  -->
      [*] Network device support  -->                     
          [*] Wireless LAN  -->                                  
              [*] Ralink driver support  -->
                  [*] Ralink rt27xx/rt28xx/rt30xx (USB) support                  
                  [*]   rt2800usb - Include support for rt33xx devices
                  [*]   rt2800usb - Include support for rt35xx devices
make uImage

After your compilation succeeds a uImage will be generated in the "arch/arm/boot/uImage" directory. You can use it to replace the existing uImage.hdmi.

sync

If you want to generate a kernel for LCD you can do it this way:

touch .scmversion
make menuconfig
  Device Drivers -->
    Graphics support -->
      Nexell Graphics -->
        [*] LCD
        [ ] HDMI
mak uImage

After your compilation succeeds a uImage will be generated for LCD. You can use it to replace the existing uImage.

4 Download linux-firmware

Insert your SD card to the board, connect the board to the internet and run the following commands to install RT3070's firmware:

apt-get update
apt-get install firmware-ralink

If your USB WiFi is not based on RT3070 you may try installing all the firmwares:

apt-get install firmware-*

After your compilation succeeds plug a USB WiFi and you can play with it now

5 Update Log

5.1 Mar-09-2016

  • Released English version