Skip to contentSkip to conversation

Apple keyboard

Bluez-users Radu Maurer 4 participants 17 messages Feb 10, 2004 – Feb 14, 2004 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

What is the method of choice to get an Apple BT keyboard running with linux?

I am running kernel 2.4.24 and debian unstable.
I have a USB dongle Epox DG02A.

Do I need to patch the kernel?
Do I need to upgrade to the 2.6 kernel series?
Do i need bluez from CVS?

thanks
Radu

hciconfig -a sais:
hci0: Type: USB
BD Address: 00:04:61:81:24:6F ACL MTU: 192:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN
RX bytes:99 acl:0 sco:0 events:13 errors:0
TX bytes:296 acl:0 sco:0 commands:12 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'baerbel-0'
Class: 0x000100
Service Classes: Unspecified
Device Class: Computer, Uncategorized
HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d
Manufacturer: Cambridge Silicon Radio (10)

hcitool scan:
Scanning ...

        00:0A:95:3A:3F:CC       Apple Wireless Keyboard

hcitool inq
Inquiring ...

        00:0A:95:3A:3F:CC       clock offset: 0x0ece    class: 0x002540

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

maintainer
#1 lore raw

Hi Radu,

Quoted 2 lines

What is the method of choice to get an Apple BT keyboard running with linux?

start here http://www.bueche.ch/comp/mx900/mx900.html

Quoted 4 lines

I am running kernel 2.4.24 and debian unstable.
I have a USB dongle Epox DG02A.

Do I need to patch the kernel?

Maybe, because you need the uinput kernel module.

Quoted 1 line

Do I need to upgrade to the 2.6 kernel series?

You don't need, if you don't want to ;)

Quoted 1 line

Do i need bluez from CVS?

Yes.

Regards

Marcel

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

#2 lore raw
Quoted 6 lines · Marcel Holtmann

Hi Radu,

Quoted 2 lines

What is the method of choice to get an Apple BT keyboard running with linux?

start here http://www.bueche.ch/comp/mx900/mx900.html

thanks Marcel, I followed the instructions there.
- recompiled the 2.4.24 kernel with your patch for uinput.
- got libs2 and utils2 from bluez cvs and compiled them (as debian packages).

- made /dev/input/uinput device.

- installed:
bluetooth-hci_0.1-1_i386.deb
bluetooth-hid_0.1-1_i386.deb
bluez-utils_0.1-1_i386.deb
libbluetooth2-dev_0.1-1_i386.deb
libbluetooth2_0.1-1_i386.deb
libbluez1-dev_0.1-1_i386.deb
libbluez1_0.1-1_i386.deb

- started bthid:

	bthid --daemon

/var/log/daemon.log sais:
bthid[19500]: Bluetooth HID service started

then I try to connect:
bthid -c <Apple Keyboard Address>

I switch on the keyboard, the green LED on the back side starts to blink.

after a few seconds I get the message:
bthid[19500]: Connection failed: Function not implemented (38)

where do i go from here?

thanks
Radu

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

maintainer
#3 lore raw

Hi Radu,

Quoted 10 lines

/var/log/daemon.log sais:
bthid[19500]: Bluetooth HID service started

then I try to connect:
bthid -c <Apple Keyboard Address>

I switch on the keyboard, the green LED on the back side starts to blink.

after a few seconds I get the message:
bthid[19500]: Connection failed: Function not implemented (38)

this can be a paring problem, because the Apple HID devices don't allow unencrypted connections. Run "hcidump -w <file>" so I can see what is on the HCI layer.

Regards

Marcel

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

#4 lore raw
Quoted 6 lines · Marcel Holtmann
Quoted 2 lines

after a few seconds I get the message:
bthid[19500]: Connection failed: Function not implemented (38)

this can be a paring problem, because the Apple HID devices don't allow unencrypted connections. Run "hcidump -w <file>" so I can see what is on the HCI layer.

Ok, I'm trying
right now to compile hcidump from cvs but configure fails:

checking "for bluetooth/bluetooth.h"... (/usr/include) yes checking "for libbluetooth"... "no"
configure: error: Bluetooth library not found.
Please compile and install bluez-libs package.

although I do have libbluetooth.so installed in /usr/lib (package libbluetooth2_0.1-1_i386.deb)

Radu

maintainer
#5 lore raw

Hi Radu,

Quoted 9 lines

right now to compile hcidump from cvs but configure fails:

checking "for bluetooth/bluetooth.h"... (/usr/include) yes checking "for libbluetooth"... "no"
configure: error: Bluetooth library not found.
Please compile and install bluez-libs package.

although I do have libbluetooth.so installed in /usr/lib (package libbluetooth2_0.1-1_i386.deb)

you can't mix the libraries, because version 2 breaks some stuff. That's why I prefer to use the Debian packages and install libs2 and utils2 by hand under /opt/bluetooth.

Regards

Marcel

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

#6 lore raw
In reply to Marcel Holtmann
Quoted 11 lines · Marcel Holtmann

Hi Radu,

Quoted 5 lines

/var/log/daemon.log sais:
bthid[19500]: Bluetooth HID service started

after a few seconds I get the message:
bthid[19500]: Connection failed: Function not implemented (38)

this can be a paring problem, because the Apple HID devices don't allow unencrypted connections. Run "hcidump -w <file>" so I can see what is on the HCI layer.

hi Marcel,

hcidump -w <file> seems to write a binary file. Do you nee that file? Anyway, if I don't give the -w option, it dumps this to stdout:

# hcidump
HCIDump - HCI packet analyzer ver 1.5
device: hci0 snap_len: 1028 filter: 0xffffffff
< HCI Command: Create Connection(0x01|0x0005) plen 13
Quoted 3 lines

HCI Event: Command Status(0x0f) plen 4
HCI Event: PIN Code Request(0x16) plen 6
HCI Event: Connect Complete(0x03) plen 11

thanks
Radu

maintainer
#7 lore raw

Hi Radu,

Quoted 2 lines

hcidump -w <file> seems to write a binary file. Do you nee that file? Anyway, if I don't give the -w option, it dumps this to stdout:

yes.

Quoted 7 lines
# hcidump
HCIDump - HCI packet analyzer ver 1.5
device: hci0 snap_len: 1028 filter: 0xffffffff
< HCI Command: Create Connection(0x01|0x0005) plen 13
Quoted 3 lines

HCI Event: Command Status(0x0f) plen 4
HCI Event: PIN Code Request(0x16) plen 6
HCI Event: Connect Complete(0x03) plen 11

So it is a pairing problem. Check the keyboard manual how the pairing procedure should work. Maybe it has a default PIN or you have to use the num pad for input.

Regards

Marcel

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

#8 lore raw
Quoted 6 lines · Marcel Holtmann

Hi Radu,

Quoted 2 lines

hcidump -w <file> seems to write a binary file. Do you nee that file? Anyway, if I don't give the -w option, it dumps this to stdout:

yes.

ok, see attachment.

Quoted 3 lines

So it is a pairing problem. Check the keyboard manual how the pairing procedure should work. Maybe it has a default PIN or you have to use the num pad for input.

The manual just sais to follow the instructions on screen :-( There is no default PIN in the manual.
I tested it on windows 2000: there you get a PIN written on the screen, which you have to type on the keyboard.

thanks
Radu

Ǫ,@�= �?:�
�Ǫ,@�\�,@5� ")�?:�


maintainer
#9 lore raw

Hi Radu,

Quoted 8 lines
Quoted 3 lines

So it is a pairing problem. Check the keyboard manual how the pairing procedure should work. Maybe it has a default PIN or you have to use the num pad for input.

The manual just sais to follow the instructions on screen :-( There is no default PIN in the manual.
I tested it on windows 2000: there you get a PIN written on the screen, which you have to type on the keyboard.

then you must make sure that the hcid PIN helper works perfect. To be sure replace it with a simple executable shell script.

	#!/bin/sh
	echo "PIN:0000"

Try again and enter the PIN "0000" on your keyboard.

Regards

Marcel

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

#10 lore raw
Quoted 3 lines · you

sure replace it with a simple executable shell script.

	#!/bin/sh
	echo "PIN:0000"

Is that /usr/bin/bluepin to /etc/bluetooth/pin ?

Signature · 32 lines
Tom Chiverton 
Advanced ColdFusion Programmer

Tel: +44(0)1749 834997
email: [email protected]
BlueFinger Limited
Underwood Business Park
Wookey Hole Road, WELLS. BA5 1AF
Tel: +44 (0)1749 834900
Fax: +44 (0)1749 834901
web: www.bluefinger.com
Company Reg No: 4209395 Registered Office: 2 Temple Back East, Temple
Quay, BRISTOL. BS1 6EG.
*** This E-mail contains confidential information for the addressee
only. If you are not the intended recipient, please notify us
immediately. You should not use, disclose, distribute or copy this
communication if received in error. No binding contract will result from
this e-mail until such time as a written document is signed on behalf of
the company. BlueFinger Limited cannot accept responsibility for the
completeness or accuracy of this message as it has been transmitted over
public networks.***


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
maintainer
#11 lore raw

Hi Thomas,

Quoted 5 lines
Quoted 3 lines

sure replace it with a simple executable shell script.

	#!/bin/sh
	echo "PIN:0000"

Is that /usr/bin/bluepin to /etc/bluetooth/pin ?

the /etc/bluetooth/pin is the PIN for incoming connections and the PIN helper script from hcid.conf is executed on everything else.

Regards

Marcel

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

#12 lore raw
In reply to Marcel Holtmann
Quoted 7 lines

then you must make sure that the hcid PIN helper works perfect. To be sure replace it with a simple executable shell script.

	#!/bin/sh
	echo "PIN:0000"

Try again and enter the PIN "0000" on your keyboard.

ok, it worked, thanks very much Marcel!!

Feb 13 23:20:49 localhost bthid[8705]: Connected: Apple Computer, Inc. Apple Wireless Keyboard (05ac:0209)

hcidump prints this every time a press a key:

Quoted 1 line

ACL data: handle 0x0029 flags 0x02 dlen 15

    L2CAP(d): cid 0x41 len 11 [psm 19]

now I wonder: how do I use the keyboard with X11 (and possibly at the console), i.e. which device do I have to enter in the "InputDevice" section of XFree86Config?

thanks
Radu

maintainer
#13 lore raw

Hi Radu,

Quoted 9 lines
Feb 13 23:20:49 localhost bthid[8705]: Connected: Apple Computer, Inc. Apple Wireless Keyboard (05ac:0209)

hcidump prints this every time a press a key:

Quoted 1 line

ACL data: handle 0x0029 flags 0x02 dlen 15

    L2CAP(d): cid 0x41 len 11 [psm 19]

now I wonder: how do I use the keyboard with X11 (and possibly at the console), i.e. which device do I have to enter in the "InputDevice" section of XFree86Config?

you only have to load the keybdev kernel module.

Regards

Marcel

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

#14 lore raw
Quoted 5 lines
Quoted 3 lines

now I wonder: how do I use the keyboard with X11 (and possibly at the console), i.e. which device do I have to enter in the "InputDevice" section of XFree86Config?

you only have to load the keybdev kernel module.

it works like a charm. I am typing this on the Apple keyboard. thanks for your help & patience!

Radu

#15 lore raw
In reply to Radu Maurer

Hi,

switch encrypt and auth off in hcid.conf and try again

Michal

Dne st 11. =FAnora 2004 16:11 Radu Maurer napsal(a):

Quoted 45 lines · Marcel Holtmann
Quoted 6 lines

Hi Radu,

Quoted 2 lines

What is the method of choice to get an Apple BT keyboard running with linux?

start here http://www.bueche.ch/comp/mx900/mx900.html

thanks Marcel, I followed the instructions there.
- recompiled the 2.4.24 kernel with your patch for uinput.
- got libs2 and utils2 from bluez cvs and compiled them (as debian packages).

- made /dev/input/uinput device.

- installed:
bluetooth-hci_0.1-1_i386.deb
bluetooth-hid_0.1-1_i386.deb
bluez-utils_0.1-1_i386.deb
libbluetooth2-dev_0.1-1_i386.deb
libbluetooth2_0.1-1_i386.deb
libbluez1-dev_0.1-1_i386.deb
libbluez1_0.1-1_i386.deb

- started bthid:

	bthid --daemon

/var/log/daemon.log sais:
bthid[19500]: Bluetooth HID service started

then I try to connect:
bthid -c <Apple Keyboard Address>

I switch on the keyboard, the green LED on the back side starts to blink.

after a few seconds I get the message:
bthid[19500]: Connection failed: Function not implemented (38)

where do i go from here?

thanks
Radu

Quoted 9 lines

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=3D1356&alloc_id=3D3438&op=3Dclick
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

#16 lore raw
Quoted 3 lines · Michal Semler (volny.cz)

Hi,

switch encrypt and auth off in hcid.conf and try again

I think these are off, since they are commented out in hcid.conf:

        # Authentication and Encryption
        #auth enable;
        #encrypt enable;

thanks
Radu

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users