You are not logged in.

#1 2006-09-09 23:56:12

woogie
Member
From: Ottawa, ON
Registered: 2005-04-01
Posts: 45

Need help pairing bluetooth headset [totally solved]

OK, I have the two following pieces of hardware:

Motorola H350 Headset
ASUS Bluetooth USB Dongle, using a CSR radio

I'm trying to use btsco to use my bluetooth headset. I haven't gotten it to work yet. What I'm posting here is what I'm doing, my config files: and the results I get.

/etc/bluetooth/rfcomm.conf:

#
# RFCOMM configuration file.
#

rfcomm0 {
        # Automatically bind the device at startup
        bind yes;

        # Bluetooth address of the device
        device 00:0C:55:AA:A3:A9;

        # RFCOMM channel for the connection
        channel 1;

        # Description of the connection
        comment "Motorola H350 Headset";
}

/etc/bluetooth/hcid.conf

#
# HCI daemon configuration file.
#

# HCId options
options {
        # Automatically initialize new devices
        autoinit yes;

        # Security Manager mode
        #   none - Security manager disabled
        #   auto - Use local PIN for incoming connections
        #   user - Always ask user for a PIN
        #
        security auto;

        # Pairing mode
        #   none  - Pairing disabled
        #   multi - Allow pairing with already paired devices
        #   once  - Pair once and deny successive attempts
        pairing multi;

        # Default PIN code for incoming connections
        passkey "0000";
}

# Default settings for HCI devices
device {
        # Local device name
        #   %d - device id
        #   %h - host name
        name "BlueZ (%d)";

        # Local device class
        class 0x3e0100;

        # Default packet type
        #pkt_type DH1,DM1,HV1;

        # Inquiry and Page scan
        iscan enable; pscan enable;

        # Default link mode
        #   none   - no specific policy
        #   accept - always accept incoming connections
        #   master - become master on incoming connections,
        #            deny role switch on outgoing connections
        lm accept;

        # Default link policy
        #   none    - no specific policy
        #   rswitch - allow role switch
        #   hold    - allow hold mode
        #   sniff   - allow sniff mode
        #   park    - allow park mode
        lp rswitch,hold,sniff,park;
}

I anonymized the MAC of the Bluetooth headset because otherwise, somebody would probably yell at me for the security vulnerability. Because with that MAC, someone could uh ..... they could ...... uhm ...... well I anonymized it anyways.

So without further ado, here's what I do to try and get my bluetooth headset going:

[root@yvonne bluetooth]# lsmod | grep ^snd_bt_sco
snd_bt_sco             14028  0
[root@yvonne bluetooth]#               

That ensures I've got the appropriate module loaded.

[root@yvonne bluetooth]# ps ax | fgrep "hcid
> dbus"
 2987 ?        Ss     0:00 /usr/bin/dbus-daemon --system
 3000 ?        Ss     0:00 /usr/sbin/hcid -f /etc/bluetooth/hcid.conf
 3494 tty1     S      0:00 /usr/bin/dbus-launch --sh-syntax --exit-with-session
 3495 ?        Ss     0:00 dbus-daemon --fork --print-pid 8 --print-address 6 --
 4758 pts/4    R+     0:00 grep -F hcid?dbus
[root@yvonne bluetooth]#      

I've got HCID going, with DBus started first (read up about that on the forums)

[root@yvonne bluetooth]# rm /var/lib/bluetooth/00:08:2B:03:68:D2/linkkeys && touch /var/lib/bluetooth/00:11:1B:09:31:E5/linkkeys
[root@yvonne bluetooth]# hcitool scan
Scanning ...
        00:0C:55:AA:A3:A9       Motorola H350
[root@yvonne bluetooth]# btsco -v 00:0C:55:AA:A3:A9
btsco v0.42
Device is 1:0
Voice setting: 0x0060
Can't connect RFCOMM channel: Connection refused
[root@yvonne bluetooth]# rfcomm connect 00:0C:55:AA:A3:A9
Can't connect RFCOMM socket: Connection refused
[root@yvonne bluetooth]# rm /var/lib/bluetooth/08:08:1C:91:71:D2/linkkeys && touch /var/lib/bluetooth/00:08:D2:44:35:D2/linkkeys
[root@yvonne bluetooth]# hcitool scan
Scanning ...
        00:0C:55:AA:A3:A9       Motorola H350
[root@yvonne bluetooth]# hcitool cc 00:0C:55:AA:A3:A9
[root@yvonne bluetooth]# btsco -v 00:0C:55:AA:A3:A9
btsco v0.42
Device is 1:0
Voice setting: 0x0060
Can't connect RFCOMM channel: Connection refused
[root@yvonne bluetooth]#                           

Note that each time after I wipe out the keys from /var/lib/bluetooth, I'm putting the headset back into pairing mode by holding down its "phone" button.

So I'm kind of at the end of my rope here. Something is going wrong during pairing, but what is it? dmesg isn't giving me any clues here either. Is the PIN not getting transmitted properly or something?[/code]

Offline

#2 2006-09-10 00:09:56

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,546
Website

Re: Need help pairing bluetooth headset [totally solved]

Ok ... I have never done anything with a bluetooth in Linux, so I cannot talk from experience. Now that we got that straigt, I noticed that channel 1 refuses the connection and wonder if that is related at all to permissions or a firewall running in the system.

Take a look at this site, they have been working on bt headsets and have succeded with your particular model, or so they say in their web site. wink

http://bluetooth-alsa.sourceforge.net/

Offline

#3 2006-09-10 16:24:44

woogie
Member
From: Ottawa, ON
Registered: 2005-04-01
Posts: 45

Re: Need help pairing bluetooth headset [totally solved]

Ralvez, the btsco software I'm using is from that site. I actually bought the H350 because of the list on that site wink Firewalls shouldn't be a Bluetooth issue at all - even at that, iptables has no rules listed for any of my tables.

Offline

#4 2006-09-10 16:49:07

filoktetes
Member
From: Skien, Norway
Registered: 2003-12-29
Posts: 286

Re: Need help pairing bluetooth headset [totally solved]

Ok, there's some strange things happening with bluetooth these days it seems. I had a lot of trouble setting up a connection to my phone, even after following avery bit of advice I found on the net.

But somehow I found a way, and now it works. I had to do some things not documented anywhere, excepte from some obscure places from 2003 etc.

The most significant problem I encountered was that my phone would never find my computer, even though I set pscan and iscan enabled.

Here's a line of code I found that fixed the problem for me. It could work for you too, since your problem looks exactly like the things I saw when the phone couldn't see my computer.

dbus-send --system --dest=org.bluez /org/bluez/hci0 
org.bluez.Adapter.SetMode string:discoverable

I write this after the bluetooth system has started.
Hope it helps  smile

Offline

#5 2006-09-11 20:18:29

woogie
Member
From: Ottawa, ON
Registered: 2005-04-01
Posts: 45

Re: Need help pairing bluetooth headset [totally solved]

Getting warmer now.

I upgraded the version of bluez-lib and bluez-utils to 3.5 from 3.1 by building the packages myself, and now I've got a connection going - but no audio yet = I'm going to take a gander at the source and see exactly what the error messages I'm getting mean.

Offline

#6 2006-09-11 20:24:54

woogie
Member
From: Ottawa, ON
Registered: 2005-04-01
Posts: 45

Re: Need help pairing bluetooth headset [totally solved]

And GOLD!

It turns out that I need the snd_emu10k1 module loaded for all the sound function the btsco system wants/needs. But I now have audio coming out of my bluetooth headset, rock on! ^_^

Offline

Board footer

Powered by FluxBB