Logitech k810 Bluetooth keyboard (updated 5/11/2014)

Thanks @cpu82 and @sk8harddiefast for going through this.

I'd just like to note all worked for me to get Targus ACB75AU Bluetooth 4.0 dual-mode micro USB adapter device recognised.

However, I found I had to change directories to get things working seamlessly. I patched from /usr/src/sys and I built (make) from /usr/src/sys/modules/netgraph/bluetooth/ubt.

On reboot the Targus USB adapter should be recognised as a Broadcom Bluetooth device without any problems:
Code:
> grep broadcom /var/run/dmesg.boot
  ugen0.2: <Broadcom Corp> at usbus0
  ubt0: <Broadcom Corp BCM20702A0, rev 2.00/1.12, addr 2> on usbus0
> dmesg | grep ubt
  ubt0: <Broadcom Corp BCM20702A0, rev 2.00/1.12, addr 2> on usbus0
> usbconfig -u 0 -a 2 dump_device_desc
  . . .
  ugen0.2: <BCM20702A0 Broadcom Corp> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
  idVendor = 0x0a5c
  idProduct = 0x21e8
  bcdDevice = 0x0112
  iManufacturer = 0x0001  <Broadcom Corp>
  iProduct = 0x0002  <BCM20702A0>
  iSerialNumber = 0x0003  <00190E11B461>
  . . .

References:

http://www.freebsd.org/doc/handbook/network-bluetooth.html
http://forums.freebsd.org/showthread.php?t=39679&highlight=bluetooth
http://forums.freebsd.org/showthread.php?p=220294#post220294

Some relevant paths:
  • /usr/src/sys/netgraph/bluetooth/drivers/ubt
  • /usr/src/sys/modules/netgraph/bluetooth/ubt

By the way, Targus Australia support stepped out and confirmed their device would be supported by FreeBSD (because of the chipset) pre sales. Well done, Targus.
 
Last edited by a moderator:
Thanks for working through this setup. I am now typing this message on my Logitech K810 Bluetooth keyboard thanks to this instruction. I didn't have to build anything though, and it worked with the GENERIC kernel.

I also had to buy a new Bluetooth USB adapter but the Targus ACB75AU Bluetooth® 4.0 Micro USB Adapter was only $23 from Officeworks. Targus Australia support also confirmed to me prior to purchase that the ACB75AU was a FreeBSD supported chipset, as well. Well done Targus Australia.

To finish off the thread above as well, several attempts at pairing failed and I was wondering if there was something else I needed to do. The keyboard was obviously available for pairing but was not connecting. I rechecked the configuration files but all was good so I switched the keyboard off and on one more time and then typed the PIN and the Bluetooth light suddenly went solid: paired! So just try a few times if you're having trouble pairing.
 
In case it helps anyone else, I was finding my keyboard did not pair now that I'd set up all the configuration files, even though I was typing on it a few days ago.

I stopped the Bluetooth service with service bluetooth stop ubt0 and then restarted it with service bluetooth start ubt0 and found that hcsecd was no longer running. So I started hcsecd but using the -d flag to keep it connected to the console to observe: /usr/sbin/hcsecd -d -f /etc/bluetooth/hcsecd.conf

I then found
Code:
syntax error on line 45
checked my hcsecd.conf and found that I had missed a semi-colon!
 
I've posted in a separate thread because I thought I had a different problem http://forums.freebsd.org/showthread.php?t=40779 but I'll continue here.

I was finding that after all set up described in this thread my keyboard did pair once but then stopped pairing.

I double and triple checked all my setup and it was just as described here. Some setting up was not required such as the /boot/loader.conf entry to load the vkbd module because kldstat -v | grep vkbd showed it was already there.

Eventually I ran hcsecd and bthidd in the foreground and found the following output when attempting to pair. I hope the following information is going to be useful here.
Code:
# 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)

I gave up but today I attempted again by removing all Bluetooth related data in /var/db and setting the hcsecd.conf device entry to nopin. The keyboard still didn't pair. But I left the workstation for some minutes (maybe half an hour) and when I came back it was paired! Here are the messages I got:
Code:
Jul 13 20:21:29 engine bthidd[1987]: Opening outbound session for 00:1f:20:75:7c:75 (new_device=1, reconnect_initiate=1)
Jul 13 20:21:29 engine kernel: kbd3 at vkbd53
Jul 13 20:21:30 engine bthidd[1987]: Could not connect to 00:1f:20:75:7c:75. Connection reset by peer (54)
Jul 13 20:21:49 engine bthidd[1987]: Opening outbound session for 00:1f:20:75:7c:75 (new_device=1, reconnect_initiate=1)
Jul 13 20:21:49 engine kernel: kbd3 at vkbd54
Jul 13 20:21:50 engine bthidd[1987]: Could not connect to 00:1f:20:75:7c:75. Connection reset by peer (54)
Jul 13 20:22:09 engine bthidd[1987]: Opening outbound session for 00:1f:20:75:7c:75 (new_device=1, reconnect_initiate=1)
Jul 13 20:22:09 engine kernel: kbd3 at vkbd55
Jul 13 20:22:10 engine bthidd[1987]: Could not connect to 00:1f:20:75:7c:75. Connection reset by peer (54)
Jul 13 20:22:29 engine bthidd[1987]: Opening outbound session for 00:1f:20:75:7c:75 (new_device=1, reconnect_initiate=1)
Jul 13 20:22:29 engine kernel: kbd3 at vkbd56
Jul 13 20:22:30 engine bthidd[1987]: Could not connect to 00:1f:20:75:7c:75. Connection reset by peer (54)
Jul 13 20:22:49 engine bthidd[1987]: Opening outbound session for 00:1f:20:75:7c:75 (new_device=1, reconnect_initiate=1)
Jul 13 20:22:49 engine kernel: kbd3 at vkbd57
Jul 13 20:22:51 engine bthidd[1987]: Could not connect to 00:1f:20:75:7c:75. Connection reset by peer (54)
Jul 13 20:23:09 engine bthidd[1987]: Opening outbound session for 00:1f:20:75:7c:75 (new_device=1, reconnect_initiate=1)
Jul 13 20:23:09 engine kernel: kbd3 at vkbd58
Jul 13 20:23:09 engine bthidd[1987]: Could not connect to 00:1f:20:75:7c:75. Connection reset by peer (54)
Jul 13 20:23:29 engine bthidd[1987]: Opening outbound session for 00:1f:20:75:7c:75 (new_device=1, reconnect_initiate=1)
Jul 13 20:23:29 engine kernel: kbd3 at vkbd59
Jul 13 20:23:34 engine bthidd[1987]: Could not connect to 00:1f:20:75:7c:75. Host is down (64)
Jul 13 20:23:49 engine bthidd[1987]: Opening outbound session for 00:1f:20:75:7c:75 (new_device=1, reconnect_initiate=1)
Jul 13 20:23:49 engine kernel: kbd3 at vkbd60
Jul 13 20:23:51 engine bthidd[1987]: Could not connect to 00:1f:20:75:7c:75. Connection reset by peer (54)
Jul 13 20:24:09 engine bthidd[1987]: Opening outbound session for 00:1f:20:75:7c:75 (new_device=1, reconnect_initiate=1)
Jul 13 20:24:09 engine kernel: kbd3 at vkbd61
 
PR needed?

cpu82 said:
After digging more I found this old-thread on the freebsd-bluetooth@ ML which explain the meaning of above log messages and how to proceed to mute it.

Thanks very much, @cpu82, you are a really helpful guy.

Actually, I'm not worried about the logging. As your thread points out, once it's paired there will be no more logging. I like the logging because it tells me how many times pairing has been attempted and confirms that pairing attempts are continuing.

This is how I use my Logitech Bluetooth K810 currently. I've configured it with no pin to make life easier. I log in using my old keyboard, delete /var/db/hcsecd.keys and /var/db/bthidd.hids and then restart services bluetooth, hcsecd and bthidd. Then I initiate a re-pair with the K810 - press connect and wait.

The K810 starts looking for a pair and I use my old keyboard to check that pair attempts are progressing in messages. When I can see the log lines showing "connection reset by peer" repeatedly I know pairing will happen eventually. I then start work on my old keyboard until reconnect happens (takes some minutes):

Code:
Jul 14 15:06:28 engine bthidd[2674]: Could not connect to 00:1f:20:75:7c:75. Connection reset by peer (54)
Jul 14 15:06:46 engine bthidd[2674]: Opening outbound session for 00:1f:20:75:7c:75 (new_device=1, reconnect_initiate=1)
Jul 14 15:06:46 engine kernel: kbd3 at vkbd19
Jul 14 15:06:47 engine bthidd[2674]: Could not connect to 00:1f:20:75:7c:75. Connection reset by peer (54)
Jul 14 15:07:06 engine bthidd[2674]: Opening outbound session for 00:1f:20:75:7c:75 (new_device=1, reconnect_initiate=1)
Jul 14 15:07:06 engine kernel: kbd3 at vkbd20
Jul 14 15:07:07 engine bthidd[2674]: Could not connect to 00:1f:20:75:7c:75. Connection reset by peer (54)
Jul 14 15:07:26 engine bthidd[2674]: Opening outbound session for 00:1f:20:75:7c:75 (new_device=1, reconnect_initiate=1)
Jul 14 15:07:26 engine kernel: kbd3 at vkbd21

After that I put my old keyboard back on the shelf and continue on the USB re-chargeable compact and comfortable K810 dished keys with helpful contrasting lit glyphs.

I'm not sure if I should submit a PR for this or developer already aware of the problem through @sk8harddiefast? I presume this is not just the K810 but other Bluetooth devices must suffer this?
 
Last edited by a moderator:
After long long time I want to share my setup hoping that somehow a way will be found.

1) cp /etc/defaults/bluetooth.device.conf /etc/bluetooth/ubt0.conf

Edit ubt0 configuration file

Code:
authentication_enable="NO"
   connectable="YES"
   discoverable="YES"
   hci_debug_level="4"
   l2cap_debug_level="4"
   local_name="lg"
   role_switch="YES"

2) sudo service bluetooth start ubt0

3) /etc/rc.conf

Code:
hcsecd_enable="YES"
   hcsecd_config="/etc/bluetooth/hcsecd.conf"
   sdpd_enable="YES"
   bthidd_enable="YES"
   bthidd_config="/etc/bluetooth/bthidd.conf"

4) /boot/loader.conf

Code:
vkbd_load="YES"
   ng_ubt_load="YES"
   ng_l2cap_load="YES"

5) install hcidump from ports

6) /etc/bluetooth/bthidd.conf

Code:
device {
  bdaddr  00:1f:20:4d:f2:c5;
  control_psm  0x11;
  interrupt_psm  0x13;
  reconnect_initiate  true;
  battery_power  true;
  normally_connectable  true;
  hid_descriptor  {
  0x05 0x01 0x09 0x06 0xa1 0x01 0x85 0x01
  0x75 0x01 0x95 0x08 0x05 0x07 0x19 0xe0
  0x29 0xe7 0x15 0x00 0x25 0x01 0x81 0x02
  0x95 0x01 0x75 0x08 0x81 0x03 0x95 0x05
  0x75 0x01 0x05 0x08 0x19 0x01 0x29 0x05
  0x91 0x02 0x95 0x01 0x75 0x03 0x91 0x03
  0x95 0x06 0x75 0x08 0x15 0x00 0x26 0xff
  0x00 0x05 0x07 0x19 0x00 0x29 0xff 0x81
  0x00 0xc0 0x05 0x0c 0x09 0x01 0xa1 0x01
  0x85 0x02 0x15 0x00 0x25 0x01 0x75 0x01
  0x95 0x14 0x0a 0x94 0x01 0x0a 0x92 0x01
  0x0a 0x83 0x01 0x0a 0x23 0x02 0x0a 0x8a
  0x01 0x0a 0x82 0x01 0x0a 0x21 0x02 0x0a
  0x30 0x00 0x0a 0x25 0x02 0x0a 0x23 0x02
  0x0a 0x27 0x02 0x09 0xb6 0x09 0xb5 0x09
  0xb8 0x09 0xcd 0x09 0xe9 0x09 0xea 0x09
  0xe2 0x0a 0x24 0x02 0x09 0x30 0x81 0x02
  0x95 0x01 0x75 0x04 0x81 0x03 0xc0 0x05
  0x0c 0x09 0x01 0xa1 0x01 0x85 0x03 0x05
  0x01 0x09 0x06 0xa1 0x02 0x05 0x06 0x09
  0x20 0x15 0x00 0x26 0x14 0x00 0x75 0x08
  0x95 0x01 0x81 0x02 0xc0 0xc0 0x05 0x01
  0x09 0x80 0xa1 0x01 0x85 0x04 0x15 0x00
  0x25 0x01 0x75 0x01 0x95 0x02 0x09 0x81
  0x09 0x82 0x81 0x02 0x95 0x01 0x75 0x06
  0x81 0x03 0xc0 0x05 0x0c 0x09 0x01 0xa1
  0x01 0x85 0x05 0x05 0x01 0x09 0x06 0xa1
  0x02 0x06 0x00 0xff 0x25 0x01 0x75 0x01
  0x95 0x02 0x0a 0x03 0xfe 0x0a 0x04 0xfe
  0x81 0x02 0x95 0x06 0x81 0x03 0xc0 0xc0
  0x05 0x0c 0x09 0x01 0xa1 0x01 0x85 0xff
  0x05 0x06 0x95 0x01 0x75 0x02 0x19 0x24
  0x29 0x26 0x81 0x02 0x75 0x06 0x81 0x01
  0xc0 0x06 0x00 0xff 0x09 0x01 0xa1 0x01
  0x85 0x10 0x75 0x08 0x95 0x06 0x15 0x00
  0x26 0xff 0x00 0x09 0x01 0x81 0x00 0x09
  0x01 0x91 0x00 0xc0 0x06 0x00 0xff 0x09
  0x02 0xa1 0x01 0x85 0x11 0x75 0x08 0x95
  0x13 0x15 0x00 0x26 0xff 0x00 0x09 0x02
  0x81 0x00 0x09 0x02 0x91 0x00 0xc0
  };
}

6) /etc/bluetooth/hcsecd.conf

Code:
device {
   bdaddr  00:1f:20:4d:f2:c5;
   name  "Logitech K810";
   key  nokey;
   pin  "702312";
   }

7) /etc/bluetooth/hosts

Code:
00:1f:20:4d:f2:c5 lg-kbd

8) cp /dev/null /var/db/bthidd.hids

After reboot my keyboard pairs and looking with hcibump -x
I get this on every click:

Code:
ember@FreeBSD ~ $ sudo hcidump -x
Password:
HCIDump - HCI packet analyzer ver 1.5
device: any snap_len: 65535 filter: 0xffffffffffffffff
> HCI Event: Connect Request(0x04) plen 10
  C5 F2 4D 20 1F 00 40 05 00 01
< HCI Command: Accept Connection Request(0x01|0x0009) plen 7
  C5 F2 4D 20 1F 00 00
> HCI Event: Command Status(0x0f) plen 4
  00 01 09 04
> HCI Event: Role Change(0x12) plen 8
  00 C5 F2 4D 20 1F 00 00
> HCI Event: Connect Complete(0x03) plen 11
  00 0B 00 C5 F2 4D 20 1F 00 01 00
< HCI Command: Write Link Policy Settings(0x02|0x000d) plen 4
  0B 00 05 00
> HCI Event: Command Complete(0x0e) plen 6
  01 0D 08 00 0B 00
> HCI Event: Link Key Request(0x17) plen 6
  C5 F2 4D 20 1F 00
< HCI Command: Link Key Request Negative Reply(0x01|0x000c) plen 6
  C5 F2 4D 20 1F 00
> HCI Event: Command Complete(0x0e) plen 10
  01 0C 04 00 C5 F2 4D 20 1F 00
> HCI Event: Disconn Complete(0x05) plen 4
  00 0B 00 13
> HCI Event: Connect Request(0x04) plen 10
  C5 F2 4D 20 1F 00 40 05 00 01
< HCI Command: Accept Connection Request(0x01|0x0009) plen 7
  C5 F2 4D 20 1F 00 00
> HCI Event: Command Status(0x0f) plen 4
  00 01 09 04
> HCI Event: Role Change(0x12) plen 8
  00 C5 F2 4D 20 1F 00 00
> HCI Event: Connect Complete(0x03) plen 11
  00 0C 00 C5 F2 4D 20 1F 00 01 00
< HCI Command: Write Link Policy Settings(0x02|0x000d) plen 4
  0C 00 05 00
> HCI Event: Command Complete(0x0e) plen 6
  01 0D 08 00 0C 00
> HCI Event: Link Key Request(0x17) plen 6
  C5 F2 4D 20 1F 00
< HCI Command: Link Key Request Negative Reply(0x01|0x000c) plen 6
  C5 F2 4D 20 1F 00
> HCI Event: Command Complete(0x0e) plen 10
  01 0C 04 00 C5 F2 4D 20 1F 00
> HCI Event: Disconn Complete(0x05) plen 4
  00 0C 00 1

But the keyboard writes nothing. There is communication between keyboard and computer but it doesn't write. Sometimes randomly start working and writes!
 
After almost two hours finally now my keyboard connected! This post is from my Logitech K810!

The bad news is that the pair will be lost again in the next reboot.
There are three problems:
  1. Creates a file /var/db/bthidd.conf file
  2. Creates a file /var/db/hcsecd.keys file (I must delete them and restart the services)
  3. Takes a long long time to pair the device
The only way I found is to set no pin option. There is still a delay but is more acceptable
 
Last edited:
I originally had the same bluetooth behaviour and workaround as sk8harddiefast started Thread 40779 and Thread 226685 and continued here.
But I've just got a fresh FreeBSD 10.1-RELEASE on AMD64 running and the behaviour of my bluetooth pairing has changed now. Although I still have to restart the services on every boot it reliably pairs first or second attempt (using no PIN).
I can share set up if anyone wants but I believe it's pretty much as specified here and probably the solution is in release 10.1? This is what I run on start up:
Code:
rm -f /var/db/bthidd.hids /var/db/hcsecd.keys
service bluetooth restart ubt0
service hcsecd restart
service bthidd restart
 
Same here. My keyboard works but after every reboot I must delete /var/db/bthidd.hids and /var/db/hcsecd.keys
and restart hcsecd and bthidd service
Also pairing to other Os makes the keyboard to lose his mind!
 
I regularly pair my K810 to a Mac Mini OS X 10.6 using the F1 pairing. I don't let any other OS or device use the F3 pairing which I always switch to for FreeBSD. I don't have any problems (related to multiple OSs). I don't press the reset / connect button on the back of the keyboard.
 
Last edited:
Hi guys,
I also having the same issue. My mouse is logitech T630. I have to do the same thing as mentioned to remove the files and restart those processes.

According to the http://ralphm.net/blog/2013/10

Seems like logitech mouse or maybe keyboard required repairing every time reconnect.

so my suspect is that what we have done is to force repairing, that is why the mouse will work again for second time. I hope maybe Anil-G can highlight that in your PR.
 
I don't think I understand enough to comment.

Now at FreeBSD 10.1 I find that I usually don't have to wait for pairing using the workaround described.

I'd like to find some time to do a test for normal operation, in case that's working better than it used to.

I'd like to actually understand the "bluetooth handshake" better as well, and be able to trace the various servers through logs or running in foreground so I could troubleshoot the process and try to identify cause, but I don't know where to start.
 
Back
Top