User Tools

Site Tools


makerbase-soft-shutdown-files

THIS WIKI HAS MOVED!

ACTUAL LOCATION:

2025/01/21 11:53 · torte

https://torte71.github.io/InsideSovolKlipperScreen/makerbase-soft-shutdown-files.html

.








2025/01/21 11:53 · torte

makerbase-soft-shutdown.service files

/usr/lib/systemd/system/makerbase-soft-shutdown.service

[Unit]
Description=makerbase-soft-shutdown
After=network.target
Wants=udev.target

[Install]
WantedBy=multi-user.target

[Service]
Type=oneshot
ExecStart=/root/soft_shutdown.sh

/root/soft_shutdown.sh

  • Sets up GPIO for the supper capacitor
  • does nothing more, because logic is commented out
#!/bin/bash


#enable the control of the supper capacitor,GPIO3_A4
if [ -d /sys/class/gpio/gpio100 ]
then
        echo out > /sys/class/gpio/gpio100/direction
        echo 0 > /sys/class/gpio/gpio100/value
else
        echo 100 > /sys/class/gpio/export
        echo out > /sys/class/gpio/gpio100/direction
        echo 0 > /sys/class/gpio/gpio100/value
fi

#power-off signal,gpio85(GPIO2_C5)
if [ -d /sys/class/gpio/gpio85 ]
then
        echo in > /sys/class/gpio/gpio85/direction
else
        echo 85 > /sys/class/gpio/export
        echo in > /sys/class/gpio/gpio85/direction
fi

while :
do
        #level=`cat /sys/class/gpio/gpio85/value` #Detect the power-off signal,gpio85(GPIO1_B2)
        #echo "gpio:$((level))"
        if [ "$level" = 1 ]
        then		
			sync
#           shutdown -h now

        fi
        sync
        sleep 2
done
makerbase-soft-shutdown-files.txt · Last modified: 2025/01/21 12:34 by torte