User Tools

Site Tools


shutdown

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
shutdown [2024/11/27 09:46] torteshutdown [2025/01/21 12:20] (current) torte
Line 1: Line 1:
-===== Sovol SV06+ (mostly) ===== +{{page>redirect#this_wiki_has_moved}} 
-==== Klipper Shutdown ====+https://torte71.github.io/InsideSovolKlipperScreen/shutdown.html 
 +{{page>redirect#section}} 
 +---- 
 + 
 +====== Sovol SV06+/SV07+ (mostly) ====== 
 +===== Klipper Shutdown ===== 
 +===== Windows version =====
  
 ---- ----
Line 12: Line 18:
 ---- ----
  
-For the experienced:+==== Shutdown using scripts ====
  
 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. 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:+(Actually it is first checked, if the device is powered on (reacts to "ping"). If it does not respond, the hs110 is powered off immediately. Otherwise a "shutdown" command is issued to the device and the script waits until the device stops responding to "ping". After an additional pause of 7 seconds, the hs110 is finally powered off). 
 + 
 +These scripts are not limited to Sovol's KlipperScreen, they can be used with any hardware running linux (they do not even depend on klipper). Just make sure to a) adjust the variable ''PRINTER'' in ''mks_poweroff.cmd'' and ''shutdown_sv06.cmd'' to the name or IP-address of your device and b) adjust the variable ''USERNAME'' in ''mks_poweroff.cmd'' to the username on your device. 
 + 
 +==== Requirements ====
   * HS110 wifi power plug   * HS110 wifi power plug
   * Putty "plink.exe" from https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html   * Putty "plink.exe" from https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
Line 26: Line 36:
     * modified /etc/sudoers.conf to allow passwordless shutdown     * modified /etc/sudoers.conf to allow passwordless shutdown
  
-The files:+==== The files ====
   * ''hs110_off.cmd'': Sends a power off command to the HS110 wifi plug   * ''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   * ''hs110_on.cmd'': Sends a power on command to the HS110 wifi plug
   * ''mks_poweroff.cmd'': Sends a shutdown command to the KlipperScreen   * ''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   * ''shutdown_sv06.cmd'': Shuts down the KlipperScreen, then powers it off using the HS110 wifi plug
 +  * ''tplink_smartplug.py'': Sends commands to the HS110. See above link to download it.
  
-These files need to be put into the same directory.+These files need to be put into the same directory.
  
 If nothing went wrong, you should now be able to shutdown and power off the printer by executing ''shutdown_sv06.cmd''. If nothing went wrong, you should now be able to shutdown and power off the printer by executing ''shutdown_sv06.cmd''.
Line 40: Line 51:
 ---- ----
  
-=== hs110_off.cmd ===+==== hs110_off.cmd ====
   * Replace the "192.168.1.60" with the actual IP address of your HS110 wifi power plug.   * Replace the "192.168.1.60" with the actual IP address of your HS110 wifi power plug.
 +  * See [[#troubleshooting]] if this command does not power off the device
 <code> <code>
 tplink_smartplug.py -t 192.168.1.60 -c off tplink_smartplug.py -t 192.168.1.60 -c off
 </code> </code>
  
-=== hs110_on.cmd ===+==== hs110_on.cmd ====
   * Replace the "192.168.1.60" with the actual IP address of your HS110 wifi power plug.   * Replace the "192.168.1.60" with the actual IP address of your HS110 wifi power plug.
 +  * See [[#troubleshooting]] if this command does not power on the device
 <code> <code>
 tplink_smartplug.py -t 192.168.1.60 -c on tplink_smartplug.py -t 192.168.1.60 -c on
 </code> </code>
  
-=== mks_poweroff.cmd ===+==== mks_poweroff.cmd ====
   * Adjust PRINTER to the name or IP address of your KlipperScreen device   * Adjust PRINTER to the name or IP address of your KlipperScreen device
   * Adjust PLINKCMD to match your putty installation.   * Adjust PLINKCMD to match your putty installation.
Line 61: Line 74:
     * Set PLINKKEY to match your generated ssh key.     * Set PLINKKEY to match your generated ssh key.
     * Clear out PASSWORD     * Clear out PASSWORD
 +  * For other hardware than Sovol's KlipperScreen:
 +    * Adjust USERNAME, e.g. to ''pi'' on a default Raspbian installation
 <code> <code>
 @echo off @echo off
Line 67: Line 82:
  
 set PRINTER=mkspi set PRINTER=mkspi
 +set USERNAME=mks
 set PLINKCMD=c:\putty\plink.exe set PLINKCMD=c:\putty\plink.exe
 set PLINKKEY= set PLINKKEY=
Line 92: Line 108:
  
 :LOGIN :LOGIN
-%PLINKCMD% %OPTPW% %OPTKEY% -batch mks@%PRINTER% %POWERCMD%+%PLINKCMD% %OPTPW% %OPTKEY% -batch %USERNAME%@%PRINTER% %POWERCMD%
 </code> </code>
  
-=== shutdown_sv06.cmd ===+==== shutdown_sv06.cmd ====
   * Adjust PRINTER to the name or IP address of your KlipperScreen device   * Adjust PRINTER to the name or IP address of your KlipperScreen device
 <code> <code>
Line 136: Line 152:
 ---- ----
  
-=== For the advanced: Passwordless login and shutdown using ssh key and visudo ===+===== Advanced: Passwordless login and shutdown using ssh key and visudo =====
  
-Prepare the ssh key:+==== Preparing the ssh key ====
   * Start ''puttygen.exe''   * Start ''puttygen.exe''
   * Select the "EdDSA" radiobox   * Select the "EdDSA" radiobox
Line 159: Line 175:
     * Press ''ENTER'' to confirm the filename     * Press ''ENTER'' to confirm the filename
  
-Test the ssh key:+==== Testing the ssh key ====
   * Open a command prompt   * Open a command prompt
-  * Adjust the paths to plink and the saved key, and replace "mkspi" by the name or IP address of your KlipperScreen, then execute it:\\ ''c:\putty\plink.exe -i c:\putty\printer.ppk -batch mks@mkspi sudo poweroff''+  * Adjust the paths to plink and the saved key, and replace "mkspi" by the name or IP address of your KlipperScreen, then execute it:\\ ''c:\putty\plink.exe -i c:\putty\printer.ppk -batch mks@mkspi sudo poweroff''\\ (Also replace "mks" with the actual username when not using Sovol's KlipperScreen)
   * When you connect first, plink will ask to save a fingerprint. Press "y" to confirm that.   * When you connect first, plink will ask to save a fingerprint. Press "y" to confirm that.
   * You should now be logged into the KlipperScreen without any further input/password prompts.\\ If not, then you've either made a mistake copying the public key to the ''authorized_keys'' file or selected a wrong private key file.   * You should now be logged into the KlipperScreen without any further input/password prompts.\\ If not, then you've either made a mistake copying the public key to the ''authorized_keys'' file or selected a wrong private key file.
  
-Prepare ''/etc/sudoers.conf'':+==== Preparing ''/etc/sudoers.conf'' ====
   * Execute ''sudo visudo''   * Execute ''sudo visudo''
   * Append following line in the editor that just opened:   * Append following line in the editor that just opened:
Line 175: Line 191:
 ---- ----
  
-=== Troubleshooting ===+===== Troubleshooting =====
   * HS110 not turning on or off   * HS110 not turning on or off
     * Ensure that the IP-address of the HS110 is correctly set in ''hs110_on.cmd'' and ''hs110_off.cmd''     * Ensure that the IP-address of the HS110 is correctly set in ''hs110_on.cmd'' and ''hs110_off.cmd''
Line 186: Line 202:
         * ''c:\python\pythonw.exe tplink_smartplug.py -t 192.168.1.60 -c on''         * ''c:\python\pythonw.exe tplink_smartplug.py -t 192.168.1.60 -c on''
  
 +===== Linux version =====
 +Linux versions of these scripts are [[shutdown_linux|available here]].
 +
 +----
 +Back to [[start]]
shutdown.1732697163.txt.gz · Last modified: 2024/11/27 09:46 by torte