90

Ubuntu 13.04 64 bits, on ELiteBook 8740, gnome desktop with bluetooth-applet shown.

I could not figure out how to turn on and off from shell the Bluetooth and not from the notification bt applet menu. I need to turn on the service and the thing from menu from shell or C.

service bluetooth start/stop has noting to do with the applet button menu item because here are the four scenarios I can see.

  1. Service off, menu item from applet is off (shows turn on)

    bt-device --list yields bluez service is not found

  2. Service on, (sudo service bluetooth start) menu item from applet is off (shows turn on)

    bt-device --list yields rg.bluez.Error.NoSuchAdapter: No such adapter

  3. Service on, menu item from applet is on (shows turn off)

    bt-device --list yields

    Added devices:
    HMDX JAM (36:8F:E8:07:B2:CA)
    Mint Speaker (5BA5) (01:19:53:4C:5B:A5)
    
  4. Service off, menu item from applet is on (shows turn off)

    bt-device --list yields bluez service is not found

I want to be able to turn on and off the Bluetooth as is being done from the applet button. How can I do this?

Pablo Bianchi
  • 17,371
user2195463
  • 1,011

7 Answers7

118

The commands you're looking for are:

rfkill block bluetooth

and

rfkill unblock bluetooth

To toggle on/off:

rfkill toggle bluetooth
Marcus
  • 2,643
33

To stop :

sudo /etc/init.d/bluetooth stop

To start :

sudo /etc/init.d/bluetooth start

To restart :

sudo /etc/init.d/bluetooth restart
Anwar
  • 77,855
Chester
  • 1,098
  • 7
  • 15
28

On systems that use systemd, including Ubuntu 15.04 and later:

systemctl start bluetooth

for turning on Bluetooth

systemctl stop bluetooth

for turning off Bluetooth

systemctl restart bluetooth

for restarting Bluetooth

moonshadowolf13
  • 391
  • 3
  • 7
7

Try this, it worked for me: From: bluetooth keeps turning off in 19.04 after physically and manually turning off bluetooth device, any fix to this?

$ sudo rmmod btusb
$ sudo modprobe btusb
nirala
  • 214
  • 2
  • 4
3

If you have tlp installed you can use:

$ bluetooth on  # To start 
$ bluetooth off # To stop

To install TLP:

$ sudo apt install tlp
Grammargeek
  • 2,792
1

I know this is a quite old question.

service

command worked for me.

To stop the service -

service bluetooth stop

To start the service -

service bluetooth start

0

What worked for me was to install bluez:

  1. Go to http://en.archive.ubuntu.com/ubuntu/pool/universe/b/bluez-tools/

  2. Select your compatible version

  3. Install it manually

Zanna
  • 72,312
noname
  • 1