RetroPie Add A Power Button / Switch Raspberry Pi 1 2 3

Поділитися
Вставка
  • Опубліковано 21 сер 2024
  • HOW TO ADD A LED - • How To Add A Power LED...
    In this video, i show you how to add a power button / Switch to your Raspberry pi 1 2 or 3 Running Retropie
    TEXT FILE V1.1"added sudo apt-get install update"-
    mega.nz/#!ppdy...
    Barry Hubbard Website -www.barryhubbar...
    pi/howto-raspberry-pi-raspbian-power-on-off-gpio-button/▼Do you run an AdBlocker? Consider donating-
    bit.ly/2gy2ffr
    ▼GET A RASPBERRY PI3 ON AMAZON HERE-
    amzn.to/2ea3zAQ
    ▼ GET A FULL RASPBERRY PI 3 KIT HERE- amzn.to/2gPNJ1F
    Buy A Button On Amazon Raspberry Squid Button Twin Pack-
    amzn.to/2fTAVmg
    VIDEO HOW TO ADD A POWER BUTTON TO RECALBOX- • Recalbox Add A Power B...
    DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. DISCLAIMER: Under section 107 of the Copyright Act 1976, allowance is made for “fair use” for purposes such as criticism, comment, news reporting, teaching, scholarship, education, and research. No Games Or Applications Are Included Or Added On Or To Any Device In This Video

КОМЕНТАРІ • 851

  • @SEEtheREPLAY
    @SEEtheREPLAY 7 років тому +32

    Great tutorial man. I think you should mention that your script for some reason is updated and there is an extra step. I'm referring to the "1. sudo apt-get install update" If anyone is playing his video side by side as you are doing this. You'll need to start at 2. of his scrip while he starts at 1. and then just follow exactly how he goes from there. Also it's worth mentioning that you have the command to reboot the RPi at 13. before you the "sudo python /home/pi/scripts/shutdown.py &" command. At this point you should skip 13. (reboot) apply said command 14. and then run the reboot command (sudo reboot). Best of luck to everyone out there.
    Also not that if you have a faulty switch ( i did ) you'll see the retropie splash screen, but then the it will shut down again. Just unplug your switch, get a new one and try again.

    • @einesarredondo
      @einesarredondo 7 років тому +2

      SEEtheREPLAY You are a lifesaver! The parts you mentioned corrected my issue. I couldn't get anything to happen with my switch until I ran across your comment. Thank you for taking the time to provide your input!

    • @henrikengelbrechtsvendsen8557
      @henrikengelbrechtsvendsen8557 6 років тому

      I just got it working first try using your extra helping comments. Thank you ETA Prime - I'm an absolut beginner at this. Great work 👍

    • @GarrettBlackmon
      @GarrettBlackmon 6 років тому

      I realize this is now a year old but I'm using it now so I thought I'd add this.
      You should still do step 1, its just he got the command wrong.
      Should be sudo apt-get update
      This ensures you get the latest versions of the software you are about to install and should be done before installing software on linux.

    • @Murlockingqc
      @Murlockingqc 6 років тому

      are you saying Step 14 should go before Step 13?
      and what is the correct command in the first step?
      "sudo apt-get update" ?

    • @cbk12
      @cbk12 2 роки тому

      @@GarrettBlackmon Hey thank you ! that worked great like you said. you def have to do this code first or it wont install properly. thanks for the update!

  • @ETAPRIME
    @ETAPRIME  7 років тому +16

    HOW TO ADD A LED - ua-cam.com/video/of2p-FHg6nY/v-deo.html

    • @pablomoreno1206
      @pablomoreno1206 7 років тому

      Does any coding need to be changed when adding the LED? or is adding it as specified in the image enough.

    • @somedudeonyoutubefrfr
      @somedudeonyoutubefrfr 7 років тому

      ETA PRIME And could i paste all the commands in one command? I mean it doesnt change the order or so

    • @michaelhousser4355
      @michaelhousser4355 7 років тому +1

      hey ETA when I try to do "wget pypi.python.org/packages/source/R/RPi.GPIO/RPi.GPIO-0.5.11.tar.gz" (without the quotation marks) it is giving me a 404 error. What should I do?

    • @michaelhousser4355
      @michaelhousser4355 7 років тому

      Never mind

    • @danielliens5360
      @danielliens5360 7 років тому

      Captain 8track how did you fix it? I'm getting the same.

  • @Retrobution
    @Retrobution 5 років тому +1

    I dont know why I didnt search for an ETA PRIME video first, you can spend about 20 mins searching google and then head on to youtube and see some guy drawing it out like a maths problem and a breadboard and all sorts of other videos and then boom ETA PRIME, so simple and exactly what I was looking for!
    I appreciate the time put into these instructions it is helping me out and saving me so much time!

  • @monkeyfeetmonkeyshoes8300
    @monkeyfeetmonkeyshoes8300 7 років тому

    I bought a raspberry about a year ago and i tried to do this with failure. now in the future i can say that with everything ive learned because of you and others i have accomplished this objective. Thank You for everything!!!!

  • @GregsGameRoom
    @GregsGameRoom 5 років тому +6

    THANK YOU SO MUCH! Following along with you is my much preferred way of accomplishing these tasks! Really so much easier than trying to decipher 15 pages of text!

  • @tusabez1
    @tusabez1 3 роки тому +14

    For those of you that have a Raspberry Pi 4, replace step 6, 7, and 8 with the ones below and it will work.
    Next you need to get RPi.GPIO:
    6. wget pypi.python.org/packages/source/R/RPi.GPIO/RPi.GPIO-0.7.0.tar.gz
    Uncompress the packages:
    7. sudo tar -zxvf RPi.GPIO-0.7.0.tar.gz
    move into the newly created directory:
    8. cd RPi.GPIO-0.7.0

    • @lukli425
      @lukli425 Рік тому +1

      Thank you

    • @funkymonk4688
      @funkymonk4688 Рік тому +1

      Thank you!! You solved my problem!!

    • @jarrod8461
      @jarrod8461 8 місяців тому

      Thanks. Works like a charm. Previously I could power up the PI but the shutdown did not work

  • @franksxxxr2099
    @franksxxxr2099 3 роки тому +2

    I am a Noob on pi's, but knew I wanted to be able to have an on / off switch to protect to operating system. You did a great job with the video and even better job with the text file with the steps clearly laid out. Thank you very much for sharing

  • @jamespelt3651
    @jamespelt3651 7 років тому +5

    For some reason I cannot download from megadownload. So basically I typed in all the commands straight off the video. To my immense surprise it all works! Very nice.

    • @danielliens5360
      @danielliens5360 7 років тому

      James Pelt I am having to do the same.
      Al goes well until I type the command into the blank script then I save press enter and get nothing.

    • @jamespelt3651
      @jamespelt3651 7 років тому +1

      Do you mean where you are entering text into NANO? Nano is a linux version of Notepad. At that point you are simply editing a text file that contains instructions the Pi will use later. Forgive me if I misunderstand.

    • @danielliens5360
      @danielliens5360 7 років тому

      James Pelt from 9.04 in. that part mate.
      from the # downwards.

    • @jamespelt3651
      @jamespelt3651 7 років тому

      #!/usr/bin/python
      import RPi.GPIO as GPIO
      import time
      import subprocess
      GPIO.setmode(GPIO.BOARD)
      GPIO.setup(5, GPIO.IN, pull_up_down = GPIO.PUD_UP)
      oldButtonState1 = True
      while True:
      buttonState1 = GPIO.input(5)
      if buttonState1 != oldButtonState1 and buttonState1 == False:
      subprocess.call("shutdown -h now", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
      oldButtonState1 = buttonState1
      time.sleep(.1)

    • @danielliens5360
      @danielliens5360 7 років тому +1

      James Pelt I will try it mate. ĺike I say I have to type it out so I think it's just getting it all just right.
      thank you.

  • @Jaimo.87
    @Jaimo.87 9 місяців тому

    I just installed this now in 2023 and it works. it is amazing! Thank you for this tutorial.

  • @MarkyShaw
    @MarkyShaw 7 років тому +1

    This worked great. I saw many complicated tutorials involving soldering and resistors, but all I needed was to figure out a way to take a power switch from an old PC to hook up to my Pi 3. Downloading your text file instructions worked wonderfully. Thank you!

  • @SuperGreenbacon
    @SuperGreenbacon 5 років тому +1

    YES!!! Did this today to my cab and worked like a charm! Easy Peasy! I like how fast it works and I wired mine to a seperate LED button. Thanks ETA Prime!

  • @robertshaw5914
    @robertshaw5914 7 років тому

    this worked flawless for me. Im not that great with tapping in remote to the PI so I typed every thing out per your copy and past and it worked perfect. Thank you for doing a COMPLETE how to with all the info!!

    • @ETAPRIME
      @ETAPRIME  7 років тому

      No problem! I'm glad you got it up and working!

  • @ML-qs4kl
    @ML-qs4kl 7 років тому

    You have out done yourself once again ETA Prime. My micro push button is working perfectly on Retropie. Can't wait for the next vid.

  • @A1FiE360
    @A1FiE360 7 років тому +3

    This is exactly what i was looking for for my Retropie RPi3 - Thank you so much.. Keep up the great work!!

  • @taqmobile
    @taqmobile 7 років тому

    Worked great! Nice to see this is all possible without having to solder headers to the "run" holes

  • @DaiAtlus79
    @DaiAtlus79 5 років тому +13

    please be advised, entire /R/ subdirectory on the PyPi site no longer exists so the file being fetched via wget is no longer there (just tried this last night). as well, it's 'sudo apt-get update'

    • @kdogg12222
      @kdogg12222 5 років тому

      using 'sudo apt-get update' instead of whats in the video will solve this issue?

    • @ZeeboTheDragon
      @ZeeboTheDragon 4 роки тому +1

      When do you enter this command? I'm incredibly new to all of this.

  • @danielkuperberg9930
    @danielkuperberg9930 5 років тому +1

    Great tutorial, I didn't manage connecting to Raspberry PI2 using Putty, so I entered all the commands one by one and it worked. thanks a lot!

    • @mohammadhaque9886
      @mohammadhaque9886 5 років тому

      Hi! did you have any issues getting python? The links seem to not be valid

    • @danielkuperberg9930
      @danielkuperberg9930 5 років тому

      No, I used both python links, and both worked for me.

  • @chancellor2755
    @chancellor2755 6 років тому

    Your the man, your guide is still helping people all this time later. Thanks man!

  • @justinthomas2458
    @justinthomas2458 6 років тому

    For those building a pigrrl2, this works great. If using top tft button change script from pin 5 to pin 13. Thanks ETA for making this and other very helpful raspi videos.

  • @lego40404
    @lego40404 7 років тому

    Started at step 2 with everything else from that step forward and it worked like a charm!!!!!!!!!

  • @creation80graphics49
    @creation80graphics49 6 років тому

    You are the best source for understanding all thing about the Raspberry Pi and Retropie systems. Thanks much!

  • @dg3083
    @dg3083 6 років тому

    Best Raspberry pi related videos in UA-cam! You Rock! Thank You!

  • @craigbisgard7675
    @craigbisgard7675 3 роки тому

    Tried this for the first time in 2021. Works like a charm, thanks!

  • @crysknife007
    @crysknife007 7 років тому

    Awww yea thanks ETA PRIME. Now I have one of the original switches in my Atari 2600 pi case hooked up to allow me to turn the thing on and shut it down properly. Your instructions worked great :)

  • @JDavidGoodman1
    @JDavidGoodman1 7 років тому

    Thank you SO MUCH. I was building my RetroPie Table with EXACTLY these buttons and had a couple to spare. Perfect.. now to drill one more hole with my forstner bit..

  • @irfanaslam5859
    @irfanaslam5859 7 років тому

    love it! i just started to search for raspberry pi buttons and got a notification about this video. works well on raspian (I for doing it quickly, i skiped the first 2 steps)

  • @eLaine33
    @eLaine33 5 років тому

    really nice guide, if you can't type in the password screen like i had trouble, remember it just doesn't show your text is being entered and that your login password may be different

  • @KillerQ
    @KillerQ 7 років тому

    Pound-for-pound, thisnis still the best tutorial video on UA-cam

  • @micolino83
    @micolino83 7 років тому

    thx for having you :) appreciate your videos, voice and explaining style :)

  • @sentry4944
    @sentry4944 7 років тому

    Cool deal. Got it working! Thanks!
    As a side note, the reason you can't use CTRL-X is probably because you haven't set up your keyboard as a US keyboard in raspi-config. Run sudo raspi-config and go into Internationalisation options and change the keyboard layout. Select something like a generic 101 key PC keyboard and then on the next screen if it doesn't have English (US) before your options, pick Other and go down to English (US) then go to the top and select English (US). This should fix all your key mapping problems. (Note that you do have to have a keyboard attached to the Pi for the keyboard layout tool to work)

    • @ETAPRIME
      @ETAPRIME  7 років тому

      sentry07 yeah that was it , it was odd because all my other keyboards worked without the set up

  • @foxbox19
    @foxbox19 4 роки тому

    Excellent tut as always ETA. My power bottom works perfectly in my retropie arcade cabinet.

  • @LongSlenderNeck
    @LongSlenderNeck 7 років тому

    Brilliant!
    Had a little trouble as the password for my pi user wasn't raspberry. Had to reset it. After that I managed to follow your excellent instructions no problem.
    Now to do the LED :)

  • @Jaykav99
    @Jaykav99 6 років тому

    Just did it on a custom retropie img ...still worked like a charm. Thank you.

  • @Tsigarinho
    @Tsigarinho 7 років тому

    You are the best ETA. Thanks for "eating" your valiable time by helping us out. Respect....

  • @sliturarse
    @sliturarse 6 років тому

    To copy & paste text from notepad to putty. (Copy whatever text you need) Hit Shift button, then INSERT button on your keyboard.

  • @banditdog1338
    @banditdog1338 7 років тому

    Thank you for the video. I am just starting to experiment with a Raspberry Pi to set up retro gaming system and this will help immensely.

  • @Alcoholic_Nerd
    @Alcoholic_Nerd 5 років тому +1

    Just use the built in "on screen keyboard", I use it almost every single day on my 55" tv since it's easier than getting out the wireless keyboard for it. I only use a real keyboard when I have to type a bunch of stuff but "ctrl x" would work fine.

  • @KevinPiattAdmiralP
    @KevinPiattAdmiralP 6 років тому

    Honestly, this was easier than I thought... I'd say I'm disappointed in that, but that would be an utter and complete fabrication. Thank you for this and then some!

  • @TryNCatchThaBeat
    @TryNCatchThaBeat 7 років тому +7

    Essentially this would be the same for pi zero, I would just have to solder to the GPIO right?

  • @Kad0n
    @Kad0n 4 роки тому

    Keep up the great work with the Pi, Loving your vids!

  • @tonogtube
    @tonogtube 6 років тому +1

    Many thanks. 100% works on Raspberry Pi 3 B +

  • @ericochoa4034
    @ericochoa4034 7 років тому

    Awesome work its videos like these that help grow the raspberry pi community!

  • @nikoEDS
    @nikoEDS 4 роки тому

    Fantastic! I'm a newbie in using Raspberry Pi and this solves my problem!

  • @Whatzit666
    @Whatzit666 5 років тому +1

    Respectfully, I started having issues with the directions from the first...however, after I changed "sudo apt-get install update" to "sudo apt-get update". Everything started working fine. YMMV

  • @KingGrim87
    @KingGrim87 7 років тому

    Awesome! worked out beautiful! thank you for dumbing it down for all of us that are learning.

  • @Sithel_
    @Sithel_ 7 років тому

    Thanks ETA PRIME ! Works perfectly. Although I'm just getting into raspberry pie and retro pie, your videos have helped a lot. Great work!

  • @volsi2087
    @volsi2087 7 років тому

    ETA PRIME, Thank you so much for your raspberry pi tutorials they are the most helpful tutorials i've found. Thank you so much again!!

  • @HussoFPV
    @HussoFPV 4 роки тому

    YOU SIR ARE AN ABSOLUTE LEGEND. WORKED FLAWLESSLY - GREAT GUIDE!

  • @JJiG
    @JJiG 7 років тому +1

    Simple, easy to follow and right to the point. Thanks!

  • @xxmpwaterdawgxx
    @xxmpwaterdawgxx 6 років тому

    THANK YOU!!!!! I have used your channel for nearly all of my pi arcade projects.

  • @georgepitaru
    @georgepitaru 6 років тому

    Perfect diction! Reciting these detailed instruction with such diction makes everything so much simpler to follow.

  • @johnnyrocha8708
    @johnnyrocha8708 5 років тому

    Great tutorial, used the current script version on pi 3B and everything worked flawlessly.

    • @ddraj
      @ddraj 5 років тому

      the connection is timing out on step 6 for me. you run into anything like that?

  • @tonberryhunter
    @tonberryhunter 7 років тому

    love your tutorials so easy to follow and to the point. Thanks :)

  • @DaneSaysStuff
    @DaneSaysStuff 7 років тому

    Nice! I'll be adding this to my 128gb install tomorrow! thank you!
    p.s.
    is your Ethernet cord soldered to the bottom of your Pi?

  • @angeaka8442
    @angeaka8442 7 років тому

    I rarely comment on the videos I watch but I bought a Pi and have been playing with it and your video have been a great source of information for me. a big thanks for that. I just used this video to setup a on and off switch on my Pi and the video and step were very easy to follow and I succeed with the setup but I realize something that is if you leave the Pi plug after turning it off after a while the Pi turn on back by itself. at first, I thought I turn it on but i turn it off and waited again and sure enough, it turned back on. so small thing but wanted to let you know. thanks again and bye

    • @mmxmarc
      @mmxmarc 5 років тому

      ange aka Same exact thing is happening with my Pi. The switch works great for shut down and turn on. But after shutting down, and not unplugging- it turns itself back on after a while. Have you found a fix for this?

    • @SPRTN085
      @SPRTN085 3 роки тому

      @@mmxmarc I have the same issue. any fix you've found?

    • @mmxmarc
      @mmxmarc 3 роки тому

      @@SPRTN085 I haven't found a fix. I use the on/off switch for quick shutdowns, and have the pi power supply plugged into a wall outlet that's controlled by a lightswitch. After a shutdown I wait about 10 seconds and just turn off the lightswitch.

    • @SPRTN085
      @SPRTN085 3 роки тому

      @@mmxmarc Ive started hitting the power button on the back of the cabinet after a shutdown. I've resigned to this being the way. Can't find any other solution unless I next attempt a hardware pull up resistor.

  • @MatiasSlash
    @MatiasSlash 7 років тому

    Awesome tutorial! Thanks a lot for all the raspberry pi/retropie videos.

  • @Velocia2009
    @Velocia2009 7 років тому +2

    This is what i wanted :) Thank you soooo much for this Video! Your Tutorials are both entertaining and helpfull :) Keep on and 1000 Thanks.

  • @gustos2478
    @gustos2478 7 років тому

    Thanks ETA, worked like a charm! I love my new switch.

  • @Davidajr23
    @Davidajr23 7 років тому

    Excellent video!! Keep making these informative videos on Raspberry Pi

  • @jimsinkus4890
    @jimsinkus4890 7 років тому

    Around to doing this - your videos are the best.

  • @JohnOdd
    @JohnOdd 5 років тому

    Hey thanks!
    I got my RetroPi working with a simple button switch!

  • @MrM3ch
    @MrM3ch 7 років тому

    Thank you so much for a very clear and helpful tutorial! It works perfect!

  • @johnratrod9806
    @johnratrod9806 7 років тому

    Thanks for all the awesome help with the pi.

  • @ericnelson5239
    @ericnelson5239 4 роки тому +1

    This put me in a boot loop....

  • @raginhaver
    @raginhaver 7 років тому +5

    great work!! could you do one for a reset button

    • @AnselmoSilvaBrito1hue
      @AnselmoSilvaBrito1hue 7 років тому

      Using the same tutorial this should work:
      For organization:
      At 8:45 in line 41 in NOTEPAD++ change "/shutdown.py" to "/restart.py"
      The command:
      At 9:09 find line 67 in NOTEPAD++, change "shutdown -h now" for "shutdown -r now"
      1: According to askubuntu "reboot" may power your device on maintenance mode so shutdown -r is preferable.

  • @Dakkor32
    @Dakkor32 7 років тому

    Just did this and it works perfectly. Thank you sir!

  • @patrickfitzpatrick7245
    @patrickfitzpatrick7245 6 років тому

    Thanks ETA! Best tutorial. Works magic!

  • @kyrkbymannen
    @kyrkbymannen 6 років тому

    THANKS For creating this, i've built a retro arcade cabinet and where worried about the ruined sd card possibility.

  • @TheWigg
    @TheWigg 5 років тому

    Thanx! Worked great. I used pin 5 and 9 though as 4 and 6 are my 5v fan. The only thing now is that the fan still runs after the pi shuts down.

  • @aurielklasovsky1435
    @aurielklasovsky1435 4 роки тому

    hey, you can use vi instead of nano. Once in vi you will need to press [i] before pasting the text then [Esc :wq Enter] to save. Excluding the brackets, they are just there to make it clear what the keybord input is.

  • @OscarTorresWork
    @OscarTorresWork 7 років тому

    thank you I plan on getting another sd card and running Retro pie as well to learn more especially about getting arcade like desktop boxes running.

  • @FhargaZ
    @FhargaZ 6 років тому

    It worked like a charm, thanks. Now i need to build something to hold the button xD

  • @jolakos122
    @jolakos122 5 років тому

    REALLY good tutorial and well explained!!
    Thanks!

  • @nostalgicbiscuit707
    @nostalgicbiscuit707 2 роки тому

    You can also install all the packages in the command line, Just by adding a space and doing this
    sudo apt-get install python-dev python3-dev gcc python-pip
    Saves on time. Other than that ETA great video

  • @renancs4551
    @renancs4551 6 років тому

    worked perfectly here, Thanks !! . But if you showed the message "starting" and "turning off" would look better

  • @lj8a537
    @lj8a537 6 років тому

    Works flawlessly! thank you.

  • @resistnonexist
    @resistnonexist 5 років тому

    This worked the first time. Tyvm!

  • @sineld
    @sineld 7 років тому

    I have made what you have shown and worked great.
    Thank you.

  • @kevinhartman1863
    @kevinhartman1863 7 років тому

    I love smart people, thank you so much. And keep up the great work.

  • @opts9
    @opts9 7 років тому

    Thanks man! This works perfectly on a Pi Zero W!

  • @psychosious
    @psychosious 6 років тому

    Thank you good sir, you now have my (Black/white/blue hydro-dipped OG-PS1) Blueberry PieStation fully functional. 1000 likes to you if I could.

  • @cravenmoorehead3253
    @cravenmoorehead3253 7 років тому

    Awesome. I imagine the testing felt like watching paint dry. Thanks for another spot on lesson. And what the hell, dell?

    • @ETAPRIME
      @ETAPRIME  7 років тому +2

      Craven Moorehead OMG I never want to watch this thing boot up ever again. LOL

  • @natesviewfinder
    @natesviewfinder 7 років тому

    Great video! Works just as expected.

  • @stowjer
    @stowjer 3 роки тому

    Great instructions mate. Thank you 👍👍

  • @nicka.9073
    @nicka.9073 7 років тому

    Worked like a charm, thank you!!!

  • @dscim988
    @dscim988 6 років тому

    Managed to make it work with a Pi 0 W, thank you!

  • @somedudeonyoutubefrfr
    @somedudeonyoutubefrfr 7 років тому

    You dont have to type y ;D Because when the Y is big (Y/n) then is yes selected. Just press enter :D (6:36 and before/after)

  • @jasonsmini
    @jasonsmini 7 років тому

    Great tutorial thanks for all the vids you do! One small issue on the text file i wanted to point out.. it should be "sudo apt-get update" instead of "sudo apt-get install update"

  • @cr0wland
    @cr0wland 7 років тому

    nice tutorial, I was looking at buying a mausberry add on board to do the same, but this seems simpler and cheaper.

  • @Gadgets4you
    @Gadgets4you 2 роки тому

    Thank you so much man, it worked at my rasp pi 3b+ wirth running magic mirror os

  • @garystinten9339
    @garystinten9339 7 років тому

    Thanks man.
    Making my decision easier now.

  • @personal85games
    @personal85games 7 років тому

    Fantastic Tutorial Brother!
    Tks!

  • @car07062
    @car07062 7 років тому

    Great video. The button works perfectly. Thank!

  • @hx8457
    @hx8457 7 років тому

    Thanks, easy instructions, works great!

  • @btmiller14
    @btmiller14 6 років тому

    fantastic video works like a charm

  • @markyharris
    @markyharris 3 роки тому

    Love the info.
    This procedure needs to be updated for the RPi4. Be sure that RPI.GPIO v .7 and not .5 is installed otherwise Error 'RuntimeError: This module can only be run on a Raspberry Pi!' will occur.
    I renamed the directory and .egg file in '/usr/local/lib/python3.7/dist-packages' then reinstalled with 'sudo pip3 install RPi.GPIO'. This updated it from '0.5.11' to '0.7.0' and the script worked properly.
    Note: If you decide to make the change to 3.7, be sure to alter the command to the 'rc.local' file from 'sudo python /home/pi/scripts/shutdown.py &' to 'sudo python3 /home/pi/scripts/shutdown.py &' otherwise it won't run at startup.
    BTW: I would assume you could do the same for python2 in '/usr/local/lib/python2.7/dist-packages' as well, at which point you wouldn't need to alter the command in 'rc.local'. - Hope it helps.

  • @bradford2001s
    @bradford2001s 7 років тому +2

    First things first, awesome video. it was easy setting this up. QUESTION. I'm using a fan on pin outs 1 and 9 now due too the shutdown switch, is there a way to have the fan shut off with the switch as well?

    • @GuitarGodgt
      @GuitarGodgt 7 років тому +1

      You would need a 5v fan and you would need to move it off pin 1 to a gpio and include it within the shutdown code.
      I have not done the switch mod yet though.

    • @GuitarGodgt
      @GuitarGodgt 7 років тому

      Actually it looks like he addressed this in his power led video so nevermind.

    • @pablomoreno1206
      @pablomoreno1206 7 років тому

      Im looking to do this myself, this is an easy tutorial:
      s55ma.radioamater.si/2015/11/16/controling-5v-fan-with-raspberrypi-poor-mans-pwm/

  • @rp479
    @rp479 7 років тому

    I LOVE this button! I have a Pi in my car and use this to exit the car without having to worry about the Pi3 draining the battery.
    I am currently experimenting with LibreELEC for kodi instead of RetroPie and I was wondering if you could help me use this shutdown button in that OS as well. Thanks a ton. Your vids taught me all I need to know about the Pi. Youre the best.

    • @rp479
      @rp479 7 років тому

      I found an answer to my own dumb question lol. LibreELEC doesnt have enough OS to do anything, so I switched to OSMC, all I had to do was delete the home/pi/ before scripts.
      All other instructions worked great. Thanks a ton ETA for setting this up, very easy for a noob to understand.

  • @TheRomanPraetorian78
    @TheRomanPraetorian78 7 років тому

    Thanks man worked perfectly.