Pascal Hibon wrote: 
> I finally got around implementing a shutdown button. It is based on the
> script gib8 created but I modified it slightly. The hardware is a bit
> different too. I use a delayed button; you have to press and hold it for
> about 2 seconds before it kicks in. 
> 
> The hardware consists of just a few components: 
> 
> As mentioned, I slightly modified gib8’s script and called it
> *csos-shutdown*. It is located in */usr/sbin* and contains the
> following:
> 
> > 
Code:
--------------------
  >   > 
  > #!/bin/bash
  > 
  > sudo echo in > /sys/class/gpio/gpio91/direction
  > sudo echo out > /sys/class/gpio/gpio200/direction
  > sudo echo 1 > /sys/class/gpio/gpio200/value
  > 
  > while [ true ]; do
  >     i=`cat /sys/class/gpio/gpio91/value`
  >     if [ $i -eq 1 ] 
  >     then
  >                     sudo echo 0 > /sys/class/gpio/gpio200/value
  >                     sleep 0.5
  >                     sudo echo 1 > /sys/class/gpio/gpio200/value
  >                     sleep 0.5
  >                     sudo echo 0 > /sys/class/gpio/gpio200/value
  >                     sleep 0.5
  >                     sudo echo 1 > /sys/class/gpio/gpio200/value
  >                     sleep 0.5
  >                     sudo echo 0 > /sys/class/gpio/gpio200/value
  >                     sleep 0.5
  >                     sudo echo 1 > /sys/class/gpio/gpio200/value
  >                     sleep 0.5
  >                     sudo echo 0 > /sys/class/gpio/gpio200/value
  >                     sudo shutdown -h now
  > break
  >     fi
  >     sleep 1
  > done
  > 
--------------------
> > 
> 
> This script needs to be executable, so run the command *chmod 777
> csos-shutdown*
> 
> Next, create a service file called *shutdown.service* located in *
> /etc/systemd/system*
> The shutdown.service file contains the following:
> 
> > 
Code:
--------------------
  >   > 
  > [Unit]
  > Description=Shutdown Switch
  > 
  > [Service]
  > ExecStart=/usr/sbin/csos-shutdown
  > Type=idle
  > 
  > [Install]
  > WantedBy=multi-user.target
  > 
--------------------
> > 
> 
> Then enable the service: *systemctl enable shutdown.service* and
> reboot the system.
> 
> How does it work: press and hold the button (about two seconds) until
> the LED starts to blink. Allow about 30 seconds (to be sure) to let
> the WB shutdown safely before removing the power.

Hi, could you add detailed instructions on how to do this to your
msqueeze-page. To me it seems to be the "missing link" for implementing
a wandboard in my car :) Does it also allow for powering on? Does the
wandboard have some kind of "suspend"-mode, to accelerate waking up
again?



Main System: Touch; Marantz SR-5004; TMA Premium 905; TMA Premium 901;
BK Monolith+ FF; HDI Dune Smart D1; Pioneer PDP-LX5090H
iPad 32GB Wifi + Squeezepad (local playback activated)
Acer Iconia Tab A700 + Squeezeplayer
Wandboard Duallite + CSOS, integrated LMS activated
------------------------------------------------------------------------
bakker_be's Profile: http://forums.slimdevices.com/member.php?userid=30369
View this thread: http://forums.slimdevices.com/showthread.php?t=99395

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to