11

I've bought a nano wifi adapter at modmypi.com (this one).

It works, I checked it in a raspbmc configuration (I used raspbmc to configure it there).

Now I'm back at my wheezy distro, and I can't get it to work.

When I do a ifconfig it's there (see below).

The help page on modmypi.com had a script, but when I run that, I get this exception: "Looks like you're using the new 2012-09-18-wheezy-raspbian image. Sorry but the script will not currently set up the wifi on this image. You need to start the GUI using command startx and set it up using WiFi Config. The script will now terminate. Press any key to continue ..."

So now I am in the GUI, and started nm-connection-editor, but it doesn't seem to get an ipaddress.

I've read about this command: dhclient -v wlan0, and this is it's output:

sudo dhclient -v wlan0
Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/wlan0/00:0f:more numbers
Sending on   LPF/wlan0/00:0f:more numbers
Sending on   Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 18
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

And now I don't know what to do.

This is the ifconfig:

wlan0     Link encap:Ethernet  HWaddr 00:0f:1more numbers
          UP BROADCAST MULTICAST  MTU:1500  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:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

iwconfig wlan0:

wlan0     unassociated  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency=2.412 GHz  Access Point: Not-Associated   
          Sensitivity:0/0  
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

/etc/wpa_supplicant/wpa_supplicant.conf:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1


network={
        ssid="Nerd"
        psk="SECRET"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
        group=CCMP TKIP
}

Executing wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf gives this:

wlan0: Trying to associate with 2a:65:11:f2:ce:97 (SSID='Nerd' freq=2412 MHz)
wlan0: Association request to the driver failed
wlan0: Associated with 2a:65:11:f2:ce:97
wlan0: WPA: Key negotiation completed with 2a:65:11:f2:ce:97 [PTK=CCMP GTK=TKIP]
wlan0: CTRL-EVENT-CONNECTED - Connection to 2a:65:11:f2:ce:97 completed (auth) [id=0 id_str=]
wlan0: CTRL-EVENT-DISCONNECTED bssid=2a:65:11:f2:ce:97 reason=0
wlan0: Trying to associate with 90:00:4e:87:c8:cf (SSID='Nerd' freq=2412 MHz)
wlan0: Association request to the driver failed
wlan0: Associated with 00:00:00:00:00:00
wlan0: CTRL-EVENT-TERMINATING - signal 2 received
wlan0: Trying to associate with 90:00:4e:87:c8:cf (SSID='Nerd' freq=2412 MHz)
wlan0: Association request to the driver failed
katspaugh
  • 115
  • 6
Michel
  • 1,124
  • 4
  • 14
  • 21
  • Have you tried setting up the connection using wpa_gui? That's what I used to get WiFi running. – Arne Mar 10 '13 at 09:41
  • Also, output of iwconfig wlan0 would be useful. – Arne Mar 10 '13 at 09:42
  • i've added the output of iwconfig wlan0 – Michel Mar 10 '13 at 14:04
  • i'll try the wpa_gui now – Michel Mar 10 '13 at 14:07
  • I get an error: association request to the driver failed in wpa_gui.... I must say i don't know if i have to install any drivers for this device? – Michel Mar 10 '13 at 14:33
  • Can you look in /var/log/messages if there is any output from wpa_supplicant there? – Arne Mar 10 '13 at 14:40
  • Hi, i've executed this command (quite new in Linux) sudo cat /var/log/messages | grep -i *wpa_* and it returned no results – Michel Mar 10 '13 at 15:06
  • Then check if /etc/wpa_supplicant/wpa_supplicant.conf exists and contains your WPA encryption settings, and if they are correct. If they do, you can run wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf manually, and see if it works. – Arne Mar 10 '13 at 15:10
  • This is getting very hard to read. Maybe you should edit your question to supply the information. The comments swallow the linebreaks. – Arne Mar 10 '13 at 16:43
  • Done. Can it be a problem that i have a repeater which broadcasts the same ssid name? – Michel Mar 10 '13 at 18:03
  • i've rebooted 16 times, 8 times with the wifi dongle in the pi, and 8 times with the wifi in a usb powered hub. Got an ip address once. – Michel Mar 10 '13 at 20:05
  • Late at night, i rebooted 4 times WITHOUT the UTP cable in, so only with the wifi dongle in. Got an IP address 4 times.... could it be the presence of the UTP cable is in the way? – Michel Mar 11 '13 at 07:33
  • What power supply are you using? I would guess that having the cable connected draws more power. So if your power supply is a bit on the weak side, you might get weird side effects. – Arne Mar 11 '13 at 10:05
  • I'm using a 1A for my rpi, and a 2.45 A usb powered hub – Michel Mar 11 '13 at 14:18
  • That's plenty. Sorry, I think I am out of ideas. – Arne Mar 11 '13 at 14:47
  • Well thanks very much for your support so far. I'll keep you informed wether the wifi will work without a UTP cable connected – Michel Mar 11 '13 at 15:29
  • It's trying to associate with both your AP and repeater (one then the other). You might try turning the repeater off if you can to help diagnose. Also, are you sure you have a working dhcp server with an available address? – TomG Sep 03 '14 at 21:16

4 Answers4

11

You might have multiple instances of wpa_supplicant running. try

ps ax | grep "wpa_supplicant -B" | grep -v grep
kill {pid of wpa_supplicant}

if that works then you can try this

sudo kill $(pgrep -f "wpa_supplicant -B")
sudo ifconfig wlan0 down
sudo ifconfig wlan0 up
sudo rm -r /var/run/wpa_supplicant/*
sudo wpa_supplicant -B -iwlan0 -f/var/log/wpa_supplicant.log -c/etc/wpa_supplicant/wpa_supplicant.conf
sleep 15
sudo dhclient -v -r wlan0
sudo dhclient -v wlan0

and tail the /var/log/wpa_supplicant.log to see what is going on.

wpa_supplicant should run at start up with the default config file. if you want to chage your config file on the fly kill the old process, blow away the /var/run/wpa_supplicant/* directory and start wpa_suplicant with the new config file by using the -c option.

Side note wpa_cli is odd the flags are not followed by a space. for example you want to do

wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf

not

-c /etc/wpa_supplicant
lenik
  • 11,541
  • 1
  • 30
  • 37
vfd000
  • 111
  • 1
  • 2
  • 1
    I had everything configured correctly. Only I couldn't get an IPv4 address from ifconfig wlan0 up. After doing dhclient -v wlan0 it worked like a dream. I have no idea why. Why does my system need this command? – atripes Jan 19 '16 at 13:37
2

I had a bad wifi password, which caused this. Specifically, the "at" symbol and quotation mark are reversed on a UK keyboard, so the "at" symbol in my password came out as a quotation mark, which the config file certainly didn't like. :)

  • Something similar happened to me once; I only figured out the problem after I ran iwlist scan, when I realized that the SSID had an extra space at the end. – 3cheesewheel Sep 01 '13 at 06:20
1

http://wirelessdefence.org/Contents/LinuxWirelessCommands.htm

i had the same problem logging in with WEP, i resourced a linux web site and scored this page, tried the first one and now im linked via wifi!

Zack
  • 11
  • 1
  • 1
    Please include the specific solution in your answer in case the link is moved/removed to help future users. – Tevo D Sep 07 '13 at 16:32
  • 1
    yeah... including the information would've been nice. the page is dead by now. the glorious wayback machine still has a snapshot of that site though: http://web.archive.org/web/20130929013742/http://www.wirelessdefence.org/Contents/LinuxWirelessCommands.htm – wullxz May 24 '15 at 21:26
0

Have you tried powering up the pi untill you have logged in either in a terminal or gui then unplugging and replugging the wifi adapter. Then remove all entries for wireless networks and re-scanning for your network then configuring it. Dont know if it will work for you but it did for me when my adaptor plays up

stuart
  • 1