|
|
#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. |
|
|
|
|
|
#2 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,683
Karma: 79983758
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
Nicely done
This would be an ideal addition to be built into the plugin
|
|
|
|
|
|
#3 |
|
Treachery of images ...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,149
Karma: 94320195
Join Date: May 2012
Location: Australia
Device: Sony 650, Kobo Glo, H2O, Aura One, Forma, Libra 2, Libra Colour
|
Kevin Short are you saying that the zip file is ready to use?
|
|
|
|
|
|
#4 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
|
|
|
|
|
|
#5 |
|
Treachery of images ...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,149
Karma: 94320195
Join Date: May 2012
Location: Australia
Device: Sony 650, Kobo Glo, H2O, Aura One, Forma, Libra 2, Libra Colour
|
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 |
|
|
|
|
|
#6 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 111
Karma: 471030
Join Date: Nov 2012
Location: Berlin
Device: Kobo Elipsa 2e, Kobo Forma, Tolino Epos 2
|
Works fine here. Thanks.
Also works well with the plugin, using something like: Code:
light0=Plugin::executeSystemCmd("/mnt/onboard/frontlight/frontlight 0")
|
|
|
|
|
|
#7 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 71
Karma: 18140
Join Date: Jul 2011
Device: PRS-T1&KOBOTOUCH
|
|
|
|
|
|
|
#8 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 88
Karma: 39373
Join Date: Apr 2003
Location: Austria
Device: Kobo Touch
|
Yes it is.
|
|
|
|
|
|
#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?
|
|
|
|
|
|
#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")
|
|
|
|
|
|
|
#11 | |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 111
Karma: 471030
Join Date: Nov 2012
Location: Berlin
Device: Kobo Elipsa 2e, Kobo Forma, Tolino Epos 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 |
|
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? |
|
|
|
|
|
#13 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 111
Karma: 471030
Join Date: Nov 2012
Location: Berlin
Device: Kobo Elipsa 2e, Kobo Forma, Tolino Epos 2
|
Setting it to 3 would be just the standard light level 3.
Last edited by xor_; 12-29-2012 at 04:11 AM. |
|
|
|
|
|
#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")
|
|
|
|
|
|
#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?
|
|
|
|
![]() |
|
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 |