Page 1 of 7 123 ... LastLast
Results 1 to 10 of 118

Thread: HOWTO: Apple Wireless Keyboard (Bluetooth)

Hybrid 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

  2. #2
    Join Date
    Aug 2005
    Location
    Sun Prairie, WI
    Beans
    181
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Apple Wireless Keyboard (Bluetooth)

    Thank you very much for this. I have to tell you that I was slightly disappointed that my bluetooth keyboard didn't 'just work' after I updated to Dapper, but then I was really disappointed when following the same steps that got it working under Breezy didn't work. While I don't remember the precise steps I took in Breezy, I do remember that they were way simpler than this.

    Anyhow, thanks again for the great howto. This worked perfectly (after I had properly charged batteries in the keyboard). Now all I have to do is find a bluetooth mouse that I can afford, There must be a grand total of 3 mice that are bluetooth and are not made by Apple. (Like the keyboards, hate the mice.)
    Adopt a post!! Click on the Unanswered Threads link and share the knowledge and love!

  3. #3
    Join Date
    Jun 2006
    Beans
    15

    Re: HOWTO: Apple Wireless Keyboard (Bluetooth)

    I followed these instructions to the T, but if I turn my keyboard off, it is never automatically recognized again.

    Every time I want to use it, I have to manually (and with another keyboard) type "sudo hidd --search".

    What might I be doing wrong?

  4. #4
    Join Date
    May 2005
    Beans
    498

    Re: HOWTO: Apple Wireless Keyboard (Bluetooth)

    [/QUOTE]

    Okay, now we're ready to do the actual pairing. Restart the keyboard again using the switch on the bottom. Do not hit any buttons 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, execute the following command:

    Code:
    user@ubuntu:~$ sudo hidd --search
    Searching ...
            Connecting to device BD_ADDR
    user@ubuntu:~$
    As soon as it prints out "Connecting to device BD_ADDR", you should enter a PIN consisting of 4 digits and hit the Return key (on your Apple Keyboard). Right after hitting Return, a window should pop up on your computer asking you for the PIN you just entered. Enter it. 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 [/QUOTE]

    works thus far the I get

    "Searching ...
    Connecting to device 00:0A:95:3F:75:17
    Can't get device information: File descriptor in bad state"

    Any help received with thanks. It would really be nice if we could make a sticky out of this as I like many I suspect are using cheapo usb keyboards,mice and headsets with our good gear sat in a cupboard.

    I think there is a bluez file that stores the code for your seperate bluetooth devices. I seem to remember editing it a while back for my phone or headset but I knew the codes to enter.

  5. #5
    Join Date
    Dec 2006
    Beans
    2

    Re: HOWTO: Apple Wireless Keyboard (Bluetooth)

    What a great howto - it worked flawlessly the first time! Thanks so much for the info.

    However, similar to nakko above, I'm struggling to understand how to make the pairing automatic in the case of either the keyboard or computer falling asleep or restarting. Is it simply a matter of putting the "hidd --search" command in a startup script somewhere?

    Any help is much appreciated.

  6. #6
    Join Date
    Dec 2006
    Beans
    29
    Distro
    Gutsy Gibbon Testing

    Re: HOWTO: Apple Wireless Keyboard (Bluetooth)

    Or you can just uninstall bluez-utils. It worked like an instant charm for me. System -> Administration -> Synaptic Package Manager.

    Search for bluez, uncheck (check for removal) bluez-utils. Apply.

  7. #7
    Join Date
    Sep 2008
    Beans
    3
    Distro
    Ubuntu 8.04 Hardy Heron

    Wink Re: HOWTO: Apple Wireless Keyboard (Bluetooth)

    Quote Originally Posted by morphet View Post
    Or you can just uninstall bluez-utils. It worked like an instant charm for me. System -> Administration -> Synaptic Package Manager.

    Search for bluez, uncheck (check for removal) bluez-utils. Apply.
    Thanks man this worked like a charm

  8. #8
    Join Date
    Dec 2006
    Beans
    2

    Re: HOWTO: Apple Wireless Keyboard (Bluetooth)

    As it turns out, I found the information I needed here: https://help.ubuntu.com/community/BluetoothSetup Now my Apple Wireless Keyboard will work after reboot, and also wake the machine up from sleep. Brilliant! Now if I could just figure out how to get the Apple Wireless Mighty Mouse input to be interpreted properly...

  9. #9
    Join Date
    Aug 2005
    Location
    North of the Artic
    Beans
    85
    Distro
    Ubuntu Intrepid Ibex (testing)

    Re: HOWTO: Apple Wireless Keyboard (Bluetooth)

    Quote Originally Posted by skindog View Post
    As it turns out, I found the information I needed here: https://help.ubuntu.com/community/BluetoothSetup Now my Apple Wireless Keyboard will work after reboot, and also wake the machine up from sleep. Brilliant! Now if I could just figure out how to get the Apple Wireless Mighty Mouse input to be interpreted properly...
    Thanks for that link, works perfectly now
    I forgot that love existed - Van Morrison

  10. #10
    Join Date
    Oct 2007
    Location
    Waterloo, Ontario
    Beans
    36
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: HOWTO: Apple Wireless Keyboard (Bluetooth)

    So yeah... I posted here previously with thanks for help getting this to work... except for the bluetooth keyboard powersaving mode.

    After awhile of inactivity, as at least one other person on this thread has noticed, the keyboard goes to sleep. Now I believe normal functionality on a Mac is that the keyboard reconnects as soon as a key is pressed, and the Mac allows this because it uses the same time-out length for the bluetooth connection as the keyboard uses as a trigger to go to sleep after so long of inactivity.

    Therefor, I believe the problem being experienced with the keyboard going to sleep and not automatically reconnecting to Ubuntu is because Ubuntu does not automatically disconnect the device after a period of inactivity, or at least the same period of inactivity. I notice that even after the bluetooth keyboard has gone to sleep, the Bluetooth Manager Preferences window shows the device as still connected. If one disconnects the device manually in this window, and then presses a key on the keyboard after doing so, the keyboard should reconnect and you can resume as normal.

    At least this way people who rely only on the bluetooth keyboard and still have a corded mouse have a chance at getting the keyboard reconnected without the paradox of needing the keyboard to connect the keyboard.

    I wonder if there is a way to script the bluetooth keyboard's automatic disconnection from the machine after X inactivity, or for that matter if there is a way to enable some kind of timeout in the bluetooth preferences themselves?

Page 1 of 7 123 ... LastLast

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
  •