通过wpa_cli命令连接不上wifi
本帖最后由 午夏时分 于 2023-3-7 11:15 编辑无法通过wpa_cli命令连接上WiFi,看Log上好像连了一次又断开了。之后再输入wpa_cli -i wlan0 enable_network 0没反应了。我也测试过其他几家主控平台的,好像都无法连接。所以想问下这个是android有什么机制吗?
疑问2:我试了一种方式,开启飞行模式之后,手动把驱动和wlan0重新起来,然后再启动wpa_supplicant服务。发现这种情况下是可以通过wpc_cli来连接wifi的,请问下为什么正常工作模式不能通过wpa_cli来连接,必须要飞行模式再去连接呢? 午夏时分 发表于 2023-3-7 11:10
可以复现情况的时候抓log看看,内核和上层都抓~ zhangzhenzhao 发表于 2023-3-7 11:23
可以复现情况的时候抓log看看,内核和上层都抓~
:/ # dmesg -C
:/ #
:/ #
:/ # logcat -c
:/ #
:/ #
:/ #
:/ #
:/ #
:/ #
:/ # logcat |grep wpa&
1428 1429
:/ #
:/ #
:/ #
:/ # wpa_cli
wpa_cli v2.8-devel-10
Copyright (c) 2004-2019, Jouni Malinen <j@w1.fi> and contributors
This software may be distributed under the terms of the BSD license.
See README for more details.
Using interface 'wlan0'
Interactive mode
>
>
> add_net
0
>
>
>
> set_network 0 ssid"Xiaomi_68A5"
OK
>
>
> set_network 0 key_mgmt WPA-PSK
OK
>
>
>
> set_network 0 psk"12345678"
OK
>
>
> enable_network 0
OK
<3>CTRL-EVENT-STATE-CHANGE id=-1 state=3 BSSID=00:00:00:00:00:00 SSID=
<3>CTRL-EVENT-SCAN-STARTED
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>Trying to associate with ec:41:18:e7:68:a6 (SSID='Xiaomi_68A5' freq=2417 MHz)
> 12-28 10:19:51.621 751 751 I wpa_supplicant: wlan0: Trying to associate with ec:41:18:e7:68:a6 (SSID='Xiaomi_68A5' freq=2417 MHz)
<3>CTRL-EVENT-STATE-CHANGE id=-1 state=5 BSSID=00:00:00:00:00:00 SSID=
<3>CTRL-EVENT-STATE-CHANGE id=0 state=6 BSSID=00:00:00:00:00:00 SSID=Xiaomi_68A5
<3>Associated with ec:41:18:e7:68:a6
> 12-28 10:19:51.705 751 751 I wpa_supplicant: wlan0: Associated with ec:41:18:e7:68:a6
<3>CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
> 12-28 10:19:51.706 751 751 I wpa_supplicant: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
<3>CTRL-EVENT-STATE-CHANGE id=0 state=7 BSSID=ec:41:18:e7:68:a6 SSID=Xiaomi_68A5
<3>WPA: RX message 1 of 4-Way Handshake from ec:41:18:e7:68:a6 (ver=2)
<3>WPA: Sending EAPOL-Key 2/4
12-28 10:19:51.808 751 751 I wpa_supplicant: wlan0: WPA: RX message 1 of 4-Way Handshake from ec:41:18:e7:68:a6 (ver=2)
> 12-28 10:19:51.808 751 751 I wpa_supplicant: wlan0: WPA: Sending EAPOL-Key 2/4
<3>WPA: RX message 3 of 4-Way Handshake from ec:41:18:e7:68:a6 (ver=2)
<3>WPA: Sending EAPOL-Key 4/4
> 12-28 10:19:51.834 751 751 I wpa_supplicant: wlan0: WPA: RX message 3 of 4-Way Handshake from ec:41:18:e7:68:a6 (ver=2)
12-28 10:19:51.834 751 751 I wpa_supplicant: wlan0: WPA: Sending EAPOL-Key 4/4
<3>CTRL-EVENT-STATE-CHANGE id=0 state=8 BSSID=ec:41:18:e7:68:a6 SSID=Xiaomi_68A5
<3>WPA: Key negotiation completed with ec:41:18:e7:68:a6
<3>CTRL-EVENT-CONNECTED - Connection to ec:41:18:e7:68:a6 completed
12-28 10:19:51.838 751 751 I wpa_supplicant: wlan0: WPA: Key negotiation completed with ec:41:18:e7:68:a6
<3>setprop vendor.wifi.state connected
<3>CTRL-EVENT-STATE-CHANGE id=0 state=9 BSSID=ec:41:18:e7:68:a6 SSID=Xiaomi_68A5
> 12-28 10:19:51.839 751 751 I wpa_supplicant: wlan0: CTRL-EVENT-CONNECTED - Connection to ec:41:18:e7:68:a6 completed
12-28 10:19:51.840 751 751 I wpa_supplicant: wlan0: setprop vendor.wifi.state connected
<3>CTRL-EVENT-DISCONNECTED bssid=ec:41:18:e7:68:a6 reason=3 locally_generated=1
<3>setprop vendor.wifi.state disconnected
> 12-28 10:19:51.856 751 751 I wpa_supplicant: wlan0: CTRL-EVENT-DISCONNECTED bssid=ec:41:18:e7:68:a6 reason=3 locally_generated=1
12-28 10:19:51.856 751 751 I wpa_supplicant: wlan0: setprop vendor.wifi.state disconnected
<3>CTRL-EVENT-STATE-CHANGE id=0 state=0 BSSID=ec:41:18:e7:68:a6 SSID=Xiaomi_68A5
>
>
>
>
>
>
>
>
>
>
>
> status
wpa_state=DISCONNECTED
p2p_device_address=24:b7:2a:df:3c:0f
address=24:b7:2a:df:3c:0e
uuid=2e365ec6-567b-5baa-9410-92697f52f34a
<3>CTRL-EVENT-STATE-CHANGE id=-1 state=0 BSSID=00:00:00:00:00:00 SSID=
>
>
>
>
> status
wpa_state=DISCONNECTED
p2p_device_address=24:b7:2a:df:3c:0f
address=24:b7:2a:df:3c:0e
uuid=2e365ec6-567b-5baa-9410-92697f52f34a
<3>CTRL-EVENT-STATE-CHANGE id=-1 state=0 BSSID=00:00:00:00:00:00 SSID=
>
>
>
>
>
> q
:/ #
:/ #
:/ #
:/ #
:/ #
:/ #
:/ #
:/ #
:/ #
:/ # dmesg
logd: logdr: UID=0 GID=0 PID=1428 b tail=0 logMask=19 pid=0 start=0ns timeout=0ns
healthd: battery none chg=a
>>> rwnx_cfg80211_scan()
>>> rwnx_send_scanu_req()
rwnx_send_msg (4104)SCANU_VENDOR_IE_CFM reqcfm:1 in_irq:0 in_softirq:0 in_atomic:0\x0d
rwnx_send_msg (4105)SCANU_START_CFM_ADDTIONAL reqcfm:1 in_irq:0 in_softirq:0 in_atomic:0\x0d
>>> rwnx_rx_scanu_start_cfm()
>>> rwnx_cfg80211_connect()
>>> rwnx_send_sm_connect_req()
rwnx_send_msg (6145)SM_CONNECT_CFM reqcfm:1 in_irq:0 in_softirq:0 in_atomic:0\x0d
>>> rwnx_rx_sm_connect_ind()
need cfm ethertype: 8e88,user_idx=1, skb=00000000738b0c47
sdio_host_tx_cfm_handler:used_idx=0, 0x00000000b2223747, status=9\x0d
need cfm ethertype: 8e88,user_idx=2, skb=00000000b5281073
>>> rwnx_cfg80211_add_key()
>>> rwnx_send_key_add()
rwnx_send_key_add: sta_idx:0 key_idx:0 inst_nbr:0 cipher:2 key_len:16
key: 00000000: 82 a3 d9 cb 1c 0f 53 26 03 07 6b d3 cb c1 f7 58......S&..k....X
rwnx_send_msg (37)MM_KEY_ADD_CFM reqcfm:1 in_irq:0 in_softirq:0 in_atomic:0\x0d
>>> rwnx_cfg80211_set_default_key()
>>> rwnx_cfg80211_add_key()
>>> rwnx_send_key_add()
rwnx_send_key_add: sta_idx:255 key_idx:1 inst_nbr:0 cipher:1 key_len:32
key: 00000000: b8 11 89 ee 88 be 7a a5 83 f2 90 99 48 f2 13 79......z.....H..y
key: 00000010: 57 c4 bb 9d 0f 21 f2 c9 8b 3c 55 3b a7 e8 22 5dW....!...<U;.."]
rwnx_send_msg (37)MM_KEY_ADD_CFM reqcfm:1 in_irq:0 in_softirq:0 in_atomic:0\x0d
sdio_host_tx_cfm_handler:used_idx=1, 0x00000000b2223747, status=9\x0d
selinux: avc:denied{ set } for property=vendor.wifi.state pid=751 uid=1010 gid=1010 scontext=u:r:hal_wifi_supplicant_default:s0 tcontext=u:object_r:vendor_hal_wifi_prop:s0 tclass=property_service permissive=1\x0a
>>> rwnx_send_me_set_control_port_req()
rwnx_send_msg (5125)ME_SET_CONTROL_PORT_CFM reqcfm:1 in_irq:0 in_softirq:0 in_atomic:0\x0d
>>> rwnx_cfg80211_disconnect()
>>> rwnx_send_sm_disconnect_req()
rwnx_send_msg (6148)SM_DISCONNECT_CFM reqcfm:1 in_irq:0 in_softirq:0 in_atomic:0\x0d
>>> rwnx_rx_sm_disconnect_ind()
deinit:macaddr:24,b7,2a,df,3c,e\x0d
>>> rwnx_cfg80211_del_key()
>>> rwnx_send_key_del()
rwnx_send_msg (39)MM_KEY_DEL_CFM reqcfm:1 in_irq:0 in_softirq:0 in_atomic:0\x0d
>>> rwnx_cfg80211_del_key()
>>> rwnx_send_key_del()
rwnx_send_msg (39)MM_KEY_DEL_CFM reqcfm:1 in_irq:0 in_softirq:0 in_atomic:0\x0d
>>> rwnx_cfg80211_del_key()
>>> rwnx_send_key_del()
rwnx_send_msg (39)MM_KEY_DEL_CFM reqcfm:1 in_irq:0 in_softirq:0 in_atomic:0\x0d
>>> rwnx_cfg80211_del_key()
>>> rwnx_send_key_del()
rwnx_send_msg (39)MM_KEY_DEL_CFM reqcfm:1 in_irq:0 in_softirq:0 in_atomic:0\x0d
>>> rwnx_cfg80211_del_key()
>>> rwnx_send_key_del()
rwnx_send_msg (39)MM_KEY_DEL_CFM reqcfm:1 in_irq:0 in_softirq:0 in_atomic:0\x0d
>>> rwnx_cfg80211_del_key()
>>> rwnx_send_key_del()
rwnx_send_msg (39)MM_KEY_DEL_CFM reqcfm:1 in_irq:0 in_softirq:0 in_atomic:0\x0d
:/ #
:/ #
:/ #
:/ #
:/ #
:/ #
:/ #
:/ #
:/ #
:/ # logcat
--------- beginning of system
12-28 10:19:00.001 393 474 V AlarmManager: setImplLocked type=3 ,when=227494
--------- beginning of main
12-28 10:19:00.006 542 542 D KeyguardClockSwitch: Updating clock: 10:19 AM
12-28 10:19:51.612 307 307 I wificond: Received external scan result notification from kernel.
12-28 10:19:51.613 393 667 D WificondControl: Scan result ready event
12-28 10:19:51.621 751 751 I wpa_supplicant: wlan0: Trying to associate with ec:41:18:e7:68:a6 (SSID='Xiaomi_68A5' freq=2417 MHz)
12-28 10:19:51.705 751 751 I wpa_supplicant: wlan0: Associated with ec:41:18:e7:68:a6
12-28 10:19:51.706 751 751 I wpa_supplicant: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
12-28 10:19:51.808 751 751 I wpa_supplicant: wlan0: WPA: RX message 1 of 4-Way Handshake from ec:41:18:e7:68:a6 (ver=2)
12-28 10:19:51.808 751 751 I wpa_supplicant: wlan0: WPA: Sending EAPOL-Key 2/4
12-28 10:19:51.834 751 751 I wpa_supplicant: wlan0: WPA: RX message 3 of 4-Way Handshake from ec:41:18:e7:68:a6 (ver=2)
12-28 10:19:51.834 751 751 I wpa_supplicant: wlan0: WPA: Sending EAPOL-Key 4/4
12-28 10:19:51.838 751 751 I wpa_supplicant: wlan0: WPA: Key negotiation completed with ec:41:18:e7:68:a6
12-28 10:19:51.839 751 751 I wpa_supplicant: wlan0: CTRL-EVENT-CONNECTED - Connection to ec:41:18:e7:68:a6 completed
12-28 10:19:51.840 751 751 I wpa_supplicant: wlan0: setprop vendor.wifi.state connected
12-28 10:19:51.846 393 487 W WifiClientModeImpl: Connected to unknown networkId -1, disconnecting...
12-28 10:19:51.851 393 412 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
12-28 10:19:51.856 751 751 I wpa_supplicant: wlan0: CTRL-EVENT-DISCONNECTED bssid=ec:41:18:e7:68:a6 reason=3 locally_generated=1
12-28 10:19:51.856 751 751 I wpa_supplicant: wlan0: setprop vendor.wifi.state disconnected
12-28 10:19:51.864 393 412 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false
12-28 10:19:51.872 213 575 I netd : interfaceGetCfg("wlan0") <0.66ms>
12-28 10:19:51.875 213 575 I netd : interfaceGetCfg("wlan0") <0.60ms>
12-28 10:20:00.001 393 474 V AlarmManager: setImplLocked type=3 ,when=287494
12-28 10:20:00.007 542 542 D KeyguardClockSwitch: Updating clock: 10:20 AM
^C
130|:/ #
130|:/ #
130|:/ # 1 是否更换了wifi模块?如果没有更换的话用官方固件试下
2 可以代码跟下这里看看
zhangzhenzhao 发表于 2023-3-7 14:30
1 是否更换了wifi模块?如果没有更换的话用官方固件试下
2 可以代码跟下这里看看
1.更换了WiFi模块的,现在用的是全志的AW869A模块,不过感觉跟更换模块应该没关系,这里应该是android的一种机制之类的。2.我在找这部分的内容看看 刚才试了下,如果自己到WiFi界面去手动连接上一次,让他记录下这个WiFi,再去操作wpa_cli的话倒是可以成功。
页:
[1]