Raspberry Pi/Raspbian Wifi Won't Connect

Many of us have had difficulty getting the wifi on the RP4 in particular to work. When I run
wpa_cli, I get

Interactive Mode
Cound not connect to wpa_supplicant: (nil) - re-trying

If I try

sudo systemctl restart /etc/wpa_supplicant/wpa_supplicant.conf

I get

Failed to restart etc-wpa_supplicant-wpa_supplicant.conf; Unit
etc-wpa_supplicant-wpa_supplicant.conf.mount not found.

It appears to me that the system is not connecting to the wpa_supplicant.conf
file. Can someone tell me where to look to get this system running?
Thanks in advance.

Hi William_Bechtold,

Welcome to our forums.

Your systemctl command points to a non-existent unit. In this case, a file path, which isn’t a systemd unit at all.

To list all systemd units (mounts, services, timers, etc.), you can use the following:

$ systemctl list-unit-files

To list services only, execute:

$ systemctl list-unit-files --type=service

You can find more examples in our systemd service listing tutorial.

So in case you would like to restart the wpa_supplicant service, you’ll need to execute the following command:

$ sudo systemctl restart wpa_supplicant.service

sandmann: thanks for your kind response…

The first time I ran sudo systemct. restart wpa_supplicant.service, the wifi still did not connect.
The second time I ran it, it did connect, and I was able to reach both google and duckduckgo… But once that second web site opened, the wifi shut off. Running the command since then, has not started up wifi, even after a reboot.

My wpa_supplicant.conf file looks like this:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev


I have no trouble connecting to the router with cell phone, lap top, VOIP phone, TV, etc. So the router appears not to be the problem.

/etc/dhcp/dhclient.conf says:

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
send host-name = gethostname ();
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, domain-search, host-name,
dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
netbios-name-servers, netbios-scope, interface-mtu,
rfc3442-classless-static-routes, net-servers;

along with more lines that are commented out (I’m typing this in since I can’t cut/paste to an
email when the pi won’t connect).

Are there any other files or information that I should provide or be looking at? Thanks again
for your time and expertise.

Well, if your Pi device was able to connect to the router once, your configuration should be mostly okay. I’d suggest checking the logs at the time the device tries to connect and fails. You can use journald to get log entries related to the service with the following:

$ sudo journalctl -u wpa_supplicant.service

Check for any error messages at the time of the (failed) connection, they may give some hint on what goes wrong.