2

I'm using Raspberry Pi 2 installed with Raspbian (Debian Wheezy) ~ Release date: 2015-02-16.

Every now and then wpa_supplicant dies on me and usually when I'm remote and I cannot do anything other then physically either reboot the Pi or start the wpa_supplicant process through the Terminal.

root@raspberrypi:~# ps ax | grep '/sbin/wpa_supplicant' | grep -v grep
 1814 ?        Ss     0:29 /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@raspberrypi:~# 

Is there a service that can be (re)started in order to get it going?

3

The command to restart networking entirely, including wpa_supplicant, is this:

sudo systemctl restart networking.service

As a side note, you should be able to hit the <tab> key after you start typing the name of a service and your shell will autocomplete the name of the service, assuming you've typed in enough to make it unique. That saves you from accidentally using the name network.service which is incorrect as of Jessie, and I assume so for Wheezy. If the <tab> key didn't autocomplete at all, hit it again to see a list. If no list appears, there is no service name that starts with what you typed.

Also, wpa_supplicant might not be crashing if your only symptom is that your Pi disconnects from Wifi and doesn't reconnect. Make sure your /etc/network/interfaces file includes a line allow-hotplug wlan0 right before the wlan0 interface. It's the default on Jessie, I'm not sure about Wheezy. Sometimes you'll lose your connection due to interference and the Pi won't reconnect if it isn't configured to.

This answer is intended to help anyone who might stumble across it in the future, since the original question is a few months old now and it's author might not need the answer now.

0

You could use sudo ifdown wlan0 followed by sudo ifup wlan0 to bring the network back up.
Then use ifconfig wlan0 to check if you got an IP assigned.

PS: I'm not sure about this and haven't tested it, but there's a service called networking. Maybe restarting it with sudo service networking restart could also fix your problem.

  • I got following message : running /etc/init.d/networking restart is deprecated because it may not re-enable some interfaces, that did NOT help me to get my wpa_supplicant back either( – alexus Apr 25 '15 at 13:41
  • Yeah I didn't really know what the outcome of restarting the network service would be. Ifup and ifdown should do the trick though. – thibmaek Apr 25 '15 at 16:59
  • it doesn't, as wlan0 never goes down at the first place, it's wpa_supplicant that's dies, I tried it anyways though.. – alexus Apr 25 '15 at 17:04
  • You don't need to use the wpa_supplicant if you don't want to. You could try configuring the network settings in the network file where you load up wpa_supplicant – thibmaek Apr 25 '15 at 17:17
  • I'd prefer to use wpa_supplicant as it makes it a lot easier to switch networks (without modifying anything). – alexus Apr 25 '15 at 18:05
0

systemd was included in Debian Wheezy, So you can use the following command to restart the network:

systemctl restart network.service

or

systemctl restart networking.service
  • No such file or directory for network.service – alexus Apr 23 '16 at 1:40

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.