本文主要是介绍android wifi断开原因分析,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
最近在解bug的过程中经常遇到密码正确但处于saved的状态,总结原因有已下几种:1 在ASSOCIATING阶段由于丢包导致ASSOC REJECT
03-16 09:22:12.440 D/WifiMonitor( 924): Event [IFNAME=wlan0 CTRL-EVENT-DISCONNECTED bssid=08:cc:68:9e:ac:20 reason=3 locally_generated=1]
03-16 09:22:16.596 I/wpa_supplicant(23065): wlan0: CTRL-EVENT-ASSOC-REJECT bssid=0e:bd:51:c7:b6:33 status_code=1
2 在4WAY_HANDSHAKE阶段由于密码错误、丢帧或者弱信号丢包导致WRONG_KEY:
密码错误在4WAY_HANDSHAKE阶段中的2/4次握手会显示wrong key。
如果已经连接过则显示
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。
丢帧导致连接断开:
Line 127671:< 3>[86294.177961] wlan: [24597:E :PE ] limHandleMissedBeaconInd: 2121: Sending EXIT_BMPS_IND to SME due to Missed beacon from FW
信号弱导致断开:
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表示因为信号弱而断开。
3 4WAY_HANDSHAK成功但DHCP FAILURE
四步握手成功但获取IP地址失败
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
4 被AP踢出,这个原因需要sniffer log分析
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
5 在信号相差5-10rssi的时候会发生roam,roam是在firmware层发生的,不会断开。
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=]
6 在打开auoto join的情况下,也会发生roam,也不会断开
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 -> 1000
这篇关于android wifi断开原因分析的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!