Could not connect to wpa_supplicant: p2p-dev-wlan0 - re-trying

在使用 wpa_cli 连接 wpa_supplicant 的时候,尝试几次都是连接不上,显示结果:

Could not connect to wpa_supplicant: p2p-dev-wlan0 - re-trying

Could not connect to wpa_supplicant: p2p-dev-wlan0 - re-trying_第1张图片

 

上网查了一下,可以使用 strace 把执行过程的信息打出来, 执行命令 strace wpa_cli -i wlan0

查阅了:http://www.itkeyword.com/doc/2288722981583974x739/could-not-connect-to-wpa-supplicant-wlan0-re-trying

执行结果如下(表1),查看后发现如下一行信息 

connect(3, {sa_family=AF_UNIX, sun_path="/var/run/wpa_supplicant/wlan0"}, 110) = -1 EACCES (Permission denied)

发现 wlan0 没有执行权限,因为我用的是 pi 用户去执行 wpa_cli ,而这个过程中需要用到的 wlan0 只有 root用户和 root组才有执行权限,修改 wlan0 的执行权限(见:图3),

重新执行命令 wpa_cli 现在可以连接上 wpa_supplicant (图4)

图3:

Could not connect to wpa_supplicant: p2p-dev-wlan0 - re-trying_第2张图片

图4:

Could not connect to wpa_supplicant: p2p-dev-wlan0 - re-trying_第3张图片

表1:

execve("/sbin/wpa_cli", ["wpa_cli", "-i", "wlan0"], [/* 43 vars */]) = 0
brk(NULL)                               = 0xf68000
uname({sysname="Linux", nodename="raspberrypi_22", ...}) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76f52000
access("/etc/ld.so.preload", R_OK)      = 0
open("/etc/ld.so.preload", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=42, ...}) = 0
mmap2(NULL, 42, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x76f51000
close(3)                                = 0
open("/usr/lib/arm-linux-gnueabihf/libarmmem.so", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\210\5\0\0004\0\0\0"..., 512) = 512
lseek(3, 20868, SEEK_SET)               = 20868
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1000) = 1000
lseek(3, 20540, SEEK_SET)               = 20540
read(3, "A,\0\0\0aeabi\0\1\"\0\0\0\0056\0\6\6\10\1\t\1\n\3\f\1\22\4\24"..., 45) = 45
fstat64(3, {st_mode=S_IFREG|0644, st_size=21868, ...}) = 0
mmap2(NULL, 86080, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76f0f000
mprotect(0x76f14000, 61440, PROT_NONE)  = 0
mmap2(0x76f23000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x76f23000
close(3)                                = 0
munmap(0x76f51000, 42)                  = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=86371, ...}) = 0
mmap2(NULL, 86371, PROT_READ, MAP_PRIVATE, 3, 0) = 0x76ef9000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0 \27\0\0004\0\0\0"..., 512) = 512
lseek(3, 25352, SEEK_SET)               = 25352
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1280) = 1280
lseek(3, 24940, SEEK_SET)               = 24940
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0644, st_size=26632, ...}) = 0
mmap2(NULL, 90640, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76ee2000
mprotect(0x76ee8000, 61440, PROT_NONE)  = 0
mmap2(0x76ef7000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x76ef7000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libreadline.so.7", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\354\323\0\0004\0\0\0"..., 512) = 512
lseek(3, 239016, SEEK_SET)              = 239016
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1040) = 1040
lseek(3, 238680, SEEK_SET)              = 238680
read(3, "A,\0\0\0aeabi\0\1\"\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 45) = 45
fstat64(3, {st_mode=S_IFREG|0644, st_size=240056, ...}) = 0
mmap2(NULL, 309004, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76e96000
mprotect(0x76ecc000, 65536, PROT_NONE)  = 0
mmap2(0x76edc000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x36000) = 0x76edc000
mmap2(0x76ee1000, 1804, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76ee1000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0@h\1\0004\0\0\0"..., 512) = 512
lseek(3, 1231820, SEEK_SET)             = 1231820
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2880) = 2880
lseek(3, 1228284, SEEK_SET)             = 1228284
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0755, st_size=1234700, ...}) = 0
mmap2(NULL, 1303872, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76d57000
mprotect(0x76e80000, 65536, PROT_NONE)  = 0
mmap2(0x76e90000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x129000) = 0x76e90000
mmap2(0x76e93000, 9536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76e93000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0dI\0\0004\0\0\0"..., 512) = 512
lseek(3, 125740, SEEK_SET)              = 125740
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1560) = 1560
lseek(3, 90536, SEEK_SET)               = 90536
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0755, st_size=127300, ...}) = 0
mmap2(NULL, 164432, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76d2e000
mprotect(0x76d44000, 61440, PROT_NONE)  = 0
mmap2(0x76d53000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x76d53000
mmap2(0x76d55000, 4688, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76d55000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libtinfo.so.5", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\354`\0\0004\0\0\0"..., 512) = 512
lseek(3, 123728, SEEK_SET)              = 123728
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1080) = 1080
lseek(3, 123380, SEEK_SET)              = 123380
read(3, "A,\0\0\0aeabi\0\1\"\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 45) = 45
fstat64(3, {st_mode=S_IFREG|0644, st_size=124808, ...}) = 0
mmap2(NULL, 190044, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76cff000
mprotect(0x76d1b000, 65536, PROT_NONE)  = 0
mmap2(0x76d2b000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c000) = 0x76d2b000
close(3)                                = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76f50000
set_tls(0x76f50b20, 0x76f511f8, 0x76f56050, 0x76f50b20, 0x76f56050) = 0
mprotect(0x76e90000, 8192, PROT_READ)   = 0
mprotect(0x76d2b000, 8192, PROT_READ)   = 0
mprotect(0x76d53000, 4096, PROT_READ)   = 0
mprotect(0x76edc000, 4096, PROT_READ)   = 0
mprotect(0x76ef7000, 4096, PROT_READ)   = 0
mprotect(0x76f0f000, 20480, PROT_READ|PROT_WRITE) = 0
mprotect(0x76f0f000, 20480, PROT_READ|PROT_EXEC) = 0
cacheflush(0x76f0f000, 0x76f14000, 0, 0x15, 0) = 0
mprotect(0x76f23000, 4096, PROT_READ)   = 0
mprotect(0x32000, 4096, PROT_READ)      = 0
mprotect(0x76f55000, 4096, PROT_READ)   = 0
munmap(0x76ef9000, 86371)               = 0
set_tid_address(0x76f506c8)             = 5279
set_robust_list(0x76f506d0, 12)         = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x76d322b0, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x76d836c0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x76d32390, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x76d836c0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
ugetrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
brk(NULL)                               = 0xf68000
brk(0xf89000)                           = 0xf89000
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
write(1, "wpa_cli v2.4\n", 13wpa_cli v2.4
)          = 13
write(1, "Copyright (c) 2004-2015, Jouni M"..., 67Copyright (c) 2004-2015, Jouni Malinen and contributors

) = 67
write(1, "This software may be distributed"..., 98This software may be distributed under the terms of the BSD license.
See README for more details.
) = 98
write(1, "\n\n", 2

)                     = 2
rt_sigaction(SIGINT, {sa_handler=0x1b268, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x76d836b0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGTERM, {sa_handler=0x1b268, sa_mask=[TERM], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x76d836b0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
write(1, "\nInteractive mode\n", 18
Interactive mode
)    = 18
write(1, "\n", 1
)                       = 1
clock_gettime(CLOCK_BOOTTIME, {tv_sec=49160, tv_nsec=585537842}) = 0
clock_gettime(CLOCK_BOOTTIME, {tv_sec=49160, tv_nsec=585803778}) = 0
_newselect(1, [], [], [], {tv_sec=0, tv_usec=0}) = 0 (Timeout)
clock_gettime(CLOCK_BOOTTIME, {tv_sec=49160, tv_nsec=586209974}) = 0
socket(AF_UNIX, SOCK_DGRAM, 0)          = 3
getpid()                                = 5279
bind(3, {sa_family=AF_UNIX, sun_path="/tmp/wpa_ctrl_5279-1"}, 110) = 0
connect(3, {sa_family=AF_UNIX, sun_path="/var/run/wpa_supplicant/wlan0"}, 110) = -1 EACCES (Permission denied)
close(3)                                = 0
unlink("/tmp/wpa_ctrl_5279-1")          = 0
write(1, "Could not connect to wpa_supplic"..., 55Could not connect to wpa_supplicant: wlan0 - re-trying
) = 55
clock_gettime(CLOCK_BOOTTIME, {tv_sec=49160, tv_nsec=588232098}) = 0
clock_gettime(CLOCK_BOOTTIME, {tv_sec=49160, tv_nsec=588463660}) = 0
_newselect(1, [], [], [], {tv_sec=0, tv_usec=999769}) = 0 (Timeout)
clock_gettime(CLOCK_BOOTTIME, {tv_sec=49161, tv_nsec=589713629}) = 0
socket(AF_UNIX, SOCK_DGRAM, 0)          = 3
getpid()                                = 5279
bind(3, {sa_family=AF_UNIX, sun_path="/tmp/wpa_ctrl_5279-2"}, 110) = 0
connect(3, {sa_family=AF_UNIX, sun_path="/var/run/wpa_supplicant/wlan0"}, 110) = -1 EACCES (Permission denied)
close(3)                                = 0
unlink("/tmp/wpa_ctrl_5279-2")          = 0
clock_gettime(CLOCK_BOOTTIME, {tv_sec=49161, tv_nsec=591746170}) = 0
clock_gettime(CLOCK_BOOTTIME, {tv_sec=49161, tv_nsec=591970960}) = 0
_newselect(1, [], [], [], {tv_sec=0, tv_usec=999776}) = 0 (Timeout)
clock_gettime(CLOCK_BOOTTIME, {tv_sec=49162, tv_nsec=593354264}) = 0
socket(AF_UNIX, SOCK_DGRAM, 0)          = 3
getpid()                                = 5279
bind(3, {sa_family=AF_UNIX, sun_path="/tmp/wpa_ctrl_5279-3"}, 110) = 0
connect(3, {sa_family=AF_UNIX, sun_path="/var/run/wpa_supplicant/wlan0"}, 110) = -1 EACCES (Permission denied)
close(3)                                = 0
unlink("/tmp/wpa_ctrl_5279-3")          = 0

 

你可能感兴趣的:(Could not connect to wpa_supplicant: p2p-dev-wlan0 - re-trying)