fmalekpour / OctoPrint-Gpioshutdown

12 stars 13 forks source link

GPIO3 not available #3

Open ssshake opened 4 years ago

ssshake commented 4 years ago

Hi, I'm new to your plugin and I'm happy to use it.

I want to know why gpio3 isn't available in the drop down? GPIO3 is the logical pin to use as a shut down button as it's also the pin which powers the pi on. Making the button an on/off button by virtue.

A side now I can't get the led to work for some reason. Seems straight forward enough. Nothing in the logs.

fmalekpour commented 4 years ago

GPIO 3 can wake a pi from sleep state. That's why it's not included in list. Although technically you can use the same pin for both shutdown and wake, but sometimes I don't have a monitor connected to the pi and having two buttons clears the confusion that pi is on or off. LED indicator designed to show when OctoPrint is up not jusr the pi.

xrxca commented 4 years ago

However, your use case is not the only use case. It is pretty common to use GPIO 3 for both shutdown AND startup. I just modified the template to add GPIO 3.

While I was in there I discovered a typo in the template, GPIO 4 does not have a QUOTE after the value in either block resulting in GPIO 4 not showing up in the list either.

neoge commented 3 years ago

I have my own power down script that is started via systemctl at boot and looks for a change to GPIO 3. I wanted to switch to this plugin to have everything in one place. But I want to use GPIO 3 so I can use the same switch to turn it off and on. I use an LED connected to a USB port to indicate if the Pi is on (it turns off power to USB when you shut it down).

So why restrict users in what they can or cannot do? Just let them decide for themselves.