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 01-05-2012, 12:34 AM   #1
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
Kobo Touch Plugin Interface

Hi,

I played around with my Kobo Touch a bit tonight and wonder if the plugin interface (https://github.com/kobolabs/Kobo-Rea...ginInterface.h) is supposed to work with it?

I set the development environment up as described on http://blog.ringerc.id.au/ and compiled the poker example, copied the .so to the reader but I can't get it to load. I noticed that the plugins are started depending on their mimetype and you can edit the sqlite-database such that you have a "book" that starts an application, by setting the mimetype of an entry in the content table to e.g. "application/x-games-Sudoku". While this works for sudoku, it doesn't for the poker example.
It seems the .so isn't even properly loaded as some debug output I added doesn't appear in the stdout of nickel.

Furthermore, I'm not able to restart nickel after killing it (http://blog.ringerc.id.au/2011/01/co...kobo-wifi.html). This causes the reader to lock up and resetting it all the time is rather annoying

And, if the plugin interface doesn't work, has anyone investigated other methods to extend the firmware? I guess locally serving webpages might also work for simple stuff.
ah- is offline   Reply With Quote
Old 01-05-2012, 01:32 AM   #2
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,119
Karma: 73448614
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Remember; those instructions you posted were from the Kobo WiFi; NOT the Touch!
PeterT is offline   Reply With Quote
Advert
Old 01-06-2012, 09:45 AM   #3
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
Quote:
Originally Posted by PeterT View Post
Remember; those instructions you posted were from the Kobo WiFi; NOT the Touch!
I noticed that, but luckily they are still close enough. After a bit of further debugging I got the poker example working (well, without any way to actually interact with it). It seems the plugin interface changed since March, any chance a newer version will get uploaded to github?

In the mean time, here is what I came up with. The old instructions are mostly correct, the only thing really missing was that I had to add --prefix= to the path in QT_EXTRA_ARGS and add -D QT_NO_QWS_CURSOR, in qt.sh.

The sources for the hacked examples are attached. PluginInterface.h was missing an extra argument (pointer to PluginStatus, but unfortunately the definition of that class is missing) and I had to change some minor other bits to get it to compile/run.

If anyone just wants to test it without installing the whole devenv, the compiled versions are in the archive as well. Just copy them to /usr/local/Kobo, open the KoboReader.sqlite database and duplicate some ebooks entry and change the mimetype to "application/x-games-videopoker". Then reboot the kobo, open the library and "read" that book. This should open either a largely blank page with a small "Hello Kobo Touch" or the poker game, depending on which library you copied. Input doesn't work yet, so there's not a lot more to do with it.

Please note that this is highly experimental and might cause your kobo to explode.
Attached Thumbnails
Click image for larger version

Name:	kobo1.jpg
Views:	2684
Size:	57.0 KB
ID:	80845   Click image for larger version

Name:	kobo2.jpg
Views:	2771
Size:	56.0 KB
ID:	80846  
Attached Files
File Type: bz2 examples.tar.bz2 (91.3 KB, 736 views)

Last edited by ah-; 01-06-2012 at 10:04 AM.
ah- is offline   Reply With Quote
Old 01-07-2012, 10:35 AM   #4
Zoxc
Junior Member
Zoxc began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jan 2012
Device: Kobo Touch
I tried building the packages in that repository with the latest Sourcery Lite toolchain. BusyBox didn't compile (not that important, later versions does) and Qt had problems with DBus and OpenSSL. Disabling those made it compile though. Which toolchain did you use? Also you probably shouldn't be changing Qt's target prefix, try using -hostprefix instead. No idea how to get Qt or Glibc (from the toolchain) to install on the rootfs.

Also have you tried to access i.MX508's USB recovery mode? The device should appear on USB as a non-mass storage device if the correct signal is sent to the SoC on boot. Hopefully one of Kobo Touch's buttons will send that signal.
Zoxc is offline   Reply With Quote
Old 01-07-2012, 04:02 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
Quote:
Which toolchain did you use?
I used Sourcery G++ 2010q1-202 4.4.1, as described here: http://blog.ringerc.id.au/2011/01/pr...nment-for.html

Quote:
Also have you tried to access i.MX508's USB recovery mode? The device should appear on USB as a non-mass storage device if the correct signal is sent to the SoC on boot. Hopefully one of Kobo Touch's buttons will send that signal.
Since there is already a pretty good recovery solution, I haven't looked into that yet.
ah- is offline   Reply With Quote
Advert
Old 01-08-2012, 03:32 AM   #6
Zoxc
Junior Member
Zoxc began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jan 2012
Device: Kobo Touch
Things do build a bit better with that toolchain (Qt still in progress).

What recovery solutions exists currently? USB recovery mode would be the ultimate since it doesn't require any working code on the device.

Also have you tried to boot from the SD card? This would be nice so we can try building our own kernel without messing with NAND. Could you extract the kernel configuration from the device? (I don't have one yet )
Zoxc is offline   Reply With Quote
Old 01-08-2012, 04:06 AM   #7
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
I agree, having USB recovery would be great, but in the mean time I'd say the default recovery (holding Home during startup) works fine as long as you don't mess with the bootloader and possibly the kernel.

As for the kernel, I haven't yet looked into that as I just accidently restored my kt yesterday and didn't reenable ssh yet.
ah- is offline   Reply With Quote
Old 01-18-2012, 07:35 PM   #8
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
Great news: QtScript is there and fully usable, so this might be a great way to develop plugins. I wrote a plugin that exposes QtScript over the network, so you can just telnet to your Kobo and mess with stuff. This allows access to pretty much everything exposed by Qt introspection.

Source (and some documentation) is at https://github.com/ah-/koboplugins, and attached is a binary version if you don't have the full development environment set up yet. Copy it to /usr/local/Kobo, reboot and open the library once to load the plugin. If you have any issues with it, just delete libqtscript.so and you should be back to normal.

Example use: Telnet to your Kobo (port 1337) and execute "aw.findChildren("label")[0].text = "QtScript""
This changes the text of the "START" menu to "QtScript". Without compiling anything and interactive.
Attached Files
File Type: bz2 libqtscript.tar.bz2 (12.4 KB, 611 views)
ah- is offline   Reply With Quote
Old 01-21-2012, 07:13 AM   #9
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
More news: I managed to get the basics to work and built a simple demo application. All it does at the moment is controlling the LEDs, but I'm planning to add more options like disabling the wifi timeout or hiding annoying UI elements.

As before, the source is at https://github.com/ah-/koboplugins and if you just want to try it, copy the attached library to /usr/local/Kobo. To activate it you have to open the library once, to deinstall it just delete libtweaks.so.
Attached Thumbnails
Click image for larger version

Name:	IMG_20120121_125108.jpg
Views:	2417
Size:	677.1 KB
ID:	81559   Click image for larger version

Name:	IMG_20120121_125119.jpg
Views:	2010
Size:	951.9 KB
ID:	81560  
Attached Files
File Type: bz2 tweaks.tar.bz2 (23.5 KB, 668 views)
ah- is offline   Reply With Quote
Old 01-21-2012, 08:30 AM   #10
voom
Just me :)
voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.
 
Posts: 106
Karma: 1282
Join Date: Jan 2012
Location: Germany
Device: Kobo Touch
Would it be easy to add shortcuts to the menu this way like the "tweaks"-entry to existing Kobo-Features like the Browser?
voom is offline   Reply With Quote
Old 01-23-2012, 02:44 PM   #11
ikarus9999
Connoisseur
ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'
 
Posts: 88
Karma: 39373
Join Date: Apr 2003
Location: Austria
Device: Kobo Touch
Quote:
Originally Posted by voom View Post
Would it be easy to add shortcuts to the menu this way like the "tweaks"-entry to existing Kobo-Features like the Browser?
I've played a litte bit with 'ah-'s code and got the browser menu working.
In addition I've added a menu entry to toggle the airplane mode.

Attached is a 'KoboRoot.zip'. Just attach the reader to your PC and extract the file to the .kobo directory. Unplug the reader and it should install automatically.

As previously mentioned open the library once to start the plugin.

@ah-: is there a chance that I could commit my changes to your git repo.
Attached Files
File Type: zip kobo.zip (42.3 KB, 659 views)

Last edited by ikarus9999; 01-23-2012 at 03:01 PM.
ikarus9999 is offline   Reply With Quote
Old 01-23-2012, 03:04 PM   #12
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
Haha, I just finished the new version with just that feature. It also supports hiding the recommendations from the home screen, since many people wanted this in the future firmware feature request thread.

If you have more ideas of what to add/alter please share them.

The installation procedure is the same as above.

Quote:
@ah-: is there a chance that I could commit my changes to your git repo.
Of course! I don't have too much experience with github since until recently i just directly used git with my own server, but I guess the way to go is that you create a github account, fork the repository and then send merge requests for individual commits. Maybe we could also setup github so can directly commit to my repository, but I'm not sure how that is done.

Please feel free to improve everything.

Edit:
Oh, and before I forget it: I think we should come up with some simple deinstallation procedure if we start to distribute the plugin as easily installable zips. Just deleting it via ssh is easy, but not everyone has that set up. Maybe flashing some other file so the original gets overwritten, or some script that automatically deletes it. I don't want anyone to have problems because of the plugin if the Kobo firmware should ever update itself and change the interfaces.
Also checking the firmware version on load might be a good idea. And lastly, the qtscript plugin is potentially dangerous if you're not in a network you trust, since it's only intended for development and uses no authentication. Libtweaks.so works fine without it, so don't install the qtscript plugin if you don't know what it does.
Attached Thumbnails
Click image for larger version

Name:	IMG_20120123_204557.jpg
Views:	1640
Size:	581.2 KB
ID:	81629   Click image for larger version

Name:	IMG_20120123_204611.jpg
Views:	1765
Size:	275.7 KB
ID:	81630   Click image for larger version

Name:	IMG_20120123_204629.jpg
Views:	1844
Size:	435.8 KB
ID:	81631  
Attached Files
File Type: bz2 tweaks.tar.bz2 (28.4 KB, 543 views)

Last edited by ah-; 01-23-2012 at 03:40 PM.
ah- is offline   Reply With Quote
Old 01-23-2012, 04:31 PM   #13
voom
Just me :)
voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.
 
Posts: 106
Karma: 1282
Join Date: Jan 2012
Location: Germany
Device: Kobo Touch
That looks great Having seen the Home-Page without the Bottom-List my first impression is I would like some kind of small Buttonbar at the bottom of the page instead, rather adding custom-buttons for shortcuts there instead of adding them to the menu. I would at first think of having direct buttons for going to library, shortlist, browser and search...

Then, like for the browser in the menu or in a buttonbar, we would need icons...

If you tell me what the ideal format and proportion would be for additional icons, I could create some, maybe as a start for the browser in the menu as seen above and new one for the tweaks... For airplane-mode there is probably already one in the system that could be used
voom is offline   Reply With Quote
Old 01-24-2012, 03:56 AM   #14
Koboyashi
Zealot
Koboyashi ought to be getting tired of karma fortunes by now.Koboyashi ought to be getting tired of karma fortunes by now.Koboyashi ought to be getting tired of karma fortunes by now.Koboyashi ought to be getting tired of karma fortunes by now.Koboyashi ought to be getting tired of karma fortunes by now.Koboyashi ought to be getting tired of karma fortunes by now.Koboyashi ought to be getting tired of karma fortunes by now.Koboyashi ought to be getting tired of karma fortunes by now.Koboyashi ought to be getting tired of karma fortunes by now.Koboyashi ought to be getting tired of karma fortunes by now.Koboyashi ought to be getting tired of karma fortunes by now.
 
Posts: 137
Karma: 207434
Join Date: Dec 2011
Device: Kobo Glo
Quote:
Originally Posted by ah- View Post
Haha, I just finished the new version with just that feature. It also supports hiding the recommendations from the home screen, since many people wanted this in the future firmware feature request thread.

If you have more ideas of what to add/alter please share them.

The installation procedure is the same as above. ...
Hmm, really? In your download I found only a file "libtweaks.so". Could you provide an archive like ikarus9999 does? Anyway, great stuff!
Koboyashi is offline   Reply With Quote
Old 01-24-2012, 07:17 AM   #15
ikarus9999
Connoisseur
ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'ikarus9999 can spell AND pronounce 'liseuse.'
 
Posts: 88
Karma: 39373
Join Date: Apr 2003
Location: Austria
Device: Kobo Touch
I'm currently playing around with the main menu.
So far I've been able to delete all existing menu items and readding them on demand. I've also added a dictionary entry in the menu.

My next step is to enhance ah-'s Configuration dialog to incorporate all options. I'm also working on a deinstallation routine as well as a version check.
Attached Thumbnails
Click image for larger version

Name:	IMG_20120124_131342.jpg
Views:	1243
Size:	697.9 KB
ID:	81648  
ikarus9999 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
User Interface Plugin Creation/Debug process ldolse Development 15 11-04-2011 09:15 AM
Having problems with Kindle Device Interface/Page # Plugin bfollowell Plugins 1 08-10-2011 05:53 PM
Reset Sony Device Interface plugin? NLight95 Devices 2 04-04-2011 06:40 PM
Writing an interface action plugin kiwidude Plugins 21 11-11-2010 04:11 PM
Device interface plugin - nook badmadbug Plugins 2 09-06-2010 11:03 AM


All times are GMT -4. The time now is 12:30 PM.


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