Ubuntu – Wifi ( Realtek device) disconnects every few minutes

connectioninternetnetworkingrealtek-wirelesswireless

Ever since I installed 16.04 on this laptop, I have had the following problem, only on Ubuntu (everything works fine on my Windows side): the wi-fi disconnects after maybe 2 minutes. I can reconnect for another 2 minutes or so by clicking "Enable Wi-Fi" off and on again, or by restarting network-manager from the command line.

Occasionally after doing this a few times, these methods will no longer work and I'll have to restart my computer. Or, sometimes after doing this a few times, the network will then appear connected in the network-manager applet in the top toolbar, but any page will just time out.

I have tried a variety of things over the past year to fix this, to no success; a couple of these attempted fixes caused more wi-fi issues – I'm now back to where I was when I started: wifi connects but cuts out every few minutes.

The attempted fixes that didn't work for me include:

  • updating the OS
  • installing wicd (which I later removed)
  • running sudo apt autoremove
  • starting or restarting network-manager using sudo service network-manager restart
  • setting IPv6 to "Ignore" for the connection I'm trying to connect to
  • some others that I've forgotten

So, I am now looking for help with my specific situation because trying similar things I found on Stack Overflow hasn't solved my problem and I'm afraid trying more will worsen the situation again.

Here is the output of wireless-info, during a time when the wifi appeared connected but all pages were timing out: http://paste.ubuntu.com/25582452/ I have a Realtek RTL8821AE wireless adapter on an ASUS A555 laptop.

Best Answer

See this post on medium.com

The comments on this page indicate that the issue resolves after following the steps. One person claims to have the same laptop as well. It will update your drivers with the newest available.

The model of the device (RTL8821AE) is very important, we will come back to this later.

For some reason, realtek adapters have a history of disconnects and signal drops, but, lucky for us there is an answer.

sudo apt-get install linux-headers-generic build-essential git 
git clone http://github.com/lwfinger/rtlwifi_new.git
cd rtlwifi_new
make
sudo make install

These commands build and install the drivers for rtl8192ce, rtl8192se, rtl8192de, rtl8188ee, rtl8192ee, rtl8723ae, rtl8723be, and rtl8821ae all in one go.

Just in case the system doesn’t load the appropriate kernel module, you can execute the following command from within your rtlwifi_new directory

sudo modprobe rtl8821ae

and reboot your system.