# Ubuntu – Wifi gets disconnected automatically

I am using Ubuntu 14.04 LTS and recently I had problem with my wifi card RT3290 Wireless 802.11n 1T/1R PCIe. Then I found this answer which leads me to This second solution. The second solution solved my problem.

But after some time I find my wifi is getting disconnected automatically, and if I disable and then enable internet after some time from the menu bar it works again. Now it has become practically impossible to use internet via wifi in Ubuntu. I found This bug and this Post, but neither of them has an answer.

• First, check the settings in the router. WPA2-AES is preferred; not any WPA and WPA2 mixed mode and certainly not TKIP. Second, if your router is capable of N speeds, you may have better connectivity with a channel width of 20 MHz in the 2.4 GHz band instead of automatic 20/40 MHz, although it is likely to affect N speeds. I also have better luck with a fixed channel, either 1, 6 or 11, rather than automatic channel selection. Also, be certain the router is not set to use N speeds only; auto B, G and N is preferred. In some cases, auto B and G may also be helpful. After making these changes, reboot the router.

Next, I recommend that your regulatory domain be set explicitly. Check yours:

sudo iw reg get


If you get 00, that is a one-size-maybe-fits-all setting. Find yours here: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 Then set it temporarily:

sudo iw reg set IS


Of course, substitute your country code if not Iceland. Set it permanently:

gksudo gedit /etc/default/crda


Use nano or kate or leafpad if you don't have the text editor gedit. Change the last line to read:

REGDOMAIN=IS


Proofread carefully, save and close the text editor.

Next, I'd set IPv6 to Ignore in Network Manager: http://docs.fedoraproject.org/en-US/Fedora/18/html/Installation_Guide/images/netconfig/network-connections-ipv6-ignore.png This example is for ethernet, but you want wireless.

If these changes do not help, please try:

sudo -i
echo "options rt2800pci nohwcrypt=Y"  >  /etc/modprobe.d/rt2800pci.conf
modprobe -r rt2800pci && modprobe rt2800pci
exit


If these changes are still not helpful, let's compile the newest version of the driver. Download this package to your desktop: https://www.kernel.org/pub/linux/kernel/projects/backports/2015/11/15/backports-20151115.tar.gz Right-click it and select 'Extract Here.' Now, back to the terminal:

sudo apt-get install linux-headers-generic build-essential
cd ~/Desktop/backports-20151115
make defconfig-wifi
make
sudo make install


Reboot, unload ndiswrapper and tell us if there is any improvement.

sudo modprobe -r ndiswrapper
sudo modprobe rt2800pci


If these changes are helpful, remove ndiswrapper:

sudo apt-get purge ndiswrapper-utils-1.9
sudo apt-get purge ndiswrapper


The native driver rt2800pci may be blacklisted. Please check:

sudo gedit /etc/modprobe.d/blacklist.conf


If it is, remove the line blacklist rt2800pci, save and close the text editor.

Also, you have compiled the driver for your currently running kernel only. When Update Manager installs a newer linux-image, after the requested reboot, recompile:

cd ~/Desktop/backports-20151115
make clean
make defconfig-wifi
make
sudo make install


Please retain the file and these instructions for that time.