How to connect bluetooth headset via command line on ubuntu 12.04

18
2014-06
  • Questioner

    I want to connect my computer to bluetooth headset. My computer has ubuntu 12.04 64 bits server operating system with no gui. So I must connect my computer via command line. But at internet documentation has no working example.

    I have used hciconfig, hcitool, btsco e.t.c and I was not able to success.

    My command line output is:

    hciconfig -a

    hci0: Type: BR/EDR Bus: USB

    BD Address: 00:15:83:2E:2F:70  ACL MTU: 384:8  SCO MTU: 64:8
    UP RUNNING
    RX bytes:2309 acl:0 sco:0 events:118 errors:0
    TX bytes:299 acl:0 sco:0 commands:48 errors:0
    Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
    Link policy: RSWITCH HOLD SNIFF PARK 
    Link mode: SLAVE ACCEPT 
    Name: 'EDRClassone'
    Class: 0x280404
    Service Classes: Capturing, Audio
    Device Class: Audio/Video, Device conforms to the Headset profile
    HCI Version: 2.0 (0x3)  Revision: 0xc5c
    LMP Version: 2.0 (0x3)  Subversion: 0xc5c
    Manufacturer: Cambridge Silicon Radio (10)
    

    hcitool scan

    Scanning ... 00:11:67:00:25:02 BH025C

    hcitool cc 00:11:67:00:25:02

    Can't create connection: Connection timed out

    I have bluetooth deamond at /etc/init.d/bluetooth and just work fine.

    How to connect via command line?

  • Answers
  • Ferit Cubukcuoglu

    here is an step-by-step instruction! Bluetooth Setup via commandline

    and for your connection timed out, do you reset the adapter?? if not you can do this with this command. sudo hciconfig hci0 reset

    I recommend you to read the instructions in the given link.

    And to use it in commandline, here are some commands Some Bluetooth send/get commands


  • Related Question

    linux - Ubuntu, Bluetooth headset and Skype
  • vava

    I have a nice bluetooth headset Plantronics 590 and I really want to use it in Linux the way I use it in Windows, i.e. listen to music and call through Skype. There's tons of tutorials how to make either of those usages work but not one describe how to make them both work. Another problem is that bluethooth headset support in Linux advances pretty rapidly so most of those tutorials are outdated. For example, pulse audio does support bluetooth out of the box now so editing .asoundrc is not necessary.

    What I want is a tutorial about how can I pair my bluetooth headset with latest Ubuntu (9.04), so I can play music through A2DP profile, how can I pair it in a way so I can use Skype with it (through mono profile with mic) and how do I switch between this ways of pairing with restarting as little things as possible.


  • Related Answers
  • vava

    This is really strange world. Recently new skype 2.1 beta came out and I rushed to install it and see how it works. Now my headphones works beautifully although I'm not sure why :) Nothing except skype has changed but my stereo sound magically got fixed too.

    My setup is: PulseAudio 0.9.15, bluez 4.41, Skype 2.1 beta (from official site for Ubuntu 8.10 32bit) and blueman 1.10. Skype works entirely through PulseAudio, in fact it can't work any other way.

    After pairing my headphones I have one new device in PulseAudio. In configuration tab for this device I can choose the profile, either mono (and then I can use it as audio sink or source) or stereo (only sink is visible). In mono mode it works with skype, in stereo it sounds good. And I don't have to restart anything :) Although there's a twist, stereo sink is much much more quiet than mono sink, when I disconnect from skype and change my headphones to stereo at first I thought my sound got missing but it just was too quiet to hear anything.

    If you're going to use blueman with pulseaudion 0.9.15 like I do, make sure you have PulseAudio plugin for it turned off (Bluetooth applet right-click -> about -> Plugins). If it is turned on as some sites on the internet suggests, it creates additional device in PulseAudio so you have two of them instead of just one and those devices could not work together anyway.

    Also make sure you have pulseaudio-module-bluetooth installed, in 0.9.14 it was statically linked into PulseAudio but in 0.9.15 it is additional package.

    Another trick is that Skype is not listed in Recoding tab in PulseAudio Volume control, but if you look in right down corner there's a combobox, select 'Streams' there and voilà, Skype is there and you can move that stream to your bluetooth headset.

    So it works, I'm happy :) Have to move everything to Linux now :)

  • Daff

    Well Ubuntu 9.04 comes with Pulseaudio and my Plantronics Voyager 520 works fine with Skype by just connecting it over the Bluetooth Icon in the Gnome taskbar (Bluetooth Icon Right click -> Set up new device... then Pair with Headset, PIN is usually 0000 and then set trust mode in the preferences). After choosing headset as the sound device in the Skype options the test call was working without problems.

    In 8.10 it didn't work right away but by I could make the headset available in Skype by following this tutorial.