# tar xf my_wlan0_hostap_conf_
.tar.xz -C /
为系统运行准备
MY-IMX6-EK200、EK314、EK336 上替换内核
# mount /dev/mmcblk3p1 /mnt/# cp ~/my-demo/zImage-myimx6a9-l4115-svn241 /mnt/zImage-myimx6a9
MY-IMX6-EK140P 上替换内核
# mount /dev/mmcblk1p1 /mnt/# cp ~/my-demo/zImage-myimx6a7-l4115-svn241 /mnt/zImage-myimx6a7
为 DHCP 创建文件
# touch /var/lib/misc/udhcpd.leases
写入存储并重启设备
# sync && reboot
MY-IMX6-EK200 Host-AP 使用步骤
加载 WIFI 模块的驱动# insmod ~/my-demo/MY_8188EUS_V4324_L4115_IMX6A9.koRTL871X: module init startRTL871X: rtl8188eu v4.3.24_16705.20160509bFWReady == _FALSE call reset 8051...RTL871X: hal_com_config_channel_plan chplan:0x08RTL871X: rtw_ndev_init(wlan0) if1 mac_addr=e0:b9:4d:7f:e4:40u***core: registered new interface driver rtl8188euRTL871X: module init ret=0==> rtl8188e_iol_efuse_patchIPv6: ADDRCONF(NETDEV_UP): wlan0: link is not readyRTL871X: set bssid:00:00:00:00:00:00
为 WLAN0 配置 IP 地址# ifconfig wlan0 192.168.12.1==> rtl8188e_iol_efuse_patchIPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
为 WLAN0 启用 DHCP 服务# udhcpd -f /etc/my_udhcpd.conf &[1] 773udhcpd (v1.24.1) started
为 WLAN0 启用 Host-AP 功能# hostapd /etc/my_hostapd_nl80211.conf -BConfigura
tion file: /etc/my_hostapd_nl80211.confrfkill: Cannot open RFKILL control deviceUsing interface wlan0 with hwaddr e0:b9:4d:7f:e4:40 and ssid "MY_WLAN0_HOSTAP"random: Cannot read from /dev/random: Resource temporarily unavailablerandom: Only 0/20 bytes of strong random data available from /dev/randomrandom: Not enough entropy pool available for sRTL871X: assoc successecure operationsWPA: Not enoughIPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready entropy in random pool for securRTL871X: set group key camid:1, addr:00:00:00:00:00:00, kid:1, type:AESe operations - update keys later when the first station connectswlan0: interface state UNINITIALIZED->ENABLEDwlan0: AP-ENABLED
客户端设备连接到 Host-AP
至此,开发板的 Host-AP 功能已启用,客户端设备可连接至此 AP。 需要说明的是,客户端设备(如手机)在首次连接 AP 成功前时可能会失败 0~2 次。
SSID
MY_WLAN0_HOSTAP
密码
myzr2012
设备连接成功时产生的信息Sending OFFER of 192.168.12.20Sending OFFER of 192.168.12.20Sending ACK to 192.168.12.20
设备断开连接时产生的信息RTL871X: OnDeAuth(wlan0) reason=3, ta=b4:0b:44:f5:64:2fRTL871X: clear key for addr:b4:0b:44:f5:64:2f, camid:4
MY-IMX6-EK140P Host-AP 使用步骤
加载 WIFI 模块的驱动# insmod ~/my-demo/MY_8188EUS_V4324_L4115_IMX6A7.koRTL871X: module init startRTL871X: rtl8188eu v4.3.24_16705.20160509bFWReady == _FALSE call reset 8051...RTL871X: hal_com_config_channel_plan chplan:0x20RTL871X: rtw_ndev_init(wlan0) if1 mac_addr=10:a4:be:0e:c2:32u***core: registered new interface driver rtl8188euRTL871X: module init ret=0root@myimx6ek140p:~# ==> rtl8188e_iol_efuse_patchIPv6: ADDRCONF(NETDEV_UP): wlan0: link is not readyRTL871X: set bssid:00:00:00:00:00:00
为 WLAN0 配置 IP 地址# ifconfig wlan0 192.168.12.1==> rtl8188e_iol_efuse_patchIPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
为 WLAN0 启用 DHCP 服务# udhcpd -f /etc/my_udhcpd.conf &[1] 613udhcpd (v1.24.1) started
为 WLAN0 启用 Host-AP 功能# hostapd /etc/my_hostapd_nl80211.conf -BConfiguration file: /etc/my_hostapd_nl80211.confrfkill: Cannot open RFKILL control deviceUsing interface wlan0 with hwaddr 10:a4:be:0e:c2:32 and ssid "MY_WLAN0_HOSTAP"random: Cannot read from /dev/random: Resource temporarily unavailablerandom: Only 0/20 bytes of strong random data available from /dev/randomrandom: Not enough entropy pool available for secure operationsWPA: Not enough entropy in random pool for secure operations - update keys latRTL871X: assoc successer when the first station connectIPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes readysRTL871X: set group key camid:1, addr:00:00:00:00:00:00, kid:1, type:AESwlan0: interface state UNINITIALIZED->ENABLEDwlan0: AP-ENABLED
客户端设备连接到 Host-AP
至此,开发板的 Host-AP 功能已启用,客户端设备可连接至此 AP。 需要说明的是,客户端设备(如手机)在首次连接 AP 成功前时可能会失败 0~2 次。
SSID
MY_WLAN0_HOSTAP
密码
myzr2012
设备连接成功时产生的信息Sending OFFER of 192.168.12.20Sending OFFER of 192.168.12.20Sending ACK to 192.168.12.20
设备断开连接时产生的信息RTL871X: OnDeAuth(wlan0) reason=3, ta=b4:0b:44:f5:64:2fRTL871X: clear key for addr:b4:0b:44:f5:64:2f, camid:4