11-22-2006, 02:57 PM | #1 |
Connoisseur
Posts: 78
Karma: 103
Join Date: Aug 2006
Location: Ipswich, UK
Device: Irex Iliad
|
Watchdog - automatically shut down your Iliad
Hi everyone,
Watchdog is my first attempt to write a useful utility for the Iliad. It runs as a daemon, and if the Iliad has been idle for more than a certain amount of time (default 30 minutes), it shuts it down, thus saving batteries. Version 0.1 is for those who can run it from the command line. If we're happy that it's working, then I'll ask Yokos if he can work his packaging magic with it. Usage watchdog [idle_time] Watches the Iliad and will shutdown the Iliad if it has been idle for more than idle_time minutes (minimum 5). Will default to 30 minutes if you don't specify a time stopwatchdog Will stop a running watchdog. May take up to 2 minutes before watchdog quits (as it spends most of its time asleep). How it works I noticed that the syslog file is written to each time the screen is updated with an eink marker. Watchdog forks into the background then wakes up every minute and tails this file. If it doesn't find any eink markers within the specified period then it shuts the machine down. Stopwatchdog simply sends it a quit message by way of the syslog file. Caveats I'm using /sbin/shutdown which will not perform some of the nice quit stuff you get if you push the power button. Maybe there's an event I can send everything to tell it to save and quit nicely (Ideas Scotty???) Enjoy! ps.. Source code is included in the zipfile. It compiles out of the box. |
11-22-2006, 03:18 PM | #2 |
Member
Posts: 24
Karma: 10
Join Date: Jun 2006
Location: Townsville, AU
Device: Iliad & REB1100
|
Just a suggestion, but you could cut your files in half by making watchdog do all the work. "watchdog <timeout>" to run watchdog as a demon, "watchdog 0" to turn it off, and "watchdog shutdown" to shut down the iliad immediately.
Perhaps even "watchdog reboot" and also time delayed operations like "watchdog <shutdown|reboot> <delay>" Cheers, glen. |
Advert | |
|
11-23-2006, 04:21 AM | #3 |
Gadget fan
Posts: 147
Karma: 3968
Join Date: Sep 2006
Location: London
Device: RM Tablet PC, iLiad, PRS 505, iPod Touch
|
Would be really useful tool. I hope it gets developed further.
|
11-23-2006, 04:28 AM | #4 |
iLiad Maniac
Posts: 1,382
Karma: 2369
Join Date: Apr 2006
Location: Germany
Device: Bookeen Opus (i love that thing) and iPad (what an irony)
|
Yap, i really need one of those
It would be great if we could somehow get it to start automatically. Maybe the shell script could also put in a script into the startscript folder, that checks on presently inserted external memory for additional startscript in an autorun folder. I hope Mattijs tells you, how they shut down gracefully, so that reading states are saved. BTW, if we can get autorun scripts, we could make a script, that checks for the last shutdown time in the logs and check the manifest times for close atime of manifest.xml and then reopen that file |
11-23-2006, 04:30 AM | #5 | |
Connoisseur
Posts: 78
Karma: 103
Join Date: Aug 2006
Location: Ipswich, UK
Device: Irex Iliad
|
Quote:
|
|
Advert | |
|
11-23-2006, 06:43 AM | #6 |
eink fanatic
Posts: 2,022
Karma: 4924
Join Date: Mar 2006
Location: Germany
Device: STAReBOOK, iRex Iliad, Sony 505, Kindle 2
|
Yes...that would be the first step in the direction of suspend...:-)
|
11-23-2006, 06:49 AM | #7 | |
iLiad Maniac
Posts: 1,382
Karma: 2369
Join Date: Apr 2006
Location: Germany
Device: Bookeen Opus (i love that thing) and iPad (what an irony)
|
Quote:
Does the iRex shutdown script make the open application change the atime of the manifestfile when closing it? |
|
11-23-2006, 06:54 AM | #8 | |
Connoisseur
Posts: 78
Karma: 103
Join Date: Aug 2006
Location: Ipswich, UK
Device: Irex Iliad
|
Quote:
|
|
11-23-2006, 07:32 AM | #9 |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
If you look you'll see they've been trying to store the last accessed document in /mnt/settings/er_registry.txt...
Technically this isn't "suspend" but it would be useful. In between rounds of gnashing my teeth over the missing kmod support and getting things like the CD-ROM FS working. I've been exploring power management in the kernel and our good buddy the power switch (and the other buttons). iRex is providing zero support in this area as they seem to think they have all the kernel work under control and they'd rather have Poppler whacked instead. No pay check, no NDA, no loaner iLiad, no permission to attach my JTAG debugger: no iRex strings == no iRex directives, I work on what I want this way. I'll take a break and suss out the shutdown logic as I very much down M will drop anything about it. They've got him on an even shorter leash where the hardware internals are concerned. By the way, if anyone that opened up their iLiad has the raw digital photos they would be useful. iRex has refused to supply any hardware details at all. They seem to feel they can deny the needed knowledge by simply withholding it. For example, the Philips UCB13XX chip comes in 8 or 9 varieties. It would be helpful to know exactly which version iRex chose and as I mentioned: they refuse to say. This chip likely controls the buttons and is definitely the chip they haven't mastered to turn off the audio. It also runs the Wacom tablet and has support for a microphone. I wish they'd hooked that up... |
11-23-2006, 07:34 AM | #10 | |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
Quote:
|
|
11-23-2006, 10:07 AM | #11 | |
Guru
Posts: 607
Karma: 2157
Join Date: Oct 2005
Device: NCR3125, Nokia 770,...
|
Quote:
|
|
11-23-2006, 10:10 AM | #12 |
Guru
Posts: 607
Karma: 2157
Join Date: Oct 2005
Device: NCR3125, Nokia 770,...
|
http://www.flickr.com/photos/72166458@N00 and http://www.flickr.com/photos/45138438@N00 are the photos, from snoopy and myself. No idea if there are some others around.
|
11-23-2006, 01:12 PM | #13 | |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
Quote:
But I agree with you, they are putting too much in such a critical file. They should have a volatile file that keeps track of last viewed books for each category as well as The Last Book. |
|
11-23-2006, 01:15 PM | #14 | |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
Quote:
|
|
11-24-2006, 06:14 AM | #15 |
Pac-Man caught my iLiad.
Posts: 807
Karma: 3595
Join Date: Apr 2006
Location: Germany; next to Baltic Sea
Device: Boox Max Lumi, iRex iLiad (RIP)
|
design256, thanks.
I run your watchdog [only 2 iLiad pages src ]with: Code:
./watchdog 5 [Edit]: Can anybody verify my observation of energy consumption? Irex's hasn't answer design256 question on iRex's forum. [Edit] iRex answered now. Last edited by yokos; 11-24-2006 at 06:50 AM. Reason: iRex's answer |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Well, Shut My Mouth | Fat Abe | News | 67 | 05-02-2010 06:14 PM |
v3.0 has me shut down..... | lmoore348 | Sony Reader | 1 | 09-06-2009 12:18 AM |
Automatic shut off? | Stacey34 | Sony Reader | 8 | 03-14-2009 06:11 AM |
Shut-down? | scrappnjoyce | Sony Reader | 9 | 01-09-2009 11:12 AM |