![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
Python/Pygame successfully running on Kobo Touch
I recently managed to get python and the pygame module working on my Kobo Touch.
So I whipped up a couple of quick examples, and I put them, along with python and pygame, in a KoboRoot.tgz file. Here's a download link. Install it by extracting the zip file and copying the KoboRoot.tgz file to the .kobo folder on your Touch. Now telnet into your Touch and run: Code:
ln -s /mnt/onboard/.python/bin/python /usr/bin/python Code:
python menu.py to the example menu. In pong, the power switch will flash the screen. As would be expected, pygame has a couple of problems on the Kobo.
You'll most likely want to stop the Kobo's graphical application, Nickel, before you start the pygame examples. You can do so with: Code:
killall nickel the small reset button on the back of the Touch, or run the command: Code:
reboot I compiled python and pygame on a virtual debian arm machine, and I then copied python and the necessary lib*.so files to my Kobo. Quite easy. Here are the tutorials I followed to setup a virtual debian arm machine. Last edited by KevinShort; 03-19-2012 at 04:34 PM. |
![]() |
![]() |
![]() |
#2 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 369
Karma: 37869
Join Date: Sep 2011
Device: Kobo eReader Touch, Kobo Aura HD
|
Very good news.
I'll try it this weekend. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
After a bit of work, I've gotten a Tetris clone running on my Kobo Touch!
Here's a video Also, pygame should now be able to load all image formats normally supported, not just .bmp files. You can download the updated pygame here. Install by copying KoboRoot.tgz to the .kobo folder on your touch. Tetris is installed in the directory "/mnt/onboard/.python/" Last edited by KevinShort; 03-19-2012 at 04:31 PM. |
![]() |
![]() |
![]() |
#4 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 377
Karma: 770002
Join Date: Dec 2011
Location: Windsor, Nova Scotia
Device: Kobo Aura
|
That's very impressive!
|
![]() |
![]() |
![]() |
#5 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 64
Karma: 7786
Join Date: Jan 2012
Device: Kobo Touch
|
Really cool, I just tried it and considering that it's an E-Ink display it works really well. Also, I'm surprised that pygame runs that fast.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 369
Karma: 37869
Join Date: Sep 2011
Device: Kobo eReader Touch, Kobo Aura HD
|
Hi,
I had a dream that one day ... ah- and KevinShort could combine theirs efforts so that the games could be started without having to telnet the Kobo. It would be great ![]() |
![]() |
![]() |
![]() |
#7 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
Thanks to ah-'s work, I was able to create a "book" that started the games,
but there is a big problem. If pygame is started while nickel is running, pygame will wait forever until I press CTRL+C. The holdup is caused by SDL (which pygame uses) calling the ioctl VT_WAITACTIVE. But if I start pygame through a "book", I have no way to press CTRL+C, so the Touch just freezes. You can read a few more details here. Last edited by KevinShort; 04-02-2012 at 01:55 PM. |
![]() |
![]() |
![]() |
#8 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
I figured out how to restart nickel without rebooting the Touch, so Tetris can now
be started from the Kobo's home menu using ah-'s plugin interface! The plugin, with an updated version of Tetris, can be downloaded here. Extract the file and copy KoboRoot.tgz to the .kobo directory on your Touch. You must open the library once to start the plugin. Pressing the home button or pulling the power switch will end the Tetris game and send you back to the Touch's home screen. This is HIGHLY experimental, and things might not always work right! Last edited by KevinShort; 04-10-2012 at 03:05 PM. |
![]() |
![]() |
![]() |
#9 |
♫
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 661
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
|
Kevin, doesn't work for me. No Tetris and no Tweaks. No errors either.
I'm back to the original Tweak... |
![]() |
![]() |
![]() |
#10 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Jan 2012
Location: Le Havre, France
Device: Kobo Touch
|
ok for me
install first ah-'s plugin interface then tetris kobo plugin |
![]() |
![]() |
![]() |
#11 | ||
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
Quote:
after copying KoboRoot.tgz to your Touch? I just did a factory reset on my Touch, upgraded to 1.9.17, and then installed my Tetris plugin with no problems. Quote:
just overwrite ah-'s. |
||
![]() |
![]() |
![]() |
#12 |
♫
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 661
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
|
I tried it again, it did not work. I saw the installing screen, but after that my before installed tweaks were gone but nothing new, no tweaks, no tetris.
Firmware is 1.9.17 with telnet enabled. Installing the "normal" tweaks works fine. |
![]() |
![]() |
![]() |
#13 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 105
Karma: 37668
Join Date: Feb 2012
Device: Kobo Touch
|
Amazing work, I am impressed. However the Tetris is not the ideal game for e-ink display. I hope you are going to port another games :-). I would really like to see puzzle games in it - a sokoban game for example.
Another interesting application would be a gamebook-player. I have created html versions of some of my childhood-favorite Fighting Fantasy books, converted them to epub, it is really fun to replay those books nearly 30 years later on my Kobo - and tapping a link is much more comfortable than turning pages several times a minute. However the pen-and-paper statistics and a dice are still mandatory to enjoy them: these could be replaced by a python app... |
![]() |
![]() |
![]() |
#14 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24
Karma: 85358
Join Date: Dec 2011
Device: kobo touch
|
hello.
to get it works i needed to: 1-factory reset the kobo 2-upgrade to 1.9.17 firmware 3-install lastest tweaked interface 4-install tetris. it's realy works great for an e-ink reader. i would be great to add more game adapted to e-ink (chess game, go game, reverso, sokoban, all puzzle like ^^) thanks for your works ! |
![]() |
![]() |
![]() |
#15 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
I don't know if it's related to my hacking, but since after turning my Touch off yesterday
it has refused to turn back on. The only feedback I get from it is a green light when I plug it into my computer. I had the same problem the day after I first bought my Touch, but it eventually turned on after I let it charge for awhile. I'm not sure what to think. |
![]() |
![]() |
![]() |
Tags |
game, hack, kobo touch, pygame, python |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Running python recipes standonlone on hosted webserver | oecherprinte | Calibre | 6 | 08-03-2011 04:30 PM |
Kindle 3, Nook Simple Touch, Kobo Touch and Libra Pro Touch | jbcohen | Which one should I buy? | 4 | 06-18-2011 07:58 PM |
The Idiot's Guide to running Igorsk's Python Scripts | Nate the great | Workshop | 9 | 05-22-2010 12:17 PM |