shutdown
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
shutdown [2024/11/13 16:27] – created torte | shutdown [2025/01/21 12:20] (current) – torte | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Sovol SV06+ (mostly) ===== | + | {{page> |
- | ==== Klipper Shutdown ==== | + | https:// |
+ | {{page> | ||
+ | ---- | ||
+ | |||
+ | ====== 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 " | I am using a set of batch files to power my printer on and off safely by first sending a " | ||
- | What you need: | + | (Actually it is first checked, if the device is powered on (reacts to " |
+ | |||
+ | These scripts are not limited to Sovol' | ||
+ | |||
+ | ==== Requirements ==== | ||
* HS110 wifi power plug | * HS110 wifi power plug | ||
- | * Putty " | + | * Putty " |
- | * Putty " | + | * Putty " |
* softScheck " | * softScheck " | ||
- | * Python from https:// | + | * Python |
- | * ssh key on the KlipperScreen device to allow passwordless login | + | |
- | * modified / | + | |
+ | * modified / | ||
- | The files: | + | ==== The files ==== |
- | * hs110_off.cmd: | + | * '' |
- | * hs110_on.cmd: | + | * '' |
- | * mks_poweroff.cmd: | + | * '' |
- | * shutdown_sv06.cmd: | + | * '' |
+ | * '' | ||
+ | |||
+ | These 5 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 '' | ||
+ | |||
+ | To power it on, execute '' | ||
+ | |||
+ | ---- | ||
- | === hs110_off.cmd === | + | ==== hs110_off.cmd |
* Replace the " | * Replace the " | ||
+ | * See [[# | ||
< | < | ||
tplink_smartplug.py -t 192.168.1.60 -c off | tplink_smartplug.py -t 192.168.1.60 -c off | ||
</ | </ | ||
- | === hs110_on.cmd === | + | ==== hs110_on.cmd |
* Replace the " | * Replace the " | ||
+ | * See [[# | ||
< | < | ||
tplink_smartplug.py -t 192.168.1.60 -c on | tplink_smartplug.py -t 192.168.1.60 -c on | ||
</ | </ | ||
- | === mks_poweroff.cmd === | + | ==== 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 | * Adjust PRINTER to the name or IP address of your KlipperScreen device | ||
+ | * Adjust PLINKCMD to match your putty installation. | ||
+ | * For login using clear text password (not recommended, | ||
+ | * Adjust PASSWORD (if you changed it to something other than the default '' | ||
+ | * Leave PLINKKEY blank | ||
+ | * For passwordless login using ssh key (recommended): | ||
+ | * Set PLINKKEY to match your generated ssh key. | ||
+ | * Clear out PASSWORD | ||
+ | * For other hardware than Sovol' | ||
+ | * Adjust USERNAME, e.g. to '' | ||
< | < | ||
@echo off | @echo off | ||
- | set PLINKCMD=c: | + | rem === best practice is using a PLINKKEY |
- | set PLINKKEY=c: | + | |
set PRINTER=mkspi | set PRINTER=mkspi | ||
+ | set USERNAME=mks | ||
+ | set PLINKCMD=c: | ||
+ | set PLINKKEY= | ||
+ | set PASSWORD=makerbase | ||
+ | rem set PLINKKEY=c: | ||
+ | rem set PASSWORD= | ||
+ | |||
+ | rem === nothing should be changed below here === | ||
+ | |||
+ | rem MKSPI: allow user " | ||
+ | rem add following to / | ||
+ | rem mks ALL=NOPASSWD: | ||
+ | |||
+ | set POWERCMD=" | ||
+ | |||
+ | set OPTKEY= | ||
+ | if %PLINKKEY%x==x goto SETPW | ||
+ | set OPTKEY=-i %PLINKKEY% | ||
+ | |||
+ | :SETPW | ||
+ | set OPTPW= | ||
+ | if %PASSWORD%x==x goto LOGIN | ||
+ | set OPTPW=-pw %PASSWORD% | ||
+ | set POWERCMD=" | ||
- | %PLINKCMD% | + | :LOGIN |
+ | %PLINKCMD% %OPTPW% %OPTKEY% -batch | ||
</ | </ | ||
- | === 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 | ||
< | < | ||
@echo off | @echo off | ||
- | |||
- | rem MKSPI: allow user " | ||
- | rem add following to / | ||
- | rem mks ALL=NOPASSWD: | ||
- | |||
- | rem doc: PRINT ON SAME LINE: "< | ||
set PRINTER=mkspi | set PRINTER=mkspi | ||
Line 78: | Line 126: | ||
call mks_poweroff.cmd | call mks_poweroff.cmd | ||
+ | rem doc: PRINT ON SAME LINE: "< | ||
<NUL set /p =Waiting for MKS to shutdown | <NUL set /p =Waiting for MKS to shutdown | ||
:pingloop | :pingloop | ||
Line 101: | Line 150: | ||
</ | </ | ||
+ | ---- | ||
+ | ===== Advanced: Passwordless login and shutdown using ssh key and visudo ===== | ||
+ | |||
+ | ==== Preparing the ssh key ==== | ||
+ | * Start '' | ||
+ | * Select the " | ||
+ | * Click the " | ||
+ | * Press the "Save private key" button | ||
+ | * Confirm that there is no passphrase by clicking the " | ||
+ | * Give it a filename, e.g. '' | ||
+ | * Click into the upper box and select its content\\ (it should start with '' | ||
+ | * Open Notepad (or any other text editor), paste the content there and save it for later use, e.g. as " | ||
+ | * Start '' | ||
+ | * Click on the " | ||
+ | * Enter " | ||
+ | * Enter " | ||
+ | * Copy the public key into '' | ||
+ | * Execute '' | ||
+ | * Execute '' | ||
+ | * Paste your public key (the gibberish line saved into '' | ||
+ | * Press '' | ||
+ | * Press '' | ||
+ | * Press '' | ||
+ | |||
+ | ==== Testing the ssh key ==== | ||
+ | * Open a command prompt | ||
+ | * Adjust the paths to plink and the saved key, and replace " | ||
+ | * When you connect first, plink will ask to save a fingerprint. Press " | ||
+ | * You should now be logged into the KlipperScreen without any further input/ | ||
+ | |||
+ | ==== Preparing ''/ | ||
+ | * Execute '' | ||
+ | * Append following line in the editor that just opened: | ||
+ | * '' | ||
+ | * Press '' | ||
+ | * Press '' | ||
+ | * Press '' | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Troubleshooting ===== | ||
+ | * HS110 not turning on or off | ||
+ | * Ensure that the IP-address of the HS110 is correctly set in '' | ||
+ | * Check if python is correctly installed (see link at the top of this page) | ||
+ | * Python has to be registered to execute '' | ||
+ | * Locate the python binary (e.g. '' | ||
+ | * Adjust '' | ||
+ | * '' | ||
+ | * Adjust '' | ||
+ | * '' | ||
+ | |||
+ | ===== Linux version ===== | ||
+ | Linux versions of these scripts are [[shutdown_linux|available here]]. | ||
+ | |||
+ | ---- | ||
+ | Back to [[start]] |
shutdown.1731511621.txt.gz · Last modified: 2024/11/13 16:27 by torte