![]() |
#1 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Apr 2023
Device: Kindle Paperwhite 1
|
![]()
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. |
![]() |
![]() |
![]() |
#2 |
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
|
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 ![]() |
![]() |
![]() |
![]() |
#3 |
Junior Member
![]() 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! |
![]() |
![]() |
![]() |
#4 |
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
|
|
![]() |
![]() |
![]() |
#5 |
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
|
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. |
![]() |
![]() |
![]() |
#6 |
Junior Member
![]() 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. |
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() 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.
|
![]() |
![]() |
![]() |
#8 |
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
|
Yup, welcome to the joy & mysteries of weird PM things ;o).
|
![]() |
![]() |
![]() |
Tags |
gasgauge, pw1, rtcwake, sleep |
|
![]() |
||||
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 |