The Tridecadal Korean (astralblue) wrote,
The Tridecadal Korean

  • Location:
  • Mood:

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

Tags: bluetooth, freebsd

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.