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 12-26-2012, 03:34 PM   #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
Controlling the Glo's Frontlight

I was looking at a strace of nickel today, and found that the Glo's frontlight is controlled by ioctl calls to /dev/ntx_io. I hacked together some quick C code to control the light:
Code:
#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>

int main(int argc, char *argv[])
{
    if ( argc != 2 ) {
        printf("Usage: %s brightness \n", argv[0]);
        return 1;
    }
    
    int light;

    // Open the file for reading and writing
    if ((light = open("/dev/ntx_io", O_RDWR)) == -1) {
        printf("Error opening ntx_io device");	
    }

    int brightness = atoi ( (argv[1]) );
    ioctl(light, 241, brightness);

    return 0;
}
I've attached the source code and the compiled program below.
Attached Files
File Type: zip GloLight.zip (3.2 KB, 1034 views)

Last edited by KevinShort; 05-15-2013 at 01:09 PM.
KevinShort is offline   Reply With Quote
Old 12-26-2012, 04:11 PM   #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,103
Karma: 73447988
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Nicely done This would be an ideal addition to be built into the plugin
PeterT is offline   Reply With Quote
Advert
Old 12-26-2012, 04:42 PM   #3
Lynx-lynx
Treachery of images ...
Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.
 
Lynx-lynx's Avatar
 
Posts: 4,069
Karma: 91561091
Join Date: May 2012
Location: Australia
Device: Blackberry Playbook, Sony 650, Kobo Glo, H2O, Aura One, Forma, Libra 2
Kevin Short are you saying that the zip file is ready to use?
Lynx-lynx is offline   Reply With Quote
Old 12-26-2012, 04:49 PM   #4
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 Lynx-lynx View Post
Kevin Short are you saying that the zip file is ready to use?
It's ready to use in the sense that you can extract it and run the included "frontlight" program on the Glo.
KevinShort is offline   Reply With Quote
Old 12-26-2012, 04:55 PM   #5
Lynx-lynx
Treachery of images ...
Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.Lynx-lynx ought to be getting tired of karma fortunes by now.
 
Lynx-lynx's Avatar
 
Posts: 4,069
Karma: 91561091
Join Date: May 2012
Location: Australia
Device: Blackberry Playbook, Sony 650, Kobo Glo, H2O, Aura One, Forma, Libra 2
Thanks Kevin, I'll give it a burl.

I should add that it's pre 9am here, so I won't get to test it out properly until tonight.

Last edited by Lynx-lynx; 12-26-2012 at 04:58 PM. Reason: The fact it's only early morning here
Lynx-lynx is offline   Reply With Quote
Advert
Old 12-26-2012, 05:21 PM   #6
xor_
Zealot
xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.
 
Posts: 100
Karma: 470830
Join Date: Nov 2012
Location: Berlin
Device: Nook Simple Touch, Kobo Aura H2O, Kobo Libra 2
Works fine here. Thanks.

Also works well with the plugin, using something like:

Code:
light0=Plugin::executeSystemCmd("/mnt/onboard/frontlight/frontlight 0")
xor_ is offline   Reply With Quote
Old 12-26-2012, 09:20 PM   #7
xuyn2003
Connoisseur
xuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texan
 
Posts: 71
Karma: 18140
Join Date: Jul 2011
Device: PRS-T1&KOBOTOUCH
Quote:
Originally Posted by xor_ View Post
Works fine here. Thanks.

Also works well with the plugin, using something like:

Code:
light0=Plugin::executeSystemCmd("/mnt/onboard/frontlight/frontlight 0")
Is the plugin suitable for firmware 2.3.1? Thanks!
xuyn2003 is offline   Reply With Quote
Old 12-27-2012, 02:47 AM   #8
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
Yes it is.
ikarus9999 is offline   Reply With Quote
Old 12-28-2012, 12:20 PM   #9
Rainer Zenz
Groupie
Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.
 
Rainer Zenz's Avatar
 
Posts: 159
Karma: 629506
Join Date: Dec 2011
Device: Kobo Touch/Glo
Hm. I put "frontlight" into the ".kobo" folder and the code from #6 into "koboplugins.ini"? Is that correct?
Rainer Zenz is offline   Reply With Quote
Old 12-28-2012, 12:33 PM   #10
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 Rainer Zenz View Post
Hm. I put "frontlight" into the ".kobo" folder and the code from #6 into "koboplugins.ini"? Is that correct?
Yes on putting the code into koboplugins.ini, but you'll have to change the code if you put frontlight into the ".kobo" folder:
Code:
light0=Plugin::executeSystemCmd("/mnt/onboard/.kobo/frontlight 0")
The location "/mnt/onboard" is the root directory of the Kobo that you see when you connect your Kobo to your computer via USB. So if you put "frontlight" in the ".kobo" folder, the full path would be "/mnt/onboard/.kobo/frontlight", as you can see in the code above.
KevinShort is offline   Reply With Quote
Old 12-28-2012, 12:38 PM   #11
xor_
Zealot
xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.
 
Posts: 100
Karma: 470830
Join Date: Nov 2012
Location: Berlin
Device: Nook Simple Touch, Kobo Aura H2O, Kobo Libra 2
Quote:
Originally Posted by Rainer Zenz View Post
Hm. I put "frontlight" into the ".kobo" folder and the code from #6 into "koboplugins.ini"? Is that correct?
No, the code in #6 assumes that you create a subdirectory named frontlight in the root of the mount point, and copy it in there.

#6 is also only an example of how to turn the light off, i.e. set it to 0. You might want a corresponding line to turn it on in koboplugins.ini. In this case to 3, substitute your own desired light level.

Something like:
Code:
light3=Plugin::executeSystemCmd("/mnt/onboard/frontlight/frontlight 3")

Edit: Or do as Kev said for the path.

Last edited by xor_; 12-28-2012 at 12:40 PM.
xor_ is offline   Reply With Quote
Old 12-28-2012, 12:51 PM   #12
Rainer Zenz
Groupie
Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.
 
Rainer Zenz's Avatar
 
Posts: 159
Karma: 629506
Join Date: Dec 2011
Device: Kobo Touch/Glo
Sorry, I'm not so familliar with all that.

When I do so, the frontlight is less bright in the lowest position?
Rainer Zenz is offline   Reply With Quote
Old 12-28-2012, 01:04 PM   #13
xor_
Zealot
xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.xor_ ought to be getting tired of karma fortunes by now.
 
Posts: 100
Karma: 470830
Join Date: Nov 2012
Location: Berlin
Device: Nook Simple Touch, Kobo Aura H2O, Kobo Libra 2
Quote:
Originally Posted by Rainer Zenz View Post
When I do so, the frontlight is less bright in the lowest position?
Setting it to 3 would be just the standard light level 3.

Last edited by xor_; 12-29-2012 at 04:11 AM.
xor_ is offline   Reply With Quote
Old 12-28-2012, 01:32 PM   #14
Rainer Zenz
Groupie
Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.Rainer Zenz ought to be getting tired of karma fortunes by now.
 
Rainer Zenz's Avatar
 
Posts: 159
Karma: 629506
Join Date: Dec 2011
Device: Kobo Touch/Glo
Okay, it works. I choosed

Code:
light1=Plugin::executeSystemCmd("/mnt/onboard/.kobo/frontlight 1")
But the effect ist very small. I guess, 0 means off.
Rainer Zenz is offline   Reply With Quote
Old 12-29-2012, 04:26 AM   #15
dimi5
Junior Member
dimi5 is a glorious beacon of lightdimi5 is a glorious beacon of lightdimi5 is a glorious beacon of lightdimi5 is a glorious beacon of lightdimi5 is a glorious beacon of lightdimi5 is a glorious beacon of lightdimi5 is a glorious beacon of lightdimi5 is a glorious beacon of lightdimi5 is a glorious beacon of lightdimi5 is a glorious beacon of lightdimi5 is a glorious beacon of light
 
Posts: 5
Karma: 12050
Join Date: Dec 2012
Location: Germany
Device: Kobo Aura
Can somebody explain, where the koboplugins.ini file can be found or should be placed?
dimi5 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
Odyssey Odyssey HD FrontLight available for preorder Chi Cygni Bookeen 66 12-21-2012 02:55 AM
Frontlight + touchscreen + moths GeoffR Kobo Reader 7 12-12-2012 05:21 PM
Kobo Glo vs Cybook Odyssey Frontlight Magean Which one should I buy? 4 11-30-2012 06:50 AM
Frontlight: How to reset? WS64 Bookeen 18 11-26-2012 04:47 AM
Odyssey Odyssey HD FrontLight battery Gardenman Bookeen 4 11-12-2012 03:46 AM


All times are GMT -4. The time now is 12:27 AM.


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