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

PiSugarSButtonActive.sh and safe shutdown on S plus? #61

Open
RedStonesparrow opened this issue Apr 13, 2022 · 2 comments
Open

PiSugarSButtonActive.sh and safe shutdown on S plus? #61

RedStonesparrow opened this issue Apr 13, 2022 · 2 comments

Comments

@RedStonesparrow
Copy link

having trouble figuring out what i need to download for my S plus to shutdown the pi when the power is low or when I pres the button. I saw the PiSugarSButtonActive.sh but i'm unsure what it does and how to use it properly.

@g-or-well
Copy link

g-or-well commented Jul 7, 2022

For the "button shutdown" on my PiSugar S (without the plus) my approach was this:

  • get said script and edit line 37 and/or 39 to read "sudo shutdown -h now".
  • edit your crontab to start the script at boot
  • push the button: magic :-)

As for the automatic shutdown on low battery: isn't that a feature anyway?
In the wiki it says: "When the battery voltage is lower than 3V, PiSugar S will shut down immediately". Mine never ran empty, but I would read "shut down" as a regular shutdown like you could do with "shutdown -h now".
Otherwise you would need to read the battery level and react to that. I can think of some external circuit reading the voltage but it seems PiSugar power manager might be able to accomplish that via I2C [ adress 0x75(BAT)].

@midicdj1000
Copy link

I know very little about linux so how do I get the script, how do I edit the script, how do I edit the crontab ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants