# Bluetooth pairing problem - reset by peer



## Anil-G (Jul 11, 2013)

I'd really appreciate some help with pairing my Logitech K810 Bluetooth keyboard. It was working a couple of days ago!

I did everything specified on http://forums.freebsd.org/showthread.php?t=39679 and linked resources, including patching ng_ubt.

Several pair attempts failed and then I re-powered on the keyboard one more time and it worked! The blue light stopped flashing, went solid, and I spent the rest of the evening typing on my new keyboard!

Now it just won't pair. All diagnostics from thread 39679 come up positive. I ran hcsecd in the foreground for information. Now I'm running bthidd in the foreground and get this:


```
# service bthidd stop
# bthidcontrol -a 00:1f:20:75:7c:75 forget
# /usr/sbin/bthidd -d -c /etc/bluetooth/bthidd.conf -H /var/db/bthidd.hids -p /var/run/bthidd.pid

bthidd[2344]: Opening outbound session for 00:1f:20:75:7c:75 (new_device=1, reconnect_initiate=1)
kbd3 at vkbd9
bthidd[2344]: Could not connect to 00:1f:20:75:7c:75. Host is down (64)
Jul 12 00:46:44 engine bthidd[2344]: Could not connect to 00:1f:20:75:7c:75. Host is down (64)
bthidd[2344]: Opening outbound session for 00:1f:20:75:7c:75 (new_device=1, reconnect_initiate=1)
kbd3 at vkbd10
bthidd[2344]: Could not connect to 00:1f:20:75:7c:75. Connection reset by peer (54)
Jul 12 00:47:22 engine bthidd[2344]: Could not connect to 00:1f:20:75:7c:75. Connection reset by peer (54)
bthidd[2344]: Opening outbound session for 00:1f:20:75:7c:75 (new_device=1, reconnect_initiate=1)
kbd3 at vkbd11
bthidd[2344]: Could not connect to 00:1f:20:75:7c:75. Connection reset by peer (54)
Jul 12 00:47:59 engine bthidd[2344]: Could not connect to 00:1f:20:75:7c:75. Connection reset by peer (54)
```

The sequence I perform on the keyboard is:


 Hit the Bluetooth "connect" button (tell keyboard re-pair?).
 On the K810 press the select key for the device choice (#1) (tell keyboard which register to use to store pairing).
 Type the four digit PIN 0000 followed by Enter.

It's a pretty fresh FreeBSD 9.1

```
$ uname -a
FreeBSD engine.local 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243826: Tue Dec  4 06:55:39 UTC 2012     root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
```

Hopefully this diagnostic is an indicator that everything else is working. For instance the BD_ADDR is replaced by the name by lookup from /etc/bluetooth/hosts.


```
# hccontrol -n ubt0hci inquiry
Inquiry result, num_responses=1
Inquiry result #0
        BD_ADDR: logitech_k810
        Page Scan Rep. Mode: 0x1
        Page Scan Period Mode: 00
        Page Scan Mode: 00
        Class: 00:25:40
        Clock offset: 0x03
Inquiry result, num_responses=1
Inquiry result #0
        BD_ADDR: 6c:f3:73:ab:30:0b
        Page Scan Rep. Mode: 0x1
        Page Scan Period Mode: 00
        Page Scan Mode: 00
        Class: 18:02:04
        Clock offset: 0x747
Inquiry complete. Status: No error [00]
```

Any ideas on the connection reset by peer? Perhaps the K810 refuses to connect without encryption? I have copied in an /etc/bluetooth/ubt0.conf from the /etc/defaults/bluetooth.device.conf, and it's all comments.


----------



## Anil-G (Jul 12, 2013)

*Known issue - developer contacted already*

I've been told privately:



> There is a problem with the pairing, and will need to create a patch to fix it.



Developer has been contacted:


> so you have to wait for he returns.



Thanks very much for letting me know and really nice to know someone is onto it.

I'm just wondering about etiquette here too - when is a private message appropriate and when should someone just post openly so everyone else can know?


----------



## Anil-G (Jul 13, 2013)

By the way this really carries on from http://forums.freebsd.org/showthread.php?t=39679&page=3

I thought it was different since I thought @sk8hardiefast had got his keyboard working, but apparently he has the same issue.

I'll continue to post on thread 39679 I guess. I have new developments. I tried a few things including removing all /var/db records and setting the device entry in /etc/bluetooth/hcsecd.conf to _nopin_. It didn't immediately work but I left my workstation for a few minutes and when I came back it was paired.


----------



## fonz (Jul 13, 2013)

Anil-G said:
			
		

> By the way this really carries on from http://forums.freebsd.org/showthread.php?t=39679&page=3
> [snip]
> I'll continue to post on thread 39679 I guess.


In that case I'll close this one. Ask per PM if you need it reopened.


----------

