# Can't get connected with wireless card

## relvar

Hello all,

First post here. I love Gentoo and while it's been great as a wired music server, I now want to enable wireless to reduce cable clutter. 

Problem: wpa_supplicant won't connect with the wireless card I'm using, a TL-WN951N. Perhaps it is yet another problem with wpa_supplicant, of which I've seen a few posts but nothing resolved my situation.

My card has an Atheros chip and supports 64/128 bit WEP, WPA-PSK/WPA2-PSK. (It has worked before with other distros on another network).

My router is broadcasting my SSID and is using WPA2-Personal with AES on the 2.4Ghz frequency. I have no problem connecting other devices to it.

I've been following the guidebook and wiki for wpa_supplicant, but to no avail.

My kernel has 

```
 grep CONFIG_PACKET /usr/src/linux/.config

CONFIG_PACKET=y

# CONFIG_PACKET_DIAG is not set

```

/etc/conf.d/net

```

##---------- wireless ----------------------

# Prefer wpa_supplicant over wireless-tools

modules="wpa_supplicant"

# It's important that we tell wpa_supplicant which driver we should

# be using as it's not very good at guessing yet

wpa_supplicant_wlp5s9="-Dnl80211"

config_wlp5s9="dhcp"

```

I have this driver built-in to the kernel.

/etc/wpa_supplicant/wpa_supplicant.conf

```

ctrl_interface=/var/run/wpa_supplicant

update_config=1

network={

        ssid="myssid"

        #psk="password"

        psk=passwordscramble

        proto=WPA2

        key_mgmt=WPA-PSK

}

```

psk scrambled in hex of course, provided by wpa_passphrase

```

$ sudo /etc/init.d/net.wlp5s9 restart

 * Bringing down interface wlp5s9

 *   Removing addresses

 *     Stopping wpa_cli on wlp5s9 ...                                                                                                                 [ ok ]

 *     Stopping wpa_supplicant on wlp5s9 ...                                                                                                          [ ok ]

 * Bringing up interface wlp5s9

 *   Starting wpa_supplicant on wlp5s9 ...

Successfully initialized wpa_supplicant                                                                                                               [ ok ]

 *   Starting wpa_cli on wlp5s9 ...                                                                                                                   [ ok ]

 *   Backgrounding ... ...

 * WARNING: net.wlp5s9 has started, but is inactive

```

```

$ sudo ifconfig wlp5s9

wlp5s9: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500

        ether f8:d1:11:89:76:ac  txqueuelen 1000  (Ethernet)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

```

```

$ sudo wpa_cli status

Selected interface 'wlp5s9'

wpa_state=DISCONNECTED

p2p_device_address=f8:d1:11:89:76:ac

address=f8:d1:11:89:76:ac

```

This is likely obvious considering the above.

```

$ sudo dhcpcd wlp5s9

dhcpcd[21827]: control_open: Connection refused

dhcpcd[21827]: version 6.4.7 starting

dhcpcd[21827]: wlp5s9: adding address fe80::5767:bccc:b167:3f04

dhcpcd[21827]: wlp5s9: waiting for carrier

dhcpcd[21827]: timed out

dhcpcd[21827]: allowing 8 seconds for IPv4LL timeout

dhcpcd[21827]: timed out

dhcpcd[21827]: exited

```

Enabled BBCode, given that tags were in use. -- desultory

----------

## Roman_Gruber

well i can show you my way how to use wpa_supplicant...

Assumption: 

*) kernel configured and booted that kernel

*) basic network knowledge about wireless lan

*) basic bash knowledge

*) have a correct /etc/wpa_supplicant.conf (right spot for this file and right settings, try around different settings as explained on the web until it works)

ifconfig -a

ifconfig eth0 off

repeat this for any other network device

ifconfig wlan0 up

man wpa_supplicant or wpa_supplicant --help

run as help says but with your needed settings, example:

  wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf

dhcp wlan0

should work. I did write it down how i did it a while ago, you need to probe around and read the howtos. Gentoo wiki and other wikis or howtos are a good starting point.

please note, router + kernel settings + binary wlan driver + right wpa_supplicant conf file + right useflags for your box + right invocation of the commands should work

----------

## relvar

Thanks, tw04l124. I will keep trying these things.

----------

## relvar

I relied on a reboot and wpa_cli, following Arch's wiki

https://wiki.archlinux.org/index.php/WPA_supplicant

I think I had several instances of wpa_supplicant running and thus couldn't make sense of the scan output.

Anyway, problem solved!

----------

## ShanaXXII

My wpa_supplicant.conf is different. See if this configuration works

```
ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel

ap_scan=1

network={

   ssid="Wifi_name"

   proto=WPA2

   psk="wifi_password"

   priority=2

}
```

----------

