一:下载资源
下载链接: RTL8188EUSlinux-v4.9相关资源资源-CSDN文库
rtl8188EUS_linux_v4.9-gb1925f81a.20210615.tar.gz
libnl-1.1.4.tar.gz
openssl-1.0.2n.tar.gz
wpa_supplicant_8_N_7.x_rtw_r24577.20171025-ram.tar.gz
二:配置内核
增加上述配置后重新编译内核
三:编译RTL8188EUS
1:解压rtl8188EUS_linux_v4.9-gb1925f81a.20210615.tar.gz 并进入目录
2:修改makefile
将我添加的mc6630平台配置对应更换成自己的
3:make
4:将生成的rtl8818eus_xxx.ko 拷贝到目标平台
四:移植hostapd和wpa_supplicant
1:移植libnl-1.1.4
sudo apt-get install -y byacc
sudo apt-get install -y flex
sudo apt-get install -y bison
sudo apt-get install -y libtool
tar zxvf libnl-1.1.4.tar.gz 并进入目录
./configure --host=arm CC=/opt/molchip/arm-molchip-linux/bin/arm-mol-linux-uclibcgnueabihf-gcc --prefix=$(pwd)/__install --enable-shared --enable-static
make && make install
将libnl.so.1拷贝到目标机
2:移植openssl-1.02n
tar zxvf openssl-1.0.2n.tar.gz 并进入目录
修改Makefie
删除CFLAG和SHARED_LDFLAGS中-m64 ,修改CC AR RANLIB NM
make&make install
3:移植hostapd (wpa_supplicant一样)
tar zxvf wpa_supplicant_8_N_7.x_rtw_r24577.20171025-ram.tar.gz
进入到hostapd目录下修改Makefile
make CC=arm-mol-linux-uclibcgnueabihf-gcc
将生成hostapd拷贝到目标机器
五:配置AP模式,开启DHCP服务
1:在开发板上插入rtl8188eus模块,lsusb 查看设备,如有有设备生成,说明usb部分及rtl8818模块正常
2:运行rtl8188驱动,insmod rtl8818eus_xxx.ko
3:配置网卡 ifconfig wlan0 192.168.2.1 up
4:新建rtl_hostapd_2G.conf文件,添加如下内容
##### hostapd configuration file ##############################################
interface=wlan0
ctrl_interface=/var/run/hostapd
ssid=rtwap
channel=6
wpa=2
wpa_passphrase=87654321
#bridge=br0
##### Wi-Fi Protected Setup (WPS) #############################################
eap_server=1
# WPS state
# 0 = WPS disabled (default)
# 1 = WPS enabled, not configured
# 2 = WPS enabled, configured
wps_state=2
uuid=12345678-9abc-def0-1234-56789abcdef0
# Device Name
# User-friendly description of device; up to 32 octets encoded in UTF-8
device_name=RTL8192CU
# Manufacturer
# The manufacturer of the device (up to 64 ASCII characters)
manufacturer=Realtek
# Model Name
# Model of the device (up to 32 ASCII characters)
model_name=RTW_SOFTAP
# Model Number
# Additional device description (up to 32 ASCII characters)
model_number=WLAN_CU
# Serial Number
# Serial number of the device (up to 32 characters)
serial_number=12345
# Primary Device Type
# Used format: <categ>-<OUI>-<subcateg>
# categ = Category as an integer value
# OUI = OUI and type octet as a 4-octet hex-encoded value; 0050F204 for
# default WPS OUI
# subcateg = OUI-specific Sub Category as an integer value
# Examples:
# 1-0050F204-1 (Computer / PC)
# 1-0050F204-2 (Computer / Server)
# 5-0050F204-1 (Storage / NAS)
# 6-0050F204-1 (Network Infrastructure / AP)
device_type=6-0050F204-1
# OS Version
# 4-octet operating system version number (hex string)
os_version=01020300
# Config Methods
# List of the supported configuration methods
config_methods=label display push_button keypad
##### default configuration #######################################
driver=nl80211
beacon_int=100
hw_mode=g
ieee80211n=1
wme_enabled=1
ht_capab=[SHORT-GI-20][SHORT-GI-40][HT40+]
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
max_num_sta=8
wpa_group_rekey=86400
5:新建 /var/run/hostapd 文件夹
6:新建udhcpd.conf配置文件,如下
start 192.168.2.2
end 192.168.2.254
interface wlan0
max_leases 234
opt router 192.168.2.1
7:开启dhcp服务,如果板子上直接有udcpd,则直接使用,没有则需要交叉编译udhcpd
udhcpd ./udhcpd.conf &
8:配置ap模式
./hostapd rtl_hostapd_2G.conf -B
即可生成名字为rtwap 密码为87654321的wifi热点
六:问题点
问题1:ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
Could not connect to kernel driver
解决办法:之前移植的hostapd版本太老,导致重新移植下载链接里的即可
问题2:rfkill: Cannot open RFKILL control device
解决办法:内核未配置rfkill引起,内核配置上rfkill即可解决
问题3:mkdir[ctrl_interface]: No such file or directory
解决办法:开发板没有/var/run/hostapd这个目录,新建这个目录即可,目录可在ctrl_interface=/var/run/hostapd 里修改