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-06-2023, 10:54 AM   #1
doug.harriman
Junior Member
doug.harriman began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2023
Device: Kindle Paperwhite 1
Question PW gasgauge-info not updating

I have a PW1 that I've got running a simple loop to:

- Read battery charge & temperaturature with gasgauge-info (-s and -k)
- Post that info to a server
- Download an image from the server (weather, calendare and battery info)
- Display image
- Go to sleep for 15 min.

Wake time scheduled with rtcwake, then it goes to sleep:

rtcwake -d /dev/rtc1 -m no -s 90
echo "mem" /sys/power/state

The odd thing is that the gasgauge-info data does not usually update. Every once and a while it does, but it's totally inconsistent in the loop described above.

Whenever I ssh into the Kindle, gasgauge-info works perfectly.

Looking for guidance on how to get reliable gasgauge-info data in the looping situation.
doug.harriman is offline   Reply With Quote
Old 05-06-2023, 12:18 PM   #2
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: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Try not using it and checking the sysfs entry directly?

Also, it's unclear if you're actually seeing stale data from gasgauge-info itself, or stale data at the end of your custom pipeline, because, if it's the latter, the fault may lie somewhere in there, too .
NiLuJe is offline   Reply With Quote
Old 05-06-2023, 01:46 PM   #3
doug.harriman
Junior Member
doug.harriman began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2023
Device: Kindle Paperwhite 1
NiLuJe - Thanks for the response. Good thoughts, but unfortunately, I don't think it's either of those issues.

- I've run the system querying battery info from both gasgauge-info and directly from sysfs. Both exhibit exactly the same behavior.

- I'm running the process in a tmux window on the Kindle, and echoing out the battery info. When I reconnect, I can see previous reads, and they're not changing. Battery state should be moving slowly, but I've got an external thermometer, and the temperature is not tracking. If I stop the process, then run read the temperature (either method) I get the correct value. Literally can read it one second after it ran via the script and the value will change 5 degrees. So that confirms that it's on the Kindle side.

I've attached the shell script I'm running just in case that's of interest.

Thanks for the help!
Attached Files
File Type: txt update.sh.txt (2.4 KB, 137 views)
doug.harriman is offline   Reply With Quote
Old 05-07-2023, 05:31 PM   #4
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: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Quote:
Originally Posted by doug.harriman View Post
I can see previous reads
Does this mean you're not seeing new reads *at all*, or that new reads report stale data?
NiLuJe is offline   Reply With Quote
Old 05-07-2023, 05:36 PM   #5
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: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Sidebar: switching to powersave before entering suspend is meaningless, the CPUFreq governor is irrelevant in standby/suspend.

(In fact, for interactive use-cases, there's a strong case to be made for actually switching to *performance* before suspend, as on some SoCs, this will allow the device to actually enter suspend faster, as well as resume faster, too. That does imply setting it back to a more reasonable governor post-resume, though ).

----

As for the actual issue, if you're actually seeing stale *new* reads, I could somewhat understand PM screwing with it for a while, but it *should* eventually automatically jog itself back into shape :?

EDIT: i.e., I'd try polling after a much larger delay on wakeup (and/or a couple of tries).

Last edited by NiLuJe; 05-07-2023 at 05:41 PM.
NiLuJe is offline   Reply With Quote
Old 05-08-2023, 10:41 AM   #6
doug.harriman
Junior Member
doug.harriman began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2023
Device: Kindle Paperwhite 1
Thanks for the info on the power management, I'll make that update.

When I run the script, the first read works successfully and there's good data. After that, the data is stale. Except, every so often it will update correctly. Those updates are inconsistent and may be hours or days between data updates.
doug.harriman is offline   Reply With Quote
Old 10-24-2023, 10:42 AM   #7
doug.harriman
Junior Member
doug.harriman began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2023
Device: Kindle Paperwhite 1
Circling back to this. I've found that if I add some delays when the system wakes up from sleep that I can reliably get good data back. If I try to minimize wake time, I do not get updated data. Waits are on the order of 3-10 seconds to get updated data.
doug.harriman is offline   Reply With Quote
Old 10-24-2023, 02:25 PM   #8
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: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Yup, welcome to the joy & mysteries of weird PM things ;o).
NiLuJe is offline   Reply With Quote
Reply

Tags
gasgauge, pw1, rtcwake, sleep


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Marking a book as Read/Finished in Calibre and updating info on Kobo lealla Devices 2 08-14-2018 08:08 PM
Do I lose data / info after updating? MacBook asks if I want to replace Calibre misschienwel Library Management 2 07-22-2018 03:50 PM
PRS-T2 Show actual book info when clicking "book info" naval Sony Reader 7 07-02-2013 10:49 AM
Updating Meta Data/Info of book on Kindle AutumnDreamer Calibre 5 07-24-2010 05:00 PM


All times are GMT -4. The time now is 04:00 AM.


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