对wpa_supplicant的后续调用失败-无法连接到wifi


12

我有一台ubuntu 15.10服务器,该服务器利用wpa_supplicant连接到使用wpa_passphrase创建的无线网络配置文件。重新启动时,第一次调用时sudo wpa_supplicant -B -i wlp2s0 -c ./MVS(其中MVS是网络保存的配置文件的名称),我得到了输出

Successfully initialized wpa_supplicant
Could not read interface p2p-dev-wlp2s0 flags: No such device

但是退出代码为零,我可以通过运行以下命令确认我实际上已连接到无线网络 sudo iw wlp2s0 link

但是,随后对wpa_supplicant的调用(对于其他配置文件甚至是相同的配置文件)将产生更详细的输出:

Successfully initialized wpa_supplicant
Could not read interface p2p-dev-wlp2s0 flags: No such device
nl80211: Could not set interface 'p2p-dev-wlp2s0' UP
nl80211: deinit ifname=p2p-dev-wlp2s0 disabled_11b_rates=0
p2p-dev-wlp2s0: Failed to initialize driver interface
P2P: Failed to enable P2P Device interface

wpa_supplicant仍然返回退出代码零,但是这次无线设备肯定没有连接到任何网络。任何建议或想法将不胜感激,我不知道如何调试或修复它。

Answers:


25

我不好意思说解决方案是杀死已经在运行的wpa_supplicant进程。-B参数使程序进入后台,并且只要程序已经在运行,尝试再次运行它就会失败。我仍然不确定为什么会打印该第一条错误消息,但是它可以毫无问题地连接到无线网络。

sudo killall wpa_supplicant
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.