您尚未登录。

楼主 #1 2020-05-27 11:57:44

拉轰的脚踏车
会员
注册时间: 2020-03-20
已发帖子: 288
积分: 222

我的A64 + AP6212 板子 wpa_supplicant 连 WIFI 热点正常,但是运行hostapd出错,请问这是为什么呢?

wpa_supplicant 一切正常:

# wpa_supplicant -i wlan0 -D nl80211 -c /etc/wpa_supplicant.conf -B
Successfully initialized wpa_supplicant


# udhcpc -i wlan0
udhcpc: started, v1.31.0
[   80.342527] random: mktemp: uninitialized urandom read (6 bytes read)
udhcpc: sending discover
udhcpc: sending select for 192.168.43.14
udhcpc: lease of 192.168.43.14 obtained, lease time 3599
deleting routers

运行 hostapd 出错:

# hostapd /etc/hostapd2.conf
Configuration file: /etc/hostapd2.conf
Could not read interface wlan0            flags: No such device
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlan0            disabled_11b_rates=0
Could not read interface wlan0            flags: No such device
nl80211 driver initialization failed.
wlan0           : interface state UNINITIALIZED->DISABLED
wlan0           : AP-DISABLED
wlan0           : CTRL-EVENT-TERMINATING
hostapd_free_hapd_data: Interface wlan0            wasn't started

/etc/hostapd2.conf 内容:

interface=wlan0
driver=nl80211
ssid=mywifi
channel=1
wmm_enabled=0
wpa=3
wpa_passphrase=wa12345678
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
auth_algs=1
macaddr_acl=0

离线

楼主 #2 2020-05-27 11:58:17

拉轰的脚踏车
会员
注册时间: 2020-03-20
已发帖子: 288
积分: 222

Re: 我的A64 + AP6212 板子 wpa_supplicant 连 WIFI 热点正常,但是运行hostapd出错,请问这是为什么呢?

离线

#3 2020-05-27 14:44:30

湘楚浪子
会员
注册时间: 2019-12-22
已发帖子: 40
积分: 39.5

Re: 我的A64 + AP6212 板子 wpa_supplicant 连 WIFI 热点正常,但是运行hostapd出错,请问这是为什么呢?

不会,帮顶→_→一下吧。

离线

#4 2020-05-27 16:55:02

流氓兔
会员
注册时间: 2020-02-01
已发帖子: 121
积分: 109.5

Re: 我的A64 + AP6212 板子 wpa_supplicant 连 WIFI 热点正常,但是运行hostapd出错,请问这是为什么呢?

特意试了一下我的华嵌S3, 也是AP6212同一个WIFI芯片, /etc/hostapd3.conf

interface=wlan0
ctrl_interface=/var/run/hostapd
beacon_int=100
dtim_period=1
preamble=0
#wps_state=2
#eap_server=1
ssid=test_device
max_num_sta=5
channel=1
hw_mode=g

手机可以发现 S3 wifi 热点:

# hostapd /etc/hostapd3.conf
Configuration file: /etc/hostapd3.conf
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr b0:02:47:30:fb:ea and ssid "test_device"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED 
wlan0: STA a4:45:19:d4:27:c5 IEEE 802.11: associated
wlan0: AP-STA-CONNECTED a4:45:19:d4:27:c5
wlan0: STA a4:45:19:d4:27:c5 IEEE 802.11: disassociated
wlan0: AP-STA-DISCONNECTED a4:45:19:d4:27:c5
wlan0: STA a4:45:19:d4:27:c5 IEEE 802.11: disassociated


^Cwlan0: interface state ENABLED->DISABLED
wlan0: AP-DISABLED 
wlan0: CTRL-EVENT-TERMINATING 
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
^C[ 2466.296698] brcmfmac: brcmf_cfg80211_stop_ap: SET SSID error (-110)
[ 2466.307040] brcmfmac: brcmf_cfg80211_stop_ap: BRCMF_C_DOWN error -512
[ 2466.313525] brcmfmac: brcmf_cfg80211_stop_ap: setting AP mode failed -110
[ 2466.320386] brcmfmac: brcmf_cfg80211_stop_ap: BRCMF_C_UP error -110
[ 2466.326711] brcmfmac: brcmf_set_mpc: fail to set mpc


然后继续测试手机连开发板的WIFI热点:

#设置wifi网卡固定IP地址
ifconfig wlan0 192.168.2.234 netmask 255.255.255.0 up

#启动dhcpd服务器, 手机连上热点之后可以自动获取到IP地址
dnsmasq -i wlan0 --dhcp-range=192.168.2.100,192.168.2.109,2h

完全OK了。



参考: https://whycan.cn/t_2091.html#p14615

离线

#5 2020-06-09 16:13:08

小智跑腿
会员
注册时间: 2020-04-26
已发帖子: 78
积分: 78

Re: 我的A64 + AP6212 板子 wpa_supplicant 连 WIFI 热点正常,但是运行hostapd出错,请问这是为什么呢?

分享一个我在X3 AP6212下面的WIFI热点设置:

先设置网卡ip地址:

ifconfig wlan0 192.168.10.1 netmask 255.255.255.0 up

再开启dhcpd服务器:

dnsmasq -i wlan0 --dhcp-range=192.168.10.100,192.168.10.109,2h

配置文件: etc/hostapd.conf

interface=wlan0
ctrl_interface=/var/run/hostapd
beacon_int=100
dtim_period=1
preamble=0
#wps_state=2
#eap_server=1
ssid=x3_smallwit
max_num_sta=5
channel=1
hw_mode=g

wpa=2
#wpa_psk_file=/etc/hostapd.wpa_psk
wpa_passphrase=smallwit
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
wpa_group_rekey=600
wpa_gmk_rekey=86400

然后执行: hostapd /etc/hostapd.conf

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn