-
Notifications
You must be signed in to change notification settings - Fork 102
How to use shutdown.py
Safely shutdown (halt) Raspberry pi using a normally open momentary switch
Requires one small normally open momentary push button switch and two short insulated wires.
Mount switch and Connect each wire per below.
- Connect control wire from one switch terminal to RPI GPIO control pin 5 (default)
- Connect ground wire from second switch terminal to RPI GPIO ground pin 6 (default)
or set gpio_pin variable by editing shutdown.py and setting gpio_pin = variable to desired control pin, then connect control wire as appropriate
Note: If desired set button_hold_sec variable by editing shutdown.py and changing button_hold_sec = variable
to desired number of seconds required to hold down momentary switch before RPI halt action is taken.
default is 2 seconds. 0=No delay
cd ~
mkdir shutdown
cd shutdown
wget https://raw.github.com/pageauc/pi-timolo/master/source/shutdown.py
chmod +x shutdown.py
sudo crontab -e
Add line below to sudo crontab -e (without #) Ctrl-x y to exit nano and save change
@reboot /home/pi/shutdown/shutdown.py
After initial power boot press momentary switch for specfied time
to Initiate safe shutown (halt). You can then safely power off RPI
or
After halt, wait approx 5 seconds then press switch
again for specified time to intiate a restart or RPI
- Wiki Home
- Introduction
- Prerequisites
- Install or Upgrade
- Run pi-timolo from a drive mnt
- Customize config.py
- Panoramic Images
- user_motion_code.py
- Align Camera Motion Area
- Schedule StartAt
- Basic Troubleshooting
- Tuning Variable Settings
- menubox.sh
- Web Server View Files
- Make Timelapse Video
- Join or Convert h264 to MP4
- Run on Boot
- Setup & Run shutdown.py
- Rclone Media Sync
- watch-app.sh Usage
- Plugins Usage
- Mount USB Storage
- Mount Network Share
- Auto SubFolder Creation
- Manage Disk Space
- Utilities Summary
- GitHub Repo
gdrive is no longer default.