How to disable bluetooth in Intrepid Ibex?

Asked by DoDoENT

Hello everyone!

I've upgraded my Hardy Heron to Intrepid Ibex on my laptop recently. On Hardy, I blacklisted the "hci_usb" module to prevent unnecessary bluetooth initialization at boot time. This gave me about 20 minutes greater battery life. On intrepid, there is no "hci_usb" module, and my bluetooth is always turned on. Even if I disable the bluetooth service (sudo /etc/init.d/bluetooth stop), the bluetooth chip remains on and consumes power. Which module do I have to unload in order to completely turn off my bluetooth?

I've tried removing the "btusb" and "bluetooth" modules, but they are always in use - even if the bluetooth service is stopped.

Thank you very much in advance!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu bluez Edit question
Assignee:
No assignee Edit question
Solved by:
DoDoENT
Solved:
Last query:
Last reply:
Revision history for this message
Andrew (and471) said :
#1

Could you not do this in the Bios

Ie, when the computer boots up, it will display a message like

'For Setup press F2'

You must then click the button it says to click and in the BIOS (you are in it now, be careful) try to find a place where you can disable the bluetooth (you can certainly do this on the eeepc).

Revision history for this message
DoDoENT (dodoentertainment) said :
#2

Of course this is possible - but that is not the point.

I want to be able to quickly load the bluetooth module when I need it, and unload it when I don't need it anymore. This definitely doesn't include rebooting and entering BIOS.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#3

Open a Terminal from the menu Applications → Accessories → Terminal and type:
(when the system ask you a password give your user password, you will not see nothing when you type it, then press enter)

sudo sudo /etc/init.d/bluetooth stop

and when you want start bluetooth again type:

sudo sudo /etc/init.d/bluetooth start

Thank you

Revision history for this message
DoDoENT (dodoentertainment) said :
#4

Marcobra, I've already tried that - see my first post.

Revision history for this message
Yinon Ehrlich (yinone) said :
#5

Go to System --> Administration --> Services
Then unlock and remove the "V" near "Bluetooth device management"

Revision history for this message
DoDoENT (dodoentertainment) said :
#6

Yinon, this only turns off the bluetooth service, but the chip remains powered on and consumes battery. I would like to know which kernel module do I have to unload in order to completely turn off the bluetooth hardware. In hardy and gutsy I did that with "sudo rmmod hci_usb", but it looks like this module is no longer there in intrepid.

Revision history for this message
Yinon Ehrlich (yinone) said :
#7

try this one (although it's not Intrepid...)
http://ubuntuforums.org/showthread.php?t=624094

Revision history for this message
DoDoENT (dodoentertainment) said :
#8

This disables only the service too, but the chip remains powered on. I need to know which KERNEL MODULE I have to unload?

Revision history for this message
DoDoENT (dodoentertainment) said :
#9

I'VE FOUND OUT!!!!

To completely disable bluetooth, one must do the following:
1) disable the bluetooth service
2) disable the adapter with hciconfig tool
3) unload the kernel module in order to completely turn of the adapter power consumtion

So, here is my script for toggling bluetooth on intrepid:

#!/bin/bash

check=`/etc/init.d/bluetooth status | grep "is running"`
if [ -z "$check" ]; then
 echo "Initializing bluetooth..."
 modprobe btusb
 hciconfig hci0 up
 /etc/init.d/bluetooth start
else
 echo "Stopping bluetooth..."
 /etc/init.d/bluetooth stop
 hciconfig hci0 down
 sleep 1
 rmmod btusb
fi

This increases my laptop's battery life for cca 30 minutes.

Revision history for this message
douglasr (douglas-reith) said :
#10

FYI - For my IBM thinkpad I created this shell script:

### Start toggle_bt.sh
cat /proc/acpi/ibm/bluetooth |head -1 |grep -q enabled

if [ "$?" -ne "0" ]; then
  echo enabled > /proc/acpi/ibm/bluetooth
  exit 0
fi

echo disabled > /proc/acpi/ibm/bluetooth
### End toggle_bt.sh

I set up the script as root and then added it as a sudoer for my user.

By the way didn't Hardy remember if you had it on or off the last time you shut down your computer and then restore the last state? I think it did. Can we have that back? :)

Revision history for this message
frere (frere) said :
#11

Hi,

Try [Fn]+[F5], works great on my Thinkpad's. Allows me to toggle Wifi and Bluetooth on and off.

Regards,

Fred

Revision history for this message
Piotr Morgwai Kotarbiński (morgwai) said :
#12

I think that the proper way to power off bluetooth chip at boot time is setting InitiallyPowered parameter in /etc/bluetooth/main.conf to false.
Similarly, the proper way to remember chip's power state between boots was to set RememberPowered parameter in the same file to true.
Unfortunately both these settings are currently (in Jaunty) ignored by bluetoothd. This is probably a bug: unless someone convinces me it's not I will file a bug report within few days.
At the moment I added the following line to my /etc/rc.local script (it is called automatically at boot time)
echo "disable" >/proc/acpi/ibm/bluetooth
One probably needs to replace 'ibm' by the type of his acpi (like 'asus' or 'toshiba') to make it work: just find a subdir of /proc/acpi that contains file named 'bluetooth'.

Cheers

  Morg

Revision history for this message
willdeans (william-deans) said :
#13

Does echo disabled > /proc/acpi/ibm/bluetooth actually turn off the chip? How would I "know" if it did or not?