标签:
第一步:安装树莓派交叉编译环境
使用的环境:ubuntu13.04
1.下载交叉编译工具
wget https://s3.amazonaws.com/RTI/Community/ports/toolchains/raspbian-toolchain-gcc-4.7.2-linux32.tar.gz
2.解压到系统目录
tar -xvzf raspbian-toolchain-gcc-4.7.2-linux32.tar.gz -C /opt
3.把相应的路径添加到环境变量
vi /etc/profile
在最后一行添加
export PATH=$PATH:/opt/raspbian-toolchain-gcc-4.7.2-linux32/bin
第二步:编译内核
1.通过uname -r 查看树莓派当前内核版本(3.10.19+)
这里下载相应的树莓派内核 https://github.com/raspberrypi/linux/
2.解压内核
unzip linux-rpi-3.10.y.zip
3.编译
cd linux-rpi-3.10.y
export CCPREFIX=arm-linux-gnueabihf-
zcat /home/share/config.gz > .config (config.gz 来自于树莓派/proc/config.gz)
make ARCH=arm CROSS_COMPILE=${CCPREFIX} oldconfig
make ARCH=arm CROSS_COMPILE=${CCPREFIX}
第三步:编译小度wifi驱动
1.通过百度可以得知小度wifi使用的是MT7601的芯片
去MT官网下载相应驱动
http://www.mediatek.com/_cn/07_downloads/01_windows.php?sn=501
2.解压
3.编译
在树莓派上 lsusb 可以看到
pi@raspberrypi ~ $ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 2955:1001
百度把小度wifi的硬件ID改掉了
修改Makefile
ifeq ($(PLATFORM),PC)
# Linux 2.6
#LINUX_SRC = /lib/modules/$(shell uname -r)/build
LINUX_SRC = /home/xxx/linux-rpi-3.10.y #内核所在目录
# Linux 2.4 Change to your local setting
#LINUX_SRC = /usr/src/linux-2.4
LINUX_SRC_MODULE = /lib/modules/$(shell uname -r)/kernel/drivers/net/wireless/
CROSS_COMPILE =
endif
把硬件ID添加进去
vi common/rtusb_dev_id.c
添加:
make ARCH=arm CROSS_COMPILE=${CCPREFIX}
把这个驱动设置为开机启动
echo mt7601Usta >> /etc/modules (要有root权限)
现在reboot 启动之后 发现无线网卡已经识别出来了
eth0 Link encap:Ethernet HWaddr b8:27:eb:c1:87:4f
inet addr:192.168.1.9 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:300 errors:0 dropped:0 overruns:0 frame:0
TX packets:270 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:26153 (25.5 KiB) TX bytes:36419 (35.5 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:300 (300.0 B) TX bytes:300 (300.0 B)
ra0 Link encap:Ethernet HWaddr bc:96:80:22:b1:cc
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8756 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2270717 (2.1 MiB) TX bytes:0 (0.0 B)
小度Wifi,360随身Wifi2,小米Wifi树莓派驱动下载
标签:
原文地址:http://www.cnblogs.com/yangpeichang/p/5020940.html