{"id":16520014,"url":"https://github.com/pageauc/rpi-shutdown","last_synced_at":"2025-07-14T05:35:52.626Z","repository":{"id":74954775,"uuid":"355232176","full_name":"pageauc/rpi-shutdown","owner":"pageauc","description":"Safely shutdown a raspberry pi using a momentary switch","archived":false,"fork":false,"pushed_at":"2021-04-06T15:06:48.000Z","size":3,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-02T23:41:37.149Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pageauc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-06T15:06:43.000Z","updated_at":"2022-01-19T15:26:21.000Z","dependencies_parsed_at":"2023-07-25T20:31:35.236Z","dependency_job_id":null,"html_url":"https://github.com/pageauc/rpi-shutdown","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pageauc/rpi-shutdown","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageauc%2Frpi-shutdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageauc%2Frpi-shutdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageauc%2Frpi-shutdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageauc%2Frpi-shutdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pageauc","download_url":"https://codeload.github.com/pageauc/rpi-shutdown/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageauc%2Frpi-shutdown/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265246022,"owners_count":23734109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T16:49:12.963Z","updated_at":"2025-07-14T05:35:49.850Z","avatar_url":"https://github.com/pageauc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rpi-shutdown\n\n## Purpose\nSafely shutdown (halt) Raspberry pi using a normally open momentary switch\n\n## Hardware Requirements\nRequires one small normally open momentary push button switch \nand two short insulated wires.  \n\n## Instructions\nMount switch and Connect each wire per below.\n\n* Connect control wire from one switch terminal to RPI GPIO control pin 5   (default)  \n* Connect ground wire from second switch terminal to RPI GPIO ground pin 6 (default)  \nor \nset gpio_pin variable by editing shutdown.py and setting gpio_pin = variable to desired control pin, then connect control wire as appropriate\n\n***Note:*** If desired set button_hold_sec variable by editing shutdown.py and changing button_hold_sec = variable\nto desired number of seconds required to hold down momentary switch before RPI halt action is taken.    \ndefault is 2 seconds.  0=No delay\n\n## Software Install\n\n### Easy Install\n\n***Step 1*** With mouse left button highlight curl command in code box below. Right click mouse in highlighted area and Copy.  \n***Step 2*** On RPI putty SSH or terminal session right click, select paste then Enter to download and run script.   \n\n    curl -L https://raw.github.com/pageauc/rpi-shutdown/master/install.sh | bash\n\nThe command above will download and Run the GitHub rpi-shutdown install.sh script and install to ~/shutdown folder.  \n\n### Manual Install\n    cd ~\n    mkdir shutdown\n    cd shutdown\n    wget -O shutdown.py https://raw.github.com/pageauc/rpi-shutdown/master/shutdown.py\n    chmod +x shutdown.py\n    sudo crontab -e\n\nAdd line below to sudo crontab -e (without #) Ctrl-x y to exit nano and save change\n\n    @reboot /home/pi/shutdown/shutdown.py\n\n## Operating Instructions\nAfter initial power boot of Raspberry Pi, To Initiate Halt, press momentary switch for specfied time\nto Initiate safe shutown.  You can then safely power off RPI or alternatively Restart from Halt by \nwaiting approx 5 seconds, then press and holding momentary switch for specified seconds. This will restart\nthe raspberry pi from the Halt state.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpageauc%2Frpi-shutdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpageauc%2Frpi-shutdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpageauc%2Frpi-shutdown/lists"}