Page 1 of 2

[NC10] How to enable wireless card, with RFKILL support

Posted: 15 Feb 2009, 14:44
by voria
The Samsung NC10 has an Atheros wireless card, for which a free driver is actually under heavy development stage. Every day a lot of bugs got fixed and almost all the features of the card are supported. :)

Anyway, when we come to a new Ubuntu 8.10 installation, the wireless card does not work and we need to install a newer driver.
Easy to do: just install linux-backports-modules-intrepid package from official repos and disable old driver adding the following lines to /etc/modprobe.d/blacklist:

Code: Select all

blacklist ath_pci
blacklist ath_hal
After a system restart the card will work correctly.

Now the interesting part of this thread:
we are going to enable the RFKILL support, so the wireless card can be switched on/off when needed. :)

A patch for the driver which enables this functionality already exists, it has been written by Tobias Doerffel, and it's awaiting for being merged on main development trunk.
For more information, check the ath5k-devel mailing list.

Here is the patch, which obviously needs to be applied to driver sources.

Another usefull patch that I'm using is this one (written by Bob Copeland), which fixes an annoying bug happening sometime, when the card can't be reset until next system power cycle.

Now we have to enable the FN-F9 key to toggle the wireless card. To do this we'll use a script which will insert/remove the wireless module, but it will need admin rights to do that. So, we have to set up sudo with a new rule, in order to run the script with no need to insert our password everytime.

In a terminal, launch the command

Code: Select all

sudo visudo
This will open the sudo configuration file for editing.

Go to the line

Code: Select all

# Cmnd alias specification
and below it add this one:

Code: Select all

Cmnd_Alias      WLTOGGLE=/usr/local/bin/wlonoff.sh
Now go to the end of file and add this line:

Code: Select all

%admin ALL=(ALL) NOPASSWD: WLTOGGLE
Exit (CTRL+x) and save the file.
This way, all the users in admin group can run the WLTOGGLE command (and ONLY this command) with no need for the password.

Now get the script, copy it to /usr/local/bin and make it executable. Then configure the FN-F9 key:

Code: Select all

gconftool-2 -s --type string /apps/metacity/keybinding_commands/command_2 'sudo /usr/local/bin/wlonoff.sh'
gconftool-2 -s --type string /apps/metacity/global_keybindings/run_command_2 XF86WLAN
Now the XF86WLAN key (ie FN-F9) will launch the 'sudo /usr/local/bin/wlonoff.sh' command when pressed.

For any information or help, just ask here! :)

RE: [NC10] How to enable wireless card, with RFKILL support

Posted: 16 Feb 2009, 23:09
by voria
I just updated the package to latest version, so there will be no problems with the latest kernel released today. :)

RE: [NC10] How to enable wireless card, with RFKILL support

Posted: 05 Mar 2009, 16:28
by voria
Removed link to 2.6.27-12 kernel module (latest kernel available for ubuntu is 2.6.27.13 now).

RE: [NC10] How to enable wireless card, with RFKILL support

Posted: 11 May 2009, 22:17
by godsiem
Hi!

As a new owner of a NC10, and linux user, I found this page extremely useful! I have to congratulate Voria and all the community, these efforts are very constructive!

Anyway, but as always, you always have some remain issues that keep us posting here :D...

I have installed Ubuntu 9.04, and I got most of the things working out of the box... however the FN-F4, FN-F5 and FN-F9 are not working. I have installed the nc10-scripts from the repository and it didn' t work... then I tried the previous reported methods... still it is not working! I noticed that when I try to run:

[22:58:43] [godsiem@mia ~]$ /usr/bin/wlonoff.sh
You need admin rights to run this script. Try with sudo.

godsiem is my normal user... I am not sure, but I think this may be the issue! When I run with sudo, indeed it works! So there is some kind of error on the mapping, some privileges missing... I also made the test of using the "xev" and indeed I get positive feedback:

KeyPress event, serial 32, synthetic NO, window 0x3800001,
root 0xa5, subw 0x0, time 1901703, (488,125), root:(495,517),
state 0x0, keycode 246 (keysym 0x1008ff95, XF86WLAN), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False

KeyRelease event, serial 32, synthetic NO, window 0x3800001,
root 0xa5, subw 0x0, time 1901703, (488,125), root:(495,517),
state 0x0, keycode 246 (keysym 0x1008ff95, XF86WLAN), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

Any ideas on this?

Furthermore, the nc10-scripts are also supposed to provide the functionality for other combinations, such as FN-F8 (cpu scalling)??

Thank in in advance for your help! And again I want to congratulate you for this nice initiative, I will be tuned and participative, since I found this the nicest place for discussion of linux based issues concerning "our" nc10 :)

Cheers,

godsiem

RE: [NC10] How to enable wireless card, with RFKILL support

Posted: 11 May 2009, 23:05
by voria
Welcome! :)

In jaunty you have to enable the 'commands' plugin in the advanced compiz configuration, or else the hotkeys do not work.
Just install the compizconfig-settings-manager package, then start it through 'System'->'Preferences' menu.

The 'nc10-scripts' package enables the FN-F5, FN-F8, FN-F9 keys, plus some other non-standard keys combinations (bluetooth, webcam).
You can find more info here.

For the FN-F4 key, you can follow this simple howto.

RE: [NC10] How to enable wireless card, with RFKILL support

Posted: 12 May 2009, 07:27
by godsiem
Thank you very much voRia,

I had already installed the compizconfig-settings-manager from the repository but I was not aware of this enabling :)

All the key combinations work now perfectly! I am impressed and thankful for this nice contribution! Now I will just experiment a little bit with my external display, and that's it, the whole machine will be running very well...

...I am impressed how quickly it runs linux (ubuntu, ext4, with 2GB memory)... I still didn't use it for heavy processing, but I think it will respond nicely :)...

Thank you again for your help! I will be participating on this community! Good Work!

/godsiem

RE: [NC10] How to enable wireless card, with RFKILL support

Posted: 11 Jun 2009, 14:56
by voria
I have good news :)

The rfkill patch for ath5k by Tobias Doerffel is finally been merged in the official development tree.
This means that it will be probably included into kernels 2.6.31 and above, so no more need to install backports modules and, more important, it will be officially available for all the distros out there (well, future versions, when newer kernels will be used).

RE: [NC10] How to enable wireless card, with RFKILL support

Posted: 11 Jun 2009, 15:31
by Mat
source? :)
'voRia' pid='1406' dateline='1244728561' wrote: I have good news :)

The rfkill patch for ath5k by Tobias Doerffel is finally been merged in the official development tree.
This means that it will be probably included into kernels 2.6.31 and above, so no more need to install backports modules and, more important, it will be officially available for all the distros out there (well, future versions, when newer kernels will be used).

RE: [NC10] How to enable wireless card, with RFKILL support

Posted: 11 Jun 2009, 16:15
by voria
I've just updated the 'linux-backports-modules' package on the repository and the patch (a newer version) is already applied to the snapshot I've used (2009.06.11). According to wireless-testing.git, it has been merged yesterday. :)

RE: [NC10] How to enable wireless card, with RFKILL support

Posted: 12 Jun 2009, 17:56
by denis6902
Alright, bogus time!

my nc10 arrived safe and sound at the same day then the 2gb stick from crucial!

Had a go with xp, really nice and fast.

Installed jaunty with your fixes instructions and it all went really well, everything worked out nice and sound! :) However i found the netbook to be really, but reallllly slow, so i now installed the intrepid 8.10 and system is apparently a little faster, but now as fast as it was on xp somehow, and when i rad the xp running it only had the stock memory stick of 1gb.

Anybody to comment on this?

Now on the 8.10intrepid, i didnt manage to find the nc10-scripts package on the synaptic package manager, somehow its just not there, and i have followed the steps just as i did before hands with the jaunty version.
*** yes i added the correct repositories!

Therefore, wifi isnt working, sounds either.

The screen is also somehow weird as i open the compiz-settings-manager and when the window of the app is just way bigger then the resolution therefore is quite annoying because when u click on something at sight it ends up clicking on something else.

can anyone help me out?

I have already downloaded the netbook version from ubuntu, but i dont think it will be any better, perhaps this nc10-script is what is missing out for finishing the fixes.
alright, quick update, just got the wifi working, however still no sounds.

this is what i did to get the wifi to work:

go to terminal:
sudo echo "blacklist ath_pci" >> /etc/modprobe.d/blacklist (enter)
sudo echo "blacklist ath_hal" >> /etc/modprobe.d/blacklist (enter)

restarted and it worked, voila :]

btw, i cannot see nc10-scripts on the package manager, why? it was dead easy on jaunty!

RE: [NC10] How to enable wireless card, with RFKILL support

Posted: 12 Jun 2009, 19:14
by denis6902
i went to terminal just now, and did:

sudo apt-get nc10-scripts

it downloaded couple of stuff, but i still dont have sounds :(

RE: [NC10] How to enable wireless card, with RFKILL support

Posted: 13 Jun 2009, 10:20
by okon3
but nc10-scripts are only scripts to get the FN + F* keys working.
You have to updrate your alsa driver to get the sound working (i think)

RE: [NC10] How to enable wireless card, with RFKILL support

Posted: 13 Jun 2009, 15:31
by denis6902
alright, it was a nightmare yesterday! i went back and forth with distro and the thingy was really there yet.

The Intrepid was just the worst afterall because i could not get all the fixes on the synaptic package manager.

So....this time i decided to redo it from scraqtch again, yes i did! lol...i went back to JAUNTY version, as before i had almost everything working fine and nice but with that very slow response from the netbook.

so what did i do this time to get it sharp?

During the instalation process (at the partitioner) i selected manual partitioning instead of using entire hdd with the assistance of the particioner. I first created a primary swap partition with 2048mb and then i used all the left over of the hdd to create a partition for the jaunty version.
I USED PRIMARY EXT4 and only gave it / (slash) command


the installation went really smooth, so i followed the rest of the fixes instructions and now the netbook is ace like a fighter plane, its really fast and it responds much faster then before, so im thinking that when instaling for the first time, the wizard partitioner must use ext3 or something else to create the partition for the linux and maybe thats why it was soo slow on the fisrt time i tried it.

yesterday i was at a party with some friends, and i put my netbook to pump some tunes for the party and the sounds was working but very weird somehow, the wuality of the music was really rubish kind of crushed and i couldnt barely hear the artist voice, tied using the equalizer on amarok14 (the older version) to help the issue, but not even though it helped. Was asking myself then? Is it because of the sound card on the nc10 sucks or either this also driver is not quite good yet because the quality of the music was ridiculous, and i felt really upset when someone cracked a ACER netbook and the sound was just amazing and clear. Well...fair enough that netbooks were not develop or either design for such purposes, but it really sucked at the sounds.


Another thing which im not really sure yet is the screen resolutuion, windows just semms to be wrong somehow, whenever i open any window, like amarok, compiz-manager, or any application window, i cannot really see what is at the bottom of it, i try movinf the window up so i can apply a certain setting given or even going back to a previous menu window for example and it doesn really work, when maximazing the window then the thing gets out of control, and the screen does really work, it kind of goes boncus.

Does anyone have these same issue? Or is it only me?

RE: [NC10] How to enable wireless card, with RFKILL support

Posted: 16 Jun 2009, 19:22
by el_rico
Hello,

I've just installed nc10-scripts and backport modules so that I can get the wifi working with RFKILL and FN key. First, thank you for this!

I have a (little) problem however: if the initial state of the Wifi adapter is off (as set in the BIOS), I cannot bring it up. A first problem is that ath5k is loaded during at boot-up even is the adapter is off: wlonoff.sh will consider that the Wifi is up, based on lsmod output. But that's minor. The problem is that the sequence "modprobe -r ath5k ; modprobe ath5k' won't bring the Wifi up anyway. The only interesting event in dmesg I can see is "wlan0: link is not ready".

Do you have the same behaviour? And do you know a way to work around this?

Thanks again!

RE: [NC10] How to enable wireless card, with RFKILL support

Posted: 16 Jun 2009, 19:30
by voria
Hi and welcome :)

Yes, I already noticed the problem. As far as I know, there is no way to wake up the card in such a situation (at least for now). The only (obvious) workaround is to keep the initial state of the wifi adapter set to 'always on' in the BIOS.