# [Solved] Wi-Fi RTL8812AU troubles

## jommes

Dear all,

some days ago, I bought an usb wifi adapter:

https://wikidevi.com/wiki/Netis_WF2190

I followed these guide:

https://wiki.gentoo.org/wiki/AC1200_Wireless_Adapters

https://wiki.gentoo.org/wiki/Wpa_supplicant

to make it running.

Running wpa_supplicant outputs:

```
wpa_supplicant v2.5

random: Trying to read entropy from /dev/random

Successfully initialized wpa_supplicant

Initializing interface 'enp0s20u4' conf '/etc/wpa_supplicant/wpa_supplicant.conf' driver 'default' ctrl_interface '/var/run/wpa_supplicant/' bridge 'N/A'

Configuration file '/etc/wpa_supplicant/wpa_supplicant.conf' -> '/etc/wpa_supplicant/wpa_supplicant.conf'

Reading configuration file '/etc/wpa_supplicant/wpa_supplicant.conf'

ctrl_interface='DIR=/var/run/wpa_supplicant GROUP=wheel'

update_config=1

nl80211: Driver does not support authentication/association or connect commands

nl80211: deinit ifname=enp0s20u4 disabled_11b_rates=0

nl80211: Remove monitor interface: refcount=0

netlink: Operstate: ifindex=2 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)

nl80211: Set mode ifindex 2 iftype 2 (STATION)

nl80211: Failed to set interface 2 to mode 2: -19 (No such device)

enp0s20u4: Failed to initialize driver interface

Failed to add interface enp0s20u4

enp0s20u4: Cancelling scan request

enp0s20u4: Cancelling authentication timeout
```

Running wpa_cli outputs:

```
wpa_cli v2.4

Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.

See README for more details.

Interactive mode

Could not connect to wpa_supplicant: (nil) - re-trying
```

/usr/src/linux/.config:

https://bpaste.net/raw/c892648a9c53

lsusb:

```
Bus 004 Device 002: ID 8087:8000 Intel Corp. 

Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 003 Device 002: ID 8087:8008 Intel Corp. 

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 003: ID 152d:3562 JMicron Technology Corp. / JMicron USA Technology Corp. JMS567 SATA 6.0Gb/s bridge

Bus 002 Device 002: ID 0781:5583 SanDisk Corp. 

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 001 Device 005: ID 046a:010d Cherry GmbH 

Bus 001 Device 004: ID 1ea7:002c  

Bus 001 Device 003: ID 0bda:8812 Realtek Semiconductor Corp. RTL8812AU 802.11a/b/g/n/ac WLAN Adapter

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
```

ifconfig:

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

        ether 04:8d:38:d6:af:ff  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

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

        inet 127.0.0.1  netmask 255.0.0.0

        loop  txqueuelen 0  (Lokale Schleife)

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

lsmod:

```
Module                  Size  Used by

8812au               1077921  0

x86_pkg_temp_thermal     4591  0
```

modinfo 8812au:

https://bpaste.net/raw/561c6a6387a8

What did I missed?

Thanks in advance,

BestLast edited by jommes on Thu Mar 31, 2016 4:49 pm; edited 1 time in total

----------

## jommes

more details:

iwlist scan:

https://bpaste.net/raw/60c203d851ec

wpa_supplicant.conf:

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

update_config=1

ap_scan=1

network={

   ssid="WLAN-5CWMNM"

   psk=b1e4df811b73ba44e06efc0d858a0ac01192b7aa823bdc58bd4a11ecb34464f1

   pairwise=CCMP

   group=CCMP

}
```

/etc/conf.d/net.enp0s20u4:

```
modules="wpa_supplicant"

wpa_supplicant_enp0s20u4="-Dwext -ienp0s20u4 -c/etc/wpa_supplicant/wpa_supplicant.config -f /var/log/wpa_supplicant.log -dd"

config_enp0s20u4="dhcp"
```

/var/log/wpa_supplicant.log:

https://bpaste.net/raw/80404a3cbc82

----------

## khayyam

 *jommes wrote:*   

> /etc/conf.d/net.enp0s20u4:
> 
> ```
> modules="wpa_supplicant"
> 
> ...

 

jommes ... I suspect your issue is caused by the use of the wext driver (which is the cause of the 'ioctl[SIOCSIWENCODEEXT]: Invalid argument' errors in wpa_supplicant.log).

Also, you don't need to provide -i<interface> ... that is defined by the variable name, and the config is normally suffixed '.conf' (not '.config'). The following should be correct:

```
wpa_supplicant_enp0s20u4="-Dnl80211 -dd -f /var/log/wpa_supplicant.log"
```

HTH & best ... khay

----------

## jburns

If -Dnl80211 does not work try -D8812au

----------

## khayyam

 *jburns wrote:*   

> If -Dnl80211 does not work try -D8812au

 

jburns ... you are confusing linux drivers with wpa_supplicant drivers ... the above '8812au' doesn't exist as a possible option:

```
drivers:

  nl80211 = Linux nl80211/cfg80211

  wext = Linux wireless extensions (generic)

  wired = Wired Ethernet driver
```

best ... khay

----------

## jommes

Hi,

first of all thanks for reply.

with nl80211 driver I get:

```
wpa_supplicant v2.5

random: Trying to read entropy from /dev/random

Successfully initialized wpa_supplicant

Initializing interface 'enp0s20u4' conf '/etc/wpa_supplicant/wpa_supplicant.config' driver 'nl80211' ctrl_interface 'N/A' bridge 'N/A'

Configuration file '/etc/wpa_supplicant/wpa_supplicant.config' -> '/etc/wpa_supplicant/wpa_supplicant.config'

Reading configuration file '/etc/wpa_supplicant/wpa_supplicant.config'

ctrl_interface='/var/run/wpa_supplicant'

ctrl_interface_group='0'

update_config=1

ap_scan=1

Line: 7 - start of a new network block

ssid - hexdump_ascii(len=11):

     57 4c 41 4e 2d 35 43 57 4d 4e 4d                  WLAN-5CWMNM     

PSK - hexdump(len=32): [REMOVED]

pairwise: 0x10

group: 0x10

Priority group 0

   id=0 ssid='WLAN-5CWMNM'

nl80211: Driver does not support authentication/association or connect commands

nl80211: deinit ifname=enp0s20u4 disabled_11b_rates=0

nl80211: Remove monitor interface: refcount=0

netlink: Operstate: ifindex=2 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)

nl80211: Set mode ifindex 2 iftype 2 (STATION)

nl80211: Failed to set interface 2 to mode 2: -19 (No such device)

enp0s20u4: Failed to initialize driver interface

Failed to add interface enp0s20u4

enp0s20u4: Cancelling scan request

enp0s20u4: Cancelling authentication timeout
```

----------

## khayyam

jommes ...

can I see the relevent part of dmesg when you connect the device ...

best ... khay

----------

## jommes

 *Quote:*   

> can I see the relevent part of dmesg when you connect the device ...

 

https://bpaste.net/raw/53f17d4dce5c

Plugged device in at [   52.743171]

Best regards

----------

## jommes

When I try to perfom

```
/etc/init.d/net.enp0s20u4 start
```

I get:

```
 * Bringing up interface enp0s20u4

 *   Starting wpa_supplicant on enp0s20u4 ...

 *   /etc/wpa_supplicant/wpa_supplicant.conf not found

 * ERROR: net.enp0s20u4 failed to start
```

but the conf is there ...

----------

## jommes

Ok I was able to fix the init error.

It seems everything is fine now (with wext driver).

wpa_supplicant log:

https://bpaste.net/raw/0fc7e7285d8a

But still no internet connection ...

----------

## jommes

It works now!

I also added wpa_supplicant to runlevel default (network interface was already on boot).

Used dhcp to configure my network interface and used wext as wpa_supplicant driver.

Thanks everyone and have a nice day!

Best

----------

## khayyam

 *jommes wrote:*   

> 
> 
> ```
>  * Bringing up interface enp0s20u4
> 
> ...

 

jommes ... I did mentioned this above, you have been using the suffix "*.config".

 *jommes wrote:*   

> I also added wpa_supplicant to runlevel default (network interface was already on boot). Used dhcp to configure my network interface and used wext as wpa_supplicant driver.

 

You shouldn't do this, wpa_supplicant  is defined in /etc/conf.d/net and so will be started by /etc/init.d/net.<interface>. Also, when using net.<interface> dhcp is the default, so you shouldn't need to start a dhcp client to get an ip address. Also, 'net.<interface>' should be in the 'default' runlevel and not 'boot'.

best ... khay

----------

## jommes

 *Quote:*   

> I did mentioned this above, you have been using the suffix "*.config". 

 

Yes, you were right.

Now the behavior is quite strange again.

My network interface receives a rubbish ip address ...

When the internet connection was there, I performed

```
emerge --sync
```

and while performing, it stopped ...

Removed wpa_supplicant from any runlevel.

----------

## khayyam

 *jommes wrote:*   

> Now the behavior is quite strange again. My network interface receives a rubbish ip address ...

 

jommes ... 'rubbish' as in a link-local address? That will happen if your dhcp client doesn't get a reply from its request (so, bad network connection or no dhcp server reply).

 *jommes wrote:*   

> When the internet connection was there, I performed 'emerge --sync' and while performing, it stopped ...

 

That, and the above, sound as though the signal/link quality is bad ... see the output of 'iw dev <interface> link, or 'iwconfig <interface>', and check the status in 'wpa_cli status'.

best ... khay

----------

## jommes

Hi khay,

Link Quality 100/100 Signal level=67/100

The situtation is now:

After boot, sometimes connection is established, sometimes not (if not, than network interface got rubbish ip).

Maybe you are right, maybe signal level of 67 is too bad?

----------

## khayyam

 *jommes wrote:*   

> Link Quality 100/100 Signal level=67/100

 

If that is the 'link quality' then its fine ... though 'signal level' should be in dBm and not ratios.

 *jommes wrote:*   

> The situtation is now: After boot, sometimes connection is established, sometimes not (if not, than network interface got rubbish ip).

 

I should give you my "its radio" lecture but you can search the forum for that ... there are various things that can be happening here, ie high txpower (so tighter frames and therefore more packet loss), or poor driver/firmware quality, environmental pollution, etc, etc, etc ... I can't tell from the information so far provided.  

 *jommes wrote:*   

> Maybe you are right, maybe signal level of 67 is too bad?

 

That isn't 'signal' ... it should show '-<number> dBm'

best ... khay

----------

## Logicien

I am following the thread, when the signal level=40/100 generally I can connect and the link work. So, if the signal level=67/100 it is enough good for the data transfer to be stable. I think here the module who drive the wireless card can loose packets or things like that.

If the 8812au module need some Realtek staging drivers to be activated, this can explain why the link is not good.

----------

## jommes

Hi Logicien,

 *Quote:*   

> If the 8812au module need some Realtek staging drivers to be activated, this can explain why the link is not good.

 

I'm not pretty sure yet, but I got connection with r8712u driver.

Best regards

----------

