6

I have an Apple bluetooth keyboard and want to use it with Fedora 15.

I turn on the bluetooth on the both devices. Click 'Setup new device' via Gnome3's GUI. The computer detects the keyboard but it shows up with a MAC address kind of number format instead of a name. Upon selecting I am unable to proceed with the setup, i.e., it does not proceed to the stage where it asks for a PIN to connect the devices.

It works flawlessly with both a friend's iPad and my own Windows. So there doesn't seem to be any problem with the keyboard itself.

I don't have much experience with bluetooth devices and there seem to be no Fedora specific posts regarding the topic, and the Ubuntu forum solutions don't seem to work for me.


I know the question is vague but I don't know what else I could post to help the reader.

Therefore if any further information is required, please ask for it, I will post the same ASAP.

2 Answers 2

1

Usually, if you'll wait a moment when the MAC shows up, it'll replace it with the device's name.

At least that's how it happens on my system.

Many keyboards and small devices default to '0000' as their PIN, and the system automatically tries that in many cases. Are you sure the keyboard isn't connected? Try it.


EDIT:

I pulled this from another of my answers concerning getting a BT keyboard to pair before login, it might be helpful for you too. I used it a bunch when the BT pairing system in KDE didn't seem to work properly (never would accept PIN... hmmm, sound familiar?) (a later update finally fixed it, now working properly)

From unix.SE: 'how to get my bluetooth keyboard to be recognized before log-in'


I occasionally use the following script to add bluetooth keyboards to my systems, it adds it at a system level, rather than a user level, which seems to make things work right from the boot, and my keyboard(s) are usable from the login prompt.

As written, you'll need bash (v4.0+ hopefully) and the bluez package, which supplies the bluez-simple-agent, bluez-test-device, bluez-test-input programs.

Most of the code below is to implement a list to allow you to choose which device, it really just boils down to the last 6 (non-comment) lines, if you know your BT MAC Address, you can replace all the choice stuff with a static assignment.

#!/bin/bash
#
# L Nix <[email protected]>
# setup-bt-kb : allow choosing & pairing a bluetooth keyboard from the console
#
declare -a addrlist
#
while [ 1 ]; do
    echo -n "Scanning for Bluetooth devices ... "
    readarray -n 10 -O 0 -t addrlist < <(hcitool scan|grep -v "^Scanning"|sed -e "s/^[ \t]//g" -e "s/\t/ /g" | head -n 9)
    echo
    echo
    length=${#addrlist[@]}
    a=1
    while [ ${a} -le ${length} ]; do
        echo "$a) ${addrlist[$a-1]}"
        a=$((a + 1))
    done
    echo
    while [ 1 ]; do
        if [ ${length} -gt 0 ]; then
            echo -n "Choose (1-${length}), or "
        fi
        echo -n "'R' to rescan: "
        read -n 1 REPLY
        echo
        case ${REPLY} in
            Q)
                # just quit
                exit 0
                ;;
            [0rR])
                echo
                REPLY=0
                break
                ;;
            [123456789])
                if [ ${REPLY} -le ${length} ]; then
                    echo "Got ${REPLY}"
                    break
                fi
                ;;
            *)
                ;;
        esac
    done
    if [ ${REPLY} -gt 0 ]; then
        break
    fi
done
#
device=${addrlist[${REPLY}-1]}
#
BTADDR=${device/% *}
BTNAME=${device/#??:??:??:??:??:?? }
#
echo "selecting '${BTNAME}' at ${BTADDR}"
#
echo "Pairing with ${BTNAME} (Generally '0000')"
bluez-simple-agent hci0 ${BTADDR}
#
echo "Setting trust level with ${BTNAME}"
bluez-test-device trusted ${BTADDR} yes
#
echo "Connecting to ${BTNAME}"
bluez-test-input connect ${BTADDR}
#
echo "Completed"
7
  • 1
    No even after a full 3 minutes (time keyboard remains on when not connected) no name shows up whereas other devices show up with names instantaneously. And it doesn't proceed to the PIN stage simply keeps looking for devices. I've tried entering '0000' as the pin too. Still no luck.
    – ffledgling
    Commented Jul 8, 2012 at 17:58
  • Updated my answer with some code I use myself to bypass the GUI bluetooth system. Might help.
    – lornix
    Commented Jul 8, 2012 at 18:05
  • Aren't there some complications with having both bluez and gnome's standard Bluetooth package? Do I need to uninstall the standard package to get bluez to work?
    – ffledgling
    Commented Jul 8, 2012 at 18:14
  • shouldn't have to. I guess your package manager will let you know if there's any known dependencies. Didn't affect anything on my system, although I'm running KDE.
    – lornix
    Commented Jul 8, 2012 at 18:16
  • I'll try and tell you what happens.
    – ffledgling
    Commented Jul 8, 2012 at 18:23
0

I'm not sure about Fedora, but just yesterday I've installed an Apple Wireless keyboard on Debian without any problems.

My goal was to pair the keyboard from the console so it will connect automatically even if I boot into the console and don't run X. So to connect a bluetooth keyboard you don't need any GUI tools.

I've mostly used this nice guide. It's written for Raspberry Pi, but don't let that stop you: http://www.correlatedcontent.com/blog/bluetooth-keyboard-on-the-raspberry-pi/

The only catch I had with that guide is the pairing process. Here is what the guide says:

If everything goes well, you will be prompted to type a passkey with your keyboard: DisplayPasskey (/org/bluez/14656/hci0/dev_23_E4_87_4C_B3_A1, 936319) Your passkey is the number at the end of the line. Don’t forget to press ‘Enter’ after typing the passcode!

The thing is, I didn't have any passkey at the end of the line, and the line looked a bit different. Also, I was prompted to 'Request PIN code'. If that would be your case, you should make up some arbitrary PIN code (I used 0000), type it into the console, press 'Enter', and then — type it again on the Apple keyboard and press 'Enter' just as suggested by the guide. Then, stick with the guide again.

You may also want to start with removing existing pairing if for some reason it has already been made. To remove a pairing, run this command as root:

bluez-test-device remove MAC

where MAC is the MAC address of your keyboard (please see the above guide). After removal, you can start afresh.

P.S.: I have no rep to comment on lornix's answer, but have you tried switching to a console (Alt + F1) and killing Gnome, just to test? I guess it can be done with killall gdm or killall gdm3. I think I've done something like that when I was installing the same keyboard on another Debian machine already running Gnome3 with its Bluetooth GUI tools.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .