You are not logged in.

#1 2015-03-10 11:56:36

Frefreak
Member
Registered: 2013-12-18
Posts: 24

[SOLVED] rtl8192eu wireless adapter's driver problem

I bought a TP-WN821N wireless USB adapter, after plugged in there's even no new interface when I invoke "ip addr". From "lsusb" I get its ID is "0bda:818b". Google for a while I figured out its chipset is rtl8192eu (I thought it was 8192cu and would works just fine), whose driver, it seems, has not been included in the current kernel. Then I found a driver at github, made a modification on the Makefile(or there would be some error about macro "__DATE__" might prevent reproducible), it compiled successfully.
Now the USB adapter is recognized and a new interface is created. But there're some problems. When plugged in there's a lot of error kernel messages(journalctl). The interface name is recognized as enp0s29u1..., not started with a 'w'. I tried to create a rule file to change its name but it failed with some error during boot and the name stays the same. I managed to connect to an AP with some efforts. There're also some errors when using wifi-menu. "iw list" cannot find it, create_ap or hostapd fails to start, saying

nl80211: Could not configure driver mode
nl80211 driver initialization failed. 

I tried

nmcli r wifi off
rfkill unblock wlan

but in vain.
So my question is whether there's a better driver for this rtl8192eu, or what should I do to this USB adapter now? The only reason that I bought it is to create AP since my laptop's integrated adapter uses iwlwifi and has no AP mode.

Last edited by Frefreak (2015-03-10 15:38:10)

Offline

#2 2015-03-10 12:30:22

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: [SOLVED] rtl8192eu wireless adapter's driver problem

Like all Realtek USB vendor drivers, this one uses a private wireless stack and wext (wireless extensions) instead of mac80211/nl80211. So iw and hostapd, which exclusively use nl80211, won't work. There are hacked versions of hostapd that contain a driver specifically for these Realtek thingies - AUR lists hostapd-8188eu, hostapd-8192cu and hostapd-rtl871xdrv - maybe one of these will work.

As for the interface name, the driver needs a patch similar to this one for the 8192cu vendor driver: https://github.com/pvaret/rtl8192cu-fix … a43c5721ab

Offline

#3 2015-03-10 12:58:32

Frefreak
Member
Registered: 2013-12-18
Posts: 24

Re: [SOLVED] rtl8192eu wireless adapter's driver problem

Gusar wrote:

Like all Realtek USB vendor drivers, this one uses a private wireless stack and wext (wireless extensions) instead of mac80211/nl80211. So iw and hostapd, which exclusively use nl80211, won't work. There are hacked versions of hostapd that contain a driver specifically for these Realtek thingies - AUR lists hostapd-8188eu, hostapd-8192cu and hostapd-rtl871xdrv - maybe one of these will work.

As for the interface name, the driver needs a patch similar to this one for the 8192cu vendor driver: https://github.com/pvaret/rtl8192cu-fix … a43c5721ab

Thanks, I will try those later. BTW, is it possible that in the future, the kernel will include the driver of 8192eu? I remember seeing somewhere that the newest kernel for Raspberry Pi has included it.

Offline

#4 2015-03-10 13:14:59

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: [SOLVED] rtl8192eu wireless adapter's driver problem

Frefreak wrote:

BTW, is it possible that in the future, the kernel will include the driver of 8192eu?

Someone would need to clean the driver up and propose it for inclusion. If it hasn't happened yet, I somehow doubt it will. And even if it happens, the only place the driver can go is staging, similarly to how the kernel currently contains the 8188eu and 8723au drivers in staging. No driver with a private wireless stack will go into the kernel proper, the only option is someone writes a new driver from scratch, one that uses the mac80211 stack.

Offline

#5 2015-03-10 13:27:03

progandy
Member
Registered: 2012-05-17
Posts: 4,517

Re: [SOLVED] rtl8192eu wireless adapter's driver problem

Gusar wrote:
Frefreak wrote:

BTW, is it possible that in the future, the kernel will include the driver of 8192eu?

Someone would need to clean the driver up and propose it for inclusion. If it hasn't happened yet, I somehow doubt it will. And even if it happens, the only place the driver can go is staging, similarly to how the kernel currently contains the 8188eu and 8723au drivers in staging. No driver with a private wireless stack will go into the kernel proper, the only option is someone writes a new driver from scratch, one that uses the mac80211 stack.

A driver for the pci version of rtl8192e is in staging. If you feel confident enough, you may be able to build on that.
https://wireless.wiki.kernel.org/en/use … %5D=r8192e

Last edited by progandy (2015-03-10 13:28:27)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#6 2015-03-10 13:55:04

Frefreak
Member
Registered: 2013-12-18
Posts: 24

Re: [SOLVED] rtl8192eu wireless adapter's driver problem

After following Gusar's advice, the interface name is OK now, show as wlp0s29u...
Journalctl emits some messages about RTL871X when plugged in, so I downloaded hostapd-rtl871x from AUR. Changed driver=nl80211 to driver=rtl871xdrv in the config file. But hostapd still fails to start:

Configuration file: /etc/hostapd/hostapd.conf
drv->ifindex=4
l2_packet_init: ioctl[SIOCGIFINDEX]: No such device
no br0 interface , let l2_sock_recv==l2_sock_xmit=0x0x190e2d0
ACS: Automatic channel selection started, this may take a bit
ACS: Failed to request initial scan
wlp0s29u1u4: IEEE 802.11 Configured channel (0) not found from the channel list of current mode (0) IEEE 802.11b
wlp0s29u1u4: IEEE 802.11 Hardware does not support configured channel
Could not select hw_mode and channel. (-3)
wlp0s29u1u4: interface state UNINITIALIZED->DISABLED
wlp0s29u1u4: AP-DISABLED 
wlp0s29u1u4: Unable to setup interface.
+rtl871x_sta_deauth_ops, ff:ff:ff:ff:ff:ff is deauth, reason=3
rtl871x_set_key_ops
rtl871x_set_key_ops
rtl871x_set_key_ops
rtl871x_set_key_ops
hostapd_free_hapd_data: Interface wlp0s29u1u4 wasn't started
ELOOP: remaining socket: sock=6 eloop_data=0x190e3e0 user_data=(nil) handler=0x451ce0

What should I do now... Should I try another driver?

Offline

#7 2015-03-10 14:06:02

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: [SOLVED] rtl8192eu wireless adapter's driver problem

progandy wrote:

A driver for the pci version of rtl8192e is in staging. If you feel confident enough, you may be able to build on that.
https://wireless.wiki.kernel.org/en/use … %5D=r8192e

Entirely different driver for a different much older chipset. The PCIe version of the 8192eu would be 8192ee. There is a proper rtl8192ee driver in the kernel, but it seems there's a lot more involved in a USB device driver, despite the wifi chip itself being similar/the same.

The issue with Realtek is that there are completely different teams, that aren't even in the same country, for PCIe and for USB drivers. The PCI division has learned to write proper mac80211 drivers. The USB division not so much, they still release what is probably the Windows driver with an abstraction layer on top.

Frefreak wrote:

What should I do now... Should I try another driver?

There is no other driver. If this hacked hostapd doesn't work, your best bet is returning the adapter and buying a new one. Or maybe try hostapd-8192cu, it seems it's based on a different hostapd version.

I too recently bought a TP-WN821N, however mine does contain the 8192cu chip. Still, the kernel rtl8192cu driver doesn't work well for me (I suspect a power management issue, as the connection drops almost exactly after 5 minutes), so I've been using the vendor driver. Didn't try hostapd though, don't have a need for it.

TP-Link used to have Atheros chips in their adapters, these worked great with the ath9k_htc driver. Even the firmware for ath9k_htc is open source! However then they switched to Realtek, whose USB drivers are, well, not ideal.

Last edited by Gusar (2015-03-10 14:15:19)

Offline

#8 2015-03-10 14:33:46

Frefreak
Member
Registered: 2013-12-18
Posts: 24

Re: [SOLVED] rtl8192eu wireless adapter's driver problem

Gusar wrote:

There is no other driver. If this hacked hostapd doesn't work, your best bet is returning the adapter and buying a new one. Or maybe try hostapd-8192cu, it seems it's based on a different hostapd version.

I too recently bought a TP-WN821N, however mine does contain the 8192cu chip. Still, the kernel rtl8192cu driver doesn't work well for me (I suspect a power management issue, as the connection drops almost exactly after 5 minutes), so I've been using the vendor driver. Didn't try hostapd though, don't have a need for it.

TP-Link used to have Atheros chips in their adapters, these worked great with the ath9k_htc driver. Even the firmware for ath9k_htc is open source! However then they switched to Realtek, whose USB drivers are, well, not ideal.

Yours is probably version 4(mine is 5). I may try to return it and get another one later. Thanks for your answer.

Last edited by Frefreak (2015-03-10 14:34:09)

Offline

Board footer

Powered by FluxBB