get feed


21 is only half the truth ...

:: Getting started with Bluetooth on ArchLinux

It's been a while since my last posting, but I felt the need to publish some information about a really odd issue I experienced earlier this day

It all started, because my girlfriend asked me how to access her mobile phone via Bluetooth under ArchLinux (or ArchBang, which is basically the same thing). After some searching, trying and hitting my head on the desk and keyboard, I figured a way out.

At first, you have to install at least this packages:

* bluez
* gvfs-obexftp
* obexftp
* openobex
* obexfs

After installing that (via pacman), we make sure, that the bluetooth services are started and enabled at boot.

$ sudo systemctl enable bluetooth
$ sudo systemctl start bluetooth

So far, so good. Now we search for the MAC-adress of our phone (or other BT device). I used hcitool for this. (make sure your phone is visible)

$ hcitool scan
Scanning ...
    D4:20:6D:AF:95:B7   HTC Wildfire S A510e

hci0 is my local device for bluetooth communication. You can see which is yours with:

$ hcitool dev
    hci0    00:1E:4C:FF:7E:EA

Now we have the adress. To pair with the device, we use bluez-simple-agent.

$ sudo bluez-simple-agent hci0 D4:20:6D:AF:95:B7

After that, we are paired. Great, but what now? At first I thought a graphical UI would be nice for file transfer, but then I thought it would be even nicer, if I just could mount it like any other device. Gladly, it works! With obexfs:

$ cd ~
$ mkdir bluetooth
$ obexfs -b D4:20:6D:AF:95:B7 bluetooth/

TADAAAA! Be sure that you have privileges to read/write the bluetooth/ directory. To umount this device again, just type:

$ fusermount -u ~/bluetooth

I hope that this helps some people. Information about bluetooth is very bad these days. But I'm not a big fan of bluetooth anyway ;). Have FUN!

posted by ap0calypse in linux on 2013-04-26 13:17