Results 1 to 10 of 118

Thread: HOWTO: Apple Wireless Keyboard (Bluetooth)

Threaded View

  1. #1
    Join Date
    Apr 2006
    Beans
    4

    HOWTO: Apple Wireless Keyboard (Bluetooth)

    This guide was previously written for Ubuntu 6.06. However, these instructions have been updated to work on Ubuntu 7.04 (Feisty Fawn).

    Changes made:
    Replaced "hidd --search" by "hidd --connect BD_ADDR"
    Replaced "/etc/init.d/bluez-utils" by "/etc/init.d/bluetooth"
    Added "HIDD_ENABLED=1"
    Added package "bluetooth" and "bluez-gnome"


    Hello guys,

    I lately had some trouble using my Apple Wireless Keyboard with Ubuntu 7.04 so I'd like to share my experiences with you. So this is a small guide on pairing your Apple Wireless Keyboard with your Bluetooth Dongle of choice. Okay, so let's get started.

    First of all, install the package bluez-gnome:

    Code:
    user@ubuntu:~$ sudo apt-get install bluetooth bluez-gnome
    Restart your desktop session by logging out and logging in again. This will automatically start the bluetooth applet which will help you enter the PIN during the bluetooth pairing process.

    Now we need to find out the Bluetooth Hardware Device Address (BD_ADDR) of our Apple Keyboard. Unfortunately, this is not written anywhere on the keyboard itself. So we need to turn on the keyboard (or restart it) using the switch on the bottom and run the following command:

    Code:
    user@ubuntu:~$ hcitool scan
    Scanning ...
            BD_ADDR       Apple Wireless Keyboard
    user@ubuntu:~$
    Okay, there we got the BD_ADDR and the name of our device.

    This seems to be the crucial piece of the bluetooth puzzle!

    Now copy that BD_ADDR to your clipboard and edit the file /etc/bluetooth/hcid.conf to enable authentication and encryption for this very BD_ADDR.

    Code:
    user@ubuntu:~$ sudo gedit /etc/bluetooth/hcid.conf
    Enter the following stanza at the end of the file, replacing BD_ADDR with your BD_ADDR from the clipboard:

    Code:
    device BD_ADDR {
        name "Apple Wireless Keyboard";
        auth enable;
        encrypt enable;
    }
    When you're finished, save the file and close gedit.

    We're now going to enable HID-support by default:

    Code:
    user@ubuntu:~$ sudo gedit /etc/default/bluetooth
    Change "HIDD_ENABLED=1" to "HIDD_ENABLED=0". Take care that using this how-to you do not need any "--connect BD_ADDR" parameters to hidd. So you can remove them from HIDD_OPTIONS. "HIDD_OPTIONS='--master --server'" is just fine.

    Save the file, close gedit and restart the Bluetooth subsystem using the following command:

    Code:
    user@ubuntu:~$ sudo /etc/init.d/bluetooth restart
     * Restarting Bluetooth services... [ ok ]
    Notice that this will terminate any active bluetooth connections. However, reconnecting should not be a problem

    Finally, we're ready to do the actual pairing. Restart the keyboard again using the switch on the bottom to make it discoverable. Do not hit any keys on your Apple Keyboard unless this tutorial says so. It might cause all sorts of strange trouble during the pairing procedure. Okay, so, right after restarting the keyboard, run the following command (replacing BD_ADDR by the actual address, of course ):

    Code:
    user@ubuntu:~$ sudo hidd --connect BD_ADDR
    user@ubuntu:~$
    Ubuntu will now try to connect to the keyboard without showing any progress bar or other output. It will just sit there and wait. Okay, enter a PIN consisting of 4 digits and hit the enter key (both on your Apple Keyboard). Right after hitting enter, a notification window should pop up on your desktop asking you for the PIN you just entered. Enter it. "hidd" should finish without further outputs. You should now be set up.

    I hope that this will be useful to some people out there. Feel free to correct me or ask questions
    Last edited by naag; April 2nd, 2007 at 07:05 PM. Reason: Update for 7.04 Feisty Fawn

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •