Tuesday, January 03, 2006

Setting up a bluetooth mouse on FreeBSD 6


Add these to /boot/loader.conf:
netgraph_load="YES"
ng_ubt_load="YES"
vkbd_load="YES"

cd /usr/src/usr.sbin/bluetooth/
make install

cd /usr/src/usr.sbin/bluetooth/bthidcontrol
make && make install
cd /usr/src/usr.sbin/bluetooth/bthidd
make && make install

Add these lines to /etc/rc.conf:
hcsecd_enable="YES"
sdpd_enable="YES" # not really needed for mouse use only

Add this to /etc/rc.local:
/usr/sbin/bthidd

If ng_ubt isn't loaded already, do:
kldload ng_ubt
kldload vkbd # this probably isn't really needed either

dmesg should show you some kind of bluetooth thing like this:
ubt0: ALPS UGX, rev 1.10/11.68, addr 3
ubt0: ALPS UGX, rev 1.10/11.68, addr 3
ubt0: Interface 0 endpoints: interrupt=0x81, bulk-in=0x82, bulk-out=0x2
ubt0: Interface 1 (alt.config 5) endpoints: isoc-in=0x83, isoc-out=0x3; wMaxPacketSize=49; nframes=6, buffer size=294

Get your mouse set up, and then do this:
hccontrol -n ubt0hci inquiry

You'll see something like this:
Inquiry result, num_responses=1
Inquiry result #0
BD_ADDR: roddick
Page Scan Rep. Mode: 0x1
Page Scan Period Mode: 00
Page Scan Mode: 00
Class: 02:01:04
Clock offset: 0x3a4
Inquiry result, num_responses=1
Inquiry result #0
BD_ADDR: 00:50:f2:e9:a1:f1
Page Scan Rep. Mode: 0x1
Page Scan Period Mode: 00
Page Scan Mode: 00
Class: 00:25:80
Clock offset: 0x7e8f
Inquiry result, num_responses=1
Inquiry result #0
BD_ADDR: epa-phone
Page Scan Rep. Mode: 0x1
Page Scan Period Mode: 00
Page Scan Mode: 00
Class: 52:02:04
Clock offset: 0x575d
Inquiry complete. Status: No error [00]

Look for the BD_ADDR of your mouse (printed on the bottom of your mouse too probably).

Now do:
bthidcontrol -a BD_ADDR query
but replace with the address you got above.

You should see something like:
device {
bdaddr 00:50:f2:e9:a1:f1;
control_psm 0x11;
interrupt_psm 0x13;
reconnect_initiate true;
battery_power true;
normally_connectable false;
hid_descriptor {
0x05 0x01 0x09 0x02 0xa1 0x01 0x85 0x02
0x09 0x01 0xa1 0x00 0x05 0x09 0x19 0x01
0x29 0x05 0x15 0x00 0x25 0x01 0x75 0x01
0x95 0x05 0x81 0x02 0x75 0x03 0x95 0x01
0x81 0x01 0x05 0x01 0x09 0x30 0x09 0x31
0x09 0x38 0x15 0x81 0x25 0x7f 0x75 0x08
0x95 0x03 0x81 0x06 0x05 0x0c 0x0a 0x38
0x02 0x95 0x01 0x81 0x06 0xc0 0x05 0x01
0x09 0x4b 0x15 0x00 0x25 0x01 0x75 0x01
0xb1 0x02 0x75 0x07 0xb1 0x01 0xc0 0x05
0x0c 0x09 0x01 0xa1 0x01 0x85 0x03 0x05
0x01 0x09 0x02 0xa1 0x02 0x06 0x00 0xff
0x15 0x00 0x25 0x03 0x75 0x02 0x95 0x01
0x0a 0x01 0xfe 0x81 0x02 0x25 0x01 0x75
0x01 0x0a 0x00 0xfe 0x81 0x02 0x75 0x05
0x81 0x01 0xc0 0xc0 0x05 0x0c 0x09 0x01
0xa1 0x01 0x85 0x04 0x05 0x01 0x09 0x02
0xa1 0x02 0x05 0x0c 0x0a 0x38 0x02 0x75
0x08 0x95 0x01 0x15 0x81 0x25 0x7f 0x81
0x06 0x06 0x00 0xff 0x0a 0x04 0xff 0x0a
0x06 0xff 0x15 0x00 0x25 0x01 0x75 0x01
0x95 0x02 0xb1 0x02 0x95 0x06 0xb1 0x01
0xc0 0xc0
};
}

Now let's add it to the bthosts file, so do this:
echo "BD_ADDR msmouse" >> /etc/bluetooth/hosts
but replace BD_ADDR with the address you got above.

Now, you should be able to do:
bthidcontrol -a msmouse query >> /etc/bluetooth/bthidd.conf

and then run bthidd:
bthidd

Does your mouse work now?

2 comments:

  1. You know, the most latest and updated versions of the Swiftpoint GT work on both Mac and PC. I think no other ones can compete with this ergonomic mouse reviews for work

    ReplyDelete
  2. Perhaps you uninstalled an application that removed critical files one of your other devices need. Other instances that could ruin your device drivers would be a system crash, an unexpected shutdown or failed hard drive.click here

    ReplyDelete