# Bluetooth connection problems

## doesntcount

I have a problem getting my bluetooth hardware to recognize my wiiremote. 

I was successfully using my wiimote with XBMC for a few weeks and suddenly the event client that connected to the wiimote started giving connection errors like so:

```
 # ./xbmc-wiiremote

wiiuse v0.12 loaded.

[INFO] Found 1 bluetooth device(s).

[INFO] Found wiimote (00:1F:32:A9:A0:0A) [id 1].

connect() output sock: Connection reset by peer

[INFO] Found 1 bluetooth device(s).

[INFO] Found wiimote (00:1F:32:A9:A0:0A) [id 1].

connect() output sock: Host is down
```

To rule out the xbmc client code, i tried using other Wiimote programs like the whiteboard program:

```
# ./demo

Screen dimentions: 1280x720

MAC address: #

Put Wiimote in discoverable mode now (press 1+2)...

Socket connect error (control channel)

Unable to connect to wiimote
```

as well as wminput:

```
# # wminput -d

Socket connect error (control channel)

Socket connect error (control channel)
```

I'm using a kensignton usb dongle. Here's my hiconfig -a:

```
# hciconfig -a

hci0:   Type: USB

   BD Address: 00:19:15:60:32:C7 ACL MTU: 1017:8 SCO MTU: 64:8

   UP RUNNING PSCAN ISCAN

   RX bytes:4628 acl:2 sco:0 events:195 errors:0

   TX bytes:953 acl:13 sco:0 commands:66 errors:0

   Features: 0xff 0xff 0x8d 0xfe 0x9b 0xf9 0x00 0x80

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

   Link policy: RSWITCH HOLD SNIFF PARK

   Link mode: SLAVE ACCEPT

   Name: 'BlueZ (0)'

   Class: 0x3e0100

   Service Classes: Networking, Rendering, Capturing

   Device Class: Computer, Uncategorized

   HCI Ver: 2.0 (0x3) HCI Rev: 0x414e LMP Ver: 2.0 (0x3) LMP Subver: 0x430e

   Manufacturer: Broadcom Corporation (15)
```

What's really annoying is hcitool scan can find the wiimote:

```
 # hcitool scan

Scanning ...

   00:1F:32:A9:A0:0A   Nintendo RVL-CNT-01
```

But i can't ping it:

```
$ sudo l2ping 00:1F:32:A9:A0:0A

Password: 

Ping: 00:1F:32:A9:A0:0A from 00:19:15:60:32:C7 (data size 44) ...

Recv failed: Connection reset by peer

```

Also, I've certainly built my kernel with all the appropriate bluetooth flags as instructed here: http://www.gentoo.org/doc/en/bluetooth-guide.xml

I've seen this in my /var/log/message, not sure what it could mean:

```
Apr 14 23:42:41 walter [ 3726.010348] hci_acldata_packet: hci0 ACL packet for unknown connection handle 515

Apr 14 23:42:48 walter [ 3732.964413] hci_acldata_packet: hci0 ACL packet for unknown connection handle 16
```

Does anybody have any tips here. I'm completely at a loss and i've looked for almost every conceivable misconfiguration.

Thanks to anybody that can help.

----------

## doesntcount

Does anybody have any suggestions here. I really don't want to have to move to ubuntu  :Sad: 

There seem to be a lot of people that have been able to get bluetooth to work on gentoo. Can anybody help me out with some debugging tips?

----------

