Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Tip] Notebooks with a builtin wlan adapter
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
chrroessner
Apprentice
Apprentice


Joined: 02 Dec 2003
Posts: 156
Location: Germany

PostPosted: Fri Apr 22, 2005 9:43 pm    Post subject: [Tip] Notebooks with a builtin wlan adapter Reply with quote

Hello,

Main information

If you have a builtin-wlan adapter in your notebook and you want a daemon handling your wlan button to modprobe/rmmod your card without being logged in at a console nor a X11, you may go on reading this. This daemon replaces any hotkey manager (for the wlan task).


Download and installation instructions

I have searched for some months for a howto or something else how to get my wlan adapter (mini pci) turned on or off by pressing the corresponding button. I found rfswitch.sourceforge.net on the web and tested the listed kernel modules (most are included into portage), but I did not get positive results.

After a while I tried it again and with the acerhk module my button produced scancode events for the first time. Unfortunatly the events were not handled and therefor I planed to write a little application running as a daemon.


You can get it here at http://www.roessner-net.com/wlan_button/

Download the latest wlan_button-*.tar.bz2 archive. Put the wlan_button.init script into /etc/init.d/ and rename it to wlan_button. Put wlan_button.conf as wlan_button into /etc.conf.d/ as well.

Code:

Run make and make install (as root)


To get the application work, you must include the event interface into the kernel:

Code:

Device Drivers -> Input device support -> Event interface


Now try to find a kernel module which enables the wlan button events. Look at http://rfswitch.sourceforge.net/
In my case (MaxData 8000x) I needed acerhk (Look into portage). I must give modprobe some arguments:

Code:

modprobe acerhk usedritek=1 autowlan=1 force_series=290


I got these from a developer from rfswitch. Maybe you will find more information on the acerhk homepage.

After finding the right module, you may have to setup some keycodes

Press your button twice and have a look at dmesg. You may find things like atkdb.c ...setkeycodes e070 <keycode>

In my case:

Code:

/usr/bin/setkeycodes e070 184
/usr/bin/setkeycodes e071 185


Put them into /etc/conf.d/local/start. Now run

UPDATE since v1.50
The following instructions have been changed. So please have a look at the main project page.

Deprecated

Code:

wlan_button -u -1 -d -1 -D

and press your wlan button twice. Put these hex values into the config file (It is documented. Have a look into it).

Last but not least:

rc-update add wlan_button default

Start the daemon and be happy.

I tested this aplication on three notebooks with different hardware (ipw2100 and ndiswrapper).



Last edited by chrroessner on Sat May 14, 2005 8:35 pm; edited 2 times in total
Back to top
View user's profile Send private message
MaxDamage
l33t
l33t


Joined: 03 Jan 2004
Posts: 650
Location: Oviedo, Spain

PostPosted: Sun Apr 24, 2005 12:51 am    Post subject: Reply with quote

Wow, this looks great! I don't have a notebook ATM available for testing, but if this really works well, should be added to the gentoo baselayout.
_________________
La PDA de tungsteno
Back to top
View user's profile Send private message
chrroessner
Apprentice
Apprentice


Joined: 02 Dec 2003
Posts: 156
Location: Germany

PostPosted: Sun Apr 24, 2005 3:54 pm    Post subject: Reply with quote

Thanks. Unfortunatly I do not get very much responds to this article nor from the rsfwitch guys, so I do not really know if people would like this. From my point of view this little tool stops stupid console commands.

What´s up folks ;-)

Christian
Back to top
View user's profile Send private message
ahorn
Guru
Guru


Joined: 01 Nov 2004
Posts: 366
Location: Ol' europe

PostPosted: Wed Apr 27, 2005 11:21 am    Post subject: Reply with quote

this is exactly what i want, thank you! do you know another hotkey manager for the other special keys (the FN-Keys)?
_________________
Too many connections. Please try again later.
Back to top
View user's profile Send private message
chrroessner
Apprentice
Apprentice


Joined: 02 Dec 2003
Posts: 156
Location: Germany

PostPosted: Wed Apr 27, 2005 8:00 pm    Post subject: Reply with quote

Maybe xbindkeys
Back to top
View user's profile Send private message
Insanity5902
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1228
Location: Fort Worth, Texas

PostPosted: Wed Apr 27, 2005 10:14 pm    Post subject: Reply with quote

Most laptops, the wireless button generates an acpi event.

So all you ahve to do is write a small ACPI script the looks for the wlan device in the /sys filesystem if it isn't there then modprobe the modules and bring the device up, if the location is there then just rmmod the modules in the correct order and the device is down.

Then sounds much easier then what you have done with all the setkeys and such.

To see if your generates an even run
Code:
tail -f /var/log/acpid
then press the button if it logs something write down the button infomration and then edit your apci scripts accordingly.

P.S. I am not at my laptop right now, nor will I be here soon, if you want to scripts I have then let me know and I will get them up here asap
_________________
Join the adopt an unanswered post initiative today
Back to top
View user's profile Send private message
chrroessner
Apprentice
Apprentice


Joined: 02 Dec 2003
Posts: 156
Location: Germany

PostPosted: Thu Apr 28, 2005 4:53 am    Post subject: Reply with quote

And that is exactly the problem. My button is not supported via acpi. And it is a HW button. I know that this sound a little bit harder but it is working now (after a very long period).

I think, that your tip migth be very good in cases where people have a SW switch.
Back to top
View user's profile Send private message
Insanity5902
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1228
Location: Fort Worth, Texas

PostPosted: Thu Apr 28, 2005 1:26 pm    Post subject: Reply with quote

oh wow, i just assumed all buttons like there generated an acpi event.


Very nice to know, thanks.
_________________
Join the adopt an unanswered post initiative today
Back to top
View user's profile Send private message
chrroessner
Apprentice
Apprentice


Joined: 02 Dec 2003
Posts: 156
Location: Germany

PostPosted: Sun May 01, 2005 10:02 am    Post subject: Reply with quote

I have released a new version 1.30. You can go to the project website and get an ebuild for it. Please read the README file. The ebuild may have bugs, so a feedback is welcome. Thanks in advance

Christian
Back to top
View user's profile Send private message
klarnox
Guru
Guru


Joined: 28 Jan 2003
Posts: 350
Location: Wisconsin, USA

PostPosted: Tue May 10, 2005 7:33 pm    Post subject: Reply with quote

This sounds like exactly what I've been looking for. I'll have to try it out when I get home tonight.
Back to top
View user's profile Send private message
chrroessner
Apprentice
Apprentice


Joined: 02 Dec 2003
Posts: 156
Location: Germany

PostPosted: Fri May 13, 2005 1:59 pm    Post subject: Reply with quote

New release 1.50.

See https://bugs.gentoo.org/show_bug.cgi?id=92489

Your feedback is very welcome.
Back to top
View user's profile Send private message
chrroessner
Apprentice
Apprentice


Joined: 02 Dec 2003
Posts: 156
Location: Germany

PostPosted: Fri May 27, 2005 9:55 pm    Post subject: Reply with quote

I have a short question:

My friend uses ndiswrapper (instead of the rtl8180 native). His wlan is working fine. Unfortunatly he can not rmmod the ndiswrapper module. Just after unloading it, something, maybe udev is loading the module again. By killing udevd, this stops for a few moments.

We have started the notebook and looked, if the module was started at boot time. But this is not the case. First after modprobing it once, the system does not stop re-loading it after rmmod. So my tool wlan_button has no chance to do its job.

Does someone have an idea?

Thanks

Christian

N.B.: version 2.01 is out for some days now. You can get the ebuild and two further files in bugzilla.
Back to top
View user's profile Send private message
chrroessner
Apprentice
Apprentice


Joined: 02 Dec 2003
Posts: 156
Location: Germany

PostPosted: Tue May 31, 2005 12:43 pm    Post subject: Reply with quote

New release. Added preup, predown, postup, postdown functions and a man page. Removed all wlan_button to wlan-button. Check out the ebuild from bugzilla
Back to top
View user's profile Send private message
chrroessner
Apprentice
Apprentice


Joined: 02 Dec 2003
Posts: 156
Location: Germany

PostPosted: Sun Jun 05, 2005 6:42 pm    Post subject: Reply with quote

New release. Added config file support.
Back to top
View user's profile Send private message
Phoenix5100
n00b
n00b


Joined: 11 May 2005
Posts: 12

PostPosted: Wed Jul 13, 2005 12:57 am    Post subject: Reply with quote

Hy!

Have a problem with your ebuild. Downloaded it from bugzilla, downloaded conf and init and placed them into the directories. Then I've tried
emerge wlan-button-2.22

-->

Calculating Dependencies

!!! Problem in null/wlan-button-2.22 dependencies.
!!! "Specific key requires an operator (null/wlan-button-2.22) (try adding an '=') exceptions


What have I done wrong?

Das war der Part für die mitlesenden. Direkte Antwort im Forum wäre schön, aber noch besser wäre per ICQ 101826903 oder phoenix [at] lanon.net

Danke vielmals
Back to top
View user's profile Send private message
chrroessner
Apprentice
Apprentice


Joined: 02 Dec 2003
Posts: 156
Location: Germany

PostPosted: Wed Jul 13, 2005 6:05 am    Post subject: Reply with quote

Tach,

you placed wlan-button-2.22.ebuild inside of a folder named wlan-button and the init file (all other files have been marked as obsolete, please ensure, you grabbed the right ones) into the files folder?

Should look something like this. Please have a look at app-laptop in the path

Code:

/usr/local/portage/app-laptop/wlan-button/wlan-button-2.22.ebuild
/usr/local/portage/app-laptop/wlan-button/files/wlan-button.init


Have you done a

Code:

ebuild /path/to/overlay/app-laptop/wlan-button/wlan-button-2.22.ebuild digest


Did it download the bz2-Tarball?

Now this should work. Maybe I forgot to say that you need the folder app-laptop.

Christian

N.B.: Du kannst mich unter 91938622 auch in ICQ antreffen. Ich bin meisten gegen Nachmittag online.
Back to top
View user's profile Send private message
fedekapo
Apprentice
Apprentice


Joined: 16 Jun 2003
Posts: 223
Location: Argentina

PostPosted: Tue Jul 26, 2005 7:25 pm    Post subject: Reply with quote

Hello..first of all sorry for my english...
I've been having troubles with my Acer Aspire 3002LCI. I'm using ndiswrapper for my wlan card and it was working perfectly a week ago. Now when the system starts up the radio is always off. I've to press the led/button of the wireless card (it is in the front panel of the laptop) a few times to get it to work and it's a pain in the ass. So I find your programm but I can't compile it:
Code:

gcc -pthread `xml2-config --libs` -lsysfs -o wlan-button wlan-button.o xmlparseconfig.o
wlan-button.o(.text+0x570): In function `get_sysfs_attr_value':
: undefined reference to `sysfs_find_driver_bus'
wlan-button.o(.text+0x5c7): In function `get_sysfs_attr_value':
: undefined reference to `sysfs_get_mnt_path'
wlan-button.o(.text+0x6b2): In function `get_sysfs_attr_value':
: undefined reference to `sysfs_open_driver_path'
wlan-button.o(.text+0x70c): In function `get_sysfs_attr_value':
: undefined reference to `sysfs_get_driver_devices'
wlan-button.o(.text+0x729): In function `get_sysfs_attr_value':
: undefined reference to `dlist_start'
wlan-button.o(.text+0x73f): In function `get_sysfs_attr_value':
: undefined reference to `_dlist_mark_move'
wlan-button.o(.text+0x753): In function `get_sysfs_attr_value':
: undefined reference to `sysfs_get_device_attributes'
wlan-button.o(.text+0x774): In function `get_sysfs_attr_value':
: undefined reference to `dlist_start'
wlan-button.o(.text+0x78a): In function `get_sysfs_attr_value':
: undefined reference to `_dlist_mark_move'
wlan-button.o(.text+0x7f0): In function `get_sysfs_attr_value':
: undefined reference to `_dlist_mark_move'
wlan-button.o(.text+0x806): In function `get_sysfs_attr_value':
: undefined reference to `sysfs_close_driver'
collect2: ld returned 1 exit status
make: *** [wlan-button] Error 1



Any ideas?
Back to top
View user's profile Send private message
chrroessner
Apprentice
Apprentice


Joined: 02 Dec 2003
Posts: 156
Location: Germany

PostPosted: Tue Jul 26, 2005 9:40 pm    Post subject: Reply with quote

Hi,

it seems there are people having trouble installing this package and others not. Could you please paste your problem to the following url. I am looking at it right now, but please post your emerge --info, etc. to the bug-thread.

https://bugs.gentoo.org/show_bug.cgi?id=92489

Thanks in advance

Christian

N.B.:I just pasted a new ebuild, version 2.23
Back to top
View user's profile Send private message
chrroessner
Apprentice
Apprentice


Joined: 02 Dec 2003
Posts: 156
Location: Germany

PostPosted: Sun Jul 31, 2005 11:44 am    Post subject: Reply with quote

I have noticed that some people do hae these build problems, where libsysfs is not linkable. I really do not know why this bug occurs. I have asked some friends to test this and they even did not have any problems. But all of them me including are using completly ~x86 systems, so it might be a different gcc and/or binutils package.

So I feel sorry, I am not able to give an anser but everyone else is much welcome to help me answering this.

Thanks in advance

Christian
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum