How to turn on & off your raspberry pi safely with the push of a button! Headless Pi on/off button!
ฝัง
- เผยแพร่เมื่อ 1 พ.ย. 2024
- In this very special episode, I show you how to safely turn your Raspberry Pi on or off with the simple push of a button! This is a must for any headless Pi where you do not have easy access or just do not want to attach a keyboard or connect through SSH to just turn it off.
This works with any Raspberry Pi and worked great for my digital marquee (headless Raspberry Pi Zero W) and my Retropie Raspberry Pi 3B+. It also comes in handy when your Pi just glitches/freezes and you have no way of communicating/interacting with it and you have no choice but to hard unplug the power to reset it, which can cause corrupt sd cards. DOH!
When you buy a Raspberry Pi Zero W, it comes with the header strip (GPIO) not soldered on, so in this video I will teach you how to solder in the header strip as well. Sweet!
I also show you what you have to do in terminal on your pi in order to load the safe shutdown script whenever the number 5 and 6 pinouts on the header strip are connected due to a momentary push button being pressed (on/off button).
Quick links to parts of the video!
00:36 Intro to the project
05:33 Soldering header strip tips and tricks
14:06 commands to enter into terminal and where to get it
Special thanks to Koda for the amazing LED linkable shop lights, I am SOOO glad I bought them! If you haven't seen their LED linkable shop lights yet, they are an amazing new feature to my garage and bring a smile to my face every time I step into the garage!
kodabuilt.com/...
Special thanks to the team at 8bit junkie as this is not my own invention or coding and without them, this would not be possible. Thanks!
pie.8bitjunkie...
Items required for a Raspberry Pi zero W:
computer or tv to watch this video and pause as you do the process
another computer and Putty to SSH into terminal (remote entry) or a keyboard to access terminal directly on your pi
Raspberry Pi Zero W (or any pi you want to easy start up/shut off)
header strip (comes with Raspberry Pi Zero W)
momentary On button
insulated wires (to connect button terminals to pi GPIO pinouts 5 & 6
soldering gun (electronics pencil type)
electronics solder with rosin core
wet paper towel/serviette
safety glasses
desoldering tool (optional until you make a mistake...lol)
electronics third hand (not required but would help)
power supply and hdmi cable for pi
sd card with Retropie already installed/configured
internet (duh)
15 uninterrupted minutes to complete
Have any questions about the build? Please feel free to comment and I will get back to you as soon as possible. I like to help people....it's my job.
If you would like to keep up with behind the scenes info, pictures, and videos, follow us at / way_of_the_wrench
If you would like a PDF of my Sketchup plans and dimensions, smack that subscribe button and go to the link below to collect your free plans: sdssautomotive...
If you enjoyed the video, learned some cool tech tips, or would like to use my plans, I would appreciate a like, a subscribe, and a share so I can be inspired to create more videos and continue to make better content for you guys! Thanks for watching and if you hit the post notification bell, you will know when our next videos are out!
If you missed the earlier videos, start here www.youtube.co.... for episode#1.
Music for this very special episode by :
Royalty Free Planet:
GLITCHUNTER - Neon Road: • GLITCHUNTER - Neon Roa...
INTL.CMD - Coastline: • INTRNLCMD - Coastline ...
Thanks to Teknoaxe for his royality free music for our intro/outro music.
Please check out all of Teknoaxe's sweet music tracks!
www.teknoaxe.com
Intro music is Synthwave D www.youtube.co....
Outro music is Sythwave E www.youtube.co....
Way of the Wrench is looking for a collaboration with any TH-camrs out there hard at work making royalty free music, just send me a message with your link for consideration.
Disclaimer: These videos are intended for entertainment and inspiration. Working in a woodshop, metalshop, or autoshop is dangerous without proper safety and experience. Always seek professional advice and training before using any power tools/machinery. If you have any uncertainty before performing any shop procedure, stop and learn a safe method/technique. Do not attempt anything simply because you saw it in one of my videos. Be smart, use common sense, respect your power tools/machines, use safety glasses/guards and be safe.
When I solder I like to use flux core solder and then put some on the tip of the hot iron, hold it against the contact and the pin, then slowly add more solder, wait 1 second or so with the iron in the solder and then pull up. If you hold it too long the flux burns off and then you get the solder following the tip and leaving those nasty points. Also as long as you're not soldering something super heat sensitive it can help to take excess solder off by using the soldering iron. Wipe it off and then hold it to the solder and then repeat. Finish off by adding a tiny bit more solder (and thereby adding a tiny bit more flux) and you'll have a nice joint that you won't believe you made. I'm just a newb but this has helped me make joints that my cousin thought came preinstalled 😁
Good info! Yeah it would have been easier to pre tin the contacts and use a finer tip soldering iron too. Thanks for the watch!
Thanks for showing the full software install steps. That was the part I was really struggling with on getting the script installed on my setup. Works perfectly!
Glad the video helped you out. You should check out the virtual pinball cabinet project too. Thanks for the watch!
@@wayofthewrench One note, 1st time I tried, it didn't work. Realized that is because RetroPie by default has SSH disabled. So there's a few steps that could be added as an improvement suggestion for your next vid. Need to enable SSH on RetroPie RASPI-CONFIG. 😉
Ah noted. As I made this cabinet as a series, in one of the previous videos I turned on SSH already but it probably would be good to add this to the video description. Thanks for the suggestion! Cheers!
@@wayofthewrench Thanks! Seems to be a common oversight. Been running across that frequently in other similar RetroPie guides. Others provide guides using a PC to Network into Raspberry Pi via Samba, where the first time you do that, you need to provide the pi/raspberry login credentials but only need to do it the 1st time and then it gets saved on local machiine. A newb like me seems to keep running into those forgotten hurdles, doing everything for the 1st time. 😀
It's all part of the experience, if it was too easy, it wouldn't be fun! Cheers!
thanks so much for the help. i wish i saw what the button looked like so i know if im getting the right kind and how you wired that up too.
You can use any momentary button that is normally off but on when pushed. I used cheap arcade microswitch buttons. If you're still not sure, you can look at my parts video for the arcade cabinet. Thanks for the watch!
This is super awesome. I just subscribed and glad I did. Now about to watch more. Thanks for being detailed in how to do the small basic things like taping drill bits or how thick the bit should be. There are things that people just don't mention so thanks man
Sweet! Thanks for the watch and sub. Yeah what you just described is my niche in TH-cam. Everything you need to know shown and in a way that is entertaining/memorable. Glad you liked the videos and if you think I'm worthy, I'd really appreciate a share out on your social media. Cheers!
Thanks for such an amazing tutorial, your cabinet looks amazing! Just one simple question: I have those pins occuppied with the fans (RP4). Are there any other pins where I can connect the button, or do you know if there is any other place where to put the fans? Thanks!!
Thanks Hugo! Glad you liked it, you should make one! Free plans are in the description. If you google rpi4 pinouts, you can find other pinouts that can be regulated 5v/or grounds like pins 2 and 4. Or there are other gpios that can be outputs. You might be able to change the program to use different pinouts as well but I haven't tried that so Im not 100% sure. Thanks for the watch!
@@wayofthewrench thanks for the answer! I'll dig a little more, and will be back with an answer 😁
800 subs
Production quality: 800k subs
Workmanship: 8m subs
This made my day....thanks for the great comment! I do try my hardest to make the best videos I can for my subscribers. Would really appreciate a share on your social media cause it's super tough to break through youtube's algorithims and get my content out there. Thanks again!
So does that switch work for the PI 4. Is it the same application to the motherboard?
Yes it should be pretty much the same except I remember there being another line of code needed for the rpi4. Here is a link to what I'm referring to. www.embeddedcomputing.com/technology/open-source/development-kits/raspberry-pi-power-up-and-shutdown-with-a-physical-button. Let me know if this works as I actually haven't messed with a rpi4 yet because I have just jumped to refurbishing older pcs that are free and are way more powerful for arcade projects. Cheers!
I’m almost done with my arcade cabinet! I ended up not using the furniture connectors, but I made some changes on my build. It was a crazy ride but it looks pretty cool !
I would love to see it when your done, send me a message on the Way of the Wrench instagram (link in description). Its a good feeling to play on these after all of the hard work. Any hiccups/things not go right?
Way of the Wrench I’ll send you pictures and videos, I’m surprised on how it turn out with the limited tools I had. I still need to wire the audio and design the warping on the sides and console. I made it so it connects to a ps4 pro. I’ll give you a more detail info in maybe two weeks when I’m done ✌️
Sounds good!
Ty for the video
No worries Bruh! Thanks for the watch!
Nice video thank you! Can I add those lines of code directly into a file of the sd? Thank you!
Thanks! You might but this way was pretty easy. There was a file to download and install so you would have to do that as well. I know this worked on my 2 raspberry pi though, not sure of other methods. Cheers!
Way of the Wrench gotcha.👍🏼 Thank you so much for the prompt reply! Happy Holidays/Merry Christmas
Another question. When you shut it down using this method do you still have the Red Light on or your Raspberry or it goes completely off? Thank you again!
It has been a while since I actually looked at the pi after shutting it off so I am not sure 100% but I think there is always a red light to show you have a stable power supply to the pi but the green light(s) blink a couple times and go out. I usually wait about 15 seconds or so and wait for the shutdown sequence to scroll across the screen and the display goes into a source not found screen and then I know it is off for sure. I do this for both pi on my cabinet before unplugging the power cord to the cabinet.
Many thanks!
You're welcome Jamie! Thanks for the watch!
Love this series and project, hoping to do this with my daughter as well as the virtual pinball as you go when time allows it, however before I start my project I was wondering when you hope to put out the breakdown of costs and parts required as I did have a raspberry 4 before it got damaged and want to get parts in place ready for when I can finally get home to see my daughter and start. Thanks in advance and got a sub from me for sure. It’s awesome.
Yeah Ian this will be a great project for you and your daughter! I would recommend just taking your time and ordering stuff as you go, that way the overall cost is spread out and not as noticible. Plus this gives you more time to find cheap or free parts. Start with a rasp pi 3 b plus ( $100 after proper power supply and case and cable) at a minimum or a pi 4 but I also recommend taking a look at my how to fix a free computer video so you can use a pc which will be way more powerful and probably cheaper. Then you can install retropie and some games and play while you build. Try it out on a free monitor ( or used no more than $30 )to see if that is the size you want before you build too. After that you'll need mdf or plywood (roughly $70 a sheet). You'll need 3 to 5 sheets depending on your design. Cheap button, joystick, usb board for $60. Misc glue and screws and sand paper $40. T molding roughly $25 for 50 feet. 2.1 sound system with bluetooth $80. Speaker grills free to $20. Paint $50. Casters $25. Beyond that it just gets into the extras. Coin door $150. Marquee monitor $279. Marquee pi and kit $100. Graphics $300. Vinyl for control panel $80. For mine it added up in the end but it was my dream cabinet and the money was spent over a year. I still plan on spending some more for upgrades and mods too. Cheers and thanks for the watch!
@@wayofthewrench still watching the vid but wondering if you painted the cab or vinyl?
I like the shirt
Gotta love Atari.....Cheers!
Hi there, just wanna know when your next episode will come out, and I also think you should do a virtual pinball as a project, will follow the shit out of that, I build my Arcade machine exactly as yours and love my machine, would love to do a pinball machine, got the software done, have a 3 monitor system, with baller installer its sooooo easy to do, just need you to build the cabinet so we can follow :)
Sweet! I would love to see some pictures or a video of your cabinet (send me a DM on Instagram). There are already 5 or 6 of these "Way of the Wrench" designs out there, so welcome to the family! I have a ton of stuff to film and put out for some upgrades to the arcade cabinet but I haven't had a chance to film/edit yet. YES! I have been researching and messing around with my first virtual pinball cabinet and I have a 3 screen set up ready to go as well. I am in the middle of deciding what my design will be so I can order parts with a theme in mind. My playfield is 46" HD 8ms lag 60 to 240Hz refresh rate tv and it looks amazing so far on the tables I have put into pinup player/popper. The videos and plans are coming soon I swear.....just not enough time in the day. Thanks for the watch!
@@wayofthewrench It really was a pleasure following your videos and do my build. I cant wait for you to begin the pinball, look forward to that. I'm all the way from South Africa, so you can tell everyone that one of your builds is on the Africa continent :) I send you my pics of my build, Name I used is Acidmax (Gamer Tag).
Lesley! Just checking in, in case you didn't know....my virtual pinball series is alive and 24 videos strong. Thanks for suggestion a long time ago!
Good project though you could have just used a 2-pin connector or soldered the wires directly to the board.
Yeah I could have but they have been ok (haven't disconnected in over 2 years). I still need to set this up on my main pi so I can have a safe reset when it has a jammer every now and then. Right now, I just open up the control panel and manually touch the contacts but it would be nice to have a button (I even drilled a hole for it so I could just poke the button when it needed it and so no one else could hit it. Thanks for the watch! You should check out my vpin build series....it's soooo good. Cheers!
Get a flat head soldering tip when doing that.
yeah might have helped but the pads were so tiny and close. The best thing was to pre tin the pads on the board and then it went waaay easier.
wow
Still have to show you this bad boy....one of these days
Video starts 14:00 welcome
Yup, there's a time stamp at 14:02 as well. This video is part of a video series for a diy arcade cabinet so I included the step needed to wire in the on/off button for the script to work. Thanks for the watch!
Awsome
Yeet!
Your from Slovakia?
I live in Canada but I am Slovak! Guess that makes me a Canvak or Slovadian. lol. Ahoy!
Word from the wise use a flat tip instead of point. A flat tip gives good solder point
Yeah I borrowed a general purpose pencil soldering iron but I have used fine point electronics soldering irons before that worked way better.....not my finest soldering.
@@wayofthewrench good build this is what i do in my spare time in the cave is practice on any power board your not using. I always see you perfect so i was gonna throw my solder sucker stick and solder braid thru the screen to you.
lol...I can imagine. I have to show my mistakes too, everybody can always improve.....that's what it's all about. Cheers!
If you '"Soddeh" pins to a board, ute a flathead tip.
Good tip but in this case the solder pads were so tiny I don't think it would fit. Plus I used what I had, they may not be my best solder joints but there were good. No issues in 2 years of use. Thanks for the tip and the watch!
Wow
You should see the virtual pinball I'm building....sooo cool
How much? TAKE MY MONEY
Lol....free. Just buy the materials. There is a whole series on how to make what you see. If you have any questions, feel free to ask.