FS#29946 - [netcfg] wifi-menu failing to find networks
Attached to Project:
Arch Linux
Opened by Douglas McFadzean (ninian) - Saturday, 19 May 2012, 10:20 GMT
Last edited by Jouke Witteveen (jouke) - Thursday, 14 June 2012, 12:42 GMT
Opened by Douglas McFadzean (ninian) - Saturday, 19 May 2012, 10:20 GMT
Last edited by Jouke Witteveen (jouke) - Thursday, 14 June 2012, 12:42 GMT
|
Details
Description:
Computer #1: Dell Inspiron 1525 laptop with PRO/Wireless 3945ABG [Golan] wifi, using the driver: iwl3945 If already connected to a network, wifi-menu scans and shows networks correctly. But if not already connected, wifi-menu finds no networks. (NetworkManager appears to work perfectly.) Computer #2: Asus Eee PC 701SD netbook with Realtek RTL8187SE wifi, using driver: r8187se wifi-menu finds no networks when trying to scan. (NetworkManager appears to work perfectly.) Additional info: wifi-menu from netcfg 2.8.2 4 users currently report similar problems (https://bbs.archlinux.org/viewtopic.php?id=141476) Steps to reproduce: Try using wifi-menu to scan for networks, when 1) disconnected completely and 2) connected |
This task depends upon
Closed by Jouke Witteveen (jouke)
Thursday, 14 June 2012, 12:42 GMT
Reason for closing: Fixed
Additional comments about closing: 2e15a please mark the bbs thread as [SOLVED]
Thursday, 14 June 2012, 12:42 GMT
Reason for closing: Fixed
Additional comments about closing: 2e15a please mark the bbs thread as [SOLVED]
Basically wifi-menu brings the interface up and calls `wpa_cli scan`. I just noticed that the code paths used are currently not used by any other part of netcfg.
Is it possible that these cards are just plain slow?
Please report whether `wpa_cli -i wlan0 scan; sleep <time>; wpa_cli -i wlan0 scan_results` returns something useful for different values of <time> (suggestion: 1, 1.5, 2, 2.5, 3, 4, 5).
Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory
But wifi-select DOES scan and show the networks; 'iwlist wlan0 scan' works also
Try to precede testing by running something along the lines of `wpa_supplicant -B -i wlan0 -D nl80211,wext -C /run/wpa_supplicant`.
You can later kill the supplicant with `wpa_cli -i wlan0 terminate`.
The point of wifi-menu is to use netcfg and netcfg doesn't use iwlist as it is advised against using wireless_tools on a modern set-up.
On running your wpa_supplicant command, it worked but produced the message: nl80211: 'nl80211' generic netlink not found
Then trying the wpa_cli scan command for the first time, with sleep 1, I got:
OK
bssid / frequency / signal level / flags / ssid
but no networks were listed, just these headers.
However, on retrying with sleep 1 and above, the networks displayed okay.
Killed the supplicant and tried again: failed the first 3 times with sleep 1, and just showed headers with no networks. Seems okay now and with sleep 2 and above.
My computer is a Dell Latitude e5520 with Intel Corporation Centrino Advanced-N 6205 :
02:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)
I use the iwlwifi module.
I write a script to debug :
#/bin/bash
wpa_supplicant -B -P /run/wpa_supplicant_wlan0.pid -i wlan0 -D nl80211,wext -C/run/wpa_supplicant
sleep 1
wpa_cli -p /run/wpa_supplicant -i wlan0 scan
sleep 2.5
wpa_cli -p /run/wpa_supplicant -i wlan0 scan_results
wpa_cli -p /run/wpa_supplicant -i wlan0 terminate
sleep 2.5 is the current value used in wpa_supplicant_scan_info() function.
With this 2.5 value, I get no scan result.
I replace 2.5 with 3.5 (3 does not work) then I get this :
bssid / frequency / signal level / flags / ssid
00:26:3e:c8:4c:04 2412 -67 [WPA-EAP-TKIP+CCMP][WPA2-EAP-TKIP+CCMP][ESS] XXX
00:26:3e:c8:4c:02 2412 -69 [WPA-EAP-TKIP+CCMP][WPA2-EAP-TKIP+CCMP][ESS] XXX
f4:ca:e5:c6:34:b8 2417 -85 [WPA-PSK-CCMP][ESS] XXX
00:26:3e:c8:4c:05 5180 -86 [WPA-EAP-TKIP+CCMP][WPA2-EAP-TKIP+CCMP][ESS] XXX
00:26:3e:c8:4c:03 5180 -87 [WPA-EAP-TKIP+CCMP][WPA2-EAP-TKIP+CCMP][ESS] XXX
00:26:3e:c8:4c:00 2412 -69 [ESS] XXX
00:1a:c1:15:bd:c2 2462 -85 [ESS] XXX
00:26:3e:c8:4c:01 5180 -86 [ESS] XXX
I think there is a better method than sleep to wait for results because the right value (3.5 for me) will change with other wifi nics or modules.
`wpa_cli -p /run/wpa_supplicant -i wlan0 status` returns wpa_state=SCANNING while scanning.
A better solution is maybe to check the value of wpa_state.
When the scan is finished, the wpa_state is INACTIVE.
I suggest to replace plain sleep with something like :
while [[ "$(wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" status 2> /dev/null | grep "wpa_state=" | sed "s/^wpa_state=//")" == "SCANNING" ]]; do
sleep 0.5
done
I run wifi-menu with 'set -x' and I get this log.
The new loop works, it waited 2+1+1 seconds and I get scan results.
++ wpa_supplicant_scan_info wlan0 3,4,5
++ local INTERFACE=wlan0 fields=3,4,5 spawned_wpa=0 essids scan_wait
++ [[ -z wlan0 ]]
+++ mktemp --tmpdir essid.XXXXXXXX
++ essids=/tmp/essid.1wxEUhYE
+++ wpa_cli -p /run/wpa_supplicant -i wlan0 ping
++ [[ '' != \P\O\N\G ]]
++ start_wpa wlan0 '' nl80211,wext
++ local INTERFACE=wlan0 WPA_CONF= WPA_DRIVER=nl80211,wext
++ shift 3
++ local WPA_OPTS=
++ [[ -n '' ]]
++ WPA_CONF=-C/run/wpa_supplicant
++ wpa_supplicant -B -P /run/wpa_supplicant_wlan0.pid -i wlan0 -D nl80211,wext -C/run/wpa_supplicant
++ sleep 1
++ [[ ! -f /run/wpa_supplicant_wlan0.pid ]]
++ spawned_wpa=1
++ wpa_cli -p /run/wpa_supplicant -i wlan0 scan
++ sleep 2
++ (( scan_wait = 2 ))
++ (( scan_wait < 10 ))
++ wpa_cli -p /run/wpa_supplicant -i wlan0 status
++ grep -q wpa_state=SCANNING
++ sleep 1
++ (( scan_wait++ ))
++ (( scan_wait < 10 ))
++ wpa_cli -p /run/wpa_supplicant -i wlan0 status
++ grep -q wpa_state=SCANNING
++ sleep 1
++ (( scan_wait++ ))
++ (( scan_wait < 10 ))
++ wpa_cli -p /run/wpa_supplicant -i wlan0 status
++ grep -q wpa_state=SCANNING
++ break
++ wpa_cli -p /run/wpa_supplicant -i wlan0 scan_results
++ grep -v '^Selected'
++ grep -v '^bssid'
++ sort -rn -k3
++ sort -u -k5
++ sort -rn -k3
++ cut -f3,4,5
++ (( 1 == 1 ))
++ stop_wpa wlan0
++ wpa_cli -p /run/wpa_supplicant -i wlan0 terminate