my Raspberry Pi has been connected to a wireless network for a while. It occasionally gets disconnected, but I've got a crontab that tests for connection and if there isn't one, reconnects, which has been working fine for weeks. But last night at some point, it got disconnected and couldn't reconnect. from command line, I ran:

 sudo ifdown -a

and then:

sudo ifup -a

which usually fixes everything, but this time, I got:

wpa_supplicant : wpa_supplicant daemon failed to start

run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1

failed to bring up wlan0

the syslog showed some errors from wpa_supplicant:

wpa_supplicant[15668]: Could not set interface wlan0 flags: no such

device wpa_supplicant[15668]: nl80211: Could not set interface 'wlan0'

UP wpa_supplicant[15668]: Could not set interface wlan0 flags: no such

device wpa_supplicant[15668]: WEXT: Could not set interface 'wlan0' UP

wpa_supplicant[15668]: wlan0: Failed to initialize driver interface

I haven't touched any network settings.

I have rebooted and it's started working again. What happened?

Also, what can I do to stop it from happening again?

  • Same problem here, have you found anything? – Thomas Feb 19 '14 at 22:30
  • 1
    No, I never figured out what caused it, but it also hasn't happened again. If it does, and if I figure it out, I'll post here. good luck – MichaelBaker Feb 22 '14 at 17:03

Did you happen to have a look at ifconfig or the syslog before you rebooted ?
What probably happened is that the wlan0 device disappeared.
Whether it was a temporary issue or perhaps a sign of failing hardware is hard to tell without logs.

The wlan0 device can disappear if there is a hiccup with the device itself, or a hiccup with the power supply which then has a flow on effect.

The only real way to avoid the issue is to check that the wlan0 device exists, and if it doesn't reboot the Pi.
There may be a command to reset the USB bus or something like that, but from what I've heard, there's no reliable way to reset USB devices on the Pi beyond unplugging it and plugging it back in.

  • Thanks for the reply. Unfortunately, I didn't check the logs before rebooting. Your suggestion of a hiccup with power seems about right, as the behaviour hasn't reappeared since. If it does, I'll make sure to look at ifconfig and syslog. – MichaelBaker Feb 22 '14 at 17:02

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.