wpa\_supplicant故障与调试

问题1:没有在后台运行的错误

1
Failed to connect to non-global ctrl_ifname: (nil) error: No such file or directory

解决方法:让wpa_supplicant运行在后台

问题2:传参有问题

1
Failed to connect to non-global ctrl_ifname: wlan0  error: No such file or directory

解决方法:-i指定的参数所在的设备名错误,可以通过ifconfig查看以后自行改正,一般是因为没有正确的网卡驱动。

问题3:服务多开导致的问题

1
2
3
4
5
6
ctrl_iface exists and seems to be in use - cannot override it 
Delete ‘/var/run/wpa_supplicant/wlo1’ manually if it is not used anymore
Failed to initialize control interface ‘/var/run/wpa_supplicant’.
You may have another wpa_supplicant process already running or the file was
left by an unclean termination of wpa_supplicant in which case you will need
to manually remove this file before starting wpa_supplicant again.

解决方法:系统已经存在打开的多个wpa_supplicant实例,执行killall wpa_supplicant杀死所有wpa_supplicant即可

问题4:内核没有对应驱动导致的错误

1
rfkill: Cannot open RFKILL control device

解决方法:内核添加对应的驱动即可。

1
2
3
4
Networking support
<*> RF switch subsystem support --->
[*] Power off on suspend (NEW)
<*> Generic rfkill regulator driver

问题5:在ASSOCIATING阶段由于丢包导致ASSOC REJECT

1
2
Event [IFNAME=wlan0 CTRL-EVENT-DISCONNECTED bssid=08:cc:68:9e:ac:20 reason=3 locally_generated=1]
I/wpa_supplicant(23065): wlan0: CTRL-EVENT-ASSOC-REJECT bssid=0e:bd:51:c7:b6:33 status_code=1

解决方法:暂无

问题6:在4WA_HANDSHAKE阶段由于密码错误、丢帧或者弱信号丢包导致WRONG_KEY

  • 密码错误在4WAY_HANDSHAKE阶段中的2/4次握手会显示wrong key
1
01-01 23:19:01.778 I/wpa_supplicant(19043): wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=1 ssid="Onetouch Idol 3 (4.7)" > auth_failures=1 duration=5 reason=WRONG_KEY。
  • 丢帧导致连接断开
1
Line 127671:< 3>[86294.177961] wlan: [24597:E :PE ] limHandleMissedBeaconInd: 2121: Sending EXIT_BMPS_IND to SME due to Missed beacon from FW
  • 信号弱导致断开
1
2
3
4
5
02-28 21:56:59.703 I/wpa_supplicant(31023): wlan0: CTRL-EVENT-DISCONNECTED bssid=c8:3a:35:2b:71:30 reason=0

02-28 21:56:59.713 E/WifiStateMachine( 821): NETWORK_DISCONNECTION_EVENT in connected state BSSID=c8:3a:35:2b:71:30 RSSI=-89 freq=2437 was debouncing=false reason=0 ajst=0

# reason=0表示因为信号弱而断开。

解决方法:暂无

问题7:4WAY_HANDSHAK成功但DHCP FAILURE(四步握手成功但获取IP地址失败)

1
2
3
03-14 14:21:59.681 E/WifiStateMachine(28360): WifiStateMachine DHCP failure count=0

03-14 14:21:59.705 E/WifiConfigStore(28360): message=DHCP FAILURE

解决方法:暂无

问题8:被AP踢出,这个原因需要sniffer log分析

1
2
3
4
5
6
7
8
9
10
11
12
reason=2,reason=7,reason=15代表被AP踢出,在kernel log中可以找到对应的deauth信息。

03-14 14:21:29.932 I/wpa_supplicant(28064): wlan0: CTRL-EVENT-DISCONNECTED bssid=c4:14:3c:29:47:05 reason=7
< 3>[86553.353983] wlan: [28055:E :PE ] limProcessDeauthFrame: 144: Received Deauth frame for Addr: 44:a4:2d:52:bc:a5 (mlm state = eLIM_MLM_LINK_ESTABLISHED_STATE, sme state = 12 systemrole = 3) with reason code 7 from c4:14:3c:29:47:05

03-14 14:20:03.274 I/wpa_supplicant(28064): wlan0: CTRL-EVENT-DISCONNECTED bssid=1c:1d:86:e9:e2:85 reason=15

<3>[86568.199309] wlan: [28055:E :PE ] limProcessDeauthFrame: 144: Received Deauth frame for Addr: 44:a4:2d:52:bc:a5 (mlm state = eLIM_MLM_LINK_ESTABLISHED_STATE, sme state = 12 systemrole = 3) with reason code 15 from 1c:1d:86:e9:e2:85

03-14 13:42:24.354 I/wpa_supplicant(28064): wlan0: CTRL-EVENT-DISCONNECTED bssid=c4:14:3c:29:47:25 reason=2

< 3>[85195.665538] wlan: [28055:E :PE ] limProcessDeauthFrame: 144: Received Deauth frame for Addr: 44:a4:2d:52:bc:a5 (mlm state = eLIM_MLM_LINK_ESTABLISHED_STATE, sme state = 12 systemrole = 3) with reason code 2 from c4:14:3c:29:47:25

解决方法:暂无

问题9:在信号相差5-10rssi的时候会发生roam,roam是在firmware层发生的,不会断开

1
2
3
4
5
6
7
8
9
10
11
03-14 14:19:24.774 I/WifiHAL (28360): event received NL80211_CMD_ROAM, vendor_id = 0x0

03-14 14:19:24.781 I/wpa_supplicant(28064): wlan0: CTRL-EVENT-CONNECTED - Connection to c4:14:3c:29:47:25 completed [id=0 id_str=]

03-14 14:19:30.298 I/WifiHAL (28360): event received NL80211_CMD_ROAM, vendor_id = 0x0

03-14 14:19:30.316 I/wpa_supplicant(28064): wlan0: CTRL-EVENT-CONNECTED - Connection to c4:14:3c:29:47:05 completed [id=0 id_str=]

03-14 14:19:48.681 I/WifiHAL (28360): event received NL80211_CMD_ROAM, vendor_id = 0x0

03-14 14:20:00.162 I/wpa_supplicant(28064): wlan0: CTRL-EVENT-CONNECTED - Connection to 1c:1d:86:e9:e2:85 completed [id=0 id_str=]

解决方法:暂无

问题10:在打开auoto join的情况下,也会发生roam,也不会断开

1
2
3
4
5
6
7
03-14 12:09:32.171 E/WifiStateMachine(28360): WifiStateMachine shouldSwitchNetwork txSuccessRate=0.00 rxSuccessRate=0.00 delta 1000 -> 1000

03-14 12:09:34.505 I/wpa_supplicant(28064): wlan0: CTRL-EVENT-CONNECTED - Connection to 6c:99:89:b0:01:85 completed [id=0 id_str=]

03-14 12:09:55.132 I/wpa_supplicant(28064): wlan0: CTRL-EVENT-DISCONNECTED bssid=6c:99:89:b0:01:85 reason=0

03-14 13:10:51.805 E/WifiStateMachine(28360): WifiStateMachine shouldSwitchNetwork txSuccessRate=0.00 rxSuccessRate=0.00 delta 1000 -> 100

解决方法:暂无


转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 yxhlfx@163.com

文章标题:wpa\_supplicant故障与调试

本文作者:红尘追风

发布时间:2017-03-19, 21:32:17

原始链接:http://www.micernel.com/2017/03/19/wpa_supplicant%E6%95%85%E9%9A%9C%E4%B8%8E%E8%B0%83%E8%AF%95/

版权声明: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。

目录