User Tools

Site Tools


shutdown

This is an old revision of the document!


Sovol SV06+ (mostly)

Klipper Shutdown


Do not simply power off the device by the switch.

Shut it down using either the web interface or the buttons on the KlipperScreen first.

Just powering it off can -and does- lead to damaged files.


For the experienced:

I am using a set of batch files to power my printer on and off safely by first sending a “shutdown” command to the device via ssh (actually Putty's plink.exe) and then sending a shutdown command to my hs110 wifi power plug.

What you need:

The files:

  • hs110_off.cmd: Sends a power off command to the HS110 wifi plug
  • hs110_on.cmd: Sends a power on command to the HS110 wifi plug
  • mks_poweroff.cmd: Sends a shutdown command to the KlipperScreen
  • shutdown_sv06.cmd: Shuts down the KlipperScreen, then powers it off using the HS110 wifi plug

hs110_off.cmd

  • Replace the “192.168.1.60” with the actual IP address of your HS110 wifi power plug.
tplink_smartplug.py -t 192.168.1.60 -c off

hs110_on.cmd

  • Replace the “192.168.1.60” with the actual IP address of your HS110 wifi power plug.
tplink_smartplug.py -t 192.168.1.60 -c on

mks_poweroff.cmd

  • Adjust PLINKCMD to match your putty installation.
  • Adjust PLINKKEY to match your generated ssh key.
  • Adjust PRINTER to the name or IP address of your KlipperScreen device
@echo off

set PLINKCMD=c:\putty\plink.exe
set PLINKKEY=c:\putty\printer.ppk
set PRINTER=mkspi

%PLINKCMD% -i %PLINKKEY% -batch mks@%PRINTER% sudo poweroff

shutdown_sv06.cmd

  • Adjust PRINTER to the name or IP address of your KlipperScreen device
@echo off

rem MKSPI: allow user "mks" to shutdown/reboot/halt:
rem        add following to /etc/sudoers.conf (run "visudo"):
rem        mks ALL=NOPASSWD: /sbin/halt, /sbin/reboot, /sbin/poweroff

rem doc: PRINT ON SAME LINE: "<NUL set /p =TextToDisplay"

set PRINTER=mkspi

rem try to ping MKSPI
ping -n 1 -w 1000 %PRINTER% >NUL
rem bail out, if MKSPI did not respond
if errorlevel 1 goto smartplug_off

echo Shutting down MKSPI
call mks_poweroff.cmd

<NUL set /p =Waiting for MKS to shutdown
:pingloop
rem echo "." on same line
<NUL set /p =.
rem try to ping MKSPI
ping -n 1 -w 1000 %PRINTER% >NUL
rem bail out, if MKSPI did not respond
if errorlevel 1 goto did_shutdown
rem otherwise wait a second
ping -n 2 127.0.0.1 >NUL
rem then try next ping
goto pingloop

:did_shutdown
echo MKS has shut down.
echo Waiting additional 7 seconds...
ping -n 8 127.0.0.1 >NUL

:smartplug_off
echo Power off HS110 smartplug...
call hs110_off
shutdown.1731511662.txt.gz · Last modified: 2024/11/13 16:27 by torte