
Where can I find a safe shutdown script?
Where can I find a safe shutdown script?
I don’t know if it needs special hardware but I was wondering how to do safe shut down? Thanks in advance 

- infinitLoop
- Posts: 536
- Joined: Mon Dec 24, 2018 11:46 am
- Location: Portland, OR
- Has thanked: 222 times
- Been thanked: 199 times
- Contact:
Re: Where can I find a safe shutdown script?
i think that the easiest solution is to add a gpio button, and put this in config.txt (assuming pin 4 for this):
Code: Select all
dtoverlay=gpio-shutdown,gpio_pin=4
Some of my builds...
BMO GBZ
Star Wars Millenium Falcon Challenge
Game Boy Color Zero
... and another Gameboy Color Zero with custom 3D-printed parts
"Ultimate" 3A+ Build
GlowBoy Zero
Some 3d designs I've done...
Soft Tactile Shoulder Buttons, for screw-hole, well mounting
Snap-in, Soft Tactile Shoulder Button insert, for screw-hole, well mounting
Pac-Man and Space Invaders Themed Rear Fan Holder
BMO GBZ
Star Wars Millenium Falcon Challenge
Game Boy Color Zero
... and another Gameboy Color Zero with custom 3D-printed parts
"Ultimate" 3A+ Build
GlowBoy Zero
Some 3d designs I've done...
Soft Tactile Shoulder Buttons, for screw-hole, well mounting
Snap-in, Soft Tactile Shoulder Button insert, for screw-hole, well mounting
Pac-Man and Space Invaders Themed Rear Fan Holder
Re: Where can I find a safe shutdown script?
Cool, thanks, could it be possible to run a toggle button through a teensy it has 5 volt output right?
- infinitLoop
- Posts: 536
- Joined: Mon Dec 24, 2018 11:46 am
- Location: Portland, OR
- Has thanked: 222 times
- Been thanked: 199 times
- Contact:
Re: Where can I find a safe shutdown script?
hm, not in that way. that would work for a button straight to the gpio. when you use a teensy, or similar, you program it to pretend to be a usb keyboard input, and that's how its used as a controller. i haven't tried to point a keyboard button to the shutdown command, but it's probably possible (although, my guess is it's harder than just using the gpio).
but, it's at least as easy to solder the wires to the pi itself, so unless you're using all your pins, it still seems easier to go the gpio.
Some of my builds...
BMO GBZ
Star Wars Millenium Falcon Challenge
Game Boy Color Zero
... and another Gameboy Color Zero with custom 3D-printed parts
"Ultimate" 3A+ Build
GlowBoy Zero
Some 3d designs I've done...
Soft Tactile Shoulder Buttons, for screw-hole, well mounting
Snap-in, Soft Tactile Shoulder Button insert, for screw-hole, well mounting
Pac-Man and Space Invaders Themed Rear Fan Holder
BMO GBZ
Star Wars Millenium Falcon Challenge
Game Boy Color Zero
... and another Gameboy Color Zero with custom 3D-printed parts
"Ultimate" 3A+ Build
GlowBoy Zero
Some 3d designs I've done...
Soft Tactile Shoulder Buttons, for screw-hole, well mounting
Snap-in, Soft Tactile Shoulder Button insert, for screw-hole, well mounting
Pac-Man and Space Invaders Themed Rear Fan Holder
Re: Where can I find a safe shutdown script?
couldnt you still use the teensy in serial+keyboard? Then wire that to the gpio? Then have a separate pin outputting 5v? Sorry I’m kinda new to this stuff.
- infinitLoop
- Posts: 536
- Joined: Mon Dec 24, 2018 11:46 am
- Location: Portland, OR
- Has thanked: 222 times
- Been thanked: 199 times
- Contact:
Re: Where can I find a safe shutdown script?
pretty sure you shouldn't wire 5v from the teensy to a pi's gpio. the input pins are lower voltage, like 1.1v or something. enough to get on/off digital signals mainly. the 5v is your main power line. if you push 5v into the gpio pins that aren't the two that are labelled 5v, you're going to fry the pi (if it's a zero. the other models have some voltage protection, i think, but it's still a very bad idea).
as far as programming in keyboard + serial -- i dunno, maybe. i've only ever set up micro controllers to do keyboard, key press stuff. but again, it seems way harder than just wiring the button to the gpio, to have the micro handle it.
as far as programming in keyboard + serial -- i dunno, maybe. i've only ever set up micro controllers to do keyboard, key press stuff. but again, it seems way harder than just wiring the button to the gpio, to have the micro handle it.
Some of my builds...
BMO GBZ
Star Wars Millenium Falcon Challenge
Game Boy Color Zero
... and another Gameboy Color Zero with custom 3D-printed parts
"Ultimate" 3A+ Build
GlowBoy Zero
Some 3d designs I've done...
Soft Tactile Shoulder Buttons, for screw-hole, well mounting
Snap-in, Soft Tactile Shoulder Button insert, for screw-hole, well mounting
Pac-Man and Space Invaders Themed Rear Fan Holder
BMO GBZ
Star Wars Millenium Falcon Challenge
Game Boy Color Zero
... and another Gameboy Color Zero with custom 3D-printed parts
"Ultimate" 3A+ Build
GlowBoy Zero
Some 3d designs I've done...
Soft Tactile Shoulder Buttons, for screw-hole, well mounting
Snap-in, Soft Tactile Shoulder Button insert, for screw-hole, well mounting
Pac-Man and Space Invaders Themed Rear Fan Holder
Re: Where can I find a safe shutdown script?
Yeah your right. (But for the record I was gonna run it throughout the dedicated 5v pins)
Re: Where can I find a safe shutdown script?
Here’s what I was thinking
UPDATE: just remembered shutting down and powering off are two separate things forget all of this
UPDATE: just remembered shutting down and powering off are two separate things forget all of this
- infinitLoop
- Posts: 536
- Joined: Mon Dec 24, 2018 11:46 am
- Location: Portland, OR
- Has thanked: 222 times
- Been thanked: 199 times
- Contact:
Re: Where can I find a safe shutdown script?
right - if you want shutdown + power off, then that's something people have used gates for, or at least some kind of circuit. depending on the power supply you want to use, you might have some options around utilizing the "engage" pin too. the ones i've seen/used still use just the gpio for control though, and basically have one pin call "shut down" then another pin that stays active til the power down, and then that triggers it to cut the power.
Some of my builds...
BMO GBZ
Star Wars Millenium Falcon Challenge
Game Boy Color Zero
... and another Gameboy Color Zero with custom 3D-printed parts
"Ultimate" 3A+ Build
GlowBoy Zero
Some 3d designs I've done...
Soft Tactile Shoulder Buttons, for screw-hole, well mounting
Snap-in, Soft Tactile Shoulder Button insert, for screw-hole, well mounting
Pac-Man and Space Invaders Themed Rear Fan Holder
BMO GBZ
Star Wars Millenium Falcon Challenge
Game Boy Color Zero
... and another Gameboy Color Zero with custom 3D-printed parts
"Ultimate" 3A+ Build
GlowBoy Zero
Some 3d designs I've done...
Soft Tactile Shoulder Buttons, for screw-hole, well mounting
Snap-in, Soft Tactile Shoulder Button insert, for screw-hole, well mounting
Pac-Man and Space Invaders Themed Rear Fan Holder
- infinitLoop
- Posts: 536
- Joined: Mon Dec 24, 2018 11:46 am
- Location: Portland, OR
- Has thanked: 222 times
- Been thanked: 199 times
- Contact:
Re: Where can I find a safe shutdown script?
Some of my builds...
BMO GBZ
Star Wars Millenium Falcon Challenge
Game Boy Color Zero
... and another Gameboy Color Zero with custom 3D-printed parts
"Ultimate" 3A+ Build
GlowBoy Zero
Some 3d designs I've done...
Soft Tactile Shoulder Buttons, for screw-hole, well mounting
Snap-in, Soft Tactile Shoulder Button insert, for screw-hole, well mounting
Pac-Man and Space Invaders Themed Rear Fan Holder
BMO GBZ
Star Wars Millenium Falcon Challenge
Game Boy Color Zero
... and another Gameboy Color Zero with custom 3D-printed parts
"Ultimate" 3A+ Build
GlowBoy Zero
Some 3d designs I've done...
Soft Tactile Shoulder Buttons, for screw-hole, well mounting
Snap-in, Soft Tactile Shoulder Button insert, for screw-hole, well mounting
Pac-Man and Space Invaders Themed Rear Fan Holder
Who is online
Users browsing this forum: Google [Bot] and 1 guest