# [solved] USB wifi adpater not working

## Reiner6

I have an old laptop i installed gentoo to, now im trying to make the wifi work, and i got it a wifi usb adapter, i tried working with it using iwconfig commands, but with no results; mostly i think because my network has a wpa2 protection, can anyone help me solve this?

thanks in advance  :Very Happy: Last edited by Reiner6 on Fri Aug 26, 2016 3:48 am; edited 1 time in total

----------

## Logicien

Assuming that the wireless Usb adapter is already working, I mean commands like

```
ifconfig wlan0 up

iwlist wlan0 scan | less
```

return access points available and the one you want to connect to. You need first to associate your wireless card to the access point. Suppose you create a simple wpa_supplicant.conf like this

```
wpa_passphrase access-point passphrase > /root/wpa_supplicant.conf
```

Replace access-point and passphrase with the good information. Than you start wpa_supplicant like this for testing

```
 wpa_supplicant -c /root/wpa_supplicant.conf -D nl80211,wext -i wlan0
```

Than, after a pause, you check if you are associated with the access point

```
iwconfig wlan0
```

If yes, than

```
dhcpcd wlan0
```

To get an Ip configuration from the dhcp server. Try to surf. This can be ameliorate but may work from the beginning after adapting (change wlan0 with the real wireless name interface). Than you can setup a boot script to do the same.

----------

## ian.au

 *Reiner6 wrote:*   

> I have an old laptop i installed gentoo to, now im trying to make the wifi work, and i got it a wifi usb adapter, i tried working with it using iwconfig commands, but with no results; mostly i think because my network has a wpa2 protection, can anyone help me solve this?
> 
> thanks in advance 

 

If you want meaningful help you need to be a bit more specific, ie. what is the hardware - the output of 

```
lsusb
```

 - you may need to 

```
emerge -a usbutils
```

 if not already installed.

You may need additional kernel options, firmware etc.. depending on the device. Have you tried to work through https://wiki.gentoo.org/wiki/Wifi if so, include what you did and how far you got - do you have a wireless device listed if you run: 

```
ip a
```

For wpa2 you need wpa_supplicant installed.

----------

## Reiner6

 *Logicien wrote:*   

> 
> 
> Replace access-point and passphrase with the good information. Than you start wpa_supplicant like this for testing
> 
> ```
> ...

 

I tried this and i got

```
Successfully initialized wpa_supplicant

ioctl[SIOCSIWENCODEEXT]: Invalid argument

ioctl[SIOCSIWENCODEEXT]: Invalid argument

ioctl[SIOCSIWSCAN]: Device or resource busy

wlan0: CTRL-EVENT-SCAN-FAILED ret=-1 retry1

```

and got stuck there, im guessing thats not a good thing

ian.au

lsusb tells me this

```
148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
```

----------

## ian.au

 *Reiner6 wrote:*   

>  *Logicien wrote:*   
> 
> Replace access-point and passphrase with the good information. Than you start wpa_supplicant like this for testing
> 
> ```
> ...

 

This is a systemd install, right? If setup with NetworkManager there might already have been a wpa_supplicant process running, which would give that error, what does 

```
systemctl status wpa_supplicant 
```

 return? If your credentials in /etc/wpa_supplicant/wpa_supplicant.conf are correct it should just work, you do have to restart  wpa_supplicant after you entered the config strings in /etc/conf.d.net and /etc/wpa_supplicant/wpa_supplicant.conf per the wiki ie 

```
systemctl restart wpa_supplicant
```

Unfortunately I don't have a system with this running at the moment and it's been some time since I set it up, but from memory provided you have a device listed to connect to 

```
ip a
```

, an entry in /etc/conf.d/net and correct passphrase in /etc/wpa_supplicant/wpa_supplicant.conf, that should be all that is required.

----------

## NeddySeagoon

Reiner6,

Post your dmesg on a pastebin site please.

----------

## Reiner6

A friend ended up helping me with NetworkManager, it solved everything

----------

