I had an unfortunate pulling of the power plug on my pi and now wpa_cli isn't starting correctly.

user@raspberrypi:~ $ wpa_cli
wpa_cli v2.3
Copyright (c) 2004-2014, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.
See README for more details.

Interactive mode

Could not connect to wpa_supplicant: (null) - re-trying
^Cuser@raspberrypi:~ $ 

I ran strace wpa_cli -i wlan0 and got a repeating error like the following...

bind(3, {sa_family=AF_LOCAL, sun_path="/tmp/wpa_ctrl_1909-24"}, 110) = 0
connect(3, {sa_family=AF_LOCAL, sun_path="/var/run/wpa_supplicant/wlan0"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
unlink("/tmp/wpa_ctrl_1909-24")         = 0
clock_gettime(CLOCK_BOOTTIME, {2846, 214746047}) = 0
clock_gettime(CLOCK_BOOTTIME, {2846, 215339022}) = 0
select(1, [], [], [], {0, 999407})      = 0 (Timeout)
clock_gettime(CLOCK_BOOTTIME, {2847, 216740204}) = 0
socket(PF_LOCAL, SOCK_DGRAM, 0)         = 3

How can I fix this? Does there need to be a /var/run/wpa_supplicant/wlan0 directory? Is there even a way to run fsck on the pi, since there is no 'recovery cd'?

Edit(s) for troubleshooting:

I initialized wpa_supplicant using sudo wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf, but then that process takes the terminal window and doesn't let go. Now I'm more confused; I thought that wpa_supplicant started on its own at boot time...

user@raspberrypi:~ $ systemctl status wpa_supplicant.service
● wpa_supplicant.service - WPA supplicant
   Loaded: loaded (/lib/systemd/system/wpa_supplicant.service; disabled)
   Active: inactive (dead)
user@raspberrypi:~ $ systemctl status wpa_supplicant@wlan0.service
● wpa_supplicant@wlan0.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)
user@raspberrypi:~ $ 
  • 1
    is wpa_supplicant running? because that's an error you can get if it isn't – Jaromanda X Jul 24 '18 at 0:57
  • @JaromandaX I don't know. I tried to initialize it and it said Successfully initialized wpa_supplicant, but nothing is working yet... – user3.1415927 Jul 24 '18 at 16:10
  • I don't understand why do you use wpa_cli. What operating system you are using? – Ingo Jul 25 '18 at 0:10
  • @Ingo I'm using standard Raspbian. Jesse I think. The official docs call wpa_cli... so I figured it was a smart move... – user3.1415927 Jul 25 '18 at 0:28
  • What gives you systemctl status wpa_supplicant.service and systemctl status wpa_supplicant@wlan0.service? – Ingo Jul 25 '18 at 1:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.