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?