Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
intel wireless-n 2230 and wpa_supplicant [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 943
Location: Belgium

PostPosted: Sun Jun 30, 2013 11:05 am    Post subject: intel wireless-n 2230 and wpa_supplicant [solved] Reply with quote

I'm trying to get wifi on my laptop running. So far I have done the following:

lspci:
Code:
03:00.0 Network controller: Intel Corporation Centrino Wireless-N 2230 (rev c4)


In the kernel I compiled in:
- loading of firmware
- networking support -> wireless -> cfg80211
- networking support -> wireless -> Generic IEEE802.11 networking stack
- networking support -> WIMAX wireless broadband support
- networking support -> RF switch subsystem support
- network devices support -> wireless lan -> intel wireless wifi next gen - wireless-n/advanced-n/ultimate n (iwlwifi)
- network devices support -> wireless lan -> intel wireless wifi next gen - wireless-n/advanced-n/ultimate n (iwlwifi) -> iwlwifi experimental p2p support

Next I downloaded the firmware for the wireless-n 2230 and put that in /lib/firmware

Because I use WPA-PSK on the wireless router I then followed with "emerge wpa_supplicant", this included Wicd network manager. Then created the following /etc/wpa_supplicant/wpa_supplicant.conf (I used the correct ssid and psk :D) ) plain copied from the wiki:
Code:
# The below line not be changed otherwise we refuse to work
ctrl_interface=/var/run/wpa_supplicant

# Ensure that only root can read the WPA configuration
ctrl_interface_group=0

# Let wpa_supplicant take care of scanning and AP selection
ap_scan=1

# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers
network={
  ssid="my_ssid"
  psk="my_psk"
  # The higher the priority the sooner we are matched
  priority=5
}


Then there is /etc/conf.d/net
Code:
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /usr/share/doc/openrc*/net.example* and save your configuration
# in /etc/conf.d/net (this file :]!).
config_enp12s0="dhcp"

modules="wpa_supplicant"
wpa_supplicant_wlp3s0="-Diwlwifi"
config_wlp3s0="dhcp"


Created the link net.wlp3s0 and added this to runlevel default.

When I boot the pc I see the following:

dmesg:
Code:
[    6.799157] Intel(R) Wireless WiFi driver for Linux, in-tree:
[    6.799159] Copyright(c) 2003-2012 Intel Corporation
[    6.800250] iwlwifi 0000:03:00.0: irq 46 for MSI/MSI-X
[    6.808061] iwlwifi 0000:03:00.0: loaded firmware version 18.168.6.1
[    6.823844] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUG disabled
[    6.823848] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUGFS disabled
[    6.823851] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEVICE_TRACING disabled
[    6.823854] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEVICE_TESTMODE disabled
[    6.823856] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_P2P enabled
[    6.823859] iwlwifi 0000:03:00.0: Detected Intel(R) Centrino(R) Wireless-N 2230 BGN, REV=0xC8
[    6.824121] iwlwifi 0000:03:00.0: L1 Enabled; Disabling L0S
[    6.824402] udevadm (1352) used greatest stack depth: 4240 bytes left
[    6.848048] systemd-udevd[1334]: renamed network interface eth0 to enp12s0
[    6.848084] ieee80211 phy0: Selected rate control algorithm 'iwl-agn-rs'
[    6.904703] keymap (1396) used greatest stack depth: 3976 bytes left
[    7.019702] systemd-udevd[1336]: renamed network interface wlan0 to wlp3s0


I assume after this that the hardware has its firmware correctly programmed and should be working?

rc.log however gives:
Code:
  * Starting WPA Supplicant Daemon ...
ioctl[SIOCSIWPMKSA]: Invalid argument
ioctl[SIOCSIWMODE]: Invalid argument
ioctl[SIOCGIWRANGE]: Invalid argument
ioctl[SIOCGIWMODE]: Invalid argument
ioctl[SIOCSIWAP]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWPMKSA]: Invalid argument
 [ ok ]
 * Starting DHCP Client Daemon ...
 [ ok ]
 * Bringing up interface enp12s0
 *   dhcp ...
 *     Running dhcpcd ...
dhcpcd[2190]: sending commands to master dhcpcd process
 [ ok ]
 *     received address
 [ ok ]
 * Bringing up interface wlp3s0
 *   Starting wpa_supplicant on wlp3s0 ...
Unsupported driver 'iwlwifi'.
 *   start-stop-daemon: failed to start `/usr/sbin/wpa_supplicant'
 [ !! ]
 * ERROR: net.wlp3s0 failed to start
 * ERROR: cannot start netmount as net.wlp3s0 would not start


rc-status --all:
Code:
Runlevel: default
 wpa_supplicant                                                                                                                                                                      [  started  ]
 dhcpcd                                                                                                                                                                              [  started  ]
 dbus                                                                                                                                                                                [  started  ]
 net.enp12s0                                                                                                                                                                         [  started  ]
 net.wlp3s0                                                                                                                                                                          [  stopped  ]
 netmount                                                                                                                                                                            [  stopped  ]
 consolekit                                                                                                                                                                          [  started  ]
 local                                                                                                                                                                               [  started  ]
Runlevel: shutdown


Now where does it run wrong? I have been looking around on the net but I cannot see the problem when I compare with what is done there.
_________________
Expert in non-working solutions


Last edited by Spanik on Fri Jul 05, 2013 6:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Sun Jun 30, 2013 1:27 pm    Post subject: Reply with quote

Change in /etc/conf.d/net
Code:
wpa_supplicant_wlp3s0="-Diwlwifi"

for
Code:
wpa_supplicant_wlp3s0="-Dnl80211"

_________________
Paul
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 943
Location: Belgium

PostPosted: Sun Jun 30, 2013 2:25 pm    Post subject: Reply with quote

Changed /etc/conf.d/net to
Code:
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /usr/share/doc/openrc*/net.example* and save your configuration
# in /etc/conf.d/net (this file :]!).
config_enp12s0="dhcp"

modules="wpa_supplicant"
wpa_supplicant_wlp3s0="-Dnl80211"
config_wlp3s0="dhcp"


It is NL80211 and not N180211?

rc.log now gives:
Code:
 * Starting WPA Supplicant Daemon ...
ioctl[SIOCSIWPMKSA]: Invalid argument
ioctl[SIOCSIWMODE]: Invalid argument
ioctl[SIOCGIWRANGE]: Invalid argument
ioctl[SIOCGIWMODE]: Invalid argument
ioctl[SIOCSIWAP]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWPMKSA]: Invalid argument
 [ ok ]
 * Starting DHCP Client Daemon ...
 [ ok ]
 * Bringing up interface enp12s0
 *   dhcp ...
 *     Running dhcpcd ...
dhcpcd[2191]: sending commands to master dhcpcd process
 [ ok ]
 *     received address
 [ ok ]
 * Bringing up interface wlp3s0
 *   Starting wpa_supplicant on wlp3s0 ...
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/wpa_supplicant/wlp3s0' manually if it is not used anymore
Failed to initialize control interface '/var/run/wpa_supplicant'.
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.

 *   start-stop-daemon: failed to start `/usr/sbin/wpa_supplicant'
 [ !! ]
 * ERROR: net.wlp3s0 failed to start
 * ERROR: cannot start netmount as net.wlp3s0 would not start
 * Starting local
 [ ok ]


I removed the /var/run/wpa_supplicant/wlp3s0 file and rebooted but that made no difference.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Sun Jun 30, 2013 2:49 pm    Post subject: Reply with quote

Yes it is an L, but the l in lower case. So, theres's an invalid argument somewhere. Do NetworkManager and/or Wicd are started too? Because Wpa_supplicant complain about an other instance of itself who is already started.

Try to stop all network script and verify that wpa_supplicant and dhcp daemon are not active for the wlp3s0 interface with the command ps or htop. If so kill them.
Manually try to get your wlp3s0 up an configure as the root user:

Code:
wpa_supplicant -B -c /etc/wpa_supplicant/wpa_supplicant.conf -D nl80211 -dd -f /var/log/wpa.log -i wlp3s0 -t

Check after a moment if the interface is associated with the access point:
Code:
iwconfig wlp3s0

If not, have a look to /var/log/wpa.log. Only if the association with the access point have succeed:
Code:
dhcpcd wlp3s0


When you have a problem with the Gentoo network daemon, it is good to be sure that you can succeed to make up and running an interface manually before trying to automated it with the daemon.

My /etc/wpa_supplicant/wpa_supplicant.conf
Code:
ap_scan=1
country=CA # change for your country
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=0
eapol_version=1
fast_reauth=1
update_config=1

network={
        #psk="comment"
        psk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        ssid="name of the access point"
}


I set the access point that way:
Code:
wpa_passphrase <ssid> [passphrase] >> /etc/wpa_supplicant/wpa_supplicant.conf
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 943
Location: Belgium

PostPosted: Mon Jul 01, 2013 7:22 pm    Post subject: Reply with quote

Don't understand it anymore.

I removed dhcpcd and wpa_supplicant from runlevel default to start without any network-related stuff running. When I now boot I have the following with rc-status:
Code:
Runlevel: default
 dbus                                                                                                                                                                                [  started  ]
 net.enp12s0                                                                                                                                                                         [  started  ]
 net.wlp3s0                                                                                                                                                                          [  started  ]
 netmount                                                                                                                                                                            [  started  ]
 consolekit                                                                                                                                                                          [  started  ]
 local                                                                                                                                                                               [  started  ]
Dynamic Runlevel: hotplugged
Dynamic Runlevel: needed
Dynamic Runlevel: manual


Remark that net.wlp3s0 is up and running!!!
Taking a look at rc.log:
Code:
 * Bringing up interface enp12s0
 *   dhcp ...
 *     Running dhcpcd ...
dhcpcd[2122]: version 5.6.4 starting
dhcpcd[2122]: enp12s0: waiting for carrier
dhcpcd[2122]: enp12s0: carrier acquired
dhcpcd[2122]: enp12s0: sending IPv6 Router Solicitation
dhcpcd[2122]: enp12s0: sendmsg: Cannot assign requested address
dhcpcd[2122]: enp12s0: rebinding lease of 192.168.2.6
dhcpcd[2122]: enp12s0: acknowledged 192.168.2.6 from 192.168.2.1 `tc'
dhcpcd[2122]: enp12s0: checking for 192.168.2.6
dhcpcd[2122]: enp12s0: sending IPv6 Router Solicitation
dhcpcd[2122]: enp12s0: leased 192.168.2.6 for 259200 seconds
dhcpcd[2122]: forked to background, child pid 2160
 [ ok ]
 *     received address 192.168.2.6/24
 [ ok ]
 * Bringing up interface wlp3s0
 *   Starting wpa_supplicant on wlp3s0 ...
 [ ok ]
 *   Starting wpa_cli on wlp3s0 ...
 [ ok ]
 *   Backgrounding ... ...
 * WARNING: net.wlp3s0 has started, but is inactive
 * WARNING: netmount is scheduled to start when net.wlp3s0 has started
 * Starting local
 [ ok ]


Why does it runs now? The only difference is that I have powered down the pc for the night instead of just restarting or init 6.

If I run ps auxw I get:
Code:
...
root      2160  0.0  0.0   8560   360 ?        Ss   21:04   0:00 dhcpcd -m 2 enp12s0
root      2281  0.0  0.0  35632  1528 ?        Ss   21:04   0:00 /usr/sbin/wpa_supplicant -Dnl80211 -c /etc/wpa_supplicant/wpa_supplicant.conf -W -B -i wlp3s0 -P /var/run/wpa_supplicant-wlp3s0.p
root      2288  0.0  0.0  11012   336 ?        Ss   21:04   0:00 /usr/bin/wpa_cli -a /etc/wpa_supplicant/wpa_cli.sh -p /var/run/wpa_supplicant -i wlp3s0 -P /var/run/wpa_cli-wlp3s0.pid -B
...
root      2751  0.1  0.2 225684 22876 ?        S    21:05   0:00 /usr/bin/python2 -O /usr/share/wicd/gtk/wicd-client.py --tray
...


So even while I removed dhcpcd frm runlevel default it is up and running with the wired interface. Wpa_supplicant and wicd are also running.

What is even worse is that if I now open the gui of wpa_supplicant I see that is has found the wireless connection. And if I ask to connect it does connect to the wireless. If I ask it to scan it finds other wireless networks as well.

Only thing right now is that it doesn't do dhcp with the wireless router. So I dont have an IP address that works on the network and no working connection.

But I do not understand it. I removed dhcpcd and it is still running. But only with the wired connection, not with the wireless, while that is also defined in /etc//conf.d/net. Likewise I removed wpa_supplicant only to find it running (even better, working). I never did something for wicd except emerging it and running a few times inside kde to see what it would do/find. But wicd is still not finding more than the wired connection, no wireless connection there.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 943
Location: Belgium

PostPosted: Wed Jul 03, 2013 7:18 pm    Post subject: Reply with quote

Tested a bit more. Conclusion and questions so far:

- with dhcpcd and wpa_supplicant removed from runlevel default wireless works.
- I get a message that wicd cannot run and should be resterted. I didn't restart and didn't use it (AFAIK). Can I remove it?
- I took the pc to a place where it can see wireless networks it hasn't seen before. A scan works fine. And I can connect to it and receive an ip address.
- it looks as if when the pc boots attached to a wired network, the wireless cannot do dhcp. Is this correct?
- who starts dhcpcd if it is removed from runlevel default? Is this started when /etc/conf.d/net is called?
- netmount doesn't start as it is waiting for both network interfaces (wired and wireless) to be running. Is there a way to tell it to start when one of them is up?
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Wed Jul 03, 2013 9:32 pm    Post subject: Reply with quote

dhcpcd and wpa_supplicant boot scripts are generic. wpa_supplicant try find a local wireless card and try to associate it to an access point according to /etc/wpa_supplicant/wpa_supplicant.conf. dhcpcd try to get a valid configuration to all local network cards (wired and wireless) from dhcp servers. NetworkManager and Wicd do the same on their sides.

If you have a symoblic link from /etc/init.d/net.lo to /etc/init.d/net.wlp3s0 and net.wlp3s0 is in the boot process, it will be configure according to the contain of the file /etc/conf.d/net. Because you have configure wlp3s0 to call wpa_supplicant and dhcpcd from there, they are started. The same principle apply to the wire one enp12s0.

So you do not need dhcpcd, wpa_supplicant, networkmanager and wicd boot scripts. Delete them with rc-update and just keep net.enp12s0 and net.wlp3s0 in the boot process and your wired and wireless cards will be configure. It is important to use only one network configuration method to advoid problems.

About the netmount script, you can tell it to wait for the network to be up before starting with the options in /etc/conf.d/netmount and/or with /etc/rc.conf. Remark that you must have some remote network to mount in /etc/fstab for the netmount script do something.
_________________
Paul
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 943
Location: Belgium

PostPosted: Fri Jul 05, 2013 6:07 pm    Post subject: Reply with quote

Ok, thank you for explaining what happens. I'm afraid I don't know enough to get all that correctly. Most of the time I follow wiki's or other installation docs.

Information like you just explained is often missing. You can find info at noob level and info at expert level but rarely in between.

Anyway, I can connect to wireless wetworks without much trouble. The wired connection also works. And I now know that there is no reason to have netmount working. (no idea why that should start)
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum