I am trying to create a batch file to set gpio pin high (which will turn off power to the printer. I am putting the batch file (name sdown.sh) in the Octoprint Settings->Octoprint->Server->-Shutdown System, but the batch file never gets executed.
The sdown.sh (in my home directory) file contains:
raspi-gpio set 27 op
raspi-gpio set 27 dh
sudo shutdown -h now
And I created it with nano on the Pi.
- Manually ran sdown.sh (which is in my home directory), and it worked fine.
- Tried various combinations of sdown.sh in the Shutdown System field, but nothing worked.
I am a complete newbe on Linux. This used to work many years ago, and I rebuilt the Octoprint box to incorporate the Pi 7" touchscreen (so I could have local control over the printer), and now it doesn't work.
No. Batch file never got executed.
You can download this in OctoPrint's System Information dialog ... no bundle, no support!)
octoprint-systeminfo-20240209015549.zip (44.5 KB)
Octoprint on a Pi4B with 7" touch screen and custom hat. Driving the Pi with a 24V power supply with a buck converter 24V->5V. Printer is Prusa MK4 GPIO pin 27 drives the reset (through a relay on the hat-the relay is driven by a darlington transistor) on a high-power latching relay which cuts off power after 20 seconds to the Pi and the printer.