toggling bluetooth on/off - t42 ubuntu

Solaris, RedHat, FreeBSD and the like
Post Reply
Message
Author
rossman
Posts: 26
Joined: Tue May 03, 2005 5:53 am

toggling bluetooth on/off - t42 ubuntu

#1 Post by rossman » Sat Jun 04, 2005 11:22 pm

Fn-F5 turns off the wireless antenna but the bluetooth antenna stays on. Anybody know how to toggle bluetooth antenna in ubuntu?

Thanks,
Ross
T42 (2373-3UU)

Volker
Junior Member
Junior Member
Posts: 482
Joined: Fri Oct 01, 2004 10:21 am
Location: Dublin, Ireland
Contact:

#2 Post by Volker » Sun Jun 05, 2005 2:10 pm

You are confused, by default Fn-F5 toggles Bluetooth but not wlan.

If you want to customize this behaviour, install ibm-acpi. This lets you disable any default action. Then you can hook acpid in to receive the Fn-F5 keypress. Turning wlan/Bluetooth on/off is just a matter of loading/unloading the relevant drivers.

rossman
Posts: 26
Joined: Tue May 03, 2005 5:53 am

#3 Post by rossman » Sun Jun 05, 2005 6:01 pm

I double checked - after pressing Fn-F5 the wireless light goes out and I lose connection to my AP but the bluetooth light stays on and my BT mouse continues to function.

I followed this howto.

However, I do not get on screen display when I press the function keys.

I'm a linux n00b, how do I load/unload the bluetooth driver?

Thanks,
ross

Volker
Junior Member
Junior Member
Posts: 482
Joined: Fri Oct 01, 2004 10:21 am
Location: Dublin, Ireland
Contact:

#4 Post by Volker » Mon Jun 06, 2005 10:02 am

Strange that your Fn-F5 behaves differently.

The easiest way to enable/disable bluetooth is then http://ibm-acpi.sourceforge.net/. Install, load modules, and

Code: Select all

echo disable > /proc/acpi/ibm/bluetooth
echo enable > /proc/acpi/ibm/bluetooth

rossman
Posts: 26
Joined: Tue May 03, 2005 5:53 am

#5 Post by rossman » Tue Jun 07, 2005 6:15 am

That works. Thanks for the info Volker.

Another oddity, while booting, pressing Fn-F5 does like you say, disable bluetooth but once I'm logged in it disables wireless. I guess my setup is changing it from default. I don't think I did this because I have no idea how to change the settings!

egibbs
Senior Member
Senior Member
Posts: 896
Joined: Tue Apr 27, 2004 6:05 am
Location: New Jersey

#6 Post by egibbs » Tue Jun 07, 2005 6:19 am

Thanks for the link. I have a T42p with both Wifi and BT, and although I don't reguarly use either I've been wondering how to get BT working.

I added the Debian repos to /etc/apt/sources.list and was able to DL and install ibm-acpi through Synaptics in Ubuntu. I am not able to use the commands you listed directly, I get Permission Denied even if running as root - maybe because I have tpb running as well. However Fn+F5 now reliably turns the BT radio (and LED) on and off.

Of course the drawback is that Fn+F5 no longer works to turn the Wifi on and off. I CAN control the Wifi by running /etc/acpi/wireless.sh, which is what tpb is supposed to call when it detects an Fn+F5 press, but that's a pain.

I'm thinking about hacking together the wireless.sh and bluetooth.sh scripts to combine both sets of functions - so Fn+F5 will turn both BT and Wifi on and off together. But I'm thinking there has to be a more elegant solution.

Any ideas?

rossman
Posts: 26
Joined: Tue May 03, 2005 5:53 am

#7 Post by rossman » Tue Jun 07, 2005 11:24 am

How about enabling Fn-F6 to turn wireless on/off? In my case I'd like it to turn BT on/off. Anybody know how to do this?

egibbs
Senior Member
Senior Member
Posts: 896
Joined: Tue Apr 27, 2004 6:05 am
Location: New Jersey

#8 Post by egibbs » Tue Jun 07, 2005 12:04 pm

I did try (simplistically) editing the wireless event handler script to change the part of the key scan code that read 0105 to 0106 but nothing happened. Not sure if I needed to restart gnome or x-org or something, of if Fn+F6 is simply not a mapped key.

I think the Fn keys work different from normal scan codes - they are actually generated by the keyboard controller rather than by direct scan. And since Fn+F6 is not assigned to any event in the standard TP setup, the controller may not output a code for it ever.

I suppose I could try one of the keys that are mapped - like Fn+F7, but I pretty much want all of the existing functions.

Anybody know for sure if Fn+F6 should generate a detectable event?

Ed Gibbs

Volker
Junior Member
Junior Member
Posts: 482
Joined: Fri Oct 01, 2004 10:21 am
Location: Dublin, Ireland
Contact:

#9 Post by Volker » Wed Jun 08, 2005 11:36 am

I don't think that Fn-F6 can generate any detectable event. ibm-acpi lets you change the behaviour of the following keys:

Code: Select all

	key	bit	behavior when set	behavior when unset

	Fn-F3			always generates ACPI event
	Fn-F4			always generates ACPI event
	Fn-F5	0010	generate ACPI event	enable/disable Bluetooth
	Fn-F7	0040	generate ACPI event	switch LCD and external display
	Fn-F8	0080	generate ACPI event	expand screen or none
	Fn-F9	0100	generate ACPI event	none
	Fn-F12			always generates ACPI event

AndreasMeier
Posts: 33
Joined: Thu Mar 03, 2005 12:26 pm

#10 Post by AndreasMeier » Sat Jul 09, 2005 8:24 am

Volker wrote:I don't think that Fn-F6 can generate any detectable event. ibm-acpi lets you change the behaviour of the following keys:

Code: Select all

	key	bit	behavior when set	behavior when unset

	Fn-F3			always generates ACPI event
	Fn-F4			always generates ACPI event
	Fn-F5	0010	generate ACPI event	enable/disable Bluetooth
	Fn-F7	0040	generate ACPI event	switch LCD and external display
	Fn-F8	0080	generate ACPI event	expand screen or none
	Fn-F9	0100	generate ACPI event	none
	Fn-F12			always generates ACPI event
Where can I change that ?

Regards
Andreas

Volker
Junior Member
Junior Member
Posts: 482
Joined: Fri Oct 01, 2004 10:21 am
Location: Dublin, Ireland
Contact:

#11 Post by Volker » Sat Jul 09, 2005 11:29 am

Code: Select all

echo 0x0000 > /proc/acpi/ibm/hotkey
and replace 0x0000 with the bitmask of your choice. For details, see ibm-acpi's README.

AndreasMeier
Posts: 33
Joined: Thu Mar 03, 2005 12:26 pm

#12 Post by AndreasMeier » Sun Jul 10, 2005 4:49 pm

Thanks Volker,
I give it a try.

@rossman,
what about your Fn-F6 key ? Is it a mappable key or not ?
I think that would be a nice idea to have WLAN on Fn-F5 and bluetooth on Fn-F6, but xev is not giving me a keycode after pressing this comibination.

Regards
Andreas

AndreasMeier
Posts: 33
Joined: Thu Mar 03, 2005 12:26 pm

#13 Post by AndreasMeier » Fri Jul 15, 2005 8:16 am

Has anyone of you here found a reliable way of getting bluetooth activated by pressing (any) Fn-Key other than Fn-F5 ?

In my Kubuntu Hoary, Fn-F5 is toogling WLAN.
Now I'm trying to enable bluetooth.
I tried echo enable > /proc/acpi/ibm/bluetooth, status is then ena bled, but bluetooth manager says that now adapter is found.
Also the bluetooth-LED is not lighted.

So, to be honest, I'm looking for more things:
1.) Activate Bluetooth with Fn-F9 (which is not yet assigned by other ACPI events).
2.) Get WLAN-LED working if enabled
3.) Get Bluetooth-LED working if enabled

I have a T42 with WLAN and Bluetooth.

Perhaps you have some hints for me.
Thanks in advance,
Regards
Andreas

AndreasMeier
Posts: 33
Joined: Thu Mar 03, 2005 12:26 pm

#14 Post by AndreasMeier » Fri Jul 15, 2005 2:09 pm

So, I have Bluetooth working including the LED :-)
After a restart, the adapter was found and the LED was working.

I think (or hope) that the WLAN-LED is coming up, when my WLAN connection is properly configured and working.

So, basically only question 1 is still left, if I can somehow reconfigure Fn-F6 or Fn-F9 for toggling Bluetooth on/off.

Regards,
Andreas

AndreasMeier
Posts: 33
Joined: Thu Mar 03, 2005 12:26 pm

#15 Post by AndreasMeier » Sat Jul 16, 2005 4:22 am

No, I have another question.

I can (manually) enable my bluetooth adapter with "echo enable > /proc/acpi/ibm/bluetooth".
Before I do that, the kdebluetoothd says, that there is no adapter found.
After I enable bluetooth, kdebluetoothd stays with this status.
Also after I restart the bluetooth services with "sudo /etc/init.d/bluez-utils restart", the status wont change.

But when I do a reboot, at next startup, the adapter was found and can be used.

Is it possible to initialize the adapter without a reboot ?

Regards
Andreas

jkraemer
Posts: 1
Joined: Mon Jul 18, 2005 3:01 pm

#16 Post by jkraemer » Mon Jul 18, 2005 3:14 pm

I set up my T42 so I can toggle Bluetooth using Fn-F6.

Have a look in the ACPI section of my little Ubuntu/T42 howto:

http://www.jkraemer.net/knowhow/t42_ubuntu.html

Edit: actually I used the acpi-support package, ibm-acpi isn't installed here. Seems to me it isn't really needed, as the other function keys work fine, too.

Greetings,
Jens

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “Linux Questions”

Who is online

Users browsing this forum: No registered users and 2 guests