# Bluetooth GPS: connection refused [solved]

## peajay

I can't figure out what the problem is.  I have one bluetooth GPS which works just fine, and another which I just bought which always results in "connection refused."  Both are set up identically, and both indicate in their instructions to use a passkey of '0000', and so the only idea I have at the moment is that the old one doesn't actually care if it gets the passkey or not, and so the new one is the first to require it.

```
pj@isuck:~$ rfcomm 

rfcomm0: 00:18:E4:1E:8C:88 channel 1 clean 

rfcomm1: 00:1C:D9:30:02:26 channel 1 clean 
```

rfcomm0 is the new GPS unit, rfcomm1 is the old one, which used to be rfcomm0, but I renamed it.

```
root@isuck:~# cat /dev/rfcomm0

cat: /dev/rfcomm0: Connection refused

root@isuck:~# cat /dev/rfcomm1

$GPGGA,193034.400,3951.4389,N,084...
```

The new one doesn't work, but the old one still does.

```
root@isuck:/etc/bluetooth# cat rfcomm.conf 

rfcomm0 {

        bind yes;

        device 00:18:E4:1E:8C:88;

        channel 1;

        comment "Columbus GPS";

}

rfcomm1 {

        bind yes;

        device 00:1C:D9:30:02:26;

        channel 1;

        comment "Bluetooth GPS";

}

```

The setup for each is the same.

```
hcid[5482]: pin_code_request (sba=00:1D:4F:98:6D:63, dba=00:18:E4:1E:8C:88)

hcid[5482]: call_passkey_agent(): no agent available
```

This is output by hcid when I try to connect the new GPS.  Nothing is output when I connect the old (working) GPS.  This makes me think that only the new one is asking for a passkey.

```
root@isuck:~# cat /var/lib/bluetooth/00\:1D\:4F\:98\:6D\:63/pincodes 

00:1C:D9:30:02:26 0000
```

I tried this to tell it what to use, among other things, such as specifying the code in the hcid.conf file:

```
#

# 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 0x000100;

        # 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;

}
```

...and using some pin code files...

```
root@isuck:/etc/bluetooth# cat pin

0000

root@isuck:/etc/bluetooth# cat pin-helper 

#!/bin/bash

echo "PIN:0000"

```

...and I tried searching the web for other ideas of where to put the pin code, but it seems as if no one really knows, given that there are many suggestions for many different places to put it.

Finally, I have no idea what this call_passkey_agent() thing is all about.  How is it supposed to identify this passkey agent?  Is it supposed to be specified in /etc/bluetooth/hcid.conf?  Is it supposed to be an executable of a certain name?  ...or is it just a function that's complaining that it can't find some file?  ...or what?  Certain searches have turned up executable names for pin helpers, but I don't have any of them, and trying to find gentoo-specific documetation about how to set one up has been unsuccessful.

So what can I possibly do to figure out what is going wrong here?

--edit--

I definately seem to be able to communicate with it, e.g. I can ping it:

```
root@isuck:~# l2ping 00:18:E4:1E:8C:88

Ping: 00:18:E4:1E:8C:88 from 00:1D:4F:98:6D:63 (data size 44) ...

4 bytes from 00:18:E4:1E:8C:88 id 0 time 18.96ms

4 bytes from 00:18:E4:1E:8C:88 id 1 time 89.63ms

4 bytes from 00:18:E4:1E:8C:88 id 2 time 84.88ms

4 bytes from 00:18:E4:1E:8C:88 id 3 time 32.92ms

4 bytes from 00:18:E4:1E:8C:88 id 4 time 75.93ms

^C5 sent, 5 received, 0% loss
```

...and I got the mac address by scanning for it.  I'm inclined to think that it wouldn't be broken in a way that nearly completely works except that it won't accept connections, but at the same time, I can't connect to it via USB either (dmesg displays endless errors about a failure to enumerate).  Its a Columbus V-900, if that helps anyone.  I bought it specifically because the manufacturer says that it supports Linux.Last edited by peajay on Thu Jun 18, 2009 11:47 am; edited 1 time in total

----------

## peajay

I finally figured this out.

In /var/lib/bluetooth/00:1D:4F:98:6D:63/pincodes I had put the mac address for the wrong GPS unit.

Still doesn't explain why the many other methods of entering a pin code don't work, but, whatever.

----------

