fmalekpour / OctoPrint-Gpioshutdown

12 stars 13 forks source link

no shutdown while printing #11

Open Smsoplaeser opened 3 years ago

Smsoplaeser commented 3 years ago

Hi would it be possible to add a check mark to support shutdown while printing. I am using your plugin with a touch button to turn off my homemade Sisyphus table. Best regards Jubaz

srjacob999 commented 3 years ago

Use the Automatic Shutdown plugin. It does this.

Smsoplaeser commented 3 years ago

Thx for your reply. Do you have a link for this plugin or did you misunderstand my question? I need a plugin that via gpio will shutdown down a ongoing print... not when it is finished. It is not for 3d print, but a xy sisyphus table or did I miss something.... regards Jubaz

srjacob999 commented 3 years ago

I did understand your comment. Automatic Shutdown does this. Here is the link: https://plugins.octoprint.org/plugins/automaticshutdown/ It uses the shutdown command locate in the Octoprint Shutdown Command field. However, you can replace that command with a bash script that turns on a gpio pin and then does a sudo shutdown. That's what I did to have Octoprint shut down my printer power supply.
I made the mod to this plugin (which is now incorporated into the master) to do that very same thing-use the Octoprint shutdown command. My bash script is:

!/bin/bash

disconnect gpio -g mode 27 out gpio -g write 27 1 sudo shutdown -h now

and I call it sdown.sh

and in the Octoprint Shutdown command (which is sudo shutdown -h now), I replaced it with /pi/home/sdown.sh, which is where I put the bash script. GPIO 27 turns on a timer (for 15 seconds), and then turns off the power supply.

If you built your own table, you should be able to figure out how to do this. I use a 24V power relay to switch off the power supply, a couple of small relays and a ULN2003 driver in the Pi, and a timer module I got off Amazon. The PI runs off the 24V printer power supply via a buck converter.

Smsoplaeser commented 3 years ago

Hi again... I just found another solution in the meantime, found a small Python Script and just installed and configured it to my gpio pin, when the Pi then loses power on the usb, an Attiny85 via some optocouplers and an sonoff shutdown the rest. On my 3d printer I did almost the same thing, so I have a one click start button and after that print-cooldown-autoshutdown of everything. But thank you for your reply

Den lør. 5. dec. 2020 kl. 18.03 skrev srjacob999 notifications@github.com:

I did understand your comment. Automatic Shutdown does this. Here is the link: https://plugins.octoprint.org/plugins/automaticshutdown/ It uses the shutdown command locate in the Octoprint Shutdown Command field. However, you can replace that command with a bash script that turns on a gpio pin and then does a sudo shutdown. That's what I did to have Octoprint shut down my printer power supply. I made the mod to this plugin (which is now incorporated into the master) to do that very same thing-use the Octoprint shutdown command. My bash script is:

!/bin/bash

disconnect gpio -g mode 27 out gpio -g write 27 1 sudo shutdown -h now

and I call it sdown.sh

and in the Octoprint Shutdown command (which is sudo shutdown -h now), I replaced it with /pi/home/sdown.sh, which is where I put the bash script. GPIO 27 turns on a timer (for 15 seconds), and then turns off the power supply.

If you built your own table, you should be able to figure out how to do this. I use a 24V power relay to switch off the power supply, a couple of small relays and a ULN2003 driver in the Pi, and a timer module I got off Amazon. The PI runs off the 24V printer power supply via a buck converter.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fmalekpour/OctoPrint-Gpioshutdown/issues/11#issuecomment-739321501, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHPT2FULUXLEOH7XMDWV72TSTJRXTANCNFSM4UGTV6DQ .