Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-21-2014, 11:21 PM   #61
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Ugh, good point, I had totally forgotten that this was a sneaky pillow/whatever hack and not a good old shell script. Amend my previous answer with everything Cykotitan said.
NiLuJe is offline   Reply With Quote
Old 05-22-2014, 08:46 AM   #62
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by NiLuJe View Post
Ugh, good point, I had totally forgotten that this was a sneaky pillow/whatever hack and not a good old shell script. Amend my previous answer with everything Cykotitan said.
Me too!
I had "change the script" stuck in my mind also.
- - - -
The links Cykotitan quoted do look like a good entry point into the problem.

And we know (from a lot of log reading) that the system does check the battery state at regular intervals.

Hooking that event (if there is one generated) or setting our own hook event in the battery state check may well be possible.

No telling if it would also be practical until someone tries it.
knc1 is offline   Reply With Quote
Advert
Old 05-24-2014, 04:26 PM   #63
Cykotitan
Enthusiast
Cykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animals
 
Posts: 44
Karma: 6550
Join Date: May 2013
Location: Bosnia & Herzegovina
Device: Kindle Paperwhite 1 WiFi
Here are some 3 day powerd logs from my device for reference:
Code:
[root@kindle root]# showlog messages | grep -F powerd[ |grep '\(def:battinfo\|lipc:evts:name=battLevelChanged\)'
140521:233005 powerd[1026]: I def:battinfo:cap=43%, mAh=541mAh, volt=3810mV, current=-61mA, temp=78F, bp=3810mV, lmd=1270mAh, cycl=0, cyct=0:
140521:233606 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=42:Event sent
140521:234006 powerd[1026]: I def:battinfo:cap=43%, mAh=544mAh, volt=3860mV, current=392mA, temp=78F, bp=3860mV, lmd=1270mAh, cycl=0, cyct=0:
140521:234006 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=43:Event sent
140521:234136 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=44:Event sent
140521:234336 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=45:Event sent
140521:234506 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=46:Event sent
140521:234736 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=47:Event sent
140521:234907 powerd[1026]: I def:battinfo:cap=48%, mAh=605mAh, volt=3911mV, current=408mA, temp=78F, bp=3911mV, lmd=1270mAh, cycl=0, cyct=0:
140521:234907 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=48:Event sent
140521:235107 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=49:Event sent
140521:235237 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=50:Event sent
140521:235437 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=51:Event sent
140521:235637 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=52:Event sent
140521:235837 powerd[1026]: I def:battinfo:cap=53%, mAh=670mAh, volt=3950mV, current=407mA, temp=78F, bp=3950mV, lmd=1270mAh, cycl=0, cyct=0:
140521:235837 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=53:Event sent
140522:000037 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=54:Event sent
140522:000238 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=55:Event sent
140522:000408 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=56:Event sent
140522:000608 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=57:Event sent
140522:000738 powerd[1026]: I def:battinfo:cap=58%, mAh=731mAh, volt=3979mV, current=408mA, temp=78F, bp=3979mV, lmd=1270mAh, cycl=0, cyct=0:
140522:000738 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=58:Event sent
140522:000938 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=59:Event sent
140522:001138 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=60:Event sent
140522:001338 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=61:Event sent
140522:001538 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=62:Event sent
140522:001708 powerd[1026]: I def:battinfo:cap=63%, mAh=794mAh, volt=4006mV, current=408mA, temp=78F, bp=4006mV, lmd=1270mAh, cycl=0, cyct=0:
140522:001709 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=63:Event sent
140522:001939 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=64:Event sent
140522:002109 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=65:Event sent
140522:002309 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=66:Event sent
140522:002439 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=67:Event sent
140522:002639 powerd[1026]: I def:battinfo:cap=68%, mAh=859mAh, volt=4032mV, current=408mA, temp=78F, bp=4032mV, lmd=1270mAh, cycl=0, cyct=0:
140522:002639 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=68:Event sent
140522:002839 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=69:Event sent
140522:003039 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=70:Event sent
140522:003239 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=71:Event sent
140522:003440 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=72:Event sent
140522:003610 powerd[1026]: I def:battinfo:cap=73%, mAh=922mAh, volt=4061mV, current=408mA, temp=78F, bp=4061mV, lmd=1270mAh, cycl=0, cyct=0:
140522:003610 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=73:Event sent
140522:003810 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=74:Event sent
140522:004010 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=75:Event sent
140522:004140 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=76:Event sent
140522:004340 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=77:Event sent
140522:004540 powerd[1026]: I def:battinfo:cap=78%, mAh=987mAh, volt=4098mV, current=408mA, temp=78F, bp=4098mV, lmd=1270mAh, cycl=0, cyct=0:
140522:004540 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=78:Event sent
140522:004740 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=79:Event sent
140522:004941 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=80:Event sent
140522:005141 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=81:Event sent
140522:005311 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=82:Event sent
140522:005511 powerd[1026]: I def:battinfo:cap=83%, mAh=1050mAh, volt=4132mV, current=409mA, temp=78F, bp=4132mV, lmd=1270mAh, cycl=0, cyct=0:
140522:005511 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=83:Event sent
140522:005711 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=84:Event sent
140522:005911 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=85:Event sent
140522:010111 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=86:Event sent
140522:010341 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=87:Event sent
140522:010512 powerd[1026]: I def:battinfo:cap=87%, mAh=1111mAh, volt=4164mV, current=363mA, temp=78F, bp=4164mV, lmd=1270mAh, cycl=0, cyct=0:
140522:010542 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=88:Event sent
140522:010742 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=89:Event sent
140522:011012 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=90:Event sent
140522:011242 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=91:Event sent
140522:011512 powerd[1026]: I def:battinfo:cap=91%, mAh=1161mAh, volt=4175mV, current=246mA, temp=78F, bp=4175mV, lmd=1270mAh, cycl=0, cyct=0:
140522:011542 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=92:Event sent
140522:011943 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=93:Event sent
140522:012313 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=94:Event sent
140522:012513 powerd[1026]: I def:battinfo:cap=94%, mAh=1194mAh, volt=4183mV, current=172mA, temp=78F, bp=4183mV, lmd=1270mAh, cycl=0, cyct=0:
140522:012743 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=95:Event sent
140522:013313 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=96:Event sent
140522:013514 powerd[1026]: I def:battinfo:cap=96%, mAh=1218mAh, volt=4188mV, current=125mA, temp=78F, bp=4188mV, lmd=1270mAh, cycl=0, cyct=0:
140522:013944 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140522:014514 powerd[1026]: I def:battinfo:cap=97%, mAh=1235mAh, volt=4191mV, current=87mA, temp=78F, bp=4191mV, lmd=1270mAh, cycl=0, cyct=0:
140522:014814 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=98:Event sent
140522:015415 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=100:Event sent
140522:015515 powerd[1026]: I def:battinfo:cap=100%, mAh=1270mAh, volt=4193mV, current=63mA, temp=78F, bp=4193mV, lmd=1270mAh, cycl=0, cyct=0:
140522:020345 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=99:Event sent
140522:020515 powerd[1026]: I def:battinfo:cap=99%, mAh=1260mAh, volt=4151mV, current=-111mA, temp=78F, bp=4151mV, lmd=1270mAh, cycl=0, cyct=0:
140522:021016 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=98:Event sent
140522:021516 powerd[1026]: I def:battinfo:cap=98%, mAh=1242mAh, volt=4132mV, current=-107mA, temp=78F, bp=4132mV, lmd=1270mAh, cycl=0, cyct=0:
140522:021716 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140522:022416 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=96:Event sent
140522:022516 powerd[1026]: I def:battinfo:cap=96%, mAh=1225mAh, volt=4117mV, current=-106mA, temp=78F, bp=4117mV, lmd=1270mAh, cycl=0, cyct=0:
140522:023247 powerd[1026]: I def:battinfo:cap=96%, mAh=1216mAh, volt=4167mV, current=354mA, temp=78F, bp=4167mV, lmd=1270mAh, cycl=0, cyct=0:
140522:023517 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140522:023817 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=98:Event sent
140522:024217 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=99:Event sent
140522:024248 powerd[1026]: I def:battinfo:cap=99%, mAh=1253mAh, volt=4185mV, current=150mA, temp=78F, bp=4185mV, lmd=1270mAh, cycl=0, cyct=0:
140522:024818 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=100:Event sent
140522:025248 powerd[1026]: I def:battinfo:cap=100%, mAh=1270mAh, volt=4191mV, current=81mA, temp=77F, bp=4191mV, lmd=1270mAh, cycl=0, cyct=0:
140522:030249 powerd[1026]: I def:battinfo:cap=100%, mAh=1265mAh, volt=4162mV, current=-106mA, temp=77F, bp=4162mV, lmd=1270mAh, cycl=0, cyct=0:
140522:030319 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=99:Event sent
140522:031019 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=98:Event sent
140522:031249 powerd[1026]: I def:battinfo:cap=98%, mAh=1247mAh, volt=4140mV, current=-107mA, temp=77F, bp=4140mV, lmd=1270mAh, cycl=0, cyct=0:
140522:031720 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140522:032250 powerd[1026]: I def:battinfo:cap=97%, mAh=1229mAh, volt=4125mV, current=-107mA, temp=77F, bp=4125mV, lmd=1270mAh, cycl=0, cyct=0:
140522:032420 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=96:Event sent
140522:033220 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=95:Event sent
140522:033250 powerd[1026]: I def:battinfo:cap=96%, mAh=1214mAh, volt=4167mV, current=354mA, temp=77F, bp=4167mV, lmd=1270mAh, cycl=0, cyct=0:
140522:033250 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=96:Event sent
140522:033521 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140522:033851 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=98:Event sent
140522:034251 powerd[1026]: I def:battinfo:cap=98%, mAh=1250mAh, volt=4185mV, current=145mA, temp=78F, bp=4185mV, lmd=1270mAh, cycl=0, cyct=0:
140522:034321 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=99:Event sent
140522:035021 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=100:Event sent
140522:035252 powerd[1026]: I def:battinfo:cap=100%, mAh=1268mAh, volt=4191mV, current=77mA, temp=78F, bp=4191mV, lmd=1270mAh, cycl=0, cyct=0:
140522:040152 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=99:Event sent
140522:040252 powerd[1026]: I def:battinfo:cap=99%, mAh=1262mAh, volt=4156mV, current=-106mA, temp=78F, bp=4156mV, lmd=1270mAh, cycl=0, cyct=0:
140522:040853 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=98:Event sent
140522:041253 powerd[1026]: I def:battinfo:cap=98%, mAh=1244mAh, volt=4138mV, current=-107mA, temp=78F, bp=4138mV, lmd=1270mAh, cycl=0, cyct=0:
140522:041553 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140522:042253 powerd[1026]: I def:battinfo:cap=96%, mAh=1226mAh, volt=4122mV, current=-108mA, temp=78F, bp=4122mV, lmd=1270mAh, cycl=0, cyct=0:
140522:042253 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=96:Event sent
140522:043024 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=95:Event sent
140522:043124 powerd[1026]: I def:battinfo:cap=96%, mAh=1217mAh, volt=4172mV, current=332mA, temp=78F, bp=4172mV, lmd=1270mAh, cycl=0, cyct=0:
140522:043124 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=96:Event sent
140522:043354 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140522:043724 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=98:Event sent
140522:044125 powerd[1026]: I def:battinfo:cap=98%, mAh=1250mAh, volt=4185mV, current=139mA, temp=78F, bp=4185mV, lmd=1270mAh, cycl=0, cyct=0:
140522:044155 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=99:Event sent
140522:044855 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=100:Event sent
140522:045125 powerd[1026]: I def:battinfo:cap=100%, mAh=1267mAh, volt=4191mV, current=72mA, temp=78F, bp=4191mV, lmd=1270mAh, cycl=0, cyct=0:
140522:045956 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=99:Event sent
140522:050126 powerd[1026]: I def:battinfo:cap=99%, mAh=1260mAh, volt=4156mV, current=-107mA, temp=78F, bp=4156mV, lmd=1270mAh, cycl=0, cyct=0:
140522:050656 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=98:Event sent
140522:051126 powerd[1026]: I def:battinfo:cap=98%, mAh=1243mAh, volt=4138mV, current=-106mA, temp=78F, bp=4138mV, lmd=1270mAh, cycl=0, cyct=0:
140522:051357 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140522:052057 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=96:Event sent
140522:052127 powerd[1026]: I def:battinfo:cap=96%, mAh=1225mAh, volt=4122mV, current=-107mA, temp=78F, bp=4122mV, lmd=1270mAh, cycl=0, cyct=0:
140522:052827 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=95:Event sent
140522:052858 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=96:Event sent
140522:052928 powerd[1026]: I def:battinfo:cap=96%, mAh=1217mAh, volt=4172mV, current=325mA, temp=78F, bp=4172mV, lmd=1270mAh, cycl=0, cyct=0:
140522:053158 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140522:053528 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=98:Event sent
140522:053928 powerd[1026]: I def:battinfo:cap=98%, mAh=1250mAh, volt=4185mV, current=137mA, temp=78F, bp=4185mV, lmd=1270mAh, cycl=0, cyct=0:
140522:053958 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=99:Event sent
140522:054729 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=100:Event sent
140522:054929 powerd[1026]: I def:battinfo:cap=100%, mAh=1266mAh, volt=4191mV, current=70mA, temp=78F, bp=4191mV, lmd=1270mAh, cycl=0, cyct=0:
140522:055829 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=99:Event sent
140522:055929 powerd[1026]: I def:battinfo:cap=99%, mAh=1261mAh, volt=4159mV, current=-105mA, temp=78F, bp=4159mV, lmd=1270mAh, cycl=0, cyct=0:
140522:060530 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=98:Event sent
140522:060930 powerd[1026]: I def:battinfo:cap=98%, mAh=1244mAh, volt=4140mV, current=-106mA, temp=78F, bp=4140mV, lmd=1270mAh, cycl=0, cyct=0:
140522:061230 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140522:061930 powerd[1026]: I def:battinfo:cap=96%, mAh=1226mAh, volt=4125mV, current=-106mA, temp=78F, bp=4125mV, lmd=1270mAh, cycl=0, cyct=0:
140522:061931 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=96:Event sent
140522:062731 powerd[1026]: I def:battinfo:cap=96%, mAh=1221mAh, volt=4175mV, current=282mA, temp=78F, bp=4175mV, lmd=1270mAh, cycl=0, cyct=0:
140522:062901 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140522:063231 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=98:Event sent
140522:063732 powerd[1026]: I def:battinfo:cap=99%, mAh=1252mAh, volt=4185mV, current=125mA, temp=78F, bp=4185mV, lmd=1270mAh, cycl=0, cyct=0:
140522:063732 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=99:Event sent
140522:064502 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=100:Event sent
140522:064732 powerd[1026]: I def:battinfo:cap=100%, mAh=1267mAh, volt=4191mV, current=67mA, temp=78F, bp=4191mV, lmd=1270mAh, cycl=0, cyct=0:
140522:065433 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=99:Event sent
140522:065733 powerd[1026]: I def:battinfo:cap=99%, mAh=1258mAh, volt=4154mV, current=-105mA, temp=78F, bp=4154mV, lmd=1270mAh, cycl=0, cyct=0:
140522:070203 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=98:Event sent
140522:233034 powerd[1026]: I def:battinfo:cap=97%, mAh=1230mAh, volt=4143mV, current=-20mA, temp=73F, bp=4143mV, lmd=1270mAh, cycl=0, cyct=0:
140522:233034 powerd[1026]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140522:233157 powerd[1028]: I def:battinfo:cap=97%, mAh=1227mAh, volt=4127mV, current=-57mA, temp=75F, bp=4127mV, lmd=1270mAh, cycl=0, cyct=0:
140522:233157 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140522:233227 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=96:Event sent
140523:112718 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=95:Event sent
140523:113417 powerd[1028]: I def:battinfo:cap=95%, mAh=1206mAh, volt=4119mV, current=-71mA, temp=80F, bp=4119mV, lmd=1270mAh, cycl=0, cyct=0:
140523:114247 powerd[1028]: I def:battinfo:cap=95%, mAh=1201mAh, volt=4122mV, current=-15mA, temp=86F, bp=4122mV, lmd=1270mAh, cycl=0, cyct=0:
140523:114447 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=94:Event sent
140523:143939 powerd[1028]: I def:battinfo:cap=94%, mAh=1196mAh, volt=4114mV, current=-148mA, temp=78F, bp=4114mV, lmd=1270mAh, cycl=0, cyct=0:
140523:144142 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=93:Event sent
140523:144512 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=92:Event sent
140523:144942 powerd[1028]: I def:battinfo:cap=92%, mAh=1175mAh, volt=4101mV, current=-60mA, temp=80F, bp=4101mV, lmd=1270mAh, cycl=0, cyct=0:
140523:171502 powerd[1028]: I def:battinfo:cap=92%, mAh=1170mAh, volt=4101mV, current=-76mA, temp=75F, bp=4101mV, lmd=1270mAh, cycl=0, cyct=0:
140523:172332 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=91:Event sent
140523:172502 powerd[1028]: I def:battinfo:cap=91%, mAh=1160mAh, volt=4093mV, current=-47mA, temp=77F, bp=4093mV, lmd=1270mAh, cycl=0, cyct=0:
140524:165316 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=90:Event sent
140524:165346 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=89:Event sent
140524:194131 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=90:Event sent
140524:194231 powerd[1028]: I def:battinfo:cap=90%, mAh=1145mAh, volt=4146mV, current=355mA, temp=78F, bp=4146mV, lmd=1270mAh, cycl=0, cyct=0:
140524:194331 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=91:Event sent
140524:194601 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=92:Event sent
140524:194831 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=93:Event sent
140524:195101 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=94:Event sent
140524:195231 powerd[1028]: I def:battinfo:cap=94%, mAh=1197mAh, volt=4175mV, current=260mA, temp=80F, bp=4175mV, lmd=1270mAh, cycl=0, cyct=0:
140524:195331 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=95:Event sent
140524:195702 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=96:Event sent
140524:200102 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140524:200232 powerd[1028]: I def:battinfo:cap=97%, mAh=1230mAh, volt=4183mV, current=157mA, temp=80F, bp=4183mV, lmd=1270mAh, cycl=0, cyct=0:
140524:200632 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=98:Event sent
140524:201232 powerd[1028]: I def:battinfo:cap=98%, mAh=1250mAh, volt=4188mV, current=94mA, temp=82F, bp=4188mV, lmd=1270mAh, cycl=0, cyct=0:
140524:201302 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=99:Event sent
140524:202003 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=100:Event sent
140524:202233 powerd[1028]: I def:battinfo:cap=100%, mAh=1270mAh, volt=4191mV, current=55mA, temp=82F, bp=4191mV, lmd=1270mAh, cycl=0, cyct=0:
140524:202703 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=99:Event sent
140524:203233 powerd[1028]: I def:battinfo:cap=99%, mAh=1253mAh, volt=4148mV, current=-107mA, temp=82F, bp=4148mV, lmd=1270mAh, cycl=0, cyct=0:
140524:203403 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=98:Event sent
140524:204134 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140524:204234 powerd[1028]: I def:battinfo:cap=97%, mAh=1235mAh, volt=4132mV, current=-107mA, temp=82F, bp=4132mV, lmd=1270mAh, cycl=0, cyct=0:
140524:204834 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=96:Event sent
140524:205234 powerd[1028]: I def:battinfo:cap=96%, mAh=1218mAh, volt=4117mV, current=-107mA, temp=82F, bp=4117mV, lmd=1270mAh, cycl=0, cyct=0:
140524:205605 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=95:Event sent
140524:205635 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=96:Event sent
140524:205705 powerd[1028]: I def:battinfo:cap=96%, mAh=1216mAh, volt=4169mV, current=325mA, temp=82F, bp=4169mV, lmd=1270mAh, cycl=0, cyct=0:
140524:205935 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140524:210305 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=98:Event sent
140524:210705 powerd[1028]: I def:battinfo:cap=99%, mAh=1250mAh, volt=4185mV, current=141mA, temp=82F, bp=4185mV, lmd=1270mAh, cycl=0, cyct=0:
140524:210705 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=99:Event sent
140524:211406 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=100:Event sent
140524:211706 powerd[1028]: I def:battinfo:cap=100%, mAh=1267mAh, volt=4191mV, current=73mA, temp=82F, bp=4191mV, lmd=1270mAh, cycl=0, cyct=0:
140524:212606 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=99:Event sent
140524:212706 powerd[1028]: I def:battinfo:cap=99%, mAh=1260mAh, volt=4159mV, current=-106mA, temp=82F, bp=4159mV, lmd=1270mAh, cycl=0, cyct=0:
140524:213307 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=98:Event sent
140524:213707 powerd[1028]: I def:battinfo:cap=98%, mAh=1242mAh, volt=4140mV, current=-107mA, temp=82F, bp=4140mV, lmd=1270mAh, cycl=0, cyct=0:
140524:213937 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140524:214637 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=96:Event sent
140524:214707 powerd[1028]: I def:battinfo:cap=96%, mAh=1224mAh, volt=4125mV, current=-107mA, temp=82F, bp=4125mV, lmd=1270mAh, cycl=0, cyct=0:
140524:215038 powerd[1028]: I def:battinfo:cap=96%, mAh=1225mAh, volt=4175mV, current=271mA, temp=82F, bp=4175mV, lmd=1270mAh, cycl=0, cyct=0:
140524:215108 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=97:Event sent
140524:215438 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=98:Event sent
140524:215908 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=99:Event sent
140524:220038 powerd[1028]: I def:battinfo:cap=99%, mAh=1254mAh, volt=4188mV, current=116mA, temp=82F, bp=4188mV, lmd=1270mAh, cycl=0, cyct=0:
140524:220609 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=100:Event sent
140524:221039 powerd[1028]: I def:battinfo:cap=100%, mAh=1269mAh, volt=4191mV, current=60mA, temp=82F, bp=4191mV, lmd=1270mAh, cycl=0, cyct=0:
140524:221639 powerd[1028]: I lipc:evts:name=battLevelChanged, origin=com.lab126.powerd, fparam=99:Event sent
140524:222039 powerd[1028]: I def:battinfo:cap=99%, mAh=1254mAh, volt=4151mV, current=-107mA, temp=82F, bp=4151mV, lmd=1270mAh, cycl=0, cyct=0:
There are 2 kinds of different results that are of interest: the battLevelChanged LIPC event, and a battinfo def (definiton or deferred?)

The former seems pretty regular, reporting the battery status whenever it changes one bit.
But the latter seems about twice less frequent but still regular, showing up about every 10 minutes. I am still unable to identify its source, however.

Last edited by Cykotitan; 05-24-2014 at 06:15 PM.
Cykotitan is offline   Reply With Quote
Old 05-25-2014, 04:16 PM   #64
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
Quote:
Originally Posted by Cykotitan View Post
I would like to be of help, but I'm not sure if there's any other way to get the battery charge reading other than executing gasgauge-info -m. Like I said, it's probably not accessible via lipc properties and you'll have to find a way to get the output of the shell command and then display it in the status bar.

For a start, these posts (1, 2) look promising. I'm just not sure if any more info on this is available, or even source code of a project that has a similar implementation.
Also, I would imagine it would have to be refreshed periodically using a script, because there isn't a such event that would allow automatic updating (as opposed to battLevelChanged which provides the percentage, for instance)
Here is a Lua script (Kindle_Touch_Hacking#LIPC_Lua_bindings) exporting data from file read by gasgauge-info -m as LIPC int property and as periodic LIPC event.
Spoiler:
Code:
require("liblipclua")

------------------------------------------------------------------------------
-- Configuration
------------------------------------------------------------------------------

-- Script registers itself as a LIPC publisher under this name.
local LIPC_PUBLISHER_NAME = "com.example.battery"

-- Battery mAH will be exported through this LIPC int property.
local LIPC_PROPERTY_NAME = "mah"

-- Changed battery mAH value is broadcasted by script as a LIPC event with
-- this name.
-- (Set it to nil to disable event sending.)
local LIPC_EVENT_NAME = "mahChanged"

-- Glob pattern of path to file with data of battery mAH.
--
-- Part of data file path is changed between device models, so real path
-- is found in runtime by glob pattern.
local DATA_FILE_GLOB = "/sys/devices/system/*_battery/*_battery0/battery_mAH"

-- Time period between re-reading data from data file.
local DATA_REFRESH_PERIOD = 1 -- second(s)

------------------------------------------------------------------------------
-- Supporting functions
------------------------------------------------------------------------------

local function exit_with_message(exit_code, message)
  io.stderr:write(message .. "\n")
  io.stderr:flush()
  os.exit(exit_code)
end

-- Call 'ls' command with passed glob pattern and return found path to file.
local function find_file_path (file_glob)
  local cmd = "ls " .. file_glob
  local output, err_message = io.popen(cmd, "r")
  if output == nil then
    error(err_message)
  end
  local file_path = output:read()
  output:close()
  if file_path == nil then
    error("Can't read output of '" .. cmd .. "'")
  elseif file_path:sub(1, 4) == "ls: " then
    error("Can't find file by glob pattern '" .. file_glob .. "'")
  end
  return file_path
end

-- Return number read from first file line.
local function read_number_from_file (file_path)
  local file, err_message = io.open(file_path)
  if file == nil then
    error(err_message)
  end
  local result = file:read("*n")
  file:close()
  if result == nil then
    error("Can't read number from file '" .. file_path .. "'")
  end
  return result
end

------------------------------------------------------------------------------
-- Program setup
------------------------------------------------------------------------------

local data_file_found, data_file_path = pcall(find_file_path, DATA_FILE_GLOB)
if not data_file_found then
  exit_with_message(1, data_file_path)
end

local lipc_handle, lipc_err_msg, lipc_err_num = lipc.init(LIPC_PUBLISHER_NAME)
if not lipc_handle then
  exit_wit_message(
    lipc_err_num,
    "Failed to initialize LIPC: ("
    .. tostring(lipc_err_num) .. ") "
    .. lipc_err_msg)
else
  lipc.set_error_handler(function(msg) io.stderr:write(msg .. "\n") end)
end

local mah_property = lipc_handle:register_int_property(LIPC_PROPERTY_NAME, "r")

------------------------------------------------------------------------------
-- Main loop
------------------------------------------------------------------------------

local mah_value_read_ok, mah_value, prev_mah_value
while true do
  -- Read current battery mAH value.
  mah_value_read_ok, mah_value = pcall(read_number_from_file, data_file_path)
  if not mah_value_read_ok then
    lipc_handle:close()
    exit_with_message(1, mah_value)
  end
  -- Set LIPC property value.
  mah_property.value = mah_value
  -- Send LIPC event when value is changed.
  if LIPC_EVENT_NAME ~= nil and mah_value ~= prev_mah_value then
    lipc_handle:send_event(LIPC_EVENT_NAME, {mah_value})
    prev_mah_value = mah_value
  end
  -- Use event loop timeout as a pause duration.
  lipc.run_event_loop(DATA_REFRESH_PERIOD)
end
lipc_handle:close()

EDIT: Mesquite (aka WAF) and Pillow have different capabilities, so your links (about WAF) aren't applicable to script from this topic.

Last edited by eureka; 05-26-2014 at 10:41 AM. Reason: script fix
eureka is offline   Reply With Quote
Old 05-27-2014, 12:27 PM   #65
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Notes:
The library that underlies liblipclua and liblipc is libev (a bastardized variety of libevent) - -
http://software.schmorp.de/pkg/libev.html

Just dial this back to the rel-3.0 tag (if this link isn't already 3.0):
http://cvs.schmorp.de/libev/?pathrev=rel-3_0

[[ cvs?, yup, cvs ]]

Edit:
And there is a Lua binding to libev:
https://github.com/brimworks/lua-ev

Disclaimer:
Since the Lua binding is about two years newer than the release of libev on the PW1 firmware in front of me, I don't know if it will work "as is" with the older libev.

Last edited by knc1; 05-27-2014 at 04:02 PM.
knc1 is offline   Reply With Quote
Advert
Old 06-07-2015, 02:34 AM   #66
Cycloph
Junior Member
Cycloph began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jun 2015
Device: Kindle Paperwhite
Guys! Do you have this program for Paperwhite installer?
Cycloph is offline   Reply With Quote
Old 06-07-2015, 03:23 AM   #67
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Are you jailbroken? Is KUAL installed? Does the attachment in the first post not work?
eschwartz is offline   Reply With Quote
Old 06-07-2015, 07:52 AM   #68
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by Cycloph View Post
Guys! Do you have this program for Paperwhite installer?
No changes to any of the packages are required for use with the MR Package Installer.
That is, if the package required "installation" - I.E: was in the update_*.bin format.

- - - - -

Note:
This program is one of those which does not require "installation" - it is a KUAL extension.

- - - - -

How did you try to install this package and what where the results?
Please be as exact as possible.

Last edited by knc1; 06-07-2015 at 07:54 AM.
knc1 is offline   Reply With Quote
Old 06-08-2015, 08:33 AM   #69
nick-tech
Enthusiast
nick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned off
 
Posts: 46
Karma: 97694
Join Date: Feb 2012
Device: kindle touch
Hello,

for more than 3 years I've been powering my kindle through a built-in solar cell, it hasn't been charged through a charger since then.
https://www.mobileread.com/forums/sho...d.php?t=182872

I tried to get your app to also show the charge/discharge rate, but could not get it working. Is there an easy way to do it?
nick-tech is offline   Reply With Quote
Old 06-08-2015, 12:01 PM   #70
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@nick-tech: The BatteryStatus KUAL extension prints most everything you'll ever want to know about the battery... well... status .
NiLuJe is offline   Reply With Quote
Old 06-08-2015, 06:14 PM   #71
nick-tech
Enthusiast
nick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned offnick-tech can read ebooks with the screen turned off
 
Posts: 46
Karma: 97694
Join Date: Feb 2012
Device: kindle touch
Thank you NiJuLe for your quick response. It's almost what I want, but i'd like to see the charge/discharge rate permanently in the status bar, just like the charge percentage. Is there a way to get that working?

One update per minute would be enougch, e.g. together with the clock...

Last edited by nick-tech; 06-08-2015 at 06:18 PM.
nick-tech is offline   Reply With Quote
Old 06-08-2015, 11:16 PM   #72
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@nick-tech: AFAIK, no, the battery drain isn't available over lipc, which is the only thing we can use in the mesquite UI (or is it? it's readable in sysfs, FWIW).

That, and not quite sure how/when said display is even updated (every minute? every battery level change?).

Plus, the drain info takes more characters than the simple % value, so you'd have to jump through some extra hoops on the display front.

Last edited by NiLuJe; 06-08-2015 at 11:21 PM.
NiLuJe is offline   Reply With Quote
Old 06-09-2015, 08:59 AM   #73
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
@nick-tech, @NiLuJe, exporting values from sysfs as LIPC properties/events could be done with Lua.

What is the name of sysfs file? How value should be displayed? As a number?

EDIT: I see, it must be output of gasgauge-info -l, sysfs file is located at /sys/devices/system/*_battery/*_battery0/battery_current and value is like -162 mA or 112 mA. Right?

Last edited by eureka; 06-09-2015 at 09:06 AM.
eureka is offline   Reply With Quote
Old 06-09-2015, 11:29 PM   #74
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@eureka: Yup, that's the one .
NiLuJe is offline   Reply With Quote
Old 06-11-2015, 01:17 AM   #75
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
Quote:
Originally Posted by nick-tech View Post
Thank you NiJuLe for your quick response. It's almost what I want, but i'd like to see the charge/discharge rate permanently in the status bar, just like the charge percentage. Is there a way to get that working?
Here are three files.

/etc/init/battery_current_indicator.conf
Spoiler:
Code:
# Copyright © 2015  eureka
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

start on started pillow
stop on stopping pillow

pre-start script
  # Wait for pillow on 'started pillow' event.
  if [ "x${JOB}" == "xpillow" -a "x${UPSTART_EVENTS}" == "xstarted" ]; then
    lipc-wait-event com.lab126.pillow stateChange
    sleep 2
  fi
end script

post-start exec /bin/sh /var/local/battery_current/battery_current_indicator.sh enable

pre-stop exec /bin/sh /var/local/battery_current/battery_current_indicator.sh disable

exec /usr/bin/lua /var/local/battery_current/battery_current_lipc_publisher.lua

/var/local/battery_current/battery_current_indicator.sh
Spoiler:
Code:
#!/bin/sh

# Copyright © 2015  eureka
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

# Format given standard input (remove newlines and escape double quotes)
# for using it in JSON message passed to lipc-set-prop.
format_js_script () {
  local line
  local js_script

  while IFS="" read -r line; do js_script="${js_script}${line}"; done

  echo "${js_script}" | sed -e 's,",\\",g'
}

[ "x${1}" = "xdisable" ] && ENABLE_INDICATOR=false || ENABLE_INDICATOR=true

# Construct JavaScript code executed in context of Pillow container.
# It's glued into one big line (newlines are removed), so syntax semicolons
# are required and any comments must be block comments (not line comments).
SCRIPT=`format_js_script << 'JAVASCRIPT' \
        | sed -e "s/__ENABLE_INDICATOR__/${ENABLE_INDICATOR}/"
  /* JavaScript code begins here. */
  (function () {
    var _enableIndicator = __ENABLE_INDICATOR__,
        _originalEventsCallback = StatusBar && StatusBar.eventsCallback,
        _batteryIconId = BatteryState.batteryIconDiv,
        _batteryIconEl = _batteryIconId
                         && document.getElementById(_batteryIconId),
        _batteryCurrentId = "batteryCurrent",
        _batteryCurrentEl = document.getElementById(_batteryCurrentId);

    /* Stock battery icon element not found or LIPC events handler function is
     * not defined under expected name, return immediately. */
    if (!_batteryIconEl || !_originalEventsCallback) {
      return;
    }

    /* Custom element displaying battery current already present in DOM.
     * Either return early if disabling was not requested or execute
     * disabling procedures and then return.
     */
    if (_batteryCurrentEl !== null) {
      if (_enableIndicator) {
        return;
      }
      _batteryCurrentEl.parentNode.removeChild(_batteryCurrentEl);
      return;
    }

    /* Setup element for displaying battery current. */
    _batteryCurrentEl = document.createElement("div");
    _batteryCurrentEl.id = _batteryCurrentId;
    _batteryCurrentEl.style.paddingTop = "2pt";
    _batteryCurrentEl.style.paddingRight = "3pt";
    _batteryCurrentEl.textContent = "_ mA";

    /* It is not possible to unsubscribe from LIPC event in Pillow container
     * (or, at least, I did not find a way to do it).
     *
     * Here part of event handler is attached to 'window' object. It is
     * persisted between disabling and enabling indicator and shows that
     * subscribing was already done.
     */
    if (typeof window.__updateBatteryCurrent__ !== "function") {
      window.__updateBatteryCurrent__ = function (batteryCurrentValue) {
        var batteryCurrentEl = document.getElementById(_batteryCurrentId);

        if (batteryCurrentEl === null) {
          /* Indicator was disabled. */
          return;
        }

        batteryCurrentEl.textContent =
          batteryCurrentValue
          ? (batteryCurrentValue + " mA")
          : "? ma";
      };

      StatusBar.eventsCallback = function (eventDataJson) {
        var eventData = JSON.parse(eventDataJson),
            eventSrcOk =
              eventData
              && (eventData.eventSrc === "com.example.batterycurrent"),
            eventNameOk =
              eventData
              && (eventData.eventName === "currentChanged"),
            eventValues = eventData && eventData.eventValues;

        if (eventSrcOk && eventNameOk && eventValues) {
          window.__updateBatteryCurrent__(eventValues[0]);
        }

        _originalEventsCallback(eventDataJson);
      };

      nativeBridge.registerEventsWatchCallback(StatusBar.eventsCallback);
      nativeBridge.subscribeToEvent(
        "com.example.batterycurrent",
        "currentChanged"
      );
    }

    /* Insert battery current element left of stock battery icon. */
    _batteryIconEl.parentNode.insertBefore(_batteryCurrentEl, _batteryIconEl);

    /* Get initial battery current value and display it. */
    window.__updateBatteryCurrent__(nativeBridge.getIntLipcProperty(
      "com.example.batterycurrent",
      "ma"
    ));
  })();
  /* JavaScript code ends here. */
`

MESSAGE='{
  "pillowId": "default_status_bar",
  "function": "'${SCRIPT}'"
}'

lipc-set-prop -s com.lab126.pillow interrogatePillow "${MESSAGE}"

/var/local/battery_current/battery_current_lipc_publisher.lua
Spoiler:
Code:
#!/usr/bin/lua

-- Copyright © 2015  eureka
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the "Software"),
-- to deal in the Software without restriction, including without limitation
-- the rights to use, copy, modify, merge, publish, distribute, sublicense,
-- and/or sell copies of the Software, and to permit persons to whom the
-- Software is furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-- DEALINGS IN THE SOFTWARE.

require("liblipclua")

------------------------------------------------------------------------------
-- Configuration
------------------------------------------------------------------------------

-- Script registers itself as a LIPC publisher under this name.
local LIPC_PUBLISHER_NAME = "com.example.batterycurrent"

-- Battery current will be exported through this LIPC int property.
local LIPC_PROPERTY_NAME = "ma"

-- Changed battery current value is broadcasted by script as a LIPC event with
-- this name.
-- (Set it to nil to disable event sending.)
local LIPC_EVENT_NAME = "currentChanged"

-- Glob pattern of path to file with data of battery current.
--
-- Part of data file path is changed between device models, so real path
-- is found in runtime by glob pattern.
local DATA_FILE_GLOB = "/sys/devices/system/*_battery/*_battery0/battery_current"

-- Time period between re-reading data from data file.
local DATA_REFRESH_PERIOD = 1 -- second(s)

------------------------------------------------------------------------------
-- Supporting functions
------------------------------------------------------------------------------

local function exit_with_message(exit_code, message)
  io.stderr:write(message .. "\n")
  io.stderr:flush()
  os.exit(exit_code)
end

-- Call 'ls' command with passed glob pattern and return found path to file.
local function find_file_path (file_glob)
  local cmd = "ls " .. file_glob
  local output, err_message = io.popen(cmd, "r")
  if output == nil then
    error(err_message)
  end
  local file_path = output:read()
  output:close()
  if file_path == nil then
    error("Can't read output of '" .. cmd .. "'")
  elseif file_path:sub(1, 4) == "ls: " then
    error("Can't find file by glob pattern '" .. file_glob .. "'")
  end
  return file_path
end

-- Return battery current value read from first file line.
local function read_current_from_file (file_path)
  local file, err_message = io.open(file_path)
  if file == nil then
    error(err_message)
  end
  local result = file:read("*n")
  file:close()
  if result == nil then
    error("Can't read number from file '" .. file_path .. "'")
  end
  return result
end

------------------------------------------------------------------------------
-- Program setup
------------------------------------------------------------------------------

local data_file_found, data_file_path = pcall(find_file_path, DATA_FILE_GLOB)
if not data_file_found then
  exit_with_message(1, data_file_path)
end

local lipc_handle, lipc_err_msg, lipc_err_num = lipc.init(LIPC_PUBLISHER_NAME)
if not lipc_handle then
  exit_wit_message(
    lipc_err_num,
    "Failed to initialize LIPC: ("
    .. tostring(lipc_err_num) .. ") "
    .. lipc_err_msg)
else
  lipc.set_error_handler(function(msg) io.stderr:write(msg .. "\n") end)
end

local ma_property = lipc_handle:register_int_property(LIPC_PROPERTY_NAME, "r")

------------------------------------------------------------------------------
-- Main loop
------------------------------------------------------------------------------

local ma_value_read_ok, ma_value, prev_ma_value
while true do
  -- Read battery current value.
  ma_value_read_ok, ma_value = pcall(read_current_from_file, data_file_path)
  if not ma_value_read_ok then
    lipc_handle:close()
    exit_with_message(1, ma_value)
  end
  -- Set LIPC property value.
  ma_property.value = ma_value
  -- Send LIPC event when value is changed.
  if LIPC_EVENT_NAME ~= nil and ma_value ~= prev_ma_value then
    lipc_handle:send_event(LIPC_EVENT_NAME, {ma_value})
    prev_ma_value = ma_value
  end
  -- Use event loop timeout as a pause duration.
  lipc.run_event_loop(DATA_REFRESH_PERIOD)
end
lipc_handle:close()

Put them on their paths. Then indicator could be enabled with start battery_current_indicator or disabled with stop battery_current_indicator. It will also be enabled automatically on pillow (re)start (i.e. on reboot too).

Battery current will be displayed as 78 mA or -98 mA left of stock battery icon in status bar. Sysfs value will be continuously polled in intervals of 1 second and status bar indicator will be refreshed on value change.

It was tested on Kindle Touch 5.3.7.2.

Last edited by eureka; 06-11-2015 at 01:33 AM. Reason: sysfs value isn't watched in realtime, but polled in small intervals
eureka is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
support for IBM/360/370/S-390 code on the Kindles (KUAL) knc1 Kindle Developer's Corner 63 01-08-2014 06:02 PM
Bible app for e-ink Kindles (Kindle Active Content) draytonbenner Self-Promotions by Authors and Publishers 0 10-18-2012 10:23 AM
iPad Amazon’s Kindle iOS app now ready for the new iPad’s Retina*Display monkeyluis Apple Devices 9 03-18-2012 08:27 PM
A tray app for Calibre ? thomass Calibre 3 08-21-2011 05:19 PM
So is the Iliad really production ready and is the market ready for e-readers? pdam iRex 28 09-14-2006 05:24 PM


All times are GMT -4. The time now is 02:00 PM.


MobileRead.com is a privately owned, operated and funded community.