pimoroni / clean-shutdown

Python daemon to watch a GPIO pin and trigger a clean shutdown.
MIT License
125 stars 40 forks source link

Added support for GPIO poweroff #2

Closed Gadgetoid closed 7 years ago

Gadgetoid commented 7 years ago

This script attempts to add generic GPIO Power Off support, however it does require that the power off trigger is active-low.

The systemd shutdown script gpio-poweroff retrieves its settings from cleanshutd.conf and an additional block has been added to install.sh to set the poweroff-pin setting.

TODO:

  1. Add "press and hold" functionality, daemon should sleep for hold_time and check button state again before triggering shutdown
  2. Add "blink to indicate" functionality, daemon should fire up optional led_pin and blink it quickly to indicate that shutdown has been triggered (to go hand-in-hand with .1)