Apple Wireless keyboard hack
Hello all,
I would like to spend some time and effort to make the apple wireless keyboard work with the N900, with the help of the community. We already know that it is possible to make some bluetooth keyboards work with the N900. At least, Jeff succeeded with a Stowaway IGo. http://talk.maemo.org/showthread.php?t=38372 In order to make an apple bluetooth keyboard work in maemo 5, we would need to fulfill the following requirements: 1, pair the keyboard 2, make sure the keyboard has been registered as an input device (hildon-im-xkbtool --list) 3, Run the setxkbmap command to associate the keyboard layout we want (and not the default SU-W8) So here are my observations: The problem with the Apple wireless keyboard is that although it pairs fine, it is not being registered as an input device (hildon-im-xkbtool --list won't show it in its output). Since maemo 5 uses the bluez stack, we have at our disposal the bluez commands to try to understand what is happening. Nokia-N900-42-11:~# hcitool scan Scanning ... 00:26:CC:D4:0E:80 Nokia 3720 00:1D:4F:A7:71:46 Apple Wireless Keyboard Good, found it. Now let's create a connection: Nokia-N900-42-11:~# hcitool cc 00:1D:4F:A7:71:46 Seems good. As mentioned in many places, the Apple wireless keyboard requires encryption and authentication. So let's do that. Nokia-N900-42-11:~# hcitool auth 00:1D:4F:A7:71:46 Not connected. Bummer, indeed. Nokia-N900-42-11:~# hcitool con Connections: Connections remained empty!! What could be the problem? Maybe someone experienced with bluez can chime in. Please use this thread to report all the information pertaining the apple wireless keyboard and the N900. With some community effort, we'll find a way to make it work. Cheers, Ulysses |
Re: Apple Wireless keyboard hack
I've managed to get my Apple wireless keyboard working by compiling the hid-apple kernel module. This is missing from the installed kernel modules and is required for the kernel to recognize the device.
With this loaded, the steps below (hildon-im-xkbtool --list, setxkbmap, etc.) get everything working nicely. Cheers. Quote:
|
Re: Apple Wireless keyboard hack
Fantastic.
Maybe you could attach the kernel module here as attached file for those who don't have a development environment set up. And could you please mention the commands used to load it? That would be great. Thanks in advance. Ulysses |
Re: Apple Wireless keyboard hack
I think I'm against posting a lone little kernel module in a forum on principle alone.
My intention is to package this up exactly like kernel-module-cifs, Kernel-module-nls-utf8, or kernel-module-ntfs packages, but I'm not sure how fast I'll get to this. Possibly someone else could get to it sooner? Cheers. Quote:
|
Re: Apple Wireless keyboard hack
Quote:
stuff like this makes me wonder what other interesting hacks people have dreamt up that we'll never know about, unless we stumble upon threads like this!! .... hmmmmm i wonder?? :) |
Re: Apple Wireless keyboard hack
I would Love to See a solution. and I am not alone see this thread http://talk.maemo.org/showthread.php?t=34872
But I need something that a Regular Joe Non-coder can utilize. |
Re: Apple Wireless keyboard hack
Of course a package would be the best, but failing that, a kernel module compiled against the latest kernel version would be nice too, and pretty much normal practice for linux users.
Ulysses |
Re: Apple Wireless keyboard hack
Hi,
I've set up a development environment in order to compile the apple module for the kernel. A couple of observations: In the wiki it is said that for external kernel modules, kernel headers will suffice: Code:
[sbox-MaemoKernel: ~/maemo_kernel] > fakeroot apt-get install kernel-headersSo I resorted to compiling the module against the full source. Let's get the source. Code:
[sbox-MaemoKernel: ~/maemo_kernel ] > apt-get source kernelCode:
sbox-MaemoKernel: ~/maemo_kernel ] > cd kernel-2.6.28Code:
# Makefile for building the hello kernel module outside the kernel treeCode:
Nokia-N900-42-11:/home/user# insmod hid-apple.ko Code:
[sbox-FREMANTLE_ARMEL: ~/maemo_kernel/apple-module] > objcopy --strip-debug \ Code:
Nokia-N900-42-11:/home/user# insmod hid-apple.ko Thanks, Ulysses |
Re: Apple Wireless keyboard hack
Probably getting a version from gitweb is what's borking you. Try following:
http://wiki.maemo.org/Documentation/...Kernel_Modules The appropriate line will be # CONFIG_HID_APPLE is not setwhich should be changed to CONFIG_HID_APPLE=mCheers. |
Re: Apple Wireless keyboard hack
It's already a part of the kernel source. You got the appropriate version when you did
[sbox-MaemoKernel: ~/maemo_kernel ] > apt-get source kernelCheers. |
Re: Apple Wireless keyboard hack
Got it. Thanks.
I followed the instructions pertaining internal modules compilation, everything went smooth, however: Nokia-N900-42-11:/home/user# insmod hid-apple.ko insmod: error inserting 'hid-apple.ko': -1 Invalid module format What gives? |
Re: Apple Wireless keyboard hack
Maybe you compiled for an i386 target instead of ARM?
|
Re: Apple Wireless keyboard hack
No, it was the ARM target.
So how did you do it? You compiled the module and did an insmod on the device? That's it? You didn't reflash a custom kernel on the device, or did you? Was there anything that is not documented and we should know? Thanks in advance. Ulysses |
Re: Apple Wireless keyboard hack
Have you got this working Ulysses?
I'm going to have a go this weekend but wondered if you had succeeded and had any hints. |
Re: Apple Wireless keyboard hack
By the way I got the same problem as you with the invalid module format, it was because I hadn't built the kernel before I built the modules. Here is the complete guide to getting it to compile:
Download and install the GUI installer from http://doiop.com/maemosdk Open a command prompt and type: Code:
newgrp sbox |
Re: Apple Wireless keyboard hack
I can now load hid-apple.ko (I have to load hid.ko first) with insmod but the Apple keyboard refuses to connect properly.
I've tried restarting bluetooth as well with: Code:
stop bluetoothdhttp://cs.gmu.edu/~sean/stuff/n800/keyboard/ Will keep trying anway, any hints appreciated. |
Re: Apple Wireless keyboard hack
Looking at it now I think hid-apple.ko is a red herring. I think it's for the USB Apple keyboards.
|
Re: Apple Wireless keyboard hack
Ok by editing /etc/bluetooth/main.conf and pairing repeatedly I got it to work, teh connection keeps dropping though so I need to work on that and I also need to remap the keys. Here's what I added to main.conf:
Code:
HIDD_ENABLED=1 |
Re: Apple Wireless keyboard hack
Same here. The connection keeps dropping.
I tried to debug with hcidump. http://maemo.org/development/tools/d...bluez-hcidump/ hcidump reports a successful connection, but then a disconnect occurs almost immediately. Accordingly, the bluetooth icon on the desktop turns blue for one second, then goes white again. What is causing the disconnect? Ulysses |
Re: Apple Wireless keyboard hack
I think the problem of it closing the connection after a few seconds is related to this bug:
https://bugs.maemo.org/show_bug.cgi?id=8483 Talked about in this thread: http://talk.maemo.org/showthread.php...xkbmap&page=11 |
Re: Apple Wireless keyboard hack
I think you are right.
We should vote for that bug, by the way. https://bugs.maemo.org/votes.cgi?act...8483#vote_8483 |
Re: Apple Wireless keyboard hack
Quote:
After all, I am not sure that my Dad has recovered from the Apple II programming lessons yet, and I would love to recommend this phone to him to replace the Blackberry Storm he already owns. And we're getting closer to where I'd feel comfortable doing that. |
Re: Apple Wireless keyboard hack
I think that being able to attach a bluetooth keyboard such as the Apple Wireless Keyboard is going to make the N900 very popular!
I was not quite able to follow which of all the commands posted I need, and it looks like there is still an outstanding disconnecting bug. It's been a month since the last post - please have we gotten any further? I've just bought my N900 and I'm dying to use my wireless apple keyboard with it! :) |
Re: Apple Wireless keyboard hack
I bought a Apple Wireless keyboard yesterday.
It connected to my new n900 without problems. All I had to do was to enter the blutooth pin on the keyboard and press enter. All the letter keys work. If I press rigth alt key I get numbers and all other characters that is marked in blue on the n900 keyboard. It connects to the n900 as an nokia_vndr/rx-51 keyboard. What i need to solve now is to get a working keymap for swedish characters and to be able to use the numbers and other keys. Anyone who know how to do that? |
Re: Apple Wireless keyboard hack
Well I made it easy for me. Since the apple keyboard connected as an rx-51 with the US layout, and my n900 uses the swedish finnish layout on the internal keyboard, I went to the folder
/usr/share/X11/xkb/symbols/nokia_vndr and edited the file rx-51 and added the following code in the section for xkb_symbols "us": partial alphanumeric_keys xkb_symbols "us" { include "nokia_vndr/rx-51(english_base)" include "nokia_vndr/rx-51(arrows_4btns)" name[Group1] = "U.S. English"; key <AE01> { [ 1, exclam, NoSymbol, exclamdown ] }; key <AE02> { [ 2, quotedbl, at, rightdoublequotemark ] }; key <AE03> { [ 3, numbersign, sterling, guillemotright ] }; key <AE04> { [ 4, currency, dollar, guillemotleft ] }; key <AE05> { [ 5, percent, U2030, leftdoublequotemark ] }; key <AE06> { [ 6, ampersand, singlelowquotemark, doublelowquotemark ] }; key <AE07> { [ 7, slash, braceleft, NoSymbol ] }; key <AE08> { [ 8, parenleft, bracketleft, less ] }; key <AE09> { [ 9, parenright, bracketright, greater ] }; key <AE10> { [ 0, equal, braceright, degree ] }; key <AE11> { [ plus, question, backslash, questiondown ] }; key <AE12> { [ dead_acute, dead_grave, dead_cedilla, dead_ogonek ] }; key <AD11> { [ aring, Aring, dead_doubleacute, dead_abovering ] }; key <AD12> { [ dead_diaeresis, dead_circumflex, dead_tilde, dead_macron ] }; key <AC10> { [ odiaeresis, Odiaeresis, oslash, Oslash ] }; key <AC11> { [ adiaeresis, Adiaeresis, ae, AE ] }; key <BKSL> { [ apostrophe, asterisk, dead_caron, dead_breve ] }; key <LSGT> { [ less, greater, bar, NoSymbol ] }; key <AB08> { [ comma, semicolon, rightsinglequotemark, leftsinglequotemark ] }; key <AB09> { [ period, colon, dead_belowdot, dead_abovedot ] }; key <AB10> { [ minus, underscore, endash, dead_belowcomma ] }; }; So now Im up and running and kan use all the alphanumeric keys. Some tweaks has still to be done. Right shift does not work. < > is on the wrong key and I haven't started to look into assigning the function keys yet. |
Re: Apple Wireless keyboard hack
Quote:
Is there a way you managed to have it connect as "nokia_vndr/rx-51 keyboard"? |
Re: Apple Wireless keyboard hack
I have an Apple wireless keyboard as well.
I got it to pair successfully and is listed under blue-tooth devices. However, I am unable to get it to connect to the N900. The "connect/disconnect" button under "edit" is dimmed "disconnect". Can anyone give step -by-step instructions on how they got theirs working ? |
Re: Apple Wireless keyboard hack
Okay I've spent a few weekends on this and managed to follow almost every instruction to try get this to work. My Apple keyboard still refuses to show up when I call:
hildon-im-xkbtool --list Which means I cannot run the setxkb command. So all I'm waiting for now is for axonpoet (or someone with the skills to compile kernels) to publish the kernel package that was talked about 5 months ago. I upgraded to PR1.2 last week which encouraged me to waste another weekend going through the threads trying to get the Apple Keyboard to work. However it still doesn't. The only thing I haven't tried is compiling kernels myself but I'd rather leave it to the experts. |
Re: Apple Wireless keyboard hack
I bought an Apple Bluetooth keyboard today and I did not get it to work as well (at first).
The trick did to pair it several times (and remove it from the list in between for sure ;) Then some time it got connected! Then I finished the steps here: http://talk.maemo.org/showthread.php?t=38372&page=18 to get a proper layout. Great, I am very happy that it works now! |
Re: Apple Wireless keyboard hack
Hi sfs
I just followed the steps from your link. The keyboard ist peering fine - but I only get the "us" layout working properly, doing a setxkbmap -device 4 -I -I/usr/share/X11/xkb-chinook -rules base -model pc105 -layout de is giving this error: Error loading new keyboard description. I did a cp -i xkb-chinook/symbols/de xkb/symbols/. before. Did you get the German version working? regards, endrik Quote:
|
Re: Apple Wireless keyboard hack
Is there in Spanish?
|
Re: Apple Wireless keyboard hack
Hi there...
I grab this thread out of the dust because I wonder if anybody has made an attempt yet to pair an Apple Wireless keyboard to a N9? With the device having only a virtual keyboard, that would make even more sense as with the N900. I'll have to wait a few more weeks before I get my N9, so I can't test anything myself yet, but be sure I'll be willing to report about my attempts as soon as I can. Disclaimer: absolute n00b when it comes to kernel modules, but I'd gladly follow instructions for testing. |
Re: Apple Wireless keyboard hack
Yes, I have tried Apple Bluetooth Keyboard wih N9. Result did not surprise me after all the troubles with my kbd and n8x0 and n900.
N9 sees kbd with no troubles and looks like it pairs ok. Kbd does not notice it is paired, keeps flashing led. No luck. Previous experience suggests that there might be variants of Apple kbd model. Mine has been always very tricky. -n8x0: very tricky to get pairing succeed. Got to do everything in just right sequence and timing. Once paired, works ok. -n900: semi-hard to get paired. Once paired, does not work without hid-apple.ko, which is *not* in n900 kernels by default. With hid-apple.ko sometimes works just by turning kbd on. More regularly needs one bt disconnect-connect sequence. I'm not planning to try 50+ pairing sequences with n9 like I was once forced to do. Life is just too short and bt kbd too cheap if somebody can confirm working model.... |
Re: Apple Wireless keyboard hack
Quote:
|
Re: Apple Wireless keyboard hack
Just as a quick note, the only exterior difference between apple wireless keyboards, that I know of, is the number of batteries needed.
I have a 3-battery one, and it connect to the N9 but then flashes, and does not work, not even following this tut: http://forum.meego.com/showthread.php?t=4828 I get to the point of hidd --search, it lists a MAC, but then fails. The same kbd does not work on my N900 even after fiddling a lot, and following every procedure known to man. I know that there are 4-batteries and 2-batteries versions of the keyboard, the latter being the newer. The few people that managed to use N900 with the apple kbd that I know of, had the 2-battery version. If you have the opportunity to try with a 2-battery one, or generally, with a new keyboard, it may work.. keep us informed! |
Re: Apple Wireless keyboard hack
I have three battery version. It works with n900 using non-stock kernel and hidd-apple kernel module. It is PITA to pair with n900.
With instructions mentioned in link above and additional fiddling with simultaneous hidd --search plus pairing I got it paired without blinking led and N9 shows it connected. However, it is not working. Quite similar like N900 without hidd-apple. N9 don't have hidd-apple. |
| All times are GMT. The time now is 19:38. |
vBulletin® Version 3.8.8