The Linux Rain Linux General/Gaming News, Reviews and Tutorials

Getting Realtek 8188EU Wireless Adapters to work in Linux (and possibly other wireless Realtek chipsets!)

By Andrew Powell, published 05/02/2017 in Tutorials


Alright, so, disclaimer. This will likely be most suited for advanced or at least intermediate level Linux users. If you love NetworkManager, look away now, because we're going to obliterate it from the system. Unless, of course, someone works out how to make NetworkManager use the 'wext' driver. In which case, let me know!

Having recently bought a TP-Link TL-WN725N Nano USB Wireless Dongle for my laptop, I encountered what seems to be an unfortunately common problem with these wireless dongles that use Realtek drivers, such as 8188EU, which mine uses. Like me, you'll probably plug it in, go to the WiFi chooser (such as the wireless network selector in GNOME) and... nothing will happen. The dialog box will just be stuck at "searching for wireless networks..." or something similar.

Then you'll fire up a terminal, hit dmesg and see a bunch of spam relating to the wireless dongle, such as -

[ 1622.273368] R8188EU: INFO indicate disassoc
[ 1622.374408] IPv6: ADDRCONF(NETDEV_UP): wlp0s20u3: link is not ready
[ 1623.708779] R8188EU: INFO indicate disassoc
[ 1623.809643] IPv6: ADDRCONF(NETDEV_UP): wlp0s20u3: link is not ready
[ 1623.838688] R8188EU: INFO indicate disassoc
[ 1623.939751] IPv6: ADDRCONF(NETDEV_UP): wlp0s20u3: link is not ready

And so on.

dmesg will keep being spammed with this message so long as the dongle is plugged in and active, all the while that you WON'T get any networks show up for connection in your WiFi menu. A frustrating problem, to be sure, and seemingly one that has only happened in recent kernels, of say, the past year or two. As far as my Googling suggests, anyway.

The Problem

The problem, as it turns out, is the wireless API driver for wpa_supplicant (the underlying background software used by the likes of NetworkManager) used by default which is the modern "nl80211" driver. The old school, now depreciated driver is known as "wext".

However, depreciated or not, wext is the driver we want for these problematic Realtek chipsets such as the one found in the TP-Link TL-WN725N V2 dongle (RTL8188EU). I've heard of similar problems with "link is not ready" dmesg spam with other RTL8xxx series driven dongles too, so this is probably the same problem and worth a try if you're banging your head against a wall trying to get your dongle to work.

The Easier Way - Replace NetworkManager with Wicd

wicd is an alternative network manager for Linux with a decent amount of configurations, with both a CLI and graphical utility (wicd-gtk) available.

It has support for both nl80211 and wext drivers, but interestingly, still uses wext by default. Which is exactly what we want here. First, let's kill NetworkManager, and I'm assuming we're using a systemd system here.

sudo systemctl stop NetworkManager.service
sudo systemctl disable NetworkManager.service

Then we get rid of NetworkManager (just to be safe, though it may be sufficient just to disable it. Your mileage may vary). Adapt as necessary for your distribution.

For Debian/Ubuntu-based systems:

sudo apt-get remove network-manager

Or Arch Linux:

sudo pacman -R NetworkManager

And so on.

To be safe, let's also make sure wpa_supplicant is not running.

killall wpa_supplicant

Then install and activate wicd:

sudo apt-get install wicd wicd-gtk wicd-curses
sudo systemctl enable wicd.service
sudo systemctl start wicd.service

Look for the wicd utility in your applications, fire it up and hopefully... you get some networks show up in the list! wicd also runs as a tray application, which you may or may not love. You won't get any integration into something like GNOME's default network indicator folks. Though someone may well one day make a GNOME extension for that....

The Manual, More Hands On Way - Handle wpa_supplicant directly

For those who love doing things a little more manually in the command-line, you can do away with third-party network managers like NetworkManager or wicd entirely and just go straight to the source program - wpa_supplicant - which will pretty much already be installed on any system that has wireless capability. First, disable/remove NetworkManager as above, then proceed to run the wpa_supplicant command as shown below.

This is actually pretty simple:

wpa_supplicant -B -Dwext -c <(wpa_passphrase "ESSID" "PASSWORD") -i wlan0

Obviously, substitute ESSID, etc, with your actual wireless network ID. It's also important to note that you'll want to run this in a proper root shell, as opposed to running the command with sudo, for reasons outlined on the wpa_supplicant Arch Wiki Page.

The -i switch in the command may also need changing, depending on the wireless interface your system has. It may well be wlan0, or it may be the somewhat less intuitive and memorable wlp0s20u3, or similar. Change as needed.

The -D switch is also the crucial one here, as by issuing -Dwext, we are telling wpa_supplicant to use the wext driver.

Finally, assuming wpa_supplicant has initialized the wireless adapter properly (if your dongle has a flashing LED like mine, by now you'll notice it blinking if all has gone well), we just need to get an IP address. For most of us it'll probably be by DHCP, so the lovely little dhcpcd command will do the trick.

dhcpcd

And it will take care of the rest.

Houston, We Have Connection

Whichever way you choose, at this point hopefully you'll have a working wireless internet connection!

Simply open a web browser and try load a webpage, or issue a command in a shell such as ping www.google.com and you will quickly see if you have a proper connection.

After loading the wext driver, you should see all the dmesg spam completely stop in relation to link not ready errors too.

You may notice I never mentioned how to install the Realtek driver(s) in this article, such as the RTL8188EU driver that my dongle uses. It seems to be included in distros like Arch Linux and Ubuntu anyway, however, for a totally free software oriented distribution such as Fedora, you would need to download and compile the driver module manually. Let me know in the comments if you would like me to do an article covering this!

Also, if anyone knows how to force NetworkManager to use the wext driver extension, let me know! At the moment it's the only real reason to get rid of it in this instance, as NetworkManager does as it pleases and ignores any configurations set for wpa_supplicant or any other overrides I've tried such as setting wifi-wext-only=true in /etc/NetworkManager/NetworkManager.conf.

Somehow fix that, and we wouldn't have to commit NetworkManager murder =).


About the author

Andrew Powell is the editor and owner of The Linux Rain who loves all things Linux, gaming and everything in between.

Tags: tutorials realtek wireless 8188 networkmanager wicd network wpa_supplicant
blog comments powered by Disqus