Log in

No account? Create an account

Setting up Mighty Mouse on FreeBSD 7

Again, this is more for future reference for myself than any, but in case some of you have the same issue:

  1. Add to /boot/loader.conf:

  2. Add to /etc/rc.conf:

  3. Reboot, or run:

    kldload ng_ubt
    /etc/rc.d/sdpd start
    /etc/rc.d/hcsecd start
  4. Figure out the name of the Bluetooth HCI node by running:

    hccontrol read_node_list

    The node name will be something like “ubt0hci”; replace all HCINODE below with this name.

  5. Figure out the EUI-48 address (“BD_ADDR” in the output, six hexadecimal bytes separated by colons) of the mouse by running this right after turning on the mouse:

    hccontrol -n HCINODE inquiry

    Replace all BDADDR below with the EUI-48 address.

    Note: Mighty Mouse goes into sleep mode in a minute or so if it can't find a computer that wants to control it.

  6. Optional: Set up a Bluetooth host alias in /etc/bluetooth/hosts by running:

    echo BDADDR BDHOST >> /etc/bluetooth/hosts

    Pick a suitable host name, e.g. “mightymouse”, for BDHOST.

  7. Register the device with bthidd(8) by running:

    bthidcontrol -a BDADDR query >> /etc/bluetooth/bthidd.conf
  8. Register the PIN for the mouse by adding this to /etc/bluetooth/hcsecd.conf:

    device {
            bdaddr  BDADDR;
            name    "Mighty Mouse";
            key     nokey;
            pin     "0000";
  9. Restart hcsecd and bthidd:

    /etc/rc.d/hcsecd restart
    /etc/rc.d/bthidd restart
  10. Turn the mouse off and back on.

  11. If all went well, bthidd will emit messages like these in /var/log/messages:

    Feb 16 23:06:58 seerajeane bthidd[1906]: Accepted control connection from BDADDR
    Feb 16 23:06:58 seerajeane bthidd[1906]: Accepted interrupt connection from BDADDR

Note: Apparently bthidd talks directly to the console control device (/dev/consolectl) to inject mouse messages, without running moused.  Don't be alarmed if you don't see any moused running.  :D



Thank you!

Thank you very much for this fantastic guide. This was the only resource I needed to get my bluetooth mouse working perfectly in X.

However, I believe there is a slight error in this tutorial. You tell us to run this code:
"bthidcontrol -a BDADDR >> /etc/bluetooth/bthidd.conf"

However, running that code did nothing for me and just produced some help text. This is because there is no command at the end of the bthidcontrol argument. I believe you meant to tell us to use this code:
"bthidcontrol -a BDADDR query >> /etc/bluetooth/bthidd.conf"

Using that, everything worked as it should have.

Even still, this is the best guide I have seen over the entire Internet for bluetooth in FreeBSD, so please keep up the awesome tutorials like this!


Re: Thank you!

Thank you for your feedback!  I updated the instruction per your correction.  :D


Does not work after reboot


Thanks it works well for me but there is something strange : after reboot it does not associate again. I need to remove the file /var/db/bthidd.hids

Does it appears to you too? I asked to the FreeBSD developers but they didn't answer me right now.


FreeBSD 9.0

Works very well, thx!