auto power off an printer
Hi! I have an 3d printer with relay for on or off printer uses comand like bash /home/pi/scripts/printerOn.sh
I want that after printing my printer will do off command but need wait about 30 min for cooldown extruder.
I dont know how i need do it.
and in extcommands.xmli has:
<execute name="play" allowParams="true">sh /home/pi/scripts/printerOn.sh</execute>
<execute name="off" allowParams="true">sh /home/pi/scripts/printerOff.sh</execute>I want that after printing my printer will do off command but need wait about 30 min for cooldown extruder.
I dont know how i need do it.
Comments
Write a test if printerOff.sh is running and kill it at the start of printerOn and Off.
In printerOff add
sleep 1800
to wait 30 minutes before executing the disconnect string. That way each start will disable the off timeout. Server should start it async so it will not wait for the 30 minutes to finish but remembers that the script is running so it will not get killed.
Some tips:
sh is not needed if you set +x flag to the script and the first line in it is
#!/bin/bash
That way it should appear with it's own name as executeable and you could kill it with killall command.
Also server runs all commands as user repetierserver so make sur ethat user has permission to read/execute the script and required software.
gpio mode 8 output
gpio write 8 0
gpio write 8 1
and in endgcode on repetier-server add:
@execute off
#!/bin/bash
sleep 1800
gpio mode 8 output
killall off.sh
in on.sh complicated? Just one line that kills an evetually running off process so it will not trigger during print.