07-31-2013, 07:49 PM | #1 |
Addict
Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
Python for Kobo Firmware 2.6+
Python for Kobo devices running firmware 2.6 and newer.
Download Here Usage
Last edited by KevinShort; 08-03-2013 at 09:16 AM. |
08-14-2013, 05:10 PM | #2 |
Zealot
Posts: 129
Karma: 34471
Join Date: Aug 2013
Location: Cracow, Poland
Device: Kobo Touch N905C
|
Hi Kevin!
I'm really interested in running python (armhf version) and pygame. Your previous version worked perfect for me with software <= 2.5.2. But when I try this one with 2.8.1 - python console is starting but as soon as I type "import pygame" it crashes. How did you prepare it? I would like to reproduce your steps. Did you compile it or did you take it from linux distribution - if yes, from which one? Thanks, Marek |
Advert | |
|
08-15-2013, 12:20 PM | #3 |
Addict
Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
Hi, Marek, do you not get any error message when python crashes? Did you make sure to set LD_LIBRARY_PATH to the location of the pygamelibs directory?
I compiled python inside a virtual armhf system. I used the directions here to set up a virtual raspberry pi. Another option is to grab the armhf packages from debian. |
08-16-2013, 06:27 AM | #4 |
Zealot
Posts: 129
Karma: 34471
Join Date: Aug 2013
Location: Cracow, Poland
Device: Kobo Touch N905C
|
Thank you Kevin! That's exactly what I wanted to know. It reports problem with importing time (time.so? - there is such library) even if I set LD_LIBRARY_PATH, but I'll try to recompile it myself - that should help. Thank you very much for directions!!
|
08-18-2013, 04:54 PM | #5 |
Junior Member
Posts: 8
Karma: 10
Join Date: Dec 2012
Location: Germany
Device: Kobo Touch N905C
|
[edit]Download problem vanished. Will try installing...
Last edited by Morg; 08-18-2013 at 07:40 PM. |
Advert | |
|
08-18-2013, 07:39 PM | #6 |
Addict
Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
Hi, Morg. The download is still working on my end. If you still can't get it to work I can upload the file somewhere else.
|
08-18-2013, 08:08 PM | #7 |
Junior Member
Posts: 8
Karma: 10
Join Date: Dec 2012
Location: Germany
Device: Kobo Touch N905C
|
Hi,
download works now - no idea why, though... Trying to run python isn't too promising as yet... I ran the "install-python.sh" script and exported LD_LIBRARY_PATH, giving /usr/lib as (additional) path as the installer moved the libraries there (right?) Python crashes on "import pygame", although I don't understand why. Using verbose output, it stops working on dlopen("/mnt/onboard/.python/lib/python2.7/lib-dynload/strop.so", 2); The complete log is attached. I can't make out an error, so I have some problems understanding what is happening... any ideas? Oh, Kobo Touch 905C, 2.8.1 with devpts/telnet/ftp enabled and nickel killed... Last edited by Morg; 08-19-2013 at 01:52 AM. |
08-19-2013, 12:59 PM | #8 |
Zealot
Posts: 129
Karma: 34471
Join Date: Aug 2013
Location: Cracow, Poland
Device: Kobo Touch N905C
|
Yeah. Morg, that's exactly what I'm experiencing, too. I didn't have time to recompile it myself yet. But maybe this is something stupid...
The archive is in zip format. Maybe that's a problem? Maybe there is a problem with attributes (missing +x attribute somewhere) or links not handled properly (if there are any). |
08-19-2013, 02:25 PM | #9 |
Junior Member
Posts: 8
Karma: 10
Join Date: Dec 2012
Location: Germany
Device: Kobo Touch N905C
|
Hi,
my download was a .tgz file; anyway, correct ungzipping more or less proves data integrity. As the /mnt/onboard is a VFAT filesystem, links don't work anyway, and rights are the same for every file / directory. We should be able to rule those out - especially, as the programs run as root. The object library in question - strop.so - is existent, readable and seems ok (the file header, that is). So - I'm guessing here - either it is not okay, because either compiling or linking went wrong, or there are other (internal?) problems concerning python internals, dynamic linking or something I don't seem to think about. Python internals have evaded me so far, and I have no experience with cross-compiler-toolchains, so I couldn't say something about that. I have been running compilers on ARM devices natively, but I don't feel ready yet to put up a complete compiler suite on the Kobo... :-) Using web search a bit seems to find a lot of issues with python and dlopen(). Further investigation from my side is somewhat futile, as I'm not even able to recognize an error reported by python... or am I overlooking something? |
08-19-2013, 02:42 PM | #10 | |
Zealot
Posts: 129
Karma: 34471
Join Date: Aug 2013
Location: Cracow, Poland
Device: Kobo Touch N905C
|
Or maybe we can try to extract needed files from debian packages first, before going through the compilation torture .
Quote:
|
|
08-19-2013, 03:41 PM | #11 | |
Addict
Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
Quote:
|
|
08-19-2013, 04:42 PM | #12 |
Junior Member
Posts: 8
Karma: 10
Join Date: Dec 2012
Location: Germany
Device: Kobo Touch N905C
|
Kevin,
you're right about the installer - though everything it does is moving the pygame libraries to /usr/lib (so you wouldn't need LD_LIBRARY_PATH at all) and linking the executable to /usr/bin. I ran strace -v -o py-trace.txt python -v -v -v and entered import pygame The result: (only last lines; I guess, the rest is not interesting...) Code:
open("/mnt/onboard/.python/lib/python2.7/lib-dynload/strop.so", O_RDONLY|O_LARGEFILE) = 5 fstat64(5, {st_dev=makedev(179, 3), st_ino=456, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=112, st_s ize=56132, st_atime=2013/08/19-02:00:00, st_mtime=2012/02/04-22:19:44, st_ctime=2013/08/19-03:51:46}) = 0 write(2, "dlopen(\"/mnt/onboard/.python/lib"..., 70) = 70 futex(0x2aaf00a4, FUTEX_WAKE_PRIVATE, 2147483647) = 0 open("/mnt/onboard/.python/lib/python2.7/lib-dynload/strop.so", O_RDONLY|O_CLOEXEC) = 6 read(6, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\344\16\0\0004\0\0\0"..., 512) = 512 lseek(6, 49152, SEEK_SET) = 49152 read(6, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1480) = 1480 lseek(6, 21012, SEEK_SET) = 21012 read(6, "A-\0\0\0aeabi\0\1#\0\0\0\5ARM9TDMI\0\6\2\10\1\t\1"..., 46) = 46 exit_group(1) = ? For some - unknown - reason, after exit_group the process stops. Any further ideas how to use strace? I'd be glad to help.. :-) |
08-21-2013, 04:02 PM | #13 |
Addict
Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
I don't know, morg. I don't have any other ideas at the moment.
|
11-09-2013, 04:15 PM | #14 |
Zealot
Posts: 129
Karma: 34471
Join Date: Aug 2013
Location: Cracow, Poland
Device: Kobo Touch N905C
|
I have pygame running along with kobo software 2.8.1.
Additional to Kevin's zip package I had to download and replace libs from debian wheezy (armhf): - libsdl-mixer1.2 (http://packages.debian.org/wheezy/ar...er1.2/download) - libts-0.0 (http://packages.debian.org/wheezy/ar...0.0-0/download) After that "import pygame" works. Don't think if it matters but I also upgrade python to 2.7.3 with python2.7-minimal from here: http://packages.debian.org/wheezy/ar...nimal/download. But there is one problem: libpng and libjpeg from Kevin's package are not compatible with the ones from kobo's software (v2.8.1). If I use Kevin's versions loading images with pygame works but kobo software won't load. So I'm using kobo's versions and I had to convert all images which I am loading with pygame to BMP format. I'm not entirely happy with it - it's a mess... but at least I was able to run my boot menu written in python without rewriting it or recompiling libs. |
11-17-2013, 05:21 AM | #15 |
Junior Member
Posts: 8
Karma: 10
Join Date: Dec 2012
Location: Germany
Device: Kobo Touch N905C
|
Hm...
I tried your tips on a spare SD card, and got it to work somehow. So I tried implementing it on my "live" SD, but systematically. This meant: Installing the koboPython-armhf.zip from the first post to /mnt/onboard/.python, _softlinking_ all pygame libs to /usr/lib, linking python2.7 to /usr/bin/python and running with LD_LIBRARY_PATH=/usr/lib:/mnt/onboard/.python/lib:$LD_LIBRARY_PATH python It worked - right out of the box and _before_ replacing the additional libs.. though I have no idea why it works now and not before... Marek: what do you mean with "...but kobo software won't load"? My Touch works fine after installing python the described way... |
Tags |
armhf, kobo, python |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kobo Firmware 2.6.1 | MDK | Kobo Reader | 515 | 10-22-2013 06:40 PM |
Glo Kobo Firmware 2.3.1 | danskmacabre | Kobo Reader | 304 | 02-07-2013 01:52 AM |
Touch Python/Pygame successfully running on Kobo Touch | KevinShort | Kobo Developer's Corner | 18 | 10-24-2012 03:08 PM |
kobo firmware | The Terminator | Kobo Reader | 1 | 12-13-2010 06:26 PM |
python command line tool for kobo | reed | Kobo Reader | 2 | 06-05-2010 02:07 AM |