Sunday, March 28, 2010

Fixing wireless

Next big obstacle to overcome is the wireless driver. After some research I learned about three paths to follow:
  1. Waiting for lucid final
  2. Using the windows driver via ndiswrapper
  3. Compiling a ath9k driver from compat-wireless
Option one is not really an option as I want to have wireles now. The ndiswrapper solution might work well but I guess not as efficient as a native driver. The missing native driver support was already mentioned in a launchpad bug entry. So my first shot is compiling the driver by myself. Hey, it's linux and the source is with you. Actually it was quite easy. I got all information from http://wireless.kernel.org/en/users/Download

Get the current source tarball:
wget http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2.6.tar.bz2

Unpack it somewhere in your home dir:
tar xvfj compat-wireless-2.6.tar.bz2

Change into the source dir, for example:
cd compat-wireless-*

Select the ath9k driver and compile it:
./scripts/driver-select ath9k
make

Install the driver:
sudo make install

Unload the old drivers and load the new one:
sudo make unload
sudo make wlunload
sudo make btunload
sudo modprobe ath9k

That's it. The only drawback is that you always have to do that again after installing a new kernel image.

Note: kernel 2.6.32-22 and compat-wireless-2010-05-05 works.


45 comments:

  1. What is the performance of your wireless? Using the wifi on my 1001p, I'm only getting 1Mb/s download. When I use the wired connection, I get 5Mb/s.

    ReplyDelete
  2. Hi,

    tried both your tips on my brandnew ASUS 1001P and what can I say :-) Success!!

    Its working, I can change brightness, I can use WLAN :-)

    Thanks

    Michael

    P.S.

    Now going to solve backtrack 4 problems with the ASUS 1001P.

    ReplyDelete
  3. When downloading a file from a test FTP server of my ISP I'm getting 1.7 Mb/s. Same with my Thinkpad notebook (in b/g mode). When using ethernet the 1001p does 3.8 Mb/s and the notebook 4.2 Mb/s.

    ReplyDelete
  4. Was unable to get this to work. When I make I get:
    make -C /lib/modules/2.6.31-20-generic/build M=/home/alonea/compat-wireless-2010-04-03 modules
    make[1]: Entering directory `/usr/src/linux-headers-2.6.31-20-generic'
    CC [M] /home/alonea/compat-wireless-2010-04-03/drivers/net/wireless/ath/ath9k/xmit.o
    /home/alonea/compat-wireless-2010-04-03/drivers/net/wireless/ath/ath9k/xmit.c: In function ‘ath_tx_complete_buf’:
    /home/alonea/compat-wireless-2010-04-03/drivers/net/wireless/ath/ath9k/xmit.c:1880: error: too many arguments to function ‘ath_debug_stat_tx’
    make[5]: *** [/home/alonea/compat-wireless-2010-04-03/drivers/net/wireless/ath/ath9k/xmit.o] Error 1
    make[4]: *** [/home/alonea/compat-wireless-2010-04-03/drivers/net/wireless/ath/ath9k] Error 2
    make[3]: *** [/home/alonea/compat-wireless-2010-04-03/drivers/net/wireless/ath] Error 2
    make[2]: *** [/home/alonea/compat-wireless-2010-04-03/drivers/net/wireless] Error 2
    make[1]: *** [_module_/home/alonea/compat-wireless-2010-04-03] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.31-20-generic'


    Bit of a newb, just trying to get something other than ndiswrapper as it dc's me constantly.

    ReplyDelete
  5. Hello, for me it's the first time using linux. The first thing I want to say is, thank you very much olaf, your guide was a great help. :)
    In the beta release of xubuntu I couldn't install the wlan due to missing header-package in xubuntu (well I am a newbe in linux, didn't know what to do). With ubuntu it self this was not a problem. However, with ubuntu i got an error message during compilation. This problem could be solved by using an older version of the "compat-wireless-2.6.tar.bz2" which seems to be updated some times. So I used instead "http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2010-03-23.tar.bz2" and all works fine.

    ReplyDelete
  6. Ok, thanks for the update. Works great and hopefully all my issues with disconnecting will be fixed. It sure connected faster than it did with ndiswrapper. Also thanks for the hint on the brightness. That also works great now. The only thing that is finicky is the scrolling, but thats probably because the multitouch drivers are buggy. "Thank" Apple for getting me addicted to 2 finger scroll...

    ReplyDelete
  7. hi thanks for the help, but i can't get past the second step here. when i type:

    tar xvfj compat-wireless-2.6.tar.bz2

    i get this:

    tar: compat-wireless-2.6.tar.bz2: Cannot open: No such file or directory
    tar: Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Exiting with failure status due to previous errors

    i'm no expert, so i'm thinking the problem is simple here....

    ReplyDelete
  8. worked just fine with ubuntu netbook edition 9.10, thanks!

    ReplyDelete
  9. @anonymous: you have to be in the same directory as the downloaded source archive file. So in the console do a cd to change to that directory.

    ReplyDelete
  10. new release "2010-04-11" didn't work as well. Though I could compile it wireless still wouldn't work.

    ReplyDelete
  11. This works great - thanks! Just one problem I cannot figure out. Every time I reboot the machine - it resets the bios and disables the WLAN card. This basically forces me to go into bios settings every time I reboot. Any ideas what might be doing that?

    ReplyDelete
  12. Hallo Olaf,
    hab als Neuling ein riesen Problem mit dem installieren der Treiber. Kriege das ganze bis driver-select hin, nur beim "make" sagt das Terminal mir "make: gcc: Kommando nicht gefunden" Hab das GCC auch installiert obwohl es als Paket vorhanden ist. Trotzallem komme ich nicht weiter. Versuche es mit 9.10 sowohl als mit 10.4. Versuch die Treiber compat-wireless-2010-03-23. Könntest du mir ein Tip geben. Ist bestimmt etwas simples. Danke im Vorazs für deine Mühen.
    Gruss Kenan

    ReplyDelete
  13. gr8 job!!!
    Der Altruisten Award geht an...
    Olaf Geibig!

    Deine Lösung funktioniert bei mir prima.
    Systeminfo:
    Ubuntu 9.10 NBR
    Asus Eee PC 1001P

    Vielen Dank und Gruß aus Taunusstein
    Jens

    ReplyDelete
  14. bei mir hat auch alles besten funktioniert
    vielen lieben dank!!!!!
    heribert pleschko

    ReplyDelete
  15. Just FYI, the compilation issue you faced has been fixed for a couple of weeks now. I just built and installed the latest on an Ubuntu 9.10 system. Works great.

    Do be aware that this doesn't coexist well if you've already installed the backports package and you'll need to purge that package prior to trying to load these modules.

    ReplyDelete
  16. Hallo Olaf Geibig,
    interpretiere ich Deinen Beitrag richtig, dass beim EEE PC 1001p in 3 Tagen zum Release nach Installation von 10.04 WLAN automatisch erkannt wird/werden sollte? Das wäre ein Licht an meinem Horizont. :-)
    Ich habe mir das EEE-Schätzchen letzte Woche günstig ergattert, möchte WLAN nutzen und bin allerdings zu sehr Ubuntu-Newbie, als dass ich mich da schon an solche "Basteleien" wage, die ich dann überhaupt nicht verstehe... :-)
    Gruss
    Jörg

    ReplyDelete
  17. Hey, Thanks for this guide. Both this wireless fix and the brightness fix worked with the 32 kernel, but it worked for a bit with th 33 so I went back to 32.

    Well written and easy to follow which is sometimes hard to find when it comes to Linux distros. I could not wait two days for the final release to put the NBR of Lucid on my 1001p! Hah!

    ReplyDelete
  18. Olaf,

    everything is fine except when press Fn + F2 for disabling wireless (for battery save for example), lan will be disabled too. this is the same when turning on - behavior like it's the one device.

    ReplyDelete
  19. Got my 1001p in the mail yesterday and installed the newly released Lucid UNR. No joy with the wireless.

    The link to the 2.6 wireless drivers is changed in favor of a new method on the website.

    So I un-commented the lucid backports in the apt.sources, and installed linux-backports-modules-wireless-lucid-generic.

    No Joy. So I removed them.
    Downloaded the bleeding edge drivers from wireless.kernel.org.

    Same process of extracting and compiling. It also helps to install gcc before compiling as that is not a part of the default UNR load.

    Worked like a charm.

    ReplyDelete
  20. Vielen Dank für die Anleitung!
    Es funktioniert auf meinem 1001p mit frisch installiertem Ubuntu 10.4.

    Thanx for this guide!
    I've installed Ubuntu 10.4 onto my 1001P, and now WLAN is working again.

    ReplyDelete
  21. Does wifi work out-of-the-box in 10.4 final? I installed 10.4 beta a few weeks ago, followed your directions to get wifi working and it worked until I upgraded to 10.4 this weekend.

    ReplyDelete
  22. i just installed ubuntu 10.4 final and it didn't work out of the box.

    also with the latest compat driver, your guide didn't work...

    if it works, i guess i will have a wireless adapter shown in the networksettings??

    because there wasn't any..

    ReplyDelete
  23. Ok, for those of you who are confused, here is what you need to do step by step to install the working driver in UNR 10.4:

    first ensure that you have gcc (sudo apt-get install gcc).

    Get the bleeding edge source tarball:

    You can not just wget it, and must browse to:

    http://wireless.kernel.org/en/users/Download

    about 1/2 way down the page look for "You can get bleeding edge compat-wireless here:"

    Unpack it somewhere in your home dir:
    tar xvfj compat-wireless-2.6.tar.bz2
    or if that command fails (uncompress then extract bunzip2 compat-wireless-2.6.tar.bz2 then tar-xvf compat-wireless-2.6.tar)

    Change into the source dir, for example:
    cd compat-wireless-*

    Select the ath9k driver and compile it:
    ./scripts/driver-select ath9k
    make

    Install the driver:
    sudo make install

    Unload the old drivers and load the new one:
    sudo make unload
    sudo make wlunload
    sudo make btunload
    sudo modprobe ath9k

    That's it. The only drawback is that you always have to do that again after installing a new kernel image.

    Works nicely Ive tried it a bunch this weekend, solid wireless.

    You can tell it is working by doing a
    lsmod |grep 80211
    you will see that ath9k is loaded.

    lspci -v will show that the wifi is using ath9k driver.

    ReplyDelete
  24. thank you very much
    works great with
    1001p unr 10.4

    ReplyDelete
  25. Hello.
    Thank You very much for your post!
    Everything works!
    ASUS Eee PC 1001P and Ubuntu 10.04

    ReplyDelete
  26. On a related note, I decided to install Arch Linux my 1001p yesterday and wifi worked right out of the box.

    ReplyDelete
  27. Great Work, thank you.

    ReplyDelete
  28. I updated ubuntu today. It does still out work out of the box. But kernel 2.6.32-22 and compat-wireless-2010-05-05 works.

    ReplyDelete
  29. hey man, you are my god of wireless connectivity :-) thnx alot! but interestingly the latest compat-wireless didn't work for me, i had to take the 2010-05-05 with the .22 kernel.

    ReplyDelete
  30. I'm running Ubuntu 9.10 with brightness control and wifi on my 1001P. Brightness control worked out of the box. Wifi worked after using the advice on this forum http://ubuntuforums.org/showthread.php?t=1396074
    Internal microphone worked for Skype after using the advice on this forum
    http://ubuntuforums.org/showthread.php?t=1436133

    Getting the above working on 10.04 looks painful to this newbie.
    Does the team think that Canonical will provide updates to 10.04 so that the problems of brightness, wifi and internal microphone on Skype work with us having to customise 10.04?

    ReplyDelete
  31. Correction.
    Last line of my comment should have been:

    microphone on Skype work WITHOUT us having to customise 10.04?

    ReplyDelete
  32. Hi Olaf, interessantes Problem hier(U 10.4), wenn ich "...ath9k make" eingebe, gibt er mir eine Usage : soundso message, und das kernel-modul ist schon vorhanden.Leider tut wireless trotzdem nicht, hat da jemand eine Idee?

    ReplyDelete
  33. Whenever the computer "wakes up" from suspend or hibernate, it refuses to connect to my wireless network until I reboot. Any suggestions would be great.

    ReplyDelete
  34. @Justin
    You don't have to reboot. Just rmmod and modprobe
    the module.

    ReplyDelete
  35. There has to be a way to automate that, correct? This is my wife's netbook and that is very impractical for her.

    ReplyDelete
  36. Wow. I can't believe I found this. Thanks a bunch: clear, simple, and worked great.

    ReplyDelete
  37. Very nice, thank you very much !
    Also the part about brightness controls worked fine for me :)

    ReplyDelete
  38. ASUS Eee PC Ubuntu 10.4 Wireless Fix
    Eee PC 10.4 Wireless Working
    Eee PC 10.4 Wireless Solution

    Thank you so much, just wish this came up first in the ranks rather than an out of date 8.04 page from 2008.

    ReplyDelete
  39. Greetings!

    I'm trying to make this tutorial but it does not find the GCC command. Since I have no internet access (duh! ;)) how can I make this work? How should I install GCC??

    Note: I'm using lucid netbook remix

    ReplyDelete
  40. Moltes gràcies! Falta comentar que cal tenir instal·lar el gcc

    ReplyDelete
  41. Thanks for the tutorial. This worked through a couple of kernel security updates on my eee PC1001P using Lucid (not NBR), but somewhere around June 1 there was a security update to 2.6.32-22-generic and the 'make wlload' (or 'modprobe ath9k') stopped working. The routines compile and the modules build, but I get the following errors with modprobe:

    WARNING: Error inserting ath9k_hw (/lib/modules/2.6.32-22-generic/updates/cw/ath9k_hw.ko): Unknown symbol in module, or unknown parameter (see dmesg)
    WARNING: Error inserting mac80211 (/lib/modules/2.6.32-22-generic/updates/net/mac80211/mac80211.ko): Unknown symbol in module, or unknown parameter (see dmesg)
    WARNING: Error inserting ath9k_common (/lib/modules/2.6.32-22-generic/updates/cw/ath9k_common.ko): Unknown symbol in module, or unknown parameter (see dmesg)
    FATAL: Error inserting ath9k (/lib/modules/2.6.32-22-generic/updates/cw/ath9k.ko): Unknown symbol in module, or unknown parameter (see dmesg)

    Anybody have any idea what to do? I've reinstalled the headers and rebuilt the kernel with no change. The modules load OK into the 2.6.32-21 kernel that was built in the original installation, so I'm able to continue to boot with that.

    Thanks,
    Howard

    ReplyDelete
  42. Thanks for the nice howto.

    I found out about one error with Kernel 2.6.32-22 and the bleeding edge of compat. I ran into problems with the make-process of wext.
    To solve that, you'll have to change one line in scripts/gen-compat-autoconf.sh. It is written:
    if [ $SUBLEVEL -lt 32 ]; then

    I changed it to
    if [ $SUBLEVEL -le 32 ]; then

    The compilation now went smoothly and I could load the module afterwards.

    ReplyDelete
  43. The script has been fixed upstream and installing linux-backports-modules-wireless-lucid-generic works for me.

    ReplyDelete
  44. Using the compat wireless drivers creates an error when using tools like aircrack. The error locks the wireless card into a hypothetical -1 channel. I have found a way to fix this on Ubuntu. Visit http://ubuntuforums.org/showthread.php?p=9558176 for the fix. Olaf you may post this directly on your blog if you want. I will do the same on mine so please make reference to http://www.thecomputerknowhow.blogspot.com

    Thanks

    ReplyDelete
  45. Thanks a lot for this guide! It fixed the problem with my EEE 1000PX. Have re-done the procedure several times after updates and it keep fixing the wireless every time. :) (I keep using the same compat-wireless-2010-05-12 I initially used since it works ok for me.)

    Big Thank you!

    ReplyDelete