# Help with bluetooth

## joefish

I'm trying to get my new bluetooth adaptor to work (it's the common USB type).

I've been looking at the Gentoo bluetooth guide, but it seems out of date. Anyway, I've got the kernel modules compiled, and bluez-4.39 is installed. The adaptor seems to be detected by my system:

```
# lsusb

Bus 001 Device 001: ID 1d6b:0002

Bus 002 Device 003: ID 04d9:0499 Holtek Semiconductor, Inc.

Bus 002 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

Bus 002 Device 001: ID 1d6b:0001
```

but dmesg shows a whole lot of this:

```
hci_cmd_task: hci0 command tx timeout
```

And:

```
# hciconfig -a

hci0:   Type: USB

        BD Address: 00:1F:81:00:02:50 ACL MTU: 1021:4 SCO MTU: 180:1

        UP RUNNING PSCAN

        RX bytes:696 acl:0 sco:0 events:24 errors:0

        TX bytes:346 acl:0 sco:0 commands:40 errors:17

        Features: 0xff 0x3e 0x0d 0x76 0x80 0x01 0x00 0x80

        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3

        Link policy: RSWITCH HOLD SNIFF PARK

        Link mode: SLAVE ACCEPT

Can't read local name on hci0: Connection timed out (110)
```

I'm not sure where to go from here. Any help is appreciated.

----------

## honp

And what do you want? Use it as "AP" or client or anything else?

----------

## joefish

Mostly to transfer files/sync with my phone etc. Found a nifty program which can let me use my phone's camera as a webcam. I'm not really worried about using the phone as a modem or anything like that.

Following the guide, the suggested commands don't seem to work, and I figure it's to do with the errors I'm seeing above. Eg:

```
# hcitool scan

Scanning ...

Inquiry failed: Connection timed out
```

I've googled around somewhat, but haven't found anything that seems to relate to this specific problem.

----------

## joefish

bump

----------

## szczerb

Do you have the bluetooth service started? And do you really want to set things up through the command line? (bluetooth is nicer to use with blueman)

----------

## joefish

Yeah, I have the service started. As to doing things through the command line, I guess I'm used to getting things working here first, and then going to a graphical interface once I have that working... I'll try blueman and report back.

----------

## szczerb

You'll need to make a little change to the dbus config to have blueman working:

```
nomad szczerb # cat /etc/dbus-1/system.d/bluetooth.conf 

<!-- This configuration file specifies the required security policies

     for Bluetooth core daemon to work. -->

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"

 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">

<busconfig>

  <!-- ../system.conf have denied everything, so we just punch some holes -->

  <policy user="root">

    <allow own="org.bluez"/>

    <allow send_destination="org.bluez"/>

    <allow send_interface="org.bluez.Agent"/>

  </policy>

  <policy at_console="true">

    <allow send_destination="org.bluez"/>

  </policy>

  <policy group="plugdev">

    <allow send_destination="org.bluez"/>

  </policy>

  <policy context="default">

    <deny send_destination="org.bluez"/>

  </policy>

</busconfig>

```

----------

## joefish

Coming back to this still unsolved problem...

The blueman-applet process seems to be running, but I don't get anything I can access (I'm running KDE 4.3, hopefully not a problem).

```
# hciconfig -a

hci0:   Type: USB

        BD Address: 00:1F:81:00:02:50 ACL MTU: 1021:4 SCO MTU: 180:1

        UP RUNNING PSCAN

        RX bytes:720 acl:0 sco:0 events:28 errors:0

        TX bytes:612 acl:0 sco:0 commands:39 errors:12

        Features: 0xff 0x3e 0x0d 0x76 0x80 0x01 0x00 0x80

        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3

        Link policy: RSWITCH HOLD SNIFF PARK

        Link mode: SLAVE ACCEPT

Can't read local name on hci0: Connection timed out (110)
```

```
#dmesg

Bluetooth: L2CAP ver 2.13

Bluetooth: L2CAP socket layer initialized

Bluetooth: RFCOMM socket layer initialized

Bluetooth: RFCOMM TTY layer initialized

Bluetooth: RFCOMM ver 1.11

Bluetooth: BNEP (Ethernet Emulation) ver 1.3

Bluetooth: BNEP filters: protocol multicast

Bluetooth: SCO (Voice Link) ver 0.6

Bluetooth: SCO socket layer initialized

....

hci_cmd_task: hci0 command tx timeout

hci_cmd_task: hci0 command tx timeout

...

bluetoothd[4980]: segfault at 100000007 ip 00007f835f7bd53b sp 00007fff20bbbdc0 error 4 in libc-2.9.so[7f835f74a000+14b000] <-- happens when I try and run blueman stuff

hci_cmd_task: hci0 command tx timeout

...

```

Not sure what to do. Not sure if it's relevant or not, but I had to create the hcid.conf and pin files that the Gentoo bluetooth guide says to edit. I'm running bluez 4.39.

----------

## joefish

Anyone who can help with this? I don't seem to be getting anywhere!

----------

## Fitzcarraldo

I got Bluetooth working under KDE 4.2, so you may be able to use the same procedure under KDE 4.3. The following post explains what I did:

https://forums.gentoo.org/viewtopic-p-5884856.html#5884856

----------

## joefish

Hi there,

Thanks for your suggestion. Unfortunately I still can't get things to work. dmesg still shows a lot of:

 *Quote:*   

> hci_cmd_task: hci0 command tx timeout 

 

Which I think is what I need to solve before anything else will work properly.

I've also tried older versions of blue-utils and bluez-libs, but run into the same problem. The adaptor I have works fine on my laptop running the latest Kubuntu.

----------

## dmpogo

In principle, hciconfig and hcitool work without any bluetooth(d) services started, before any pins, pairing, etc.   All they require is proper kernel modules loaded.

So you should be looking whether bluetooth subsytem in your kernel is properly configured (and whether you use proper driver for your bluetooth chip, it is probably btusb, but there are some special ones)

----------

## joefish

I've triple checked I have the kernel modules required as per the Gentoo Bluetooth Guide.

I'm wondering about the BD Address reported in this command:

 *Quote:*   

> # hciconfig -a
> 
> hci0:   Type: USB
> 
>         BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0
> ...

 

Should that be all 00s?

----------

## dmpogo

 *joefish wrote:*   

> I've triple checked I have the kernel modules required as per the Gentoo Bluetooth Guide.
> 
> I'm wondering about the BD Address reported in this command:
> 
>  *Quote:*   # hciconfig -a
> ...

 

No, that's not good.  Could you post the results of 

cat /proc/modules

Also, it seems that before you were in a better shape - at least BD address was recognized. What has changed ?

The working output of the hciconfig -a should look something like that

```

hciconfig -a

hci0:   Type: USB

        BD Address: 00:0A:50:F0:19:A1 ACL MTU: 672:8 SCO MTU: 0:0

        UP RUNNING PSCAN ISCAN

        RX bytes:72154 acl:1888 sco:0 events:2852 errors:0

        TX bytes:44740 acl:1891 sco:0 commands:649 errors:0

        Features: 0xff 0xfb 0x01 0x00 0x00 0x00 0x00 0x00

        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3

        Link policy:

        Link mode: SLAVE ACCEPT

        Name: 'polarbear-0'

        Class: 0x4a2100

        Service Classes: Networking, Capturing, Telephony

        Device Class: Computer, Uncategorized

        HCI Ver: 1.1 (0x1) HCI Rev: 0x8106 LMP Ver: 1.1 (0x1) LMP Subver: 0x9240

        Manufacturer: ST Microelectronics (48)

```

----------

## foxicatko

If you run out of ideas, try hidd instead of hcitool. I read somewhere it's been deprecated in favor of hcitool, but it was the only way i could get my BT mouse work....

----------

## joefish

 *Quote:*   

> # cat /proc/modules 
> 
> snd_seq_oss 27744 0 - Live 0xffffffffa0ce7000
> 
> snd_seq_midi_event 6600 1 snd_seq_oss, Live 0xffffffffa0ce0000
> ...

 

Right now I'm running bluez-4.45 as per Fitzcarraldo's thread link above. That's the only thing that's changed.

----------

## joefish

 *foxicatko wrote:*   

> If you run out of ideas, try hidd instead of hcitool. I read somewhere it's been deprecated in favor of hcitool, but it was the only way i could get my BT mouse work....

 

Which package provides this? It's not on my system.

----------

## dmpogo

 *joefish wrote:*   

>  *Quote:*   # cat /proc/modules 
> 
> snd_seq_oss 27744 0 - Live 0xffffffffa0ce7000
> 
> snd_seq_midi_event 6600 1 snd_seq_oss, Live 0xffffffffa0ce0000
> ...

 

I see very little of bluetooth modules in this list. Actually just btusb.  I have

sco 5876 0 - Live 0xffffffffa001e000

bnep 7680 0 - Live 0xffffffffa003f000

rfcomm 25680 2 - Live 0xffffffffa07bd000

l2cap 15664 4 bnep,rfcomm, Live 0xffffffffa07b7000

btusb 7572 1 - Live 0xffffffffa0004000

bluetooth 38084 5 sco,bnep,rfcomm,l2cap,btusb, Live 0xffffffffa004d000

Perhaps some of them you have compiled in kernel (like the main infrastructure one - bluetooth), and the rest are not needed yet at the level

of hci communication with the card (but will be needed later - rfcomm for serial transfers, bnep for networking etc).

I wonder whether your card is supposed to be supported by generic btusb.   There are three alternative drivers in the kernel stack - HCI BCM203x USB driver, 

HCI BPA10x USB driver and HCI BlueFRITZ! USB driver.    Maybe your dongle is one of those ? (I'm thinking of Ubuntu, which you said did support the dongle, and I wonder how). Compile them as the modules and try to load manually rmmoding btusb first.   

Then, looking again, it seems it is of one of the most generic types  :Sad: 

----------

## dmpogo

The best guide I found for bluez-4.x is

http://wiki.openmoko.org/wiki/Manually_using_Bluetooth#Information_about_bluez4_networking

----------

