Wifi keeps disconnecting and extremely slow at low signal - Ubuntu 13.04

First off, I just want to say that I work as an IT engineer (Windows Desktop/Server etc) so I am willing to go right down to the ground when it comes to advance technical troubleshooting. Unfortunately however I am new to Linux so please be gentle at the same time.


The issue:

Ever since upgrading my HP Pavilion G6 laptop from Ubuntu 12.10 to 13.04 my wireless is not functioning correctly. The main issue is that if I sit upstairs the wireless signal drops to around '2' bars and the download speeds (according to speedtest.net) are extremely slow (0.26Mbps). However if I go and sit down stairs right in front of my router I get full signal and speedtest.net shows a fast connection (around 40Mbps).

This does not happen on Ubuntu 12.10. Sat both upstairs and downstairs I can get a strong signal and speed test results of up to 40Mbps.

I can provide screenshots of results if evidence is required.

Naturally, this issue is causing my second problem. Periodically at random times the connection to the Wifi will request for the Wifi password (clearly the password is correct as all other devices connect fine and it was just working on this password). If I try clicking OK to accept the password entered it will retry to connect for a few moments before requesting the password once again. This will end up in a continuous loop until I restart the laptop.


What I have tried/researched:

So from numerous google searches, askubuntu questions, guides for troubleshooting wifi, knowledge bases for hardware type etc. etc. It would seem that the issue is relating to the updated version of the wireless driver built in to the open source drivers when Ubuntu is deployed.

To the point:

Running the following commands on both 12.10 and 13.04 shows the following results:

Ubuntu 12.10

root@chris-test:~# lshw -C network

*-network               
   description: Wireless interface
   product: Ralink corp.
   vendor: Ralink corp.
   physical id: 0
   bus info: pci@0000:01:00.0
   logical name: wlan0
   version: 00
   serial: 68:94:23:0d:0e:db
   width: 32 bits
   clock: 33MHz
   capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
   configuration: broadcast=yes driver=rt2800pci driverversion=3.5.0-22-generic firmware=0.34 ip=192.168.15.225 latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn
   resources: irq:16 memory:52500000-5250ffff
*-network
   description: Ethernet interface
   product: RTL8101E/RTL8102E PCI Express Fast Ethernet controller
   vendor: Realtek Semiconductor Co., Ltd.
   physical id: 0
   bus info: pci@0000:02:00.0
   logical name: eth0
   version: 05
   serial: 28:92:4a:56:90:7e
   size: 10Mbit/s
   capacity: 100Mbit/s
   width: 64 bits
   clock: 33MHz
   capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
   configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl_nic/rtl8105e-1.fw latency=0 link=no multicast=yes port=MII speed=10Mbit/s
   resources: irq:42 ioport:3000(size=256) memory:52404000-52404fff memory:52400000-52403fff

root@chris-test:~# lspci -nnk | grep -iA2 net
01:00.0 Network controller [0280]: Ralink corp. Device [1814:539b]
Subsystem: Hewlett-Packard Company Device [103c:18ed]
Kernel driver in use: rt2800pci
--
02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller [10ec:8136] (rev 05)
Subsystem: Hewlett-Packard Company Device [103c:183f]
Kernel driver in use: r8169

Ubuntu 13.04

root@chris-laptop:~# lshw -C network
*-network               
   description: Wireless interface
   product: Ralink corp.
   vendor: Ralink corp.
   physical id: 0
   bus info: pci@0000:01:00.0
   logical name: wlan0
   version: 00
   serial: 68:94:23:0d:0e:db
   width: 32 bits
   clock: 33MHz
   capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
   configuration: broadcast=yes driver=rt2800pci driverversion=3.8.0-19-generic firmware=0.34 ip=192.168.15.225 latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn
   resources: irq:16 memory:52500000-5250ffff
*-network
   description: Ethernet interface
   product: RTL8101E/RTL8102E PCI Express Fast Ethernet controller
   vendor: Realtek Semiconductor Co., Ltd.
   physical id: 0
   bus info: pci@0000:02:00.0
   logical name: eth0
   version: 05
   serial: 28:92:4a:56:90:7e
   size: 10Mbit/s
   capacity: 100Mbit/s
   width: 64 bits
   clock: 33MHz
   capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
   configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl_nic/rtl8105e-1.fw latency=0 link=no multicast=yes port=MII speed=10Mbit/s
   resources: irq:43 ioport:3000(size=256) memory:52404000-52404fff memory:52400000-52403fff

root@chris-laptop:~# lspci -nnk | grep -iA2 net
01:00.0 Network controller [0280]: Ralink corp. Device [1814:539b]
Subsystem: Hewlett-Packard Company Device [103c:18ed]
Kernel driver in use: rt2800pci
02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller [10ec:8136] (rev 05)
Subsystem: Hewlett-Packard Company Device [103c:183f]
Kernel driver in use: r8169

So from what I can see, the only main difference here is the 'driverversion' on both distros.

Ubuntu 12.10:

configuration: broadcast=yes driver=rt2800pci driverversion=3.5.0-22-generic firmware=0.34 ip=192.168.15.225 latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn

driverversion=3.5.0.22-generic

Ubuntu 13.04:

configuration: broadcast=yes driver=rt2800pci driverversion=3.8.0-19-generic firmware=0.34 ip=192.168.15.225 latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn

drivervesrion=3.8.0.19-generic

I can only imagine that something has been changed in the newer versions which is actually causing problems with my wireless card.


So what I think I may need to do is push this driver to the older version? Can anyone confirm this as a possible fix? Is anyone able to tell me that I am barking up the completely wrong tree?

I hope this has been informative enough for someone to provide some help. If any further information is required, as mentioned earlier, I am more than happy to run further commands and tests to try and isolate the issue.

P.S. Thanks in advance for your time and consideration.


Update

So I had a very interesting moment last night!

My DVD drive was unable to open the tray when pressing the button and would no longer read DVDs.

I connected the mains power to my laptop and hey presto, my DVD drive started working again.

Leaving the mains connected I tried running a speedtest on the wifi. (40Mbps - roughly full capability of my line).

However, I have tried the battery on 12.10 and there is no problem what so ever.

My assumption

From discovering this, I can only assume that 13.04 is not supporting my battery/power settings correctly?

The other possibility is that battery itself is faulty, but when I run a battery test from the HP UEFI it does not appear to show any errors.

Thoughts?

Update 19/09/13

So following on from this, I have tried updating the 13.04 partition kernel to 3.9 rather than 3.8 which has solved the problem for some people according to a number of bug trackers.

Unfortunately, this has not solved the problem for me. This makes me think it is more than likely a kernel issue with these drivers.

Any further thoughts?


I suggest your try two things:

echo "options rt2800pci nohwcrypt=1" | sudo tee /etc/modprobe.d/rt2800pci.conf

sudo modprobe -rfv rt2800pci

sudo modprobe -v rt2800pci

I believe power management is the main issue, please do:

gksudo gedit /etc/pm/power.d/wireless

(this will create or edit a configuration file that will override the default power management behavior) and enter the following:

#!/bin/sh

/sbin/iwconfig wlan0 power off

above exit0, then save gedit, close and reboot.

Thanks