0
votes

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.

1
It looks to me like your problem is due to a syntax error in your wpa_supplicant.conf file. To identify it, I suggest you add the parms one by one until you find the error.IanB
As regards the bigger issue of network connectivity, can you just let me know the current rating (Amps) of your power supply ?IanB
@IanB The power supply wouldnt be the problem because I am using 5V 2A supply. And you were right there was some syntax error in my wpa_supplicant file. But still it didnt solve the primary issue of getting connected. But when I do the network restart or ifup command, it just gives me the first two errors. wpa_supplicant: /sbin/wpa_supplicant daemon failed to start run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1jcxmej
@IanB Guess what. The network connected and internet started working. Not sure how. But the commands still give me those errors. So some other way, the network is working. I would still like to understand what the problem is so that I dont run into this again in the future. Anyways thanks for your help.jcxmej
No prob ... thanks for clarificationIanB

1 Answers

1
votes

Hi can you be more specific from next time while posting. Like which distro you are using and which wifi dongle do you have etc.

as I can figure out

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

is a issue

so you can look into this link