Giter VIP home page Giter VIP logo

clean-shutdown's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clean-shutdown's Issues

Hyperpixel conflict?

First time I've done this, I've a Hyperpixel and Lipo shim but the Hyperpixel stops functioning with cleanshutd enabled. I'm assuming this is a conflict at BCM 2,3,4 or 14?
The Hyperpixel works up to the splash screen then goes blank.

Howto initiate the via PHP

Hi.

Is there any way to initiate the clean shutdown via the console or a python or PHP script? I have a project on my Pi that has his own shutdown button in the Webgui. If I use the built in button in the gui the Pi shuts down but without ending in a clean state.

Cheers, Thomas

More flexibility/robustness in the trigger pin

To enable the use of the trigger pin with toggle and momentary switches, it would be good to either:

a) Record trigger pin state at startup of the script, then look for a change of state that lasts for the trigger time. (hi>lo or lo>hi) depending on a stable startup state.

b) allow more flexibility to make a high/low/change the trigger for shutdown (although this amounts to "edit the code" right now :)

I prefer A, but with polling rather than edge-change interrupts it's not ideal, but I don't think it's worse than the current state of affairs.

Pi does not shutdown any more after upgrade to bookworm

Hi,
I upgraded my raspberry pi 4 to bookworm and kernel 6.6 and even if the GPIO pin 17 is triggered the clean shutdown down does not respond or shutdown the raspberry pi anymore.
I also changed the command from raspi-gpio to pinctrl as messages lead to the info the the command raspi-gpio is deprecated.
Any idea how to debug this more or even better solve the issue?

Start up using pins ( from another pi)

I understand that OnOffShim can be used to cut the power off but is there a way to start up pi using Pins and not a buttom? My intention is to use another pay to control "main" pi both cutting power and starting it up (cold reset).

When is the cleanshutd supposed to log?

I recently installed the tool and an OnOffshim. I am wondering when/how it is supposed to actually do logging. I see a bunch of echo calls in cleanshutd, but, as far as my understanding regarding initscripts goes, a LOGFILE variable is defined but it is not used, nor does it redirect stdtout or stderr to LOGFILE.

However, the service itself works correctly and when I push the button to shutdown when logged in (via ssh for example), the wall is executed and I am informed that way.

Do I miss anything?

'https://get.pimoroni.com/cleanshutdown' script hangs after install while trying to remove $installdir/$gitclonedir

I'd submit a pull request for this, but I couldn't actually find a repo with the 'cleanshutdown' script in it.

On line 1098 of the cleanshutdown script, after running setup.sh cloned from this git repo, the script tries to remove the git clone directory.

cd $installdir && rm -r $installdir/$gitclonedir &> /dev/null

This hangs the script due to some of the git files being write protected.

pi@raspberrypi:~/Pimoroni $ rm -r clean-shutdown/
rm: remove write-protected regular file 'clean-shutdown/.git/objects/b5/e36d217cd58b69c8cb5bbd2219541ecc262c2f'?

You may want to add a -f to the rm command to avoid this.

Initial confusion/issues & question

After setting up the clean-shutdown I was getting error messages and could not login to my Pi. After searching google I found this which I think something related.

https://forums.pimoroni.com/t/zero-lipo-software-causes-failed-to-authenticate-error/5246/55

Update: Noticed the commands have changed and are listed at the bottom of the page.

Second, I was wondering if there is a way to monitor the voltage? The LiPoSHIM can sense when the voltage is 3.5v and 3.0v according to documentation so it sounds possible.

reset function

is it possible to use the on/off shim also as a reset button (for example: press the button 5 seconds to initiate a reboot/reset?

OnOff Shim does not shut down the Raspberry

Hi guys,

I'm new here because of a very tricky problem, other users in the german raspberry forum can't solve.

I ordered an OnOff Shim and connected it to the raspberry via the socket which was soldered to the shim. I then installed the OnOff Shim Script using the one line command and with the software I'd like to use (Phoniebox) I run the following /etc/cleanshutd.conf-Script:

daemon_active=1 trigger_pin=17 led_pin=25 poweroff_pin=4 hold_time=2 shutdown_delay=0 polling_rate=1

The pins are not used by other connections.
There is no problem to start the raspberry by using the button on the Shim or an external attached button via the "BTN"-holes. But I do not manage to shut down the raspberry when pressing the external button or the button on the shim. The red light on the shim flashes, but the raspberry keeps running.
Furthermore the button's light is not working - only when shutting down the raspberry through the terminal right at the end the light flashes 3 times - so the GPIO seems to work. The light itself works fine when connecting it to the 3V-PIN.

I already ordered a new OnOff Shim because I thought there could be a soldering problem - no change at all.
I used another external button - no change at all.

The guys from the german forum ask me to to
sudo systemctl disable cleanshutd
and
sudo systemctl start cleanshutd

as well as to insert
disable_cleanshutd=1
into the /boot/config.txt.

No change at all.

When I do raspi-gpio get 17 I always get
GPIO 17: level=0 fsel=0 func=INPUT
no matter if I press the button or not.

Do you have any help for this issue? Why is it impossible to get the raspberry to shutdown and the button's light to shine when running the raspberry and not only at the end of a terminal's induced shutdown process?

Thank you for your help!

Prevent button trigger during start / shutdown?

I would like to ask how I can disable the button trigger once it was fired for an certain amount of time (e.g. 10 seconds).
Use case: Having the on/off shim implemented in a music for kids. sometimes they double tap on the button and in some cases the whole system crash. So I want to prevent that the button triggers any action once it was fired.

Thank you for any hints an tips.

farbschein

Any way to run a script when shutdown invoked?

I'm using clean-shutdown, and I'd like to send a message to IFTTT that notifies me when shutdown is imminent.

Is there any hook into clean-shutdown where I can have an additional command run, like doing a post to a web service? I'm sure I can modify the script that is being run, but I didn't know if there was some modularity that allowed me to extend the script built-in.

Possible to add button push function/script while the pi is on?

At the moment if the button is held for 1second the pi shuts down, which is great. Love that, exactly what I need. I'd really like to add something that issues a PiWakeup/CEC wakeup command over HDMI if the button is pushed but not held while the pi is already on.

At the moment the Pi just goes to sleep and I'd like to wake it back up, rather than restarting it using the button. I could probably do this with a second button easily enough but would like to keep the hardware minimal and try to use the same button as on the On/Off Shim....

[bug] "hold_time" ignored

I'm using ONOFF SHIM with clean shut down to be able to switch two devices at the same time (Raspi zero & active speaker).
The speaker is activated if the power button is pressed longer than 1.0s and so I configured the hold_time setting.
I recognized, that sometimes the raspi is already turned on while the speaker is not.
I wrote a little tool running on the raspi that triggers the GPIO 17 with a specified time. I used 0.5 to 0.9s interrupts and found out, even at 0.5s the ONOFF SHIM sometimes turn the raspi on even if the hold_time is set to 1.0s.
I would estimate a failure rate of approximately 10% which I think is quiet high.
I'm a total programming noob so I'm totally lost where I should start to debug. I would appreciate it if some experienced folks could help.

Installs on, but does not work with, Wheezy

Investigate either blocking install on Wheezy, or adding support- which seems simple enough:

service cleanshutd enable versus systemd enable cleanshutd

And gpio-poweroff should be installed into, I think, /etc/rc0.d/ and named something like S99gpiopoweroff

failed to start but running

I am using lipo shim.
I did used pimoroni dashboard on last rasbian OS to install this soft.

I am getting error message in journal
e2

so I did check running processes

e1

strange, it is running, and when my batter get low it is switch off my raspberry.

I did check systemd service and there is also mentioned error message
e3

I am not sure why there are two services with very similar name. I think it is mistake
cleanshud.service and cleanshutd.service
see last screenshot with red underline

Proposal: Minimum uptime

I've been experimenting with the Zero LIPO and clean-shutdown and run into the following scenario:

Sometimes I want to power my Pi Zero through USB power, not the LIPO connector. The Zero LIPO supports this just fine, but in conjunction with clean-shutdown yields a problem, since without the battery connected the low-battery GPIO fires, and clean-shutdown almost immediately turns the system back off.

My proposed solution is to add a system uptime check to clean-shutdown that will cause it not to act until the system has been up for less than min_uptime seconds (a new config parameter). Once min_uptime seconds elapse, the daemon may shut the system down, but this gives the user a grace period to log in and disable the service if we're actually running from USB.

Another option would be to permanently disable clean-shutdown (until restarted) if the very first poll of the GPIO indicates low battery (on the assumption we're actually not using a battery). This would be really convenient when running from USB and avoid a new config parameter, but will behave badly if we're actually booting the system off a low battery.

I'd be happy to submit a pull request if this feature would be welcome.

get.pimoroni.com/zerolipo rm -r hangs

Hi there,

I ran the script at https://get.pimoroni.com/zerolipo today to install this little service (which seems to be working great, btw!) but I ran into a little snag in the zerolipo install script. I can't find a source for it on github but feel free to point me in another direction?

The "little bug" was on line 1101:

1098     else # custom block starts here
1099         echo -e "\nFinalising Install...\n"
1100         cd $installdir/$gitclonedir && ./setup.sh -y zerolipo
1101         cd $installdir && rm -r $installdir/$gitclonedir &> /dev/null
1102     fi

the rm -r should probably include a -f (--force) flag, because git had marked one of the .git metadata files to remove the writable bit, and thus rm will prompt - but it's wrapped in a script redirected to /dev/null so the install script appeared to hang. I found out what was happening on another shell and running the same command:

pi@pi:~ $ rm -r Pimoroni/clean-shutdown/
rm: remove write-protected regular file 'Pimoroni/clean-shutdown/.git/objects/1c/2f8b6af8fcf33eda999a1719ff8c96372ef3e8'?

I'd recommend changing the rm -r to rm -rf

HTH!

Radio-1 Install

How can I install this in Audio-1 Runeaudio is based on Arch Linux.

init.d typo prohibits easy systemctl tabbing

I tried to tab-complete after typing systemctl status clea and it completed only until cleanshu. Double-tab resulted in:

root@myhost:~# systemctl status cleanshu
cleanshud.service   cleanshutd.service
root@myhost:~# 

cleanshud.service is nowhere defined. It results from the typo in line 3 of daemon/etc/init.d/cleanshutd:

#! /bin/sh
### BEGIN INIT INFO
# Provides:          cleanshud

Actually it should read:

#! /bin/sh
### BEGIN INIT INFO
# Provides:          cleanshutd

After adding the missing t and systemctl daemon-reload the systemctl status clea will tab-complete as expected.

Pressing button too long leads to non-responsable state

Hi

My (enclosed) Raspberry Pi 4 comes into a state of deadlock with some kind of unclean shutdown. My setup is powerbank -> onoffshim -> Raspi 4. I use default configurations (pinout) and have the Raspian and the daemon running. Shutdown works properly when button is held for a few seconds and released before the actual power off. However, when the button is held longer the Raspi seems to turn off but power is not disabled by the onoffsim (even after releasing the button). Restart is then not possible anymore without completely removing power from the onoffshim.

Any ideas? Workarounds in hardware or software?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.