RTL8188EUS WIFI驱动编译与使用说明书
目录
一、源码编译
RTL8188EUS 无线模块基于USB协议接口,支持WLAN IEEE802.11n无线通信标准,驱动软件主要包含Driver模块、hostapd模块、wpa_supplicant配置工具模块等组成;其中、作为SoftAP模式还需配置DHCP服务器,提供AP客户端使用。
1.1 编译udhcpd
DHCP服务器软件,该源码在开源社区下载获得udhcp-0.9.8版本。修改Makefile配置arm-linux-gnueabihf编译器交叉编译生成udhcpd可执行程序。
![](https://img-blog.csdnimg.cn/img_convert/d2c81ae157983de798d99bb6eb8863d8.png)
交叉编译后生成arm格式可执行文件。
![](https://img-blog.csdnimg.cn/img_convert/bda5e90defcbb7390b321f9145b81994.png)
1.2 编译8188EUS
由于619Box开发板内核为Linux 4.9.88 ,WIFI驱动需要对应支持该版本。修个源码中Makefile文件,添加arm-linux-geabihf编译器和Linux 4.9.88驱动内核源码路径。
![](https://img-blog.csdnimg.cn/img_convert/746e72a57582a593c79abad0bf925f39.png)
编译完成生成arm格式的8188eu.ko驱动文件。
![](https://img-blog.csdnimg.cn/img_convert/baf4f9d44d6b7caabea9b9a6f762f5a1.png)
1.3 编译Hostapd
此模块编译需要libnl-3网络库,修改源码包Makefile文件,添加编译库lib和头文件include路径,添加交叉编译器arm-linux-gnueabihf。
执行编译配置make CC=/opt/ToolChain/arm-buildroot-linux-gnueabihf_sdk-buildroot/bin/arm-linux-cc
![](https://img-blog.csdnimg.cn/img_convert/d8263a68e7630f73c0f42bc75c64a9eb.png)
经交叉编译后生成arm格式hostpad文件。
![](https://img-blog.csdnimg.cn/img_convert/70916987f83c0171df847169feff5ad3.png)
1.4 编译libnl-3
获得源码后配置.configure文件 ,生成Makefile,执行make && make install ,交叉编译生成lib。编译libnl-3.0(libnl-3.3.25),配置生成Makefile,
./configure --prefix=/home/roy01/RTL8723DU_Driver/libnl-3.2.29/libnl_lib/ --host=arm-linux
执行交叉编译配置:
make CC=/opt/ToolChain/arm-buildroot-linux-gnueabihf_sdk-buildroot/bin/arm-linux-cc
编译安装:
make install
![](https://img-blog.csdnimg.cn/img_convert/431cafec96960031864041106bfa7ed8.png)
编译生成Lib文件。
![](https://img-blog.csdnimg.cn/img_convert/6d4402b0ddb64050c99e05b49743d336.png)
1.5 编译wpa_supplicant
修改源码包Makefile文件,添加编译库libnl-3.0 lib和头文件include路径,添加交叉编译器arm-linux-gnueabihf。
交叉编译执行命令:make CC=/opt/ToolChain/arm-buildroot-linux-gnueabihf_sdk-buildroot/bin/arm-linux-cc
![](https://img-blog.csdnimg.cn/img_convert/8da12e4c52a40e90658f75e6ce6e485c.png)
交叉编译完成生成wap_supplicant可执行程序。
![](https://img-blog.csdnimg.cn/img_convert/3b8583d6fe20372b8099f5dd054dd5b3.png)
二、使用配置
2.1 设置AP模式
配置DHCP服务器,命令格式:./udhcpd -fS udhcpd.conf &
配置udhcp.conf,添加IP地址起始地址段:”start 192.168.5.1 end 192.168.5.254”
![](https://img-blog.csdnimg.cn/img_convert/6f25ef102e76764dbfc0f9f1b204afd7.png)
开启hostapd 模式,命令格式:./hostapd ap.conf -B
Ap.conf配置文件,主要填写无线配置参数包含ssid,psk,80211nl标准等。
![](https://img-blog.csdnimg.cn/img_convert/64b14803e1f08ee7c35f481a71c66907.png)
配置网络接口,设置为网关模式。命令格式,ifconfig wlan0 192.168.5.1 netmask 255.255.255.0。
启动网卡,命令格式:ifconfig wlan0 up。
删除dhcp配置参数文件,命令格式rm -rf /var/lib/misc/* touch /var/lib/misc/udhcpd.leases。
设置hostapd自启动脚本,添加启动命令配置文件/etc/init.d/rcS.
添加启动命令:Source ./etc/619box_usb_wifi_setup.sh -m softap -d wlan0
![](https://img-blog.csdnimg.cn/img_convert/e3a1a79fc4f71055b31f7599593a23b8.png)
当hostapd启动后,WIFI会出现热点SSID,windows无线网络连接该热点,DHCP自动获取IP。
![](https://img-blog.csdnimg.cn/img_convert/30ef19ae3e9623f06e0d1a6caee81f8e.png)
获取ap 的IP地址,由AP端向客户端发送offer和ack消息。
![](https://img-blog.csdnimg.cn/img_convert/ab6ad85eec52c28de60851b71e24cd58.png)
客户端自动获取IP,则表明连接AP完成。
![](https://img-blog.csdnimg.cn/img_convert/b8691b939cc8af19c8d6aa503ba373d6.png)
使用ftp客户端工具连接到AP端,验证网络通讯正常。
![](https://img-blog.csdnimg.cn/img_convert/29f52d27e9911d1a72cb46d2687758c4.png)
2.2 设置station 模式
系统启动后,内核自动加载8188eus驱动,会出现网络接口wlan0。
![](https://img-blog.csdnimg.cn/img_convert/a77bceecb2ee1e524e743b45df0e329e.png)
配置无线账号,打开/etc/wpa_supplicant.conf添加WIFI账号SSID和psk。
![](https://img-blog.csdnimg.cn/img_convert/28ee3bf4a0e1f3f75765c16324d17381.png)
连接启动命令wpa_supplicant -D wext -c /etc/wpa_supplicant.conf -i wlan0 &,当打印信息提示” CTRL-EVENT-CONNECTED - Connection to”,则表明无线连接成功。
![](https://img-blog.csdnimg.cn/img_convert/4dbdd9e2bec47911126734a3f49e6ef7.png)
启用网卡,且自动获取ip,命令格式:ifconfig wlan0 up udhcpc -i wlan0
![](https://img-blog.csdnimg.cn/img_convert/891904a989eed5c9c05bcaea77bc2d35.png)
使用ftp客户端工具连接到Station端,验证网络通讯正常。
![](https://img-blog.csdnimg.cn/img_convert/933097f08dd98f2b8e9a60737b7606ab.png)