LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 11-06-2004, 03:09 PM   #1
nakko
Member
 
Registered: Oct 2004
Location: Austin, TX
Distribution: Ubuntu Dapper Drake
Posts: 39

Rep: Reputation: 15
Unhappy Apple Wireless Keyboard (bluetooth)


Noticing that many people have an Apple Wireless Keyboard, I decided to buy both the keyboard and the recommended D-Link USB dongle. I have not been able to use the device as a keyboard yet, despite having read much documentation! I feel I must be missing some basic, basic step that either has been glossed over or most people assume I'd know. It's also possible I just missed it!

At any rate, here is what I have:
Debian unstable (sarge)
dual PIII 700MHz / 500MB RAM / 20 GB hdd
Was using prepackaged kernel 2.6.8

Here is what I have done:
Downloaded 2.6.9 source code and dependencies, appropriate headers, Debian patches, etc.
Patched source with patch-2.6.9-mh3.gz from bluez.org, then linked /usr/src/linux to new appropriate dir.
+ACYAIw-36; make menuconfig
Made sure to specify I am running a PIII, and enabled SMP stuff. Disabled OSS entirely, and chose builtin ALSA instead.
Chose to build HIDP in rather than make as module. (Answered "y" to CONFIG+ACYAIw-95;BT+ACYAIw-95;HIDP rather than "m")
Build, reboot, and here I am.

When I do something like:
+ACYAIw-36; hcitool inq
I get the proper info, Apple Wireless Keyboard, its address and class, all that good jazz. So obviously my USB dongle can see the keyboard on some level, and perform basic communications with it.
However, if I try:
+ACYAIw-36; hidd --search
I get this in return:
Connecting to device [my device's address]
Can't create HID control channel: Invalid exchange

Now, that is as far as I have gotten. What, at this point, must I do to make it actually work? How do I get my bluetooth subsystem to recognize the keyboard as a regular HID device? All I want to do is use it as a fancy remote control for my livingroom MythTV box!

Any help is of course appreciated.
 
Old 01-17-2005, 03:44 AM   #2
nakko
Member
 
Registered: Oct 2004
Location: Austin, TX
Distribution: Ubuntu Dapper Drake
Posts: 39

Original Poster
Rep: Reputation: 15
Apple Wireless Keyboard

Who has an Apple Wireless Keyboard running?

Who has one running under Debian?

Will you help me? It's driving me nuts.
 
Old 03-21-2005, 07:02 PM   #3
tormentum
LQ Newbie
 
Registered: May 2003
Location: Perth, Australia
Distribution: Slackware, Ubuntu
Posts: 18

Rep: Reputation: 0
Hey dude, have a look at this page:

http://klausler.com/msbtkb-linux.html

Down the bottom there is a section on how to adapt the HOWTO to an apple wireless keyboard.

Have fun and let me know how you go. I'm wanting to get one of these babies, but I want to know if it works first

Torm
 
Old 11-07-2005, 11:18 AM   #4
Learnincurve
LQ Newbie
 
Registered: Nov 2005
Location: Stavanger Norway
Distribution: Debian (Kanotix)
Posts: 6

Rep: Reputation: 0
problems with Apple wireless keyboard and D-Link DBT-120

Hi,

Sorry to revive this old thread, but I'm having big trouble even getting the dongle to be recognised, o no luck yet with the keyboard.

Here's what I have:

Debian unstable (sid) on 32 bit VMWare virtual machine and 64 bit (kanotix64 2005-03) directly installed to HD.
D-Link DBT-120 rev. B4

Most of the testing on the virtual machine, but AMD64 seems to give same results.

First off, with original D-Link firmware, both lsusb and hciconfig picked up the dongle, but I couldn't initialize it. Installing the D-Link B4 driver in Doze allowed me to use the dongle, but not pair with it.

I then followed the instructions on this page:

http://www.linuxquestions.org/hcl/sh...ort=1&cat=4250

and got the dongle flashed with the Apple firmware upgrade.

Have since tried # hid2hci --tohci
No devices in HCI mode found
hid2hci --tohid
No devices in HID mode found
# cat /proc/bus/usb/devices

T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.13-kanotix-17 uhci_hcd
S: Product=Intel Corporation 82371AB/EB/MB PIIX4 USB
S: SerialNumber=0000:00:07.2
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms

showing only the usb hub...
Doze picks up the hid devices as expected,
what am I doing wrong in Linux.

Cheers

Marius
 
Old 11-09-2005, 05:12 AM   #5
Learnincurve
LQ Newbie
 
Registered: Nov 2005
Location: Stavanger Norway
Distribution: Debian (Kanotix)
Posts: 6

Rep: Reputation: 0
One step further

Okay, sorry about the premature winging in my previous post ..
it seems that the dongle problems had to do with vmware / doze on the virtual machinge, the linux box finds the dongle and it works fine in hci mode with my T610 phone and trust bluetooth mouse.

I'm still having touble getting the apple kyboard to work. It seems to have something to do with the pin.

I run hidd -c 00:0A:95:42:47:26 ( the apple bt address) and then type my pin (blindly) on the apple keyboard.

The moment I hit return, the prompt shows:

# hidd -c 00:0A:95:42:47:26
Can't get device information: Permission denied

and kbluetooth pops up a " Problem connecting with Apple Wireless Keyboard, pairing not allowed" info box.

I've tried changing the pin helper app in /etc/hcid.conf, the file currently looks like this:

#
# HCI daemon configuration file.
#
# $Id: hcid.conf,v 1.7 2004/12/13 14:16:03 holtmann Exp $
#

# HCId options
options {
# Automatically initialize new devices
autoinit yes;

# Security Manager mode
# none - Security manager disabled
# auto - Use local PIN for incoming connections
# user - Always ask user for a PIN
#
security auto;;

# Pairing mode
# none - Pairing disabled
# multi - Allow pairing with already paired devices
# once - Pair once and deny successive attempts
pairing multi;

# PIN helper
pin_helper /usr/bin/bluez-pin;
# pin_helper /usr/lib/kdebluetooth/kbluepin;
# D-Bus PIN helper
#dbus_pin_helper;
}

# Default settings for HCI devices
device {
# Local device name
# %d - device id
# %h - host name
# name "%h-%d"; original
name "Mythbox";

# Local device class
# class 0x3e0100; original
class 0x100100;

# Default packet type
#pkt_type DH1,DM1,HV1;

# Inquiry and Page scan
iscan enable; pscan enable;

# Default link mode
# none - no specific policy
# accept - always accept incoming connections
# master - become master on incoming connections,
# deny role switch on outgoing connections
lm accept;original
lm master;

# Default link policy
# none - no specific policy
# rswitch - allow role switch
# hold - allow hold mode
# sniff - allow sniff mode
# park - allow park mode
lp rswitch,hold,sniff,park;

# Authentication and Encryption (Security Mode 3)
#auth enable;
#encrypt enable;
#added by marius:
auth disable;
encrypt disable;


}

Cheers

Marius
 
Old 11-09-2005, 05:36 AM   #6
Learnincurve
LQ Newbie
 
Registered: Nov 2005
Location: Stavanger Norway
Distribution: Debian (Kanotix)
Posts: 6

Rep: Reputation: 0
more info

tail -f /var/log/daemon.log
Nov 9 11:30:20 mythbox hcid[5346]: PIN helper exited abnormally with code 256
Nov 9 11:30:26 mythbox hcid[4624]: pin_code_request (sba=00:13:46:05:C1:D9, dba=00:0A:95:42:47:26

This is what is being logged when I send the pin request

Cheers

Marius

Last edited by Learnincurve; 11-09-2005 at 05:40 AM.
 
Old 11-09-2005, 07:04 AM   #7
Learnincurve
LQ Newbie
 
Registered: Nov 2005
Location: Stavanger Norway
Distribution: Debian (Kanotix)
Posts: 6

Rep: Reputation: 0
Everything working! I'm writing this on my shiny, white Apple keyboard.

Here's what I had to do:

Changed my pin helper program to the simple one suggested here:
http://www.triptico.com/software/bluetooth.html
i.e.
create this shell script:
#!/bin/sh
PIN=`cat /etc/bluetooth/pin`
echo "PIN:$PIN"

I put mine in /usr/local/sbin/mybtpin

change the line in /etc/bluetooth/hcid.conf
to reflect this:
pin_helper /usr/local/sbin/mybtpin;

Make sure kbluetooth is NOT running ( I don't know whether this is strictly necessary, but did it to be safe).

Stop and restart bluez-utils (again I don't know if this was necessary).

# hidd -c 00:0A:95:42:47:26

Enter pincode and hit return from Apple keyboard after waiting a couple of seconds.

BINGO!

Afterwards kbluetooth can be started again as normal.


I hope this helps others who might want to use the very well built and cheap Apple keyboard.

I have yet to see if it works in HID proxy mode at boot... didn't last time I checked.

Cheers

Marius
 
Old 12-06-2005, 05:27 PM   #8
wnor
LQ Newbie
 
Registered: Dec 2005
Distribution: Fedora Core
Posts: 6

Rep: Reputation: 0
Learnincurve's information above is great. I'm on a similar quest: connect an Apple wireless keyboard through a DBT-120 to Fedora Core 3. I've followed the above closely, but get:

[root@desk bluetooth]# service bluetooth restart
Stopping Bluetooth services: [ OK ]
Starting Bluetooth services: [ OK ]
[root@desk bluetooth]# hcitool scan
Scanning ...
00:0A:95:38:9F:EB Apple Wireless Keyboard
[root@desk bluetooth]# hidd -c 00:0A:95:38:9F:EB
Can't create HID control channel: Permission denied
[root@desk bluetooth]# hid2hci --tohid
Switching device 0a12:0001 to HID mode was successful
[root@desk bluetooth]# hidd -c 00:0A:95:38:9F:EB
Can't create HID control channel: No route to host
[root@desk bluetooth]#

Does the above post include all the changes that need to be accomplished, or are some included in prior posts necessary? I've tried adding:
auth disable;
encrypt disable;
per the above config file, but no luck. I feel soooooo close. So what's the key to the palace?
 
Old 12-07-2005, 02:52 AM   #9
Learnincurve
LQ Newbie
 
Registered: Nov 2005
Location: Stavanger Norway
Distribution: Debian (Kanotix)
Posts: 6

Rep: Reputation: 0
-19Hi wnor,
It's a bummer I know! You feel the elation as you think it's going tgo work, then BANG! Up pops the error!
Keep going, you'll get there.

Your error doesn't look quite like mine, but I'm guessing that's just a distro thing (I don't know much about Fedora), I take it you're using the homememade pin helper script. Is it executable? Any help from dmesg or /var/log/messages or /var/log/daemon.log?? One thing that springs to mind is that I think I heard that the dongle MUST be flashed with Aplle firmware to support 128 bit encryption. As hid2hci is working I guess you already did this... just checking! Does the keyboard work in hid mode? As far as I understand it you don't need to pair the devices for hid mode to work (but then again I may be wrong). The bluetooth configuration must of course be run in hci mode.
Can you post your hcid.conf file so we can see what's in there?
The only other things that spring to mind are bluez-utils version (mine's 2.19-1) and kernel version and what's in there. I'm running 2.6.14 (although I got this working on ~13)
My kernel config:
...
# FIR device drivers
#
CONFIG_USB_IRDA=m
CONFIG_SIGMATEL_FIR=m
CONFIG_NSC_FIR=m
CONFIG_WINBOND_FIR=m
CONFIG_TOSHIBA_FIR=m
CONFIG_SMC_IRCC_FIR=m
CONFIG_ALI_FIR=m
CONFIG_VLSI_FIR=m
CONFIG_VIA_FIR=m
CONFIG_BT=m
CONFIG_BT_L2CAP=m
CONFIG_BT_SCO=m
CONFIG_BT_RFCOMM=m
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=m
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=m

#
# Bluetooth device drivers
#
CONFIG_BT_HCIUSB=m
CONFIG_BT_HCIUSB_SCO=y
# CONFIG_BT_HCIUART is not set
# CONFIG_BT_HCIBCM203X is not set
# CONFIG_BT_HCIBPA10X is not set
# CONFIG_BT_HCIBFUSB is not set
CONFIG_BT_HCIVHCI=m
# CONFIG_IEEE80211 is not set

you'll find the above under networking -> bluetooth in the menu driven configs, or just check your .config file for anyththing containing _BT_:
$ cat /usr/src/linux/.config | grep _BT_

Sorry, far more questions than answers here, but keep going and you'll get there.

Cheers

Marius
 
Old 12-13-2005, 08:42 PM   #10
nakko
Member
 
Registered: Oct 2004
Location: Austin, TX
Distribution: Ubuntu Dapper Drake
Posts: 39

Original Poster
Rep: Reputation: 15
Well, it's been more than a year since I first posted, and this Apple keyboard is still not working.
I can still try:
hidd -c 00:0A:95:3A:92:27
And I still get:
Can't get device information: Permission denied

I have tried what Learnincurve suggested and created the pin helper script, to no avail. Same results. Who is a Bluetooth guru? Who is a Bluetooth guru who knows how to get this to work on Debian? I'm running Etch, I have an Apple Wireless Keyboard, and a D-Link DBT-120, can't see what pieces I'm missing here...
 
Old 12-13-2005, 09:12 PM   #11
nakko
Member
 
Registered: Oct 2004
Location: Austin, TX
Distribution: Ubuntu Dapper Drake
Posts: 39

Original Poster
Rep: Reputation: 15
Well, a little bit later, frustrated, trying a few more things, it seems to work.
I can't believe it. The only problem is, I have no idea what I did is what worked.
I changed my pin helper back to bluez-pin, so that is apparently NOT the hangup!!
It's something else, but I'll be hogtied if I could narrow it down.
Which sucks, because I know this will stop working at some point, I can feel it, and then I will be right back at square one.

I typed this with my Apple Wireless Keyboard. Dadgummit.
 
Old 12-15-2005, 04:23 AM   #12
Learnincurve
LQ Newbie
 
Registered: Nov 2005
Location: Stavanger Norway
Distribution: Debian (Kanotix)
Posts: 6

Rep: Reputation: 0
Hi again folks.

Now you got me worried again, because I was sure I'd fixed it.

If it's any consolation, mine's still working (apart from the volume and cd keys which are apparently sending signals differently).

wishing you all the best.

Cheers

Marius
 
Old 02-08-2006, 08:38 PM   #13
nakko
Member
 
Registered: Oct 2004
Location: Austin, TX
Distribution: Ubuntu Dapper Drake
Posts: 39

Original Poster
Rep: Reputation: 15
My lovely Apple Wireless Keyboard! I finally got it to work, as I stated above.

However.

If it goes to sleep (in other words, if I stop typing on it for a minute or so), it won't wake up. Period. I have to use my wired keyboard to detect it, as if from scratch. It certainly won't work from bootup.

So essentially, I --CAN NOT-- use it to replace my main wired keyboard.
*sigh*

So unless someone has some tips for me in that regard... screw it, I am selling this piece of (sadly) CRAP!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apple Keyboard M2452 and M7803 under Linux zhihengz Linux - Hardware 2 06-30-2005 04:49 PM
Compatability with Microsoft bluetooth keyboard/mouse combo Snerkel Linux - Hardware 1 06-01-2005 04:11 AM
Microsoft Bluetooth Keyboard/mouse Parley Linux - Newbie 3 02-18-2005 07:18 PM
apple keyboard with ssh to linux pevelius Other *NIX 1 01-06-2005 03:39 PM
Bluetooth mouse/keyboard garf12 Linux - Hardware 2 03-24-2004 02:21 AM


All times are GMT -5. The time now is 02:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration