First of all I would like to say I just started working on Raspberry Pi Model B three weeks ago. I am running Raspbian and connected Tenda wifi dongle(RT2870). The very first day I was unable to connect to WiFi. Thinking it was a driver issue, I wasted a lot of time on that. But eventually I got it working by removing wpa_conf line in the /etc/networks/interfaces file.
But two days ago, the internet stopped working still connected to WiFi while rest of the devices were able to connect to internet. Now I have two wifi networks so I tried to connect to the other network but failed to connect to that one even by removing the wpa_conf line and directly providing the SSID and password in the /etc/network/interfaces file. So as I had no other option, I was back to figuring out what is wrong with the wpa_supplicant file. I have been on it for last two days. Reading and trying solutions for this site and many other. So I am hoping to get a hint at what might be the problem. Willing to try any suggestion.
Now what is happening?
sudo /etc/init.d/networking restart (and) sudo ifup wlan0
gives me the same error
wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory
wpa_supplicant: /sbin/wpa_cli daemon failed to start
run-parts: /etc/network/if-up.d/wpasupplicant exited with return code 1
sudo iwlist scan | grep ESSID
gives the list of the nearby wifi networks which means the wifi dongle and the driver is working fine but not connecting to it using wpa_supplicant file.
Contents of wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="****"
psk="**"
proto=WPA
key_mgmt=WPA_PSK
pairwise=TKIP
group=TKIP
auth_alg=OPEN
}
Contents of /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet manual
#address 192.168.1.16
#netmask 255.255.255.0
#gateway 192.168.1.1
#dns-nameservers 192.168.1.1 8.8.8.8 8.8.4.4 4.4.4.4
#wpa-ssid ***
#wpa-psk ***
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
I was using static ip when everything was working. When the internet stopped working I added the dns-nameservers line. But with no luck.
I had tried dhcp mode as well to connect to the second network. Also tried wpa-roam(with manual) and wpa-conf(with dhcp). I had also edited /etc/resolv.conf file writing different nameservers.
So this is where I am stuck with a working connecting network with no internet and another network that I cant connect.