Sunday, May 9, 2010

Atheros AR5212 in Ubuntu 10.04 Lucid Lynx

I've just finished a fresh install of Ubuntu Lucid Lynx 10.04 on my crusty old Thinkpad T60. Everything is working great with the exception of my Atheros AR5212 wireless card.

Clicking the network manager applet in the panel I see the wireless listed as "Device not ready". This is tedious.

The solution to this issue is to remove the mainline ATK5K wireless driver from your Kernel and replace it with non-mainline MadWifi driver (source). MadWifi has superior support for the AR5212 card. This shouldn't take you more than about 20 minutes to sort out.
  1. Open a terminal: Aplications -> Accessories -> Terminal
  2. To check on your wireless card and make sure you have the AR5212:
    trastle$ sudo lshw -c network
    The result will look similar to this:
    *-network
        description: Wireless interface
        product: AR5212 802.11abg NIC
        vendor: Atheros Communications Inc.
        physical id: 0
        bus info: pci@0000:03:00.0
        logical name: wifi0
    Now you know your sporting an Atheros AR5212.
  3. Install some software you'll need to build MadWifi:
    trastle$ sudo apt-get install subversion linux-kernel-headers build-essential \
    libssl-dev
  4. Now go to your desktop
    trastle$ cd ~/Desktop 
  5. Make a directory to put the MadWifi source in:
    trastle$ mkdir madwifi-src
  6. Get the latest MadWifi source:
    trastle$ svn checkout http://madwifi-project.org/svn/madwifi/trunk madwifi-src
  7. Change into your new source directory:
    trastle$ cd madwifi-src
  8. Change to the root user:
    trastle$ sudo -i
  9. Blacklist the non working ATH5K drivers:
    root$ echo "# Block ATH5K" >> /etc/modprobe.d/blacklist
    root$ echo "blacklist ath9k" >> /etc/modprobe.d/blacklist
    root$ echo "blacklist ath5k" >> /etc/modprobe.d/blacklist
  10. Change to the MadWifi source directory
    root$ cd /home/[your user]/Desktop/madwifi-src
  11. Build and install the MadWifi driver:
    root$ make && make install -d
  12. Add the MadWifi driver to your Kernel
    root$ echo ath_pci >> /etc/modules

Now save anything else you have been working on and reboot your laptop. After the reboot your wireless will be working nicely.

2010-06-20: Edit added step 10. Thanks Xi.

28 comments:

Anonymous said...

Wow...

Many thanks for your solution!

I will try that for sure.

I've been looking everywhere for a simple and well explained solution.

Hope it will work for me!

Anonymous said...

Well... it did not work.

Unknown said...

No go for me, either. Can't authenticate WPA.

Anonymous said...

This worked for me, including authenticating WPA. It's a shame to have to install a wireless driver from source though, bug and security fixes won't come in automatically. Is there no better way?

Unknown said...

...before continue with nr. 10 change to madwifi dir of course, so it worked for me too. thx a lot

Troy Test 1234 said...

@Claude did you get your wireless working in the end?

@xi Thanks for the correction I have rolled updated the post.

Unknown said...

Worked like a charm!

AR5001 and Ubuntu 10.04

Sam

xpan said...

worked for me too! Thank you a million...

Actually at first it didn't work. The reason was that I use localized Ubuntu and "Desktop" was translated to my language (non-latin). So 'make' was giving me an error. I changed to home directory (which is my name in latin) created madwifi-src directory and tried again. Then the magic happened. Make worked and after restart I enabled the driver from the admin panel.

Million thanks again!
Chris

Petros said...

This worked great for me also. Thanks a lot.

Mekossou B. said...

Good job ; thanks a lot
it's ready for my Atheros AR5001X+ Wireless Network Adapter

Unknown said...

I'm getting this on step 2
crberry@crberry-z60t:~$ sudo apt-get install subversion linux-kernel-headers build-essential libssl
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting linux-libc-dev instead of linux-kernel-headers
Package libssl is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package libssl has no installation candidate
crberry@crberry-z60t:~$

Troy Test 1234 said...

@ Charles the end part of the command was cut off.
Give libssl-dev a go:
sudo apt-get install libssl-dev

Unknown said...

got thru it, rebooted. I cannot connect to the router, it asks for the wep key a few times and then disconnects for good. Here is dmesg | grep ath .. any signs here?
[ 0.502942] device-mapper: multipath: version 1.1.0 loaded
[ 0.502946] device-mapper: multipath round-robin: version 1.0.0 loaded
[ 12.690491] ath_pci 0000:13:00.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
[ 12.690507] ath_pci 0000:13:00.0: setting latency timer to 64
[ 13.544520] MadWifi: ath_attach: Switching rfkill capability off.
[ 13.604848] ath_pci: wifi0: Atheros 5212: mem=0xa7f00000, irq=19
[ 23.812024] ath0: no IPv6 routers present
[ 60.827703] ath0: unknown SIOCSIWAUTH flag 12
[ 76.575998] ath0: unknown SIOCSIWAUTH flag 12
[ 92.652134] ath0: unknown SIOCSIWAUTH flag 12
[ 108.625915] ath0: unknown SIOCSIWAUTH flag 12
[ 130.756046] ath0: unknown SIOCSIWAUTH flag 12
[ 146.820909] ath0: unknown SIOCSIWAUTH flag 12

Troy Test 1234 said...

@Charles. Your dmesg output shows the driver is being correctly loaded then no DHCP offers are being made.

The last message "unknown SIOCSIWAUTH flag 12" looks like a bad return code being passed to MadWifi from the router (ieee80211_wireless.c).

Try temporarily configuring your router with a different SSID and no WEP to see if your able to connect.

Unknown said...

worked thanks a lot :)

Kendor said...

Worked on my x40 with Atheros AR5001X+

Unknown said...

super! solved it for my ubuntu 10.04 and atheros 5001X card, thx a bunch

Jack Deth said...

You are a f***ing genious! I've been pulling all my hair out since upgrading to 10.04 trying to get my wireless with my AR5212 working again with no success. I was beginning to despair having to reinstall everything yet again. You are a f***ing icon in the world of Linux. Thank you for sharing your knowledge.

-Troy

Anonymous said...

Worked for Ubuntu 10.10.

Many thanks!

Unknown said...

Worked flawlessly on T61/AR5212.
Thanks!

-aw

zen said...

Hi Troy. I have an Atheros 5212 on a Toshiba U-300, and just upgraded to 10.04.

Tried using the fix, but when I try to make and install the driver (i.e. step 11), I get the following error-

cd: 1: can't cd to /lib/modules/2.6.32-25-generic/build
Makefile.inc:66: *** /lib/modules/2.6.32-25-generic/build is missing, please set KERNELPATH. Stop.

Any advice?
Thanks, Mahesh

Troy Test 1234 said...

Hi Mahesh,

My guess is the compile is looking for your Kernel headers and not finding them. Does the directory exist on your file system? If not you will need to download the headers for your Kernel:

$ sudo apt-get install linux-headers-$(uname -r)

Let me know how it goes for you.

zen said...

Hey Troy.
Thanks so much for your help. There were a couple of minor glitches I ran into, and was trying to figure out how to sort them out, which took me a few days. It turned out that there were a few other things I needed to do-
1. In the modprobe.d folder, there was a file blacklisting ath_pci which needed to be hashed out.
2. I needed to run an update and an upgrade.
3. Importantly, as I found out from here-
https://help.ubuntu.com/community/WifiDocs/Driver/Atheros#KurianAlternative
Kernel 2.6.32.22 (and higher) have changed the default for the rfkill parameter of ath_pci from 0 to 1, which had the effect of killing the methods described above. You'll need to make sure that it's set back to 0 on system startup. To do that, edit (or create) the file /etc/modprobe.d/options.conf to include the line

options ath_pci rfkill=0

After a few evenings of frustration trying to sort this out, it's all finally working. Thanks again for the excellent guide!
Cheers, Mahesh

Unknown said...

Works with Thinkpad T41 (no, not 61) and Atheros AR5212 and Ubuntu 10.10. Thank You!

Unknown said...

Worked like charm on an antique FuSi (wifi: DWL-G650) running Ubuntu 10.04 LTS! Thanks a lot!

Dr. Mark Endicott said...

Thanks for the help! Worked the first time on my Lenovo R61 on Ubuntu 10.10.

Unknown said...

Hola funciono para ubuntu 11.10, vaio vgn-fs815f atheros wifi AR5212/AR5213, recordar en las lineas de comandos dice desktop, para los que trabajan en versiones con otros lenguajes utilizar el nombre de la carpeta por defecto de su idioma, por ejemplo en el mio es home/felipe/Escritorio/.

Anonymous said...

Big thanks man !

After 2 days, You have find the solution !

A last problem : "Bad password" with WPA2 ! but :
sudo aptitude remove network-manager
sudo /etc/init.d/wicd restart
solved my problem !
src : http://ubuntuforums.org/showthread.php?t=1675398

Thanks a lot

Your are my deus !

Post a Comment