Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 02-16-2012, 11:33 AM   #1
KevinShort
Addict
KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.
 
KevinShort's Avatar
 
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
To start the examples, just do:
Code:
python menu.py
Pressing the Kobo's home button when running an example will take you back
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.
  • Sometimes pygame will hang when trying to start its display. When this happens,
    pressing CTRL+C seems to snap it back into action.
  • The refresh rate of the e-ink is pretty bad. I know it can do better, the web browser
    can display black-and-white animated GIFs quite well in partial-refresh mode.

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
Please note that when you want nickel to start running again, you'll have to press
the small reset button on the back of the Touch, or run the command:
Code:
reboot
How it was done
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.
Attached Thumbnails
Click image for larger version

Name:	menu.JPG
Views:	2629
Size:	73.2 KB
ID:	82619   Click image for larger version

Name:	input.JPG
Views:	2255
Size:	78.8 KB
ID:	82620   Click image for larger version

Name:	pong.JPG
Views:	2144
Size:	71.7 KB
ID:	82621  

Last edited by KevinShort; 03-19-2012 at 04:34 PM.
KevinShort is offline   Reply With Quote
Old 02-18-2012, 02:31 AM   #2
vlad59
Addict
vlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five words
 
Posts: 369
Karma: 37869
Join Date: Sep 2011
Device: Kobo eReader Touch, Kobo Aura HD
Very good news.
I'll try it this weekend.
vlad59 is offline   Reply With Quote
Advert
Old 03-19-2012, 03:50 PM   #3
KevinShort
Addict
KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.
 
KevinShort's Avatar
 
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.
KevinShort is offline   Reply With Quote
Old 03-19-2012, 04:18 PM   #4
RareBird
Addict
RareBird ought to be getting tired of karma fortunes by now.RareBird ought to be getting tired of karma fortunes by now.RareBird ought to be getting tired of karma fortunes by now.RareBird ought to be getting tired of karma fortunes by now.RareBird ought to be getting tired of karma fortunes by now.RareBird ought to be getting tired of karma fortunes by now.RareBird ought to be getting tired of karma fortunes by now.RareBird ought to be getting tired of karma fortunes by now.RareBird ought to be getting tired of karma fortunes by now.RareBird ought to be getting tired of karma fortunes by now.RareBird ought to be getting tired of karma fortunes by now.
 
Posts: 377
Karma: 770002
Join Date: Dec 2011
Location: Windsor, Nova Scotia
Device: Kobo Aura
That's very impressive!
RareBird is offline   Reply With Quote
Old 03-19-2012, 06:44 PM   #5
ah-
Connoisseur
ah- knows the square root of minus one.ah- knows the square root of minus one.ah- knows the square root of minus one.ah- knows the square root of minus one.ah- knows the square root of minus one.ah- knows the square root of minus one.ah- knows the square root of minus one.ah- knows the square root of minus one.ah- knows the square root of minus one.ah- knows the square root of minus one.ah- knows the square root of minus one.
 
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.
ah- is offline   Reply With Quote
Advert
Old 03-20-2012, 04:21 AM   #6
vlad59
Addict
vlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five words
 
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 .
vlad59 is offline   Reply With Quote
Old 03-20-2012, 08:48 AM   #7
KevinShort
Addict
KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.
 
KevinShort's Avatar
 
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.
KevinShort is offline   Reply With Quote
Old 04-06-2012, 03:27 PM   #8
KevinShort
Addict
KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.
 
KevinShort's Avatar
 
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!

Attached Thumbnails
Click image for larger version

Name:	tetrisPlugin.JPG
Views:	11371
Size:	69.1 KB
ID:	84940  

Last edited by KevinShort; 04-10-2012 at 03:05 PM.
KevinShort is offline   Reply With Quote
Old 04-07-2012, 03:05 AM   #9
WS64
WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.
 
WS64's Avatar
 
Posts: 660
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...
WS64 is offline   Reply With Quote
Old 04-07-2012, 03:25 AM   #10
quek1982
Junior Member
quek1982 began at the beginning.
 
quek1982's Avatar
 
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
quek1982 is offline   Reply With Quote
Old 04-07-2012, 08:52 AM   #11
KevinShort
Addict
KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.
 
KevinShort's Avatar
 
Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
Quote:
Originally Posted by WS64 View Post
Kevin, doesn't work for me. No Tetris and no Tweaks. No errors either.
I'm back to the original Tweak...
Which firmware version are you running? Did you get the "Installing" screen
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:
Originally Posted by quek1982
ok for me
install first ah-'s plugin interface
then tetris kobo plugin
Installing ah-'s plugin interface first shouldn't be necessary, since my plugin will
just overwrite ah-'s.
KevinShort is offline   Reply With Quote
Old 04-07-2012, 02:54 PM   #12
WS64
WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.
 
WS64's Avatar
 
Posts: 660
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.
WS64 is offline   Reply With Quote
Old 04-07-2012, 04:02 PM   #13
clsdclsd
Zealot
clsdclsd can name that ebook in five wordsclsdclsd can name that ebook in five wordsclsdclsd can name that ebook in five wordsclsdclsd can name that ebook in five wordsclsdclsd can name that ebook in five wordsclsdclsd can name that ebook in five wordsclsdclsd can name that ebook in five wordsclsdclsd can name that ebook in five wordsclsdclsd can name that ebook in five wordsclsdclsd can name that ebook in five wordsclsdclsd can name that ebook in five words
 
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...
clsdclsd is offline   Reply With Quote
Old 04-08-2012, 05:51 AM   #14
satsuki_yatoshi
Member
satsuki_yatoshi understands the Henderson-Hasselbalch Equation.satsuki_yatoshi understands the Henderson-Hasselbalch Equation.satsuki_yatoshi understands the Henderson-Hasselbalch Equation.satsuki_yatoshi understands the Henderson-Hasselbalch Equation.satsuki_yatoshi understands the Henderson-Hasselbalch Equation.satsuki_yatoshi understands the Henderson-Hasselbalch Equation.satsuki_yatoshi understands the Henderson-Hasselbalch Equation.satsuki_yatoshi understands the Henderson-Hasselbalch Equation.satsuki_yatoshi understands the Henderson-Hasselbalch Equation.satsuki_yatoshi understands the Henderson-Hasselbalch Equation.satsuki_yatoshi understands the Henderson-Hasselbalch Equation.
 
satsuki_yatoshi's Avatar
 
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 !
satsuki_yatoshi is offline   Reply With Quote
Old 04-08-2012, 02:38 PM   #15
KevinShort
Addict
KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.
 
KevinShort's Avatar
 
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.
KevinShort is offline   Reply With Quote
Reply

Tags
game, hack, kobo touch, pygame, python

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 09:59 AM.


MobileRead.com is a privately owned, operated and funded community.