Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I'm very excited to get into my Raspberry Pi, but I am pretty useless when it comes to most hardware and networking issues.

I purchased a Edimax Wi-Fi Adapter, but I am having trouble getting it to work. I using the latest version of Raspbian (“Wheezy”) and have done full updates of the firmware and software.

When I go into the Wi-Fi configuration in the GUI, I can scan for and connect to my Wi-Fi router. So far so good.

However when I go to a web page I get an error saying:

Cannot resolve hostname.

I have also noticed that in the Wi-Fi configuration no IP address has been assigned (or at least no IP address is being displayed).

When I run ifconfig -a, I get the following:

eth0      Link encap:Ethernet  HWaddr b8:27:eb:cc:0d:97  
          inet addr:192.168.1.88  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:52 errors:0 dropped:1 overruns:0 frame:0
          TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5875 (5.7 KiB)  TX bytes:5868 (5.7 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 80:1f:02:82:c1:ce  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:1 errors:0 dropped:34 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:155 (155.0 B)  TX bytes:155 (155.0 B)

Running sudo cat /etc/wpa_supplicant/wpa_supplicant.conf also seems to show everything correctly:

network={
    ssid="correct_ssid"
    psk="correct_password"
    proto=RSN
    key_mgmt=WPA-PSK
    pairwise=TKIP
    auth_alg=OPEN
}

How do I fix this problem?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

If you getting a 169.254 address there are 2 possible reasons...1) your wifi has not associated with your router, or 2) it has and dhcp isn't setup correctly.

Use "iwconfig" to verify your wifi adapter has associated with a router? You should see your ESSID, Mode should be Managed, and the Access Point should have a MAC address.

If not, try using wpa_passphrase. My wpa_supplicant does not work with an unencrypted password, and replacing just 1 line psk= worked.

If you are associated, and the dhcp client (which comes pre-installed) isn't working (shouldn't need to apt-get anything) then try setting a static address via "if config wlan0 192.168.1.X" where X is any unused number not in your routers dhcp range.

share|improve this answer
    
Thanks for your help Martin. if config wlan0 192.168.1.X did work. Ultimately it was a power supply issue though. I tried a few different power sources and when I finally tried my iPod charge it worked a treat! –  Goonanism Dec 5 '12 at 17:17

The article WPA supplicant suggests triggering DHCP to request an IP address for the WLAN. As root or with sudo, do:

 dhcpcd wlan0
share|improve this answer
    
Amazing Dan - that worked! I had to install dhcpcd first (using apt-get). It's given the wifi a strange IP address though - 169.254.107.225. Any idea why it wouldn't be 192.168.1.xx like every other device on the router? –  Goonanism Nov 26 '12 at 8:09
    
The 169.254.X.X probably means that DHCP did not work. It looks like a fallback address assigned by the RPI. Can you ping the address from another machine on your LAN? –  Dan M Nov 27 '12 at 13:35
    
Hi Dan, yeah, something is wrong, I've been meaning to update this comment accordingly but, you know, life. I could ping it the first time but after restarting and running the command again I can't. It also isn't connected to the internet and I'm still getting the cannot resolve hostname error. Thanks again for your help. –  Goonanism Nov 27 '12 at 18:32
    
Is it connected directly to a RPI or through a powered hub? The Wifi dongle probably only starts to draw significant current when it turns its transmitter on (i.e. when it trys to get an ip address). –  Dan M Dec 1 '12 at 13:44
    
Probably authentication is what happens first. You could eliminate authentication issues by starting with an unprotected guest network. –  Dan M Dec 1 '12 at 13:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.