Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Previous revision
Last revision Both sides next revision
carberry:rpi:daemons:shutdown [2017/06/29 16:57]
carberry:rpi:daemons:shutdown [2022/03/08 09:06]
admin
Line 1: Line 1:
 +===== The shutdown daemon =====
  
 +To properly shutdown Raspberry Pi when ignition signal disappears, an electrical line was provided to notify the need to shutdown.
 +The shutdown daemon, monitors this line (pin 13 on P1 header of Raspberry Pi). When this pin goes low, a shutdown command is issued.
 +
 +==== Downlaod the daemon ====
 +
 +Click here to [[http://​www.carberry.it/​down.php?​download_id=691|download]] the shutdown daemon, or follow installation steps below:
 +
 +==== Install the daemon ====
 +  ​
 +Enter home directory:
 +
 +  cd /home/pi/
 +
 +Download the daemon:
 +
 +  curl -O -J "​https://​www.carberry.it/​index.php?​route=download/​download/​download&​download_id=11"​
 +  ​
 +Untar the file:
 +
 +  tar -xvf shutdown_d_1.0.tar
 +
 +Add execution rights:
 +
 +  chmod +x /​home/​pi/​shutdown_d/​shutdown.sh
 +
 +Add a new line to the ''/​etc/​rc.local''​ before ''​exit 0''​ line.\\
 +Edit:
 +
 +  sudo nano /​etc/​rc.local
 +
 +Add:
 +  ​
 +  /​home/​pi/​shutdown_d/​shutdown.sh&​
 +  exit 0
 +  ​
 +System Reboot:
 +
 +  sudo reboot
 +  ​
 +==== Check daemon exexution ====
 +
 +Check daemon execution:
 +  ​
 +  ps aux | grep shutdown
 +
 +You have to see something like this:
 +
 +  pi@raspberrypi ~ $ ps aux | grep shutdown
 +  root      2058  0.4  0.2   ​2736 ​ 1188 ?        S    14:40   0:00 /bin/bash /​home/​pi/​shutdown_d/​shutdown.sh
 +  pi        2380  0.0  0.1   ​3568 ​  832 pts/0    S+   ​14:​42 ​  0:00 grep --color=auto shutdown
 +  pi@raspberrypi ~ $
 +
 +
 +==== Test the daemon ====
 +
 +To test the daemon, take a wire, and jump toghether pin 13 and pin 25 of P1 connector on Raspberry Pi.
 +Raspberry Pi will halt now!. 
 +  ​
 +