Tag Archives: wpa_supplicant

Wpa_supplicant Debugging Failure Cause Analysis

Background

When using WPA_ When using the supplicant tool to debug Linux WiFi, we found some problems. For the record. Some problems are encountered and have been solved. Some problems are complicated and can only be used as ideas

Problems and Solutions

1. Error not running in the background 

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

solution: let WPA_ Supplicant runs in the background, for example:

nohup wpa_supplicant -c wpa.conf > /tmp/wpa_supplicant.log &

2

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

solution: - I the device name of the specified parameter is wrong. You can check it through ifconfig and correct it later. Generally, it is because there is no correct network card driver

3. Problems caused by multiple services

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. 

solution : multiple open wpas already exist in the system_ Supply instance, execute kill WPA_ Supplicant kill all WPA_ Supplicant is OK

4. Error caused by no corresponding driver in the kernel rfkill: cannot open rfkill control device solution: add the corresponding driver to the kernel

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

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

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

solutions

6. In 4way_ In the stage of handshake W Rong is caused by password error, frame loss or weak signal packet loss_ KEY

It can be divided into the following situations:

Password error in 4way_ Two out of four handshakes in the handshake phase will display wrong key

If it has been connected, it will display:

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。

Loss of frame results in disconnection:

Line 127671:< 3>[86294.177961] wlan: [24597:E :PE ] limHandleMissedBeaconInd: 2121: Sending EXIT_BMPS_IND to SME due to Missed beacon from FW

Disconnection due to weak signal:

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 means disconnected because of weak signal.

7:4WAY_ Hanshak succeeded but DHCP failure (four step handshake succeeded but IP address acquisition failed)

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. Being kicked out by AP requires sniffer log analysis 2

reason=2,reason=7,reason=15 means kicked out by AP, and the corresponding deauth information can be found in the kernel log.

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. Roam occurs when the signal difference is 5-10rssi. Roam occurs in the firmware layer and will not be disconnected

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. When auoto join is opened, roam will also occur and will not be disconnected 10

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

Raspberry pie “wlan0: not associated” error reporting solution

When ifconfig wlan0 is executed, the network card information of wlan0 is output.

When ifconfig WLAN 0 up is executed, there is no problem (that is, there is no output).

If you execute iwlist wlan0 scan | grep SSID you should be able to see the WiFi of the surrounding environment.

At this time, you only need to modify the network configuration information

Add a network slip:

wpa_passphrase "<ssid&>" "<password&>" &>&> /etc/wpa_supplicant/wpa_supplicant.conf

It will generate the following information, 64 bit PSK

network={
        ssid="ssid"
        #psk="password"
        psk=44116ea881531996d8a23af58b376d70f196057429c258f529577a26e727ec1b
}

You may need to delete or comment out the original (“#”)

Modified/etc/WPA_ supplicant/wpa_ supplicant.conf The raspberry pie will not take effect if the network configuration information is changed

If you want the configuration to take effect , you need to kill WPA_ Supply process and restart it.

killall wpa_supplicant 
 wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf

11:10 am E

>

References

1. http://www.varmain.com/index.php/post 38.html

2. https=/raspberrypi.stackexchange.com/questions/50967/raspi-3-wlan0-not-associated.