Setting up the Raspberry Pi for Juice4halt

This procedure was tested with the Raspberry Pi 3,  Raspberry Pi 2 and Raspberry Pi Model B+, OS Raspbian installed from NOOBS v1.3.4

  • The shutdown_script file uses only one GPIO pin (default GPIO25) for bidirectional communication between the Juice4halt and the Raspberry Pi.

Auto-running the script on startup

  • Create the following folder:

 

     mkdir /home/pi/juice4halt/bin/

 

 

  • Download the script file shutdown_script here, and copy it into the created folder.
  • Open the file:

 

     sudo nano /etc/rc.local

 

 

  • Add the following line before the exit 0 in the last line:

 

     /home/pi/juice4halt/bin/shutdown_script &

 

 

     /home/pi/juice4halt/bin/shutdown

_script &

 

 

  • Save the file.
  • Make the shutdown_script file executable by typing the following command:

 

     sudo chmod 755 shutdown_script