Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Apple Wireless keyboard hack

    Reply
    Page 1 of 4 | 1   2     3   | Next | Last
    Ulysses | # 1 | 2010-01-22, 18:04 | Report

    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:CC4: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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 6 Users Say Thank You to Ulysses For This Useful Post:
    ashre, attila77, clasificado, g0dzilla, G_Gus, Haus3r

     
    axonpoet | # 2 | 2010-01-22, 18:16 | Report

    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.

    Originally Posted by Ulysses View Post
    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:CC4: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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to axonpoet For This Useful Post:
    attila77, clasificado

     
    Ulysses | # 3 | 2010-01-22, 19:05 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by Ulysses; 2010-01-22 at 19:20.

     
    axonpoet | # 4 | 2010-01-22, 19:50 | Report

    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.

    Originally Posted by Ulysses View Post
    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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to axonpoet For This Useful Post:
    attila77, clasificado

     
    starman | # 5 | 2010-01-22, 19:52 | Report

    Originally Posted by axonpoet View Post
    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.
    really? thats awesome.....

    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??

    Edit | Forward | Quote | Quick Reply | Thanks

     
    McChicken | # 6 | 2010-01-22, 20:38 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Ulysses | # 7 | 2010-01-22, 21:08 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Ulysses | # 8 | 2010-01-23, 15:17 | Report

    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-headers
    However, this package cannot be found.

    So I resorted to compiling the module against the full source. Let's get the source.

    Code:
    [sbox-MaemoKernel: ~/maemo_kernel ] > apt-get source kernel
    Now let's configure the source tree.

    Code:
    sbox-MaemoKernel: ~/maemo_kernel ] > cd kernel-2.6.28
    [sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] > make EXTRAVERSION=-omap1 rx51_defconfig
    Let's grab the latest hid-apple.c and the latest hid-ids.h form the kernel gitweb, adapt the Makefile:

    Code:
    # Makefile for building the hello kernel module outside the kernel tree
    
    KERNELDIR := /usr/src/maemo_kernel/kernel-2.6.28
    
    obj-m := hid-apple.o
    
    # default build target (uses kernel build (kbuild) system)
    all:
    	$(MAKE) -C $(KERNELDIR) M=`pwd` EXTRAVERSION=-omap1 modules
    
    # target for cleaning up
    clean:
    	$(RM) *.o .depend .*.cmd *.ko *.mod.c Module.symvers modules.order
    	$(RM) -R .tmp_versions
    Compiling the module is OK. Now let's put it on the device and do a :

    Code:
    Nokia-N900-42-11:/home/user# insmod hid-apple.ko 
    insmod: error inserting 'hid-apple.ko': -1 Invalid module format
    Not good. Let's go back to scratchbox and strip the version info in case the problem stems from a slight version mismatch:

    Code:
    [sbox-FREMANTLE_ARMEL: ~/maemo_kernel/apple-module] > objcopy --strip-debug \ 
    -R .modinfo -R __versions apple-hid.ko
    And on the device:

    Code:
    Nokia-N900-42-11:/home/user# insmod hid-apple.ko 
    insmod: error inserting 'hid-apple.ko': -1 Unknown symbol in module
    Any advice?

    Thanks, Ulysses

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 3 Users Say Thank You to Ulysses For This Useful Post:
    ashre, clasificado, Haus3r

     
    axonpoet | # 9 | 2010-01-23, 16:17 | Report

    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 set
    which should be changed to
    CONFIG_HID_APPLE=m
    Cheers.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to axonpoet For This Useful Post:
    ashre

     
    axonpoet | # 10 | 2010-01-23, 18:12 | Report

    It's already a part of the kernel source. You got the appropriate version when you did
    [sbox-MaemoKernel: ~/maemo_kernel ] > apt-get source kernel
    Cheers.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 1 of 4 | 1   2     3   | Next | Last
vBulletin® Version 3.8.8
Normal Logout