Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic shutdown on idle #1647

Open
wants to merge 35 commits into
base: dev
Choose a base branch
from

Conversation

SHxKenzuto
Copy link

@SHxKenzuto SHxKenzuto commented Aug 23, 2022

What's new

  • Added an option under [Settings->Power] that allows Flipper to be automatically turned off after a certain amount of time has passed without input from user ( the options are 15min, 30min, 1h, 2h, 6h, 12h, 24h, 48h).

Verification

  • A submenu named [Shutdown on Idle] has been added under [Settings->Power]. Under that submenu is possible to set how long Flipper will be idle before shutting off on his own and to turn off this feature.

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

Copy link
Member

@hedger hedger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please format code with clang-format

@SHxKenzuto SHxKenzuto requested a review from hedger August 23, 2022 21:34
hedger
hedger previously approved these changes Aug 23, 2022
Copy link
Member

@hedger hedger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but introducing a new file in /int will take up at least 4Kb of internal storage - and we're running short on it for debug builds.
We'll discuss this feature internally and may merge it after releasing v.0.65.

@hedger hedger added UI Affects UI New Feature Contains an IMPLEMENTATION of a new feature Core+Services HAL, furi & core system services labels Aug 23, 2022
@digitalcircuit
Copy link
Contributor

@hedger

Looks good to me, but introducing a new file in /int will take up at least 4Kb of internal storage - and we're running short on it for debug builds. We'll discuss this feature internally and may merge it after releasing v.0.65.

Good to know this. I've been looking at adding a setting to the Power application for optionally limiting the battery charging voltage, and that would've required creating a new /int file as well.

If this idle shutdown PR gets merged, I can base my battery charge limit configuration efforts atop this so there will be two settings stored in /int/.power.settings, not just one. That might make the 4 Kb minimum filesystem cost more palatable?

@azaitsev
Copy link

azaitsev commented Sep 7, 2022

Hi flipper team, how about to merge this? We are at 0.66 already.

@skotopes
Copy link
Member

skotopes commented Sep 7, 2022

Hi @azaitsev, will be included in next release. Sorry for delay.

@skotopes
Copy link
Member

@SHxKenzuto May I ask you to merge dev?

@SHxKenzuto
Copy link
Author

@SHxKenzuto May I ask you to merge dev?

Ok, doing it right now

@SHxKenzuto
Copy link
Author

@skotopes merge completed

@skotopes
Copy link
Member

Thanks. This RC is already packed with more features than our QA can test, so I'll merge it after this release.

@skotopes
Copy link
Member

I need more time with this code, moving to next release.

@Ethanol0001
Copy link
Contributor

I think the next priority it making sure the butthurt_max xp system works off of what the clock app runs off of. Ive had issues with the butthurt_max xp not resetting properly if you turn off the flipper fully instead of locking it. If we do that, it would make this feature much more favorable in terms of preserving power by shutting it off after some time.

@Ethanol0001
Copy link
Contributor

Otherwise I think this option in the settings to auto-shutoff would be very useful if the butthurt thing resets when the battery isnt under regular load

@digitalcircuit
Copy link
Contributor

Considering the recent success of a deeper power-saving mode for the Flipper for 1 month of idle time, I think the selectable auto-shutdown delays could be adjusted.

Instead of… {"OFF", "15min", "30min", "1h", "2h", "6h", "12h", "24h", "48h"}

Perhaps… {"OFF", "1h", "2h", "6h", "12h", "24h", "48h", "1wk", "2wk"}, or similar.

Alternatively, if auto-off is no longer desired, I'd still like to make use of the Power app's settings code to add the configurable battery charge voltage limit - which with longer idle time reduces the risk of someone overdischarging.

@skotopes skotopes requested a review from nminaylov as a code owner September 1, 2023 06:12
@digitalcircuit
Copy link
Contributor

Seeing the recent dev merge commits, I'm happy to help with retesting or other things to get this refined and merged.

I'm still both interested in auto-shutdown (especially if increasing the upper bound, so the Flipper shuts off after a week of not interacting with it), and in the Power application having a settings file (to build charge voltage limit settings on top of).

@skotopes
Copy link
Member

skotopes commented Sep 8, 2023

@digitalcircuit I'm currently refactoring power service, I'll update this PR and then merge it.

@skotopes skotopes requested a review from gsurkov as a code owner June 11, 2024 15:32
@skorokithakis
Copy link

Could this please be merged? Currently I'm finding myself in the fairly risky situation of forgetting to use my Flipper for a while and finding my battery depleted, which lithium batteries don't like. This would ensure that an idle flipper wouldn't be at risk of killing its battery.

@skotopes
Copy link
Member

skotopes commented Jun 13, 2024

Could this please be merged? Currently I'm finding myself in the fairly risky situation of forgetting to use my Flipper for a while and finding my battery depleted, which lithium batteries don't like. This would ensure that an idle flipper wouldn't be at risk of killing its battery.

Flipper will shut down itself when battery reaches 3.3V also there is a second battery protection circuit that will disconnect battery from the flipper when battery depleted below ~2.8V. Chances of killing battery is completely discharging it are quite small.

Anyway, I hear you. This PR was in a limbo for a long time, I'll allocate time to refactor power service and merge this PR in next release.

@skorokithakis
Copy link

Thanks, it's good to know my Flipper won't die! Still, it would be nice to leave it semi-charged and know I can pick it up and use it months later, without needing a charge.

@digitalcircuit
Copy link
Contributor

digitalcircuit commented Jun 14, 2024

I am still interested in the Power app gaining support for persistent settings, too - I haven't forgotten about the charge limiting feature that doesn't (yet!) have a GUI to control it.

Thank you for not giving up on this, and definitely understood on having had other priorities.

EDIT: Details on charge voltage limiting here: #1158 (comment)

@skorokithakis
Copy link

@digitalcircuit there's charge limiting? How do I enable it?

@ase1590
Copy link

ase1590 commented Aug 15, 2024

Exciting to see that the auto shutdown has not been forgotten or outright abandoned/rejected

@skotopes
Copy link
Member

@ase1590 nope, It's still here. Also power service refactoring is coming, so we should endup merging this PR after that. At least all pre-requirements are in place

@askoriy
Copy link

askoriy commented Aug 28, 2024

@skotopes Hope you haven't forgotten about it. After the FuriEventLoop refactoring, it's hard to simply rebase this patch and make it work

@skotopes
Copy link
Member

@askoriy nope

@skorokithakis
Copy link

Is there any news on this? I know it needs a lot of development, but it would be a really good QoL improvement for people who don't use their Flipper often.

@skotopes
Copy link
Member

@skorokithakis it was waiting for new event driven power service, it can be merged now. If someone will update it.

@UnifiedArray
Copy link

Please merge! Been waiting for this for close to 2 yrs 🙏

@azaitsev
Copy link

Please merge! Been waiting for this for close to 2 yrs 🙏

image

@UnifiedArray
Copy link

Please merge! Been waiting for this for close to 2 yrs 🙏

image

Have you been given any information about why it's being held up

@skorokithakis
Copy link

As per this thread, the PR needs to be updated to the new power service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core+Services HAL, furi & core system services New Feature Contains an IMPLEMENTATION of a new feature UI Affects UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.