koreader / koreader

An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices
http://koreader.rocks/
GNU Affero General Public License v3.0
16.62k stars 1.26k forks source link

Automatic Power Off #3806

Closed lhannest closed 5 years ago

lhannest commented 6 years ago

This is a feature request.

Backstory: I put my Kobo into sleep mode one night a little while back at forty-something-percent battery, and came back to it in the morning with the battery drained. As far as I know this is really bad for the battery, and I'm annoyed that this happened with a brand new device. Until this bug (#3706) gets fixed, there should be an automatic power off feature to prevent massive battery drainage.

The user should be able to define a threshold after which the device will attempt to automatically power down. Before actually powering down it should prompt the user to disable the feature, then powering down if the user does not respond after some time.

cramoisi commented 6 years ago

The fact is : there is one. The kobo goes to sleep after 60 minutes of inactivity. But that's the problem : for inactivity to be registered, it need to be inactivity.

Anyway, you could help gather infos about this. What about putting your kobo in debug mode ( "debug" = true, to your settings.reader.lua ) and adding a log as described there ? Perhaps you could describe your settings too ? (wifi enabled ? sleepcover ? )

For letting it sleeps overnight, I noticed I don't have the problem if there's no sleepcover and nothing touching the screen while it sleeps. (There is also the temporary solution to power it off when unused)

AlanSP1 commented 6 years ago

@cramoisi I think he thinks powering off, i.e. completely powering device off, not sleep mode.

It can be useful, sometimes we don't use our device for days and then could be useful it powers itself off.

cramoisi commented 6 years ago

@AlanSP1 yup you're right. I miss the point because the bug is related to sleep...

Frenzie commented 6 years ago

It can be useful, sometimes we don't use our device for days and then could be useful it powers itself off.

Disagree, battery drain in sleep is pretty minimal even after weeks. Besides, how would the device know I'm not going to use it tomorrow? If it did more than sleep I'd just get annoyed. But that aside. Are we sure this isn't already an option in principle? :-P

But sure, as a last resort someone could write an addition that says if we're still not sleeping after 2*sleep period then shutdown. Although one might argue that if you can write that you can probably debug and solve whatever the problem is. :-)

AlanSP1 commented 6 years ago

I looked at it from @lhannest perspective, and it can be useful if our reading habits are that we read a lot in certain periods, and don't read at all in different periods.

From battery drain perspective, there's small difference between sleep and power off, but there is difference. I think that my H2O can be in sleep about 40 days (if sleep works as it should), but can be powered off at least 6-7 months and have some battery for reading.

On the other hand, I think the biggest problem is having sleep that can go "off" on us and drain battery. Lately it doesn't happen that often on my device, but I understand frustration when it happens, as it happened to me sometime before.

On the other hand, having deep cycles is bad for battery if we have them all the time (deep cycle is spending battery from 100-0, or as close to 0 as we can get). But, from time to time it is good to have one or two deep cycles.

Depleting battery shouldn't be a problem as battery has protection from depleting irreversibly. If something goes wrong, it was some hardware problem. This to address worries of @lhannest about destroying battery too soon.

Frenzie commented 6 years ago

@lhannest

I put my Kobo into sleep mode one night a little while back at forty-something-percent battery, and came back to it in the morning with the battery drained.

Btw, are you sure Nickel doesn't do this? My H2O might last for about two months of sleeping + reading but when the battery indicator drops below 40% it's code for "I might not wake up tomorow". The battery level as indicated goes something like 100, 90, 90, 80, 80, 70, 60, 50, 40, 40, dead. On my H2O you can basically regard 50% as a low battery warning. It's been like that since it was new.

AlanSP1 commented 6 years ago

Just to add to this, I wait about 40% to start charging battery. After that, I could have maybe 2-3 days, but it is maybe, so I charge it around 40%. So it is also may be a serious factor to consider and koreader may not be guilty party here.

cramoisi commented 6 years ago

@Frenzie I'm sure nickel doesn't deplete the battery on sleepmode (but neither koreader : (from my experience) it doesn't happen when nothing touch the screen or if you wait for 1 min before closing the sleepcover, so the bug could easily be bypassed). For the 40% thing, I can't really say cause I always plug it for the night if it's bedtime and it's less than 50%)

Frenzie commented 6 years ago

@cramoisi I was talking about the analysis of the problem. If it's 40%=empty like on mine then going from 40% to dead isn't indicative of anything. Nickel or KOReader doesn't matter there.

cramoisi commented 6 years ago

@Frenzie how can we check that ?

Frenzie commented 6 years ago

The not sleeping issue is definitely real. I mean very specifically the situation sketched by the OP. If you want to find out the lowest percentage your battery will display I would write it to a timestamped log every ten minutes or so.

cramoisi commented 6 years ago

boring :-P (it could be done easily with ksm (done) but that's not really the issue)

cramoisi commented 6 years ago

ok #3706 is closed thanks to Frenzie (and not thanks to me for didn't gathering data and saying it sooner)

lhannest commented 6 years ago

Thank you all for commenting, I wasn't expecting such a quick response! It's great that #3706 was fixed, though I still think this feature would be valuable. The long battery life is the major reason why I bought an e-reader, and having features to protect that battery life from human error seems like a good idea.

@Frenzie I agree that this should not be default behavior, but it should be behavior that the user can enable if they wish. I don't think anyone will be annoyed by a feature they choose to enable, and if they are then they can just turn it back off.

I have barely used the Nickel software (I only read PDF's, which Nickel handles terribly), but you're probably right. I'm not necessarily saying that this is a bug with KOReader. Whether or not this pattern of battery discharge is expected behavior, I still think an automatic power off feature would be really useful. I would set my device to power off automatically at 40%, then.

@AlanSP1 I don't think it's ever good to have a deep discharge of Lithium batteries. (I think it was the old school nickel batteries where this was a fine practice from time to time). With other devices I've used in the past, I've noticed that lifespan goes down drastically with enough deep discharges. So while it wont completely destroy the battery, it does do harm.

But yes, your use case here is a good example. I might also sometimes go 40 days or two months or longer without using my device. It would be nice to be know that the device will automatically power off if the battery goes lower than some threshold, like 25% or 40%. I would never intentionally plan to not use a device, rather I'd just get busy and forget about it for some time. So if I were to not use my device for a prolonged period of time it's likely that I would not turn it off first.

AlanSP1 commented 6 years ago

I was actually talking about deep cycles, which isn't the same as completely discharging batteries. Completely discharging is (or at least it should be) prevented by battery software and is outside of control by devices' control.

If intermittent deep cycles are good or not, well, let each of us decide it for ourselves. I think that they are good (they enable both device and battery to know battery limits), but of course I think that each of us should decide for themselves when to charge their device.

Frenzie commented 6 years ago

@lhannest I'm not saying I would block it or anything. It sounds like a logical enough extension of autosuspend. But unless you can manage to pique @Hzj-jie 's interest it's a matter of PRs welcome. ;-)

It would be nice to be know that the device will automatically power off if the battery goes lower than some threshold, like 25% or 40%.

That's impossible I'm afraid. It can't say "oh, I think I should turn off now" after three months of sleep unless the hardware does so independently. We have no control over what happens during sleep. That's why it's sleep. If it were possible it'd make perfect sense of course. One hour autosleep, one week autoshutdown.

But yes, your use case here is a good example. I might also sometimes go 40 days or two months or longer without using my device.

I didn't say turning off the device is a bad idea in and of itself, although I don't see much point to it. With regular use easily surpassing a month, basically about two months, and just sleep surpassing three months I'd be disinclined to wait for 30 seconds of what I might add is 30 seconds of heavy battery drain. It must be the equivalent of turning dozens of pages. If I knew I wasn't going to use it for three months I'd turn it off, but otherwise it just seems annoying.

Frenzie commented 5 years ago

I was just in Nickel and I noticed it said 11 % battery, which surprised me because I've never seen such a low value. (Nickel failed to suspend properly so it drained all of my battery overnight.) I then went to KOReader and it said 31 % as reported by hardware. So Nickel performs some kind of corrective calculations to show a percentage that's more meaningful to the user.

NiLuJe commented 5 years ago

Was there a reboot involved in the switch? I've never seen nickel differ from sysfs, but I gave seen sysfs jump wildly after a reboot...

Frenzie commented 5 years ago

Nope, just direct exit to KSM, start KOReader.