Quantcast
Channel: MobileRead Forums
Viewing all articles
Browse latest Browse all 47799

Mesure battery duration for KSM

$
0
0
The goal was, as I wrote at an older Koreader's forum post:
Quote:

I asked tshering in his KSM thread for a way to count the time I read and he was kind enough to give me a command to add to my power-off script to measure the uptime of the reader.

It would be nice if someone with bash knowledge could improve it to give us somehow the total time, since now I have to make the counting manually, and to format it in a more readable way e.g.:
  • uptime: 0:00:14:32 (total 0:02:42:56)
  • idle: 0:00:13:32 (total 0:02:24:31)
  • battery: 68%

I was using a combination of this handy mod for Koreader and tshering's scripts to get a more accurate picture of my battery's duration.
And since nobody improved the original script, I had to learn a bit about bash and try to improve it myself.
So I did, and this is the outcome.

DISCLAIMER - USE AT YOUR OWN RISK
I'm using this with Kobo Glo (non-HD), KSM7 and Koreader v2015.11-11-g16509e2.
It should work with other configurations too, but I can't be sure about the KSM8 before someone else try it.
UPDATE: For KSM8 files and instructions, please read the 2nd post from tshering.

The KSM07_uptimeX_01.zip archive contains a modified poweroff.sh script that has to be copied to the "\.adds\kbmenu\onstart\" directory and
the show_uptime.sh, delete_uptime.sh scripts that have to be copied to the "\.adds\kbmenu\scripts_intern\returntests\" directory.

That's it!

After that, every time you shut down the device (really shut down, not suspend) it will add a line to a uptime.txt file that it will be created in the "\.adds\kbmenu\logs\" directory.
This line will be in the form of:
Code:

2016:03:08_19:59, 0:00:11:58 total: 52992 bat: 78
which is the date and time that the device was shut down, the time it spend open, the total ms that the device was open after the creation of the uptime .txt, and the current battery level.

Whenever you want to check the status you have to goto KSM and navigate to scripts>tests>returntests.msh and execute the "show uptime.sh" script.
You will get a reading of:

Uptime: 0:00:01:56
Total time: 0:14:06:23
Battery charge: 65
Battery spend: 22

If you want to restart the measurements (after a partial or complete charge) you have to execute the "delete uptime.sh" (found in the same place) which deletes the uptime.txt.
You have to restart the device after that to start fresh.

The "Battery charge" and the "Battery spend" sum is the battery level of the device when the uptime.txt was re-created.

If anybody that is more knowledgeable than me with bash (almost everybody ;o) can improve the scripts, please do so and post the updates here.

After two complete battery cycles, I'm in a happy position to announce that my Glo's battery is enough for more than 2 days of continuous reading:
2 days with 76 shutdowns and
2 days and 4 hours with 56 shutdowns.

I'll keep on measuring a bit more before coming to a conclusive number, but its much better than I thought.

...and have a nice read too...

Edit: Uploaded a zip file, since .7z files are not supported ...

Attached Files
File Type: zip KSM07_uptimeX_01.zip (2.3 KB)

Viewing all articles
Browse latest Browse all 47799

Trending Articles