Uncategorized

Rpi GPIO shutdown switch

Asked 
Viewed 7 times
1

I am new to Raspberry Pi and am trying to use the headless shutdown module provided by Adafruit.

I downloaded the script of Adafruit-GPIO-Halt to my Raspberry Pi, installed it to the /usr/local/bin/gpio-halt file and even made a file on the system/system folder, following the steps on https://www.recantha.co.uk/blog/?p=13999.

However, the file in the systemd/system folder is getting saved with a .service.save extension and system prevents me from using the line sudo chmod 644 /lib/systemd/system/gpio-halt.service by saying, ‘Permission denied.’

I would like to set-up the code to run on start-up. I am using Raspbian Version 9(stretch). Please help.

 New contributor
  • 1
    If you want help post a link to the module, and describe in detail what YOU did, not a link to an old tutorial for an obsolete OS. – Milliways 2 hours ago
  • Hi @Atharv Goel, Welcome and nice to me you. Ah let me see, the headless Rpi shut down trick has many variations, yours is not that newbie friendly because you need to install the newbie scary Git thing, and compile a hard to understand C program. I would suggest you to try a more newbie friendly, no Git, no compile, just a short python script. / ton continue, … – tlfong01 16 mins ago   
  • 1
    Are you just trying to shutdown with a button? I thought you were referring to a power module NOT code. – Milliways 12 mins ago
  • The secret Rpi shut down trick needs to short/connect two Rpi GPIO pins, using a manual switch, or just a paper clip. There is also a David Copperfield like magic variation using a tilt switch, then you don’t even need a paper clip, just TURN KEYBOARD UPSIDE DOWN and Rpi will switch off by itself. The trick is here: (1) Simple Shutdown Raspberry Pi Button by Using GPIO: instructables.com/id/… instructables.com/id/…. – tlfong01 7 mins ago   
  • The tilt switch, a cheapie toy like thing is just a switch which shorts/connects two contact points when you tilt it. For more details, you can search this forum using the keyword “tilt switch”. Now if you show your magic Rpi shut down to your bad friends or your daughter, then they would start to respect you more than you deserve. 🙂 – tlfong01 1 min ago   Edit   

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: