Premium Only Content
			Installing a Power Button for RetroPie - PiStation Video Series # 5
In this video, we are installing and setting up a script for a power button on our PiStation. Big shout out to ETA Prime, as he is where I learned how to do this. Check him here : https://www.youtube.com/user/Mretaprime
***************************************************************
INSTRUCTIONS:
Open up PuTTY and log in
Type the following commands and allow time to install
sudo apt-get install update
sudo apt-get install python-dev
sudo apt-get install python3-dev
sudo apt-get install gcc
sudo apt-get install python-pip
wget https://pypi.python.org/packages/source/R/RPi.GPIO/RPi.GPIO-0.5.11.tar.gz
sudo tar -zxvf RPi.GPIO-0.5.11.tar.gz
cd RPi.GPIO-0.5.11
sudo python setup.py install
sudo python3 setup.py install
mkdir /home/pi/scripts
sudo nano /home/pi/scripts/shutdown.py
This is the content of the script: Copy and paste it in the blank area
#!/usr/bin/python
import RPi.GPIO as GPIO
import time
import subprocess
# we will use the pin numbering to match the pins on the Pi, instead of the
# GPIO pin outs (makes it easier to keep track of things)
GPIO.setmode(GPIO.BOARD)
# use the same pin that is used for the reset button (one button to rule them all!)
GPIO.setup(5, GPIO.IN, pull_up_down = GPIO.PUD_UP)
oldButtonState1 = True
while True:
#grab the current button state
buttonState1 = GPIO.input(5)
# check to see if button has been pushed
if buttonState1 != oldButtonState1 and buttonState1 == False:
subprocess.call("shutdown -h now", shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
oldButtonState1 = buttonState1
time.sleep(.1)
Press CRTL X Then Y
sudo reboot
Now you will need to re-log back into PuTTY. Enter the following command:
sudo nano /etc/rc.local
Add the following info to just below where we put the line of code regarding the background music:
sudo python /home/pi/scripts/shutdown.py &
Press CRTL X Then Y
That is all. I would probably do another reboot, but you should now have a working power button. Good luck! As always, make sure to give us a thumbs up, subscribe to our channel and turn notifications so you don't miss any of our videos!
- 	
				
							21:39
								Nikko Ortiz
2 days agoI Take A North Korean Shooting
14.3K5 - 	
				
							1:46:26
								The Michelle Moore Show
18 hours ago'The Religion Invasion In the U.S. and the Deep State Agenda' Guest, Mark Taylor: The Michelle Moore Show (Nov 3, 2025)
21.3K26 - 	
				
							LIVE
								TruthStream with Joe and Scott
5 days agoSovereign Codes & Cosmic Infrastructure,Ufo's, UAP's, Monads, Matrix Satellites, Interstellar Visitors, SYRONA #505
346 watching - 	
				
							LIVE
								Lofi Girl
2 years agoSynthwave Radio 🌌 - beats to chill/game to
165 watching - 	
				
							5:55:11
								MattMorseTV
11 hours ago $93.78 earned🔴Trump's '60 Minutes' INTERVIEW + MUCH MORE.🔴
157K48 - 	
				
							2:02:36
								Badlands Media
16 hours agoBaseless Conspiracies Ep. 157: Jack the Ripper, the Crash & the Great Disclosure Countdown
35.6K22 - 	
				
							2:06:09
								Inverted World Live
12 hours agoMysterious Crash at Area 51 | Ep. 134
40K15 - 	
				
							2:48:59
								TimcastIRL
10 hours agoTrump Endorses Cuomo, Says NO COMMIE MAMDANI, Obama REFUSES To Endorse Mamdani | Timcast IRL
276K210 - 	
				
							5:51:16
								Drew Hernandez
1 day agoGOP CIVIL WAR: TUCKER CARLSON DERANGEMENT SYNDROME AT ALL TIME HIGH
57.2K42 - 	
				
							14:44
								Sponsored By Jesus Podcast
1 day agoYou Can't Serve God & MONEY | Is Money the Root of All Evil?
26K25