![]() |
#1 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 40
Karma: 8604
Join Date: Dec 2012
Location: Germany
Device: Kobo Touch
|
Custom KT UI without QT or killing nickle
Hi everyone,
there are many ideas out there on how to create own applications for the KT and integrating them into the UI. All I have found so far involve one of the following three points:
I wasn't quite statisfied with any of them, because I do not want to get started on QT development. And I do want my normal UI to run... after all, this is a reader. So I came up with a new way I would like to share. In my previous post about installing a webserver on the KT I elaborated on how it is possible to write php applications running on the Kobo Touch. Of course, these are accessible from the KT browser... though that is not really integrating. Here's the next step: Redirecting the Webstore. Once I had the browser running on my KT, I wondered how the webstore works. It turns out that many pieces of the regular user interface are in fact webpages, displayed in a qt app using hindenburg (the KT's webbrowser). That goes for the webstore as well: What you see after accessing the store are in fact webpages... take a look at webstore.kobobooks.com - looks familiar? You can control the address of the webstore. The last three entries in .kobo/Kobo/Kobo eReader.conf define the URL used when accessing the webstore. I created my own page on the Kobo's local webserver (using shttpd, see previous post) to create the directory /71485/Search/Categories/index.php. Since the webstore is redirected to 127.0.0.1 as described in my previous post, calling the webstore now opens my own custom index.php. This opens a new way to create a custom UI fully integrated with nickel without the requirement to modify the onboard libraries. It should be fairly Update-Resistend and in the end everything comes down to web development. Which in my eyes is easier to understand and modify than QT embedded applications. A nice side effect: You can also access that Kobo UI from any computer in the local subnet... for example to take screenshots of the kobo. I will post some screenshots of my little "Webstore UI" soon to show some of the possibilities given here. For starters, I am going to create the following extensions I miss:
As a note: php and sqlite to go together. I haven't compiled sqlite support for php yet, but after that one could modify the kobo's sqlite DB from an onboard php interface. Ever wanted to reclassify that sideloaded calibre book as a newspaper? Here's your chance ^^ Regards, ichrispa |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,248
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Hi ichrispa,
Good luck with your project ![]() A screenshot ability could be a handy feature when trying to answer forum questions. If you are able to safely update the sqlite database from the device UI then a good candidate may be the content_settings table which holds font-size, page margins and line spacing per book. Although the standard font setting sliders allow many values, they have not been particularly well chosen by Kobo (IMO) e.g.
Speaking purely for myself, I have no interest in web options, but there will be many who do. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 40
Karma: 8604
Join Date: Dec 2012
Location: Germany
Device: Kobo Touch
|
Hi jackie_w,
changing the sqlite DB is never safe... it was just an idea. The commandline and some restarting features are of much more interest to me - but of course I want to also point out the possibility of customizing the UI as needed. The mentioned features are just the ones needed by me ![]() EDIT: The screenshot capability would is actually there already. you can cat /dev/fb0 into the rgb565torgb program which I crosscompiled to run on arm. LibPNG is already crosscompiled, so I would only need to write some extra code to get a screenshot. Currently, this does the trick: Code:
rgb565torgb < /dev/fb0 > convert -depth 8 -size 800x1280 -rotate 90 "$(date %Y%M%d-%H%m).png" END OF EDIT As promised, here are some proof of concept screenshots: The Bookstore Interface on KT 2.3.2 should be known to everyone: ![]() I hooked my UI in the Category page: ![]() Which calls the local webpage on the kobo touch: ![]() The page is interactive (though not very usefull for now). Heres the reboot button being pressed. The link in the image calls a php script linked as "system.php?action=reboot", which in turn executes the reboot command. I had to disable the action for taking this screenshot of course. ![]() Yes, rebooting via interface is silly, since there is a nice comfy slider for that. Just wanted to demonstrate that my idea is feasable. Last edited by ichrispa; 01-13-2013 at 10:42 AM. |
![]() |
![]() |
![]() |
#4 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,248
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Quote:
![]() Quote:
|
||
![]() |
![]() |
![]() |
#5 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 40
Karma: 8604
Join Date: Dec 2012
Location: Germany
Device: Kobo Touch
|
Quote:
There are really plenty of guides on how to enable telnet access to the kobo, incl. the mobilereader wiki. You can get the raw screen content by issueing the following command over a telnet prompt: Code:
root@kobo# cat /dev/fb0 > /mnt/onboard/screenshot.raw The steps you need to take next are more or less the same whichever way you go:
I use the following script on my kobo to do convert a RGB565 Image to PNG. Code:
#!/bin/env python # # This script convert the ARM Linux RGB565 Framebuffer contents to a PNG Image # You need PyPNG and Python >= 2.7 installed to run this script. # # Use on your own risk import png import struct RAWD = "/dev/fb0" rawf = open(RAWD, b"r") pngf = open("/mnt/onboard/.local/out.png", "w") rawpng_flat = [] rawpng = [] pixel = [] data = rawf.read(2) while data != "": r5 = (struct.unpack("H", data)[0] >> 11) & 0x1F g6 = (struct.unpack("H", data)[0] >> 5) & 0x3F b5 = (struct.unpack("H", data)[0]) & 0x1F r8 = (r5<<3)+(r5>>2) g8 = (g6<<2)+(g6>>4) b8 = (b5<<3)+(b5>>2) rawpng_flat += [r8%256, g8%256, b8%256] data = rawf.read(2) png.Writer(width=800,height=600,bitdepth=8).write_array(pngf, rawpng_flat) pngf.close() rawf.close() |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Enthusiast
![]() ![]() ![]() Posts: 49
Karma: 208
Join Date: Nov 2012
Device: Kobo Glo
|
Very nice to see this, brings a lot of simple possibilities to the Kobo.
How can I access this url: http://webstore.kobobooks.com/, because it gives me 403 forbidden. Do I need to change my user agent or something? Nevermind, my KGlo uses another url. (http://webstore2.kobobooks.com/) Last edited by koenieee; 01-13-2013 at 04:16 PM. |
![]() |
![]() |
![]() |
#7 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 40
Karma: 8604
Join Date: Dec 2012
Location: Germany
Device: Kobo Touch
|
Mine KT uses webstore2 as well. I mistyped, sry.
|
![]() |
![]() |
![]() |
#8 |
Enthusiast
![]() ![]() ![]() Posts: 49
Karma: 208
Join Date: Nov 2012
Device: Kobo Glo
|
So now we can replace the Kobo store with something different? Such as an external Calibre library?
|
![]() |
![]() |
![]() |
#9 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 40
Karma: 8604
Join Date: Dec 2012
Location: Germany
Device: Kobo Touch
|
Quote:
I am still having some trouble with php. Notably, PHP works fine, but the Webstore somehow throughs an error when an HTTP POST or HEAD request is made. Still looking into that. Please note: You still have to install the webserver on the kobo. I am quite willing to make the binaries available, but I will not put them in a KoboReader.tgz for auto installation. |
|
![]() |
![]() |
![]() |
#10 |
Enthusiast
![]() ![]() ![]() Posts: 49
Karma: 208
Join Date: Nov 2012
Device: Kobo Glo
|
What is the problem with PHP? I now something about that, so maybe I can help..
|
![]() |
![]() |
![]() |
#11 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 40
Karma: 8604
Join Date: Dec 2012
Location: Germany
Device: Kobo Touch
|
What is happening is that I can start the integrated browser and point it to any address I want, incl. the onboard webserver. The pages need to be formated to fit to the screen, since there are no scrollbars and so on. I'll PM you an example of that, incl. your idea.
As long as these pages are html or generated via php, everything is ok. I have tried to install several things, including my own php-shell (for issueing ad-hoc commands to the kobo). But everytime I submit POST or HEAD requests, the first click does nothing at all. When I click again, I get an "Ooops, something happened to the network connection" error. Sometimes the Kobo hangs itself after that. I believe this is related to the webstore authenticating itself to kobo via a script called __utm.gif on the kobo server (which is requested during every UI interaction and includes many obscure paramters). The precice URL is http://webstore2.kobobooks.com/__utm...any=parameters Since the Kobo thinkgs it's not authenticated, it somehow can't send POST's, as these would usually be purchases. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Killing people | mr ploppy | Writers' Corner | 29 | 08-11-2011 06:15 AM |
DRM is killing me | blueglide | Sony Reader | 58 | 01-08-2010 07:58 AM |
The suspense is killing me | hautecontre | Introduce Yourself | 6 | 12-06-2009 09:07 AM |
Killing myself over the descision!! | vivekmreddy | Which one should I buy? | 12 | 06-11-2009 11:17 PM |
The wait is killing me! | sdmama | Sony Reader | 17 | 03-06-2009 01:50 AM |