Shutdown script used by Nanomesher Hackable Pi Switch
Python Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
LICENSE Initial commit May 9, 2017 Update May 9, 2017
RunShutdownDetect Fix RunShutdownDetect May 9, 2017
nanomesher_piswitch.service Add install as systemd service shell script Feb 3, 2018

Nanomesher PiSwitch Shutdown Detect Script

This is the Shutdown Detection script used by Hackable Raspberry Pi Switch


This python script monitors GPIO pin 7 (GPIO04). The pin needs to be setup as pull down. If the pin goes high and remain high for more than 250ms. It will triggers the linux operating system to shutdown

This script is intended to be used by Raspberry Pi but can be easily modified to suit other variances.


  • Python 2.x or Python 3.x
  • Python GPIO library
sudo apt-get install python-dev python-rpi.gpio