![]() |
#1 |
Enhtusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53
Karma: 2340139
Join Date: Dec 2018
Device: K3 DxG PW1 KV PW4
|
Monitoring battery charge
I feel my Kindle works less and less on a full charge, but maybe I just read more.
Anyway to verify that I've created a simple script to monitor the battery charge and screensaver events. Code:
#!/bin/bash VERSION='1.0' LOGFILE='/mnt/base-us/battery.log' SOURCES=$'com.lab126.powerd\ncom.lab126.hal' touch $LOGFILE echo [`date`] Starting $0 v$VERSION >> $LOGFILE echo "$SOURCES" | lipc-wait-event -m -l battLevelChanged,goingToScreenSaver,outOfScreenSaver,charging,notCharging | while read event; do echo [`date`] $event >> $LOGFILE done Example log print: Code:
[Fri Oct 18 11:00:24 EEST 2019] Starting /mnt/us/extensions/battstat/bin/battstat.sh v1.0 [Fri Oct 18 11:01:28 EEST 2019] Event Source: com.lab126.powerd [Fri Oct 18 11:01:28 EEST 2019] Event Source: com.lab126.hal [Fri Oct 18 11:01:28 EEST 2019] Waiting for events... [Fri Oct 18 11:01:28 EEST 2019] com.lab126.powerd charging [Fri Oct 18 11:03:24 EEST 2019] com.lab126.powerd battLevelChanged 98 [Fri Oct 18 11:08:28 EEST 2019] com.lab126.powerd battLevelChanged 99 [Fri Oct 18 11:14:58 EEST 2019] com.lab126.powerd battLevelChanged 100 [Fri Oct 18 11:21:22 EEST 2019] com.lab126.powerd goingToScreenSaver 3 Changelog: Spoiler:
Last edited by MrTick; 12-09-2019 at 07:34 AM. Reason: Added changelog |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,161
Karma: 3592925
Join Date: Sep 2014
Location: Ukraine
Device: Kindle PW2, PW3, PW4, Voyage
|
Thank you for sharing.
Have you found anything interesting in your log that caused battery drain? |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enhtusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53
Karma: 2340139
Join Date: Dec 2018
Device: K3 DxG PW1 KV PW4
|
|
![]() |
![]() |
![]() |
#4 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Put your log file in /var/local/your-choice.
That is persistent "user data" for the Kindle system and untouched by the activities of the USB sub-system. |
![]() |
![]() |
![]() |
#5 | |
Enhtusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53
Karma: 2340139
Join Date: Dec 2018
Device: K3 DxG PW1 KV PW4
|
Quote:
The idea was to have easy access to the log files without the need of using usbNetwork. The improvement is as follows: now the log is stored in /var/local and can be easily obtained via KUAL menu ![]() EDIT: I can't edit the first post, so I'm adding new attachment here. Last edited by NiLuJe; 10-18-2019 at 10:06 AM. Reason: Moved attachment to first post -- NiLuJe |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
It will take a "few" (unknown number) of posts before this system will give you full access. Just keep on posting, the system will wake up 'soon'. |
|
![]() |
![]() |
![]() |
#7 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,161
Karma: 3592925
Join Date: Sep 2014
Location: Ukraine
Device: Kindle PW2, PW3, PW4, Voyage
|
Will it be useful to add monitoring wirelessEnableChanged event?
More events mentioned I've seen here https://www.mobileread.com/forums/sh...d.php?t=227859 |
![]() |
![]() |
![]() |
#8 |
Enhtusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53
Karma: 2340139
Join Date: Dec 2018
Device: K3 DxG PW1 KV PW4
|
It should be easy to modify the script to log any event you want.
Just add the correct event source (separated by /n) to the SOURCES variable and include the event in the lipc-wait event list. You can also monitor all events in the system, but that might cause exessive flash wear: Code:
lipc-probe -l | lipc-wait-event -m -l "*" | while read event; do echo [`date`] $event > /mnt/us/events.log done |
![]() |
![]() |
![]() |
#9 |
Enhtusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53
Karma: 2340139
Join Date: Dec 2018
Device: K3 DxG PW1 KV PW4
|
So I've done some measurements, it seems that the battery is quite dead (all measurements were done with frontlight set to 3)
Grey zones are times where PW entered 'suspended' state. Similar green zones for charging. It lasted a little more than a day on a single charge. I've replaced the battery situation improved instantly, so it'll take some time before I discharge it fully and attach a new plot ![]() Dirty python script to generate plot from battery.log attached (python2+matplotlib) |
![]() |
![]() |
![]() |
#10 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Is that your PW1 or PW4? (Your PW1, but future readers may not realize that.)
Also the firmware version in use please. That is a very pretty little chart. As you wrote, the old battery is almost a straight line downward, regardless if the device is asleep or awake. That old battery would probably discharge in less than a day just sitting on a shelf. ![]() Last edited by knc1; 12-06-2019 at 06:56 AM. |
![]() |
![]() |
![]() |
#11 |
Enhtusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53
Karma: 2340139
Join Date: Dec 2018
Device: K3 DxG PW1 KV PW4
|
|
![]() |
![]() |
![]() |
#12 |
Nil adsuetudine maius
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 278
Karma: 500000
Join Date: Nov 2019
Location: US
Device: PW4
|
Nice idea and chart. Thanks for sharing this.
As to being able to edit your older posts, I believe it's > 20 posts and definitely < 53 posts before the forum settings will allow such. As you might gather, I didn't notice exactly when the transition occurred. |
![]() |
![]() |
![]() |
#13 | |
Enhtusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53
Karma: 2340139
Join Date: Dec 2018
Device: K3 DxG PW1 KV PW4
|
Quote:
![]() (BTW. Added a little-improved version 1.2 that gather also suspend events) |
|
![]() |
![]() |
![]() |
#14 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Just throwing this out there:
While that may be frowned upon in other subforums (as I can't speak for other mods), feel free to PM me if you need an edit on an earlier post ![]() Or a thread title, because no amount of posting will ever allow you to edit your own thread's title :/. (Yes, that last one used to drive me mad ^^). |
![]() |
![]() |
![]() |
#15 | |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Feb 2016
Device: kindle voyage
|
Quote:
Can this script run on Kindle? |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
When should I charge the battery? | charlyee | Amazon Kindle | 25 | 02-03-2016 08:11 AM |
iLiad can't charge iLiad battery | ragdoll | iRex | 2 | 11-11-2015 06:49 AM |
How Far Do You Let Your Battery Go Before You Charge ? | JimmyH | Amazon Kindle | 18 | 11-03-2014 12:11 PM |
Battery Will Not Charge | w1ksz | enTourage eDGe | 19 | 04-10-2013 10:12 AM |
Can't Charge My Battery | Lady Fitzgerald | Astak EZReader | 8 | 06-22-2010 05:09 PM |