raspberry wlan0 ifconfig fail

树莓派的wifi网卡总是上不了网,搞了很久都找不到解决办法

提示错误是当运行ifconfig wlan0分配ip时出错:

[20014.112395] wlan0: deauthenticating from xxx by local choice (reason=3)

但是lsusb时发现设备还在,应该不是电源的问题,百思不得其解

google了很久终于发现当前居然有wpa的进程(我的wlan0是无密码的)
pi@raspberrypi ~ $ ps aux|grep wpa
root 2071 0.0 0.3 5952 860 ? Ss 23:47 0:00 /sbin/wpa_supplicant -s -B -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 -W -D nl80211,wext -c /etc/wpa_supplicant/wpa_supplicant.conf
root 2153 0.0 0.1 2276 380 ? Ss 23:47 0:00 /sbin/wpa_cli -B -P /var/run/wpa_action.wlan0.pid -i wlan0 -p /var/run/wpa_supplicant -a /sbin/wpa_action
pi 2726 0.0 0.3 3544 868 pts/1 S+ 23:51 0:00 grep –color=auto wpa

所以解决办法就是杀wpa
pi@raspberrypi ~ $ sudo killall wpa_supplicant

发现重新连接ap就没问题了
[ 322.419859] wlan0: RX AssocResp from 4c:e6:76:a3:d5:82 (capab=0x401 status=0 aid=4)
[ 322.435926] wlan0: associated

谨慎怀疑是因为 /etc/network/interface中出现的一段wpa的问题:

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
那么解决办法就是将其注释掉即可。。。

iface default inet dhcp

Leave a Comment

Your email address will not be published. Required fields are marked *