Wednesday, January 14, 2009

rt73usb problem with Ubuntu Intrepid

Recently, my wireless connection seems unreliable. It keeps dropping from time to time unpredictably. I cannot just reconnect it with network-manager. I had to unplug my Linksys WUSB54GC usb stick and plug it again to work.
After getting frustrated with this, I finally did a quick google search and found out that this is somewhat a know issue with as describe in https://bugs.launchpad.net/ubuntu/+bug/283759
The suggested solution is to install linux-backports-modules-generic package.
I am trying it out now and I'll update this later if it works out well.

UPDATE:
Nope, not working for my current intrepid kernel:
$ uname -rv
2.6.27-9-generic #1 SMP Thu Nov 20 22:15:32 UTC 2008

The kernel module won't even load due to some "unknown symbols" error in the syslog

Next, I have also tried compiling the compat-wireless from http://linuxwireless.org/en/users/Download but also could not work. This time, the kernel modules could load, but could not connect at all due due to time-out errors.

Finally and hesitantly, I tried the legacy rt73 serialmonkey drivers. Thanks to the instruction from http://linuxbidouille.com/2008/10/25/wifi-rt73-rt73usb/ [ it is in french, but the shell commands is a universal language ;-) ], I had to blacklist rt73usb and then compile and install rt73 module with the following steps (slightly different steps, probably due to newer CVS version).

First, download the latest legacy rt73 package from http://rt2x00.serialmonkey.com/wiki/index.php?title=Downloads
Then, decompress and compile it with the following commands:
tar xvf rt73-cvs-daily.tar.gz
cd rt73-cvs-*/Module/
make -j4 # where 4 is the number of concurrent jobs; I have a quad core Phenom X4.

Next, I unloaded the drivers, blacklist the existing drivers by adding two lines to /etc/modprobe.d/blacklist and add the new module to /etc/modules
sudo ifconfig wlan0 down
sudo modprobe -r rt73usb
sudo modprobe -r rt2500usb
echo 'blacklist rt73usb' | sudo tee -a /etc/modprobe.d/blacklist
echo 'blacklist rt2500usb' | sudo tee -a /etc/modprobe.d/blacklist
echo 'rt73' | sudo tee -a /etc/modules

Then, install and reload the modules
sudo make install
sudo depmod -ae
sudo modprobe rt73


Because legacy serialmonkey drivers are not supported by Network Manager, I need to manual configure the wireless network before I could bring up the network interface by adding the following lines to /etc/network/interfaces:
auto wlan0
iface wlan0 inet dhcp
pre-up iwconfig wlan0 essid "YourWirelessSSID"
pre-up iwpriv wlan0 set AuthMode=WPA2PSK # or WPAPSK
pre-up iwpriv wlan0 set EncrypType=AES # or TKIP
pre-up iwpriv wlan0 set WPAPSK="Your_WPA_Password"

If you worry about storing the password as cleartext, it can be encrypted using wpa_passphase command:
$ wpa_passphrase YourWirelessSSID
# reading passphrase from stdin
Your_WPA_Password
network={
ssid="YourWirelessSSID"
#psk="1234password5678"
psk=6d5a47c07977445329d6701c78a26ce1df86263c9779aa83b4e8d125637b9d5b
}

then copy the long hexadecimal string to /etc/network/interfaces to replace the line
pre-up iwpriv wlan0 set WPAPSK="your WPA password"

with
pre-up iwpriv wlan0 set WPAPSK=6d5a47c07977445329d6701c78a26ce1df86263c9779aa83b4e8d125637b9d5b


Finally, bring up the network with:
sudo ifconfig wlan0 up


Wireless should be working fine now, so far I have been running KTorrent for almost whole day and wireless connection is still working, no connection drop :-)

The only disadvantage is if you are using laptop and roam between wireless networks and you have to manually configure the /etc/network/interfaces. I believe wpa_supplicant could be used, but I have not figure out that part yet. Perhaps next time...


Update May 2009: I have upgraded to Kubuntu Jaunty, and they have finally got it right. I am using the default drivers and things work out of box, so far it has been reliable, not drop connections and download speed is good. So no need for the above workaround unless you really want to stay with Intrepid.

No comments: