12-26-2012, 03:34 PM | #1 |
Addict
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; } Last edited by KevinShort; 05-15-2013 at 01:09 PM. |
12-26-2012, 04:11 PM | #2 |
Grand Sorcerer
Posts: 12,149
Karma: 73448616
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
|
Advert | |
|
12-26-2012, 04:42 PM | #3 |
Treachery of images ...
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?
|
12-26-2012, 04:49 PM | #4 |
Addict
Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
|
12-26-2012, 04:55 PM | #5 |
Treachery of images ...
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 |
Advert | |
|
12-26-2012, 05:21 PM | #6 |
Zealot
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") |
12-26-2012, 09:20 PM | #7 |
Connoisseur
Posts: 71
Karma: 18140
Join Date: Jul 2011
Device: PRS-T1&KOBOTOUCH
|
|
12-27-2012, 02:47 AM | #8 |
Connoisseur
Posts: 88
Karma: 39373
Join Date: Apr 2003
Location: Austria
Device: Kobo Touch
|
Yes it is.
|
12-28-2012, 12:20 PM | #9 |
Groupie
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?
|
12-28-2012, 12:33 PM | #10 | |
Addict
Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
Quote:
Code:
light0=Plugin::executeSystemCmd("/mnt/onboard/.kobo/frontlight 0") |
|
12-28-2012, 12:38 PM | #11 | |
Zealot
Posts: 100
Karma: 470830
Join Date: Nov 2012
Location: Berlin
Device: Nook Simple Touch, Kobo Aura H2O, Kobo Libra 2
|
Quote:
#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. |
|
12-28-2012, 12:51 PM | #12 |
Groupie
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? |
12-28-2012, 01:04 PM | #13 |
Zealot
Posts: 100
Karma: 470830
Join Date: Nov 2012
Location: Berlin
Device: Nook Simple Touch, Kobo Aura H2O, Kobo Libra 2
|
Setting it to 3 would be just the standard light level 3.
Last edited by xor_; 12-29-2012 at 04:11 AM. |
12-28-2012, 01:32 PM | #14 |
Groupie
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") |
12-29-2012, 04:26 AM | #15 |
Junior Member
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?
|
Thread Tools | Search this Thread |
|
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 |