Can't connect to Wi-Fi


11 posts
by Mario-Fan » Sun Dec 30, 2012 2:46 pm
Whenever I boot the Pi with my Belkin F7D1102 SURF N150 USB Wireless Micro Adapter (it or enter the command "sudo ifup wlan0" I get the following error message in the log:
Code: Select all
/etc/network/interfaces:7: unknown method
ifup: couldn't read interfaces file "etc/network/interfaces"

Here is the contents of /etc/network/interfaces:
Code: Select all
auto lo

iface lo inet loopback
iface eth0 inet dchp

auto wlan0
iface wlan0 inet dchp
wpa-conf /etc/wpa.conf

/etc/wpa.conf contains (with my SSID and passcode removed):
Code: Select all
network={
   ssid="insert ssid here"
   key_mgmt=WPA-PSK
   psk="insert code here its wpa2 btw"
}

I'm not sure what's going on here. I followed the instructions in the User Guide, so I'm not sure what's the problem. Can anyone help?
Posts: 32
Joined: Fri Dec 28, 2012 2:34 pm
by PhillyNJ » Mon Dec 31, 2012 11:28 am
Hi, check out this tutorial.

http://omer.me/2012/04/setting-up-wireless-networks-under-debian-on-raspberry-pi/
Perhaps your firmware for your adapter is not installed.


Regards,

Phil
Posts: 102
Joined: Sat Dec 29, 2012 4:07 am
by Mario-Fan » Mon Dec 31, 2012 1:15 pm
PhillyNJ wrote:Hi, check out this tutorial.

http://omer.me/2012/04/setting-up-wireless-networks-under-debian-on-raspberry-pi/
Perhaps your firmware for your adapter is not installed.


Regards,

Phil

I thought it was installed because the Pi said it was made by Realtek (I think, my memory's a bit dodgy sometimes) and apparently it already had the firmware according to the user manual and the fact that it said I had the latest version of their firmware. That tutorial does appear to give different instructions from the instructions in the manual. I wish I knew which were the right ones. I'll look through there.
[EDIT] It appears that the only difference in it is in the bit where you work out what firmware to get. That's cool. Quick question though, does the latest version of Raspbian have WPASupplicant pre-installed and, if not, where do I get it from the desktop? I don't really have any way of connecting my Pi to the Internet other than Wi-Fi.
Posts: 32
Joined: Fri Dec 28, 2012 2:34 pm
by efflandt » Wed Jan 02, 2013 4:48 am
What you show as /etc/wpa.conf should instead be added to /etc/wpa_supplicant/wpa_supplicant.conf. That file is (and should only be) readable by root, so to edit it use something like:
Code: Select all
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Posts: 359
Joined: Mon Dec 03, 2012 2:47 am
Location: Elgin, IL USA
by Mario-Fan » Wed Jan 02, 2013 8:47 am
efflandt wrote:What you show as /etc/wpa.conf should instead be added to /etc/wpa_supplicant/wpa_supplicant.conf. That file is (and should only be) readable by root, so to edit it use something like:
Code: Select all
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

So basically, I put the contents of /etc/wpa.conf into /etc/wpa_supplicant/wpa_supplicant.conf instead and change the referral in /etc/network/interfaces to the new directory.
Let's hope this works.
[EDIT] So it didn't work. All I did was add the contents of wpa.conf to the bottom of wpa_supplicant.conf and change the last line of the interfaces file to "wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf", but I feel there is more to change. What is this "more"?
Posts: 32
Joined: Fri Dec 28, 2012 2:34 pm
by Mario-Fan » Sat Jan 12, 2013 4:44 pm
So I was experimenting with the interfaces file and suddenly I'm able to configure the Wi-Fi in wpa_gui. When I try to connect, I get this in the event history (I tried a few times before this in the same session):
Code: Select all
CTRL-EVENT-BSS-ADDED 8 [MAC]
CTRL-EVENT-BSS-ADDED 9 [different MAC]
CTRL-EVENT-SCAN-RESULTS
Trying to associate with [router info]
Association request to the driver failed
Associated with [MAC]
WPA: key negotiation completed with [router info]
CTRL-EVENT-CONNECTED - Connection to [MAC] completed (reauth) [id=0 id_str=]
[a few minutes later]
CTRL-EVENT-BSS-REMOVED 8 [MAC]
CTRL-EVENT-BSS-REMOVED 9 [MAC]

I think it's saying that it's connected, but it's not acting like it. The ping command doesn't work and Midori brings up a "cannot resolve hostname" screen on Google. Anyone know what's going on?
Posts: 32
Joined: Fri Dec 28, 2012 2:34 pm
by Jim JKla » Sat Jan 12, 2013 5:00 pm
I don't know if this method will work for you but I have posted a thread as a case study that connects using a USB wireless dongle.

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=26&t=28339 ;)
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick
User avatar
Posts: 2101
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK
by MartP » Sun Jan 27, 2013 9:30 pm
Hi,
Don't know if this has been resolved but here's my two-pennuth.
If you are using "wheezy" distro, then the only thing I needed was to add the network entries ( i.e. SSID, KEY-MGMT, PSK ) to the wpa_supplicant.conf file. Don't touch wpa.conf.
This got mine working after fumbling around unsuccessfully with the user guide book instructions!
Good luck,
Martin
User avatar
Posts: 12
Joined: Sat Jan 26, 2013 10:39 pm
Location: Hertfordshire, UK
by Mario-Fan » Mon Jan 28, 2013 4:05 pm
It's been resolved for a while, but the problem was the line about wpa_supplicant.conf didn't have two spaces in front and it needed those. :p
Posts: 32
Joined: Fri Dec 28, 2012 2:34 pm
by vcrewchief » Wed Nov 13, 2013 6:54 pm
My wifi used to work, and now I get different messages each time I try sudo /etc/init.d/networking restart. I just duplicated my wpa.config file into /etc/wpa_supplicant/wpa_supplicant.conf, and I got the thing to work on my second attempt. It pinged google several times, and then lost the connection. Is my adapter/pi going bad?
Posts: 3
Joined: Fri Oct 25, 2013 4:39 pm
by DougieLawson » Wed Nov 13, 2013 7:31 pm
Assuming your RPi has a good enough power supply then it's not likely to be a hardware problem. You could measure the voltage between TP1 & TP2 with a multimeter.

Try
sudo ifdown --force wlan0
sudo ifup wlan0

The --force will ensure that there's no wpa_supplicant left running.
The ifup restarts the WiFi and should attempt to connect again.

Test it with ping news.bbc.co.uk or ping 212.58.224.70 # that site is online 24 hours a day.
If that doesn't work try tracert 212.58.224.70
Hacker on ZX80 and Microtan65
Unemployed mainframe database specialist.
Linux hacker since 1995.
RPi owner since 2012.
Twitter: @DougieLawson

Gaffer tape is "The Force", it has a dark side and a light side and it holds the Universe together.
User avatar
Posts: 5535
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK