I am new here, but hope this is in the right place. I want to use the onoff SHIM with a POE+HAT. I have searched but cannot find anything answering this. Does the SHIM have to be powered via the micro USB to work or will it work with a PoE that effectively powers the Pi via the GPIO pins.
Won’t work, not the way its intended to work anyway. Pressing the button will have the Pi shutdown, but power won’t be removed. The On Off shim can only remove the +5V if its powered via its Micro USB jack. And the Pi isn’t going to boot back up when you press the button again.
Were you after the shutdown function, and or the remove power function?
That’s doable with just a button and some wires.
The following dtoverlay entry, when added to your config.txt, will have a Pi do a safe shutdown when GPIO 3 is grounded. dtoverlay=gpio-shutdown
It won’t work if i2c is enabled though, in that case you need to use a different gpio pin.
I use the following with the button on my fan shim dtoverlay=gpio-shutdown,gpio_pin=17,active_low=1,gpio_pull=up
pin=17 is GPIO 17 physical pin 11.
A normally open, momentary contact switch is what you use. A mini arcade button for example will work. One contact to the GPIO pin and the other contact to a ground pin.
I have several headless Pi setups with buttons wired up as above. Saves me from having to SSH in to shut them down.
If you shut down, and don’t remove the power. Grounding GPIO 3 will have the Pi boot back up normally. That works regardless of whether i2c is enabled or not. And no dtoverlay needed for the on function. If you don’t need i2c, and leave it disabled, one button on GPIO 3 can do both off and on.