J'ai simplement supprimé le double clic pour faire un reset du Raspberry car je trouvais cela dangereux en cas de fausse manipulation, et j'ai allongé le temps pour l'arrêt à 4 secondes au lieu de 3.
When Raspberry Pi is powered off, shortening GPIO3 (Pin 5) to ground will wake the Raspberry Pi.
This script uses pin GPIO3(5), Ground(6) with momentary button.
- python3-gpiozero
Can be install via apt
sudo apt install python3-gpiozero
This will install the script as service
and it will run at boot
curl https://raw.githubusercontent.com/fire1ce/raspberry-pi-power-button/main/install.sh | bash
curl https://raw.githubusercontent.com/fire1ce/raspberry-pi-power-button/main/uninstall.sh | bash
Button Press (Raspberry Pi is ON) | Behavior |
---|---|
Single | Nothing |
Double | Reboot |
Long press and releases (above 3 seconds) | Power off |
Button Press (Raspberry Pi is OFF) | Behavior |
---|---|
Single | Power On |
sudo systemctl status power_button.service