torqu3e
Posts: 11
Joined: Tue Dec 25, 2012 3:04 am

Raspi wifi setup [for WHEEZY so obsolete!]

Tue Dec 25, 2012 3:44 am

I have a RaspberryPi connected to my router over ethernet when I finally got the Edimax EW-7811Un which is really tiny and works very well if you need a 150 Mbps connection.

For a full flatout 802.11b/g/n (300 Mbps) device you could use EDUP MS8512 this is based on the RTL 8191SU chipset and the setup instructions are the exact same.

The raspi is not connected to any display so everything is over the terminal, ie headless. I started reading about setting up wifi on a raspi, and then generic linux and it took me quite a while to figure out, but eventually we have both interfaces up!

I am sharing my config here for others, as this is the only thing that worked for me.

TEST SETUP : WPA-PSK2 TKIP with hidden ssid but this will work with any WPA combo you are going to use at home.

Once you connect the Edimax, it gets detected and setup hardware wise by itself, a reboot is a good idea if for some reason the pi does not bring it up.

Output to iwconfig should look so...

Code: Select all

$ iwconfig
lo        no wireless extensions.

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
          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

eth0      no wireless extensions.
Here wlan0 is your wireless interface, if it is different in your case, you might want to edit that value before saving any of the configs from here on.

Your /etc/network/interfaces file should be configured so...

lines starting with a # are commented, adding/removing # enables disables comments(not considered part of configuration as far as setup is concerned)

In case you need to change from DHCP to static IPs, you just need to swap the commenting and provide the 3 parameters manually.

Code: Select all

$ sudo cat /etc/network/interfaces
auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wireless-essid myssid
#address 192.168.1.30
#netmask 255.255.255.0
#gateway 192.168.1.20
pre-up wpa_supplicant -B w -D wext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
post-down killall -q wpa_supplicant
#wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

This is a very IMPORTANT step, your pi is not gonna go wifi without this.

You know your ssid, and you know the password, it will generate the psk key, COPY that.

Code: Select all

$ wpa_passphrase myssid password
network={
	ssid="myssid"
	#psk="password"
	psk=2fe820b1e836cb734fb88172egfi01c5d40bb8449cc55c6e26ce300bbe8e04c7
}
Then you will go in and edit your wpa_supplicant.conf file which governs the WPA part of the connection.

It should look so...

Code: Select all

$ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf 
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
	ssid="myssid"
	proto=WPA RSN
	scan_ssid=1
	key_mgmt=WPA-PSK
	pairwise=CCMP TKIP
	group=CCMP TKIP
	psk=2fe820b1e836cb734fb88172egfi01c5d40bb8449cc55c6e26ce300bbe8e04c7
}
The configuration part is over. Now you bring the interface up and hopefully get connected.

To bring the interface up..

Code: Select all

$ sudo ifup wlan0
rfkill: Cannot open RFKILL control device
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
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/80:1f:02:7e:8d:cd
Sending on   LPF/wlan0/80:1f:02:7e:8d:cd
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 7
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPOFFER from 192.168.1.20
DHCPACK from 192.168.1.20
bound to 192.168.1.28 -- renewal in 40141 seconds.
As you can see it may take several attempts before the pi gets a DHCP lease, this could be because the timeout on my router maybe low, though I have not looked into it, binding to an IP means you are good to go.

Now when you check iwconfig, you should see an output like this.

Code: Select all

$ iwconfig
lo        no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:"epi"  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:23:69:9A:A9:48   
          Bit Rate:150 Mb/s   Sensitivity:0/0  
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=100/100  Signal level=100/100  Noise level=0/100
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

eth0      no wireless extensions.
^ That output is not doctored, it is god like because the raspi is literally sitting on top of the router and even sucking power from it, so don't really go by those numbers, distance/performance testing will come later.`

Quick testing from remote machine...

Code: Select all

$ ssh [email protected]
[email protected]'s password:
Linux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Dec 24 19:25:01 2012 from 192.168.1.22
pi@raspberrypi ~ $ telnet www.google.com 80
Trying 74.125.224.49...
Connected to www.google.com.
Escape character is '^]'.
GET / HTTP/1.1
Host: www.google.com

HTTP/1.1 200 OK
Date: Tue, 25 Dec 2012 03:38:53 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Set-Cookie: PREF=ID=c2653dc8c69ffb91:FF=0:TM=1356406733:LM=1356406733:S=jnS9KGePLuB2RomV; expires=Thu, 25-Dec-2014 03:38:53 GMT; path=/; domain=.google.com
Set-Cookie: NID=67=GpLMt0TfULT7vC2QxTOHyyRnj6__4V6vhxL_GLgj6tYk3OhYNLTnSi94ozeW7i2jHRrijXDPk4TNI6LhcoMGaetRAbWHX3TKdKu8Dg_QZvPOie_IFbNQPFdpT5Nq96t3; expires=Wed, 26-Jun-2013 03:38:53 GMT; path=/; domain=.google.com; HttpOnly
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Transfer-Encoding: chunked
So we are up and running, let me know if this works for you, if not follow the errors.....
Last edited by torqu3e on Sat Mar 16, 2013 3:24 pm, edited 2 times in total.

ukadiyala
Posts: 3
Joined: Thu Dec 27, 2012 9:12 pm

Re: Raspi wifi setup

Thu Dec 27, 2012 9:21 pm

This is an excellent topic. I used this config word to word to get wifi working on my raspbmc setup... The adapter I'm using is a Netcomm np910n... I plugged it anf it did not start up right away... So I tried the information from this post: 'http://www.xbmcfreak.nl/en/wifi-onder-l ... figureren/' and that did not work either... So, I had to use the config from this post with the commands from the other post get the wifi up and running... Now let me see if the connection remains up...

torqu3e
Posts: 11
Joined: Tue Dec 25, 2012 3:04 am

Re: Raspi wifi setup

Fri Dec 28, 2012 3:31 am

Good to know that it worked for you, I noticed that the default route is not defined for both the interfaces by default (which is by design), this leads to failure of load balancing between both the interfaces.

I did find a configuration fix for this issue, but would like to know if other people are experiencing the same.

User avatar
icementhols
Posts: 8
Joined: Wed Sep 19, 2012 8:11 am
Location: Newcastle Upon Tyne

Re: Raspi wifi setup

Fri Dec 28, 2012 3:47 pm

Hi there, followed this guide and got it working fine for dhcp, but for the life of me I can't get manual/static ip address working :evil:

my interfaces file:

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet dhcp

#allow-hotplug wlan0
auto wlan0
iface wlan0 inet manual
        wireless-essid <myssid>
        address 192.168.0.100
        netmask 255.255.255.0
        gateway 192.168.0.1
        network 192.168.0.0
        broadcast 192.168.0.255
        pre-up wpa_supplicant -B w -D wext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
        post-down killall -q wpa_supplicant
iface default inet manual
and my wpa_supplicant.conf

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
        ssid="myssid"
        proto=WPA RSN
        scan_ssid=1
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
        group=CCMP TKIP
        psk=<verylongbitoftext>
}
anyone got any ideas where i'm going wrong here?
--
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.

petrace
Posts: 12
Joined: Thu Dec 13, 2012 10:29 pm

Re: Raspi wifi setup

Thu Jan 03, 2013 8:27 pm

I bought the Ralink RT5370 and followed several tutorials for setup. I have it connected it through an unpowed usb hub with a mouse and keyboard. I also edited /etc/network with my ssid and psk & used sudo wpa_passphrase NetworkEssid password. sudo ifup wlan0 returns "ifup: interface wlan0 already configured", but the web browser won't connect. Is there anything else I have to do to connect to the internet?

petrace
Posts: 12
Joined: Thu Dec 13, 2012 10:29 pm

Re: Raspi wifi setup

Thu Jan 03, 2013 10:04 pm

update: I set a static ip in /etc/network/interfaces but still have same problem. :(

torqu3e
Posts: 11
Joined: Tue Dec 25, 2012 3:04 am

Re: Raspi wifi setup

Mon Jan 07, 2013 4:55 pm

@icementhol

Code: Select all

iface wlan0 inet manual
is not right, you should change that to

Code: Select all

iface wlan0 inet static
and then try.

@petrace

If you can provide the output of your configuration files, or follow my initial post that should get you going.

bitamp
Posts: 1
Joined: Sun Mar 18, 2012 12:14 am

Re: Raspi wifi setup

Tue Jan 22, 2013 2:34 am

Thanks, very helpful.

tulumbas
Posts: 4
Joined: Mon Feb 25, 2013 9:33 am

Re: Raspi wifi setup

Mon Feb 25, 2013 9:41 am

Thank you very much for detailed explanation!
This work instantly with my NETGEAR N150 (WNA1000M).
Though I have a small question - if pi goes off (like ifdown/halt) putty don't see that connection is broken, which is not the case if I use ethernet link - any ideas why it is so?
Thanks

torqu3e
Posts: 11
Joined: Tue Dec 25, 2012 3:04 am

Re: Raspi wifi setup

Tue Feb 26, 2013 12:09 am

Interesting question, that would depend on if your network card did a proper tcp teardown with your wifi router, whereas the ethernet controller of the pi maybe actually trying to kill all connections before interfaces are shutdown by the kernel for the halt.

There could only be a trillion more reasons so don't sweat till the time it works. :lol:

--Tj

RobinGreig
Posts: 24
Joined: Sat Oct 27, 2012 2:40 am
Location: Calgary, Alberta, Canada

Re: Raspi wifi setup

Sat Mar 16, 2013 1:55 pm

This is a very IMPORTANT step, your pi is not gonna go wifi without this.

You know your ssid, and you know the password, it will generate a large key, COPY that.
Sorry, I must have missed something,
How do I generate the large key and where do I see it?

Thanks,
Robin
www.robingreig.ca
Arduino + Raspi + Amateur Radio enthusiast since 2012
VE6RBN Canadian Amateur Radio Callsign
Posted using my Pi400

torqu3e
Posts: 11
Joined: Tue Dec 25, 2012 3:04 am

Re: Raspi wifi setup

Sat Mar 16, 2013 3:25 pm

I corrected it to say the psk key, that is the largest string thrown out at the output of the wpa_passphrase command.

jaylongley
Posts: 40
Joined: Mon Mar 11, 2013 6:27 pm

Re: Raspi wifi setup

Tue Mar 19, 2013 6:58 pm

This may help too. its how i setup my airlink101 focusing on the commands and settings

http://www.instantsupportsite.com/self- ... ation-wpa/
http://www.InstantSupportSite.com/self-help/

zmashiah
Posts: 4
Joined: Sun Mar 24, 2013 11:30 pm

Re: Raspi wifi setup

Sun Mar 24, 2013 11:56 pm

I have a Realtec WiFi dongle:

Code: Select all

root@raspbmc:/opt/xbmc-bcm/xbmc-bin/lib/xbmc# lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 046d:c52e Logitech, Inc.
Bus 001 Device 005: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
root@raspbmc:/opt/xbmc-bcm/xbmc-bin/lib/xbmc#
I tried looking around here on how to setup the WiFi and here is what I am missing:
1. There is no iwconfig
However there is a program named iw instead, related perhaps but not same way of work
2. /etc/network/interfaces is just an empty file
3. There are no /etc/wpa_supplicant/ mentioned files

This is what I got in terms of version:

Code: Select all

root@raspbmc:/opt/xbmc-bcm/xbmc-bin/lib/xbmc# ./xbmc.bin --version
XBMC Media Center 12.0 Git:Unknown
Copyright (C) 2005-2012 Team XBMC - http://www.xbmc.org
root@raspbmc:/opt/xbmc-bcm/xbmc-bin/lib/xbmc#
Lastly my Router/Access-Point is configured for WPA2/PSK (It is D-Link 6740U ADSL) which works fine for me so far with Android phones, iPhones, Laptops and other networking gear I got @home. Hope I can still use this mode with the R-Pi (painful changing all machines @home)

petrace
Posts: 12
Joined: Thu Dec 13, 2012 10:29 pm

Re: Raspi wifi setup

Mon Mar 25, 2013 8:05 pm

Zmashiah:
I have found it easiest on RaspBMC to use the default GUI and the network-manager add on to configure wifi.

If your wifi has a hidden ssid, then you will have to broadcast to get it set up on your raspi, but then you can hide it again.

Keep in mind the wifi on RaspBMC is different from raspian.

zmashiah
Posts: 4
Joined: Sun Mar 24, 2013 11:30 pm

Re: Raspi wifi setup

Tue Mar 26, 2013 10:21 am

The XBMC menus is where I started, and with the Add-on, but still it doesn't work.

torqu3e
Posts: 11
Joined: Tue Dec 25, 2012 3:04 am

Re: Raspi wifi setup

Tue Mar 26, 2013 3:05 pm

Try this...

Code: Select all

sudo apt-get install wireless-tools
If that does not work, paste the output of lsusb at least.

Sample...

Code: Select all

$ lsusb
Bus 002 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 003: ID 18a5:0302 Verbatim, Ltd 
Bus 002 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter

zmashiah
Posts: 4
Joined: Sun Mar 24, 2013 11:30 pm

Re: Raspi wifi setup

Tue Mar 26, 2013 9:01 pm

Here it is:
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 046d:c52e Logitech, Inc.
Bus 001 Device 005: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter

torqu3e
Posts: 11
Joined: Tue Dec 25, 2012 3:04 am

Re: Raspi wifi setup

Tue Mar 26, 2013 9:34 pm

The wireless tools install should give you the iwconfig command, and lsusb shows that the wifi adapter was detected on the usb bus.

What does the output of iwconfig look like? If it is still empty, you need to have the realtek firmware module loaded using modprobe.

zmashiah
Posts: 4
Joined: Sun Mar 24, 2013 11:30 pm

Re: Raspi wifi setup

Wed Mar 27, 2013 7:26 am

Going through the steps:
1. installed wireless-tools
2. Set the configuration files as explained above (/etc/network/interfaces and /etc/wpa/wpa_supplicant.conf)
3. On doing the ifup wlan0 I get different errors than listed in the instructions above
root@raspbmc:/home/pi# ifup wlan0
rfkill: Cannot open RFKILL control device
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
Failed to initialize control interface 'DIR=/var/run/wpa_supplicant GROUP=netdev'.
You may have another wpa_supplicant process already running or the file was
left by an unclean termination of wpa_supplicant in which case you will need
to manually remove this file before starting wpa_supplicant again.

ioctl[SIOCSIWAP]: Operation not permitted
Failed to bring up wlan0.
Using iwconfig at this stage I get
wlan0 unassociated Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency=2.437 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

lo no wireless extensions.

eth0 no wireless extensions.
As the ifup wlan0 command suggested to remove the /var/run/wpa_supplicant/wlan0 manually, I did that too:
root@raspbmc:/home/pi# rm /var/run/wpa_supplicant/wlan0
root@raspbmc:/home/pi# ifup wlan0
rfkill: Cannot open RFKILL control device
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
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:00:b8:18:88:2e
Sending on LPF/wlan0/00:00:b8:18:88:2e
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 17
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
No DHCPOFFERS received.
Unable to obtain a lease on first try. Exiting.
Failed to bring up wlan0.
As you can see, not quite up yet.

Based on later link in this page, that used wpa_roam line in /etc/network/interface I tried that too, and with exact same results as here.

Just so the obvious question on SSID and so forth, I did use wpa_pass... to generate the lines for wpa_supplicant.conf with right info for my network

mikez104
Posts: 5
Joined: Fri Aug 02, 2013 2:42 am

Re: Raspi wifi setup

Thu Oct 24, 2013 3:53 am

@zmashiah. Argh, I'm getting the exact same thing and its driving me nuts. I even tried on a new distro.

Here are my settings
interfaces file

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wireless-essid myssid
#address 192.168.1.30
#netmask 255.255.255.0
#gateway 192.168.1.20
pre-up wpa_supplicant -B w -D wext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
post-down killall -q wpa_supplicant
#wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
wpa_supplicant.conf file

Code: Select all

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

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
   ssid="myssid"
   proto=WPA RSN
   scan_ssid=1
   key_mgmt=WPA-PSK
   pairwise=CCMP TKIP
   group=CCMP TKIP
   psk="large number here"
}
Can anyone see any major mistakes?

yvonnezoe
Posts: 127
Joined: Thu Feb 14, 2013 2:10 am

Re: Raspi wifi setup

Wed Dec 18, 2013 3:40 am

Hey guys, i'm trying to configure my wifi as well. I followed almost all the instructions here, http://www.howtogeek.com/167425/how-to- ... mand-line/ but my R-pi cannot connect to the internet.

I typed in

Code: Select all

iwconfig
and this is what i get,

Code: Select all

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

lo no wireless extensions.

eth0 no wireless extensions.
What's wrong?
Just started my Raspberry Pi journey >> http://yvonnezoe.wordpress.com

yvonnezoe
Posts: 127
Joined: Thu Feb 14, 2013 2:10 am

Re: Raspi wifi setup

Wed Dec 18, 2013 3:41 am

zmashiah wrote:Going through the steps:
1. installed wireless-tools
2. Set the configuration files as explained above (/etc/network/interfaces and /etc/wpa/wpa_supplicant.conf)
3. On doing the ifup wlan0 I get different errors than listed in the instructions above
root@raspbmc:/home/pi# ifup wlan0
rfkill: Cannot open RFKILL control device
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
Failed to initialize control interface 'DIR=/var/run/wpa_supplicant GROUP=netdev'.
You may have another wpa_supplicant process already running or the file was
left by an unclean termination of wpa_supplicant in which case you will need
to manually remove this file before starting wpa_supplicant again.

ioctl[SIOCSIWAP]: Operation not permitted
Failed to bring up wlan0.
Using iwconfig at this stage I get
wlan0 unassociated Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency=2.437 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

lo no wireless extensions.

eth0 no wireless extensions.
As the ifup wlan0 command suggested to remove the /var/run/wpa_supplicant/wlan0 manually, I did that too:
root@raspbmc:/home/pi# rm /var/run/wpa_supplicant/wlan0
root@raspbmc:/home/pi# ifup wlan0
rfkill: Cannot open RFKILL control device
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
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:00:b8:18:88:2e
Sending on LPF/wlan0/00:00:b8:18:88:2e
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 17
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
No DHCPOFFERS received.
Unable to obtain a lease on first try. Exiting.
Failed to bring up wlan0.
As you can see, not quite up yet.

Based on later link in this page, that used wpa_roam line in /etc/network/interface I tried that too, and with exact same results as here.

Just so the obvious question on SSID and so forth, I did use wpa_pass... to generate the lines for wpa_supplicant.conf with right info for my network
Hello, have you found any solution? I'm facing the same problem...
Just started my Raspberry Pi journey >> http://yvonnezoe.wordpress.com

mikez104
Posts: 5
Joined: Fri Aug 02, 2013 2:42 am

Re: Raspi wifi setup

Wed Dec 18, 2013 3:51 am

I started over. My wifi network is not hidden so I did not need to use the wpa_supplicant.conf file. I did it the easy way and just edited my /etc/network/interfaces file like this.

pi@raspberrypi /etc/network $ cat interfaces
auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "usuck"
wpa-psk "xxxxxxxx"

#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp

Replace the "xxxxxxxx" with your password for your wireless lan like - wpa-psk "Tink3rbell"
And leave the quotes in.

Then I rebooted and bam, I was in. Here output from my iwconfig command.

wlan0 IEEE 802.11bg ESSID:"usuck" Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency:2.422 GHz Access Point: 00:1E:E8:5E:08:B6
Bit Rate:54 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Power Management:off
Link Quality=100/100 Signal level=100/100 Noise level=0/100
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

lo no wireless extensions.

eth0 no wireless extensions.

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Raspi wifi setup

Wed Dec 18, 2013 11:22 am

And if you use the ifconfig wlan0 command instead of iwconfig it will show the IP address allocated. e.g.

Code: Select all

pi@raspberrypi ~ $ ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr a0:f3:c1:25:7d:28
          inet addr:192.168.16.12  Bcast:192.168.16.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:305119 errors:0 dropped:108 overruns:0 frame:0
          TX packets:722 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:119526466 (113.9 MiB)  TX bytes:58090 (56.7 KiB)
MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

Return to “Beginners”