My Hackergotchi

Updated: Never — Philip's Blog

Now featuring regular updates!

Thu, 25 Feb 2010

12:52 – Pairing Bluetooth headset

I am the proud owner of a Bluetooth headset. My laptop also speaks Bluetooth. Getting the two of them to talk to each other is less than obvious though. There seems to be plenty of documentation for ancient BlueZ versions, but none for more recent ones.

For future reference.

  • First put the device in pairing mode

  • Now use a cleverly hidden Python script (which depends on dbus and gobject, of all things) to do the pairing. I have no idea how I stumbled into this, and the only way to figure out what it does was reading it through. Highly intuitive!

    # python /usr/share/doc/bluez/examples/simple-agent hci0 XX:XX:XX:XX:XX:XX

  • The good news is, once the thing has been paired, it Just Works[tm]:

    # mplayer -ao alsa:device=bluetooth foo.ogg

I have Opinions on dbus.