Hackable Raspberry Pi Switch Quick Start

Hardware Install

Connect to your Raspberry Pi as below

Software Installation

  • Enable GPIO 15 as TxD. In /boot/config.txt , add below
    enable_uart=1
  • Install Python Module RPi.GPIO
sudo apt-get install python-dev python-rpi.gpio
  • If you dont have git, install it using
   sudo apt-get install git
  • Install Nanomesher PiSwitch Shutdown script. The install.sh will install a service called “nanomesher_piswitch” for detecting power off trigger from the Pi Switch
git clone https://github.com/nanomesher/Nanomesher_PiSwitch_Shutdown.git

cd Nanomesher_PiSwitch_Shutdown

./install.sh

  • To check if the service is install correctly, you will see it being loaded

sudo /bin/systemctl status nanomesher_piswitch

  • You should see it being active and running
  • To start / stop / restart the service

sudo /bin/systemctl start nanomesher_piswitch

sudo /bin/systemctl stop nanomesher_piswitch

sudo /bin/systemctl restart nanomesher_piswitch