OnOffShim


#1

I just got it and wanted to put it on a pizero that’s running PiHole with Adafruits OLED library on it (python, I2C library etc). I put it on and pulled the oled and I can get a red light on the board when I hold the power button but nothing happens. I realized I missed powering the shim via 5v usb so I did that and still nothing. Turned it off manually and can’t power on via shim. Additionally I figured maybe I need to power both this board and the zero and still nada. I did install the on off shim so I don’t know what to do and yes I am brand new to all of this so go easy on the noob and don’t assume I know how to do anything because I don’t lol


#2

Did you solder the on off shim directly onto the Pi’s GPIO, or connect it with a header soldered onto the shim?
Power goes to the micro USB on the shim. The shim then feeds power to the Pi Zero via the GPIO pins.
GPIO Pin 7, BCM 4 sends the shutdown signal to the Pi.


#3

Neither lol. Before soldering I’m trying to test it. Once you mentioned soldering I realized ok its probably not adequate contact with the pins (had the shim on the gpios and slid down til it contacted pi. Anyway so to guarantee contact, I put a female socket inverted onto the GPIOS (pi zero WH with headers already on) but the female is hammer headers this way when they are pointing up, the shim on them definitely makes contact and I held it down with my finger til the points nearly came out the other side of my finger :)

Anyway yep it powered up the zero but the button didn’t power down the zero. I have to ask, when I installed the software, did it set anything up to run automatically or must I run something on every reboot to allow this to work?


#4

Yeah, I just wanted to confirm how you had it connected. As far as I know, the software install is supposed to setup the shutdown function. This is what it says on the product page.
After installing our software (details below), you can press and hold the button for one second to initiate a clean shutdown and completely cut the power to your Pi.
I don’t own one myself. I’d rerun the installer one more time

https://get.pimoroni.com/onoffshim | bash


#5

idk how or why but reinstall worked. I was starting to think you had to run the script every time. Seems odd like I’m flashing it to know what off means - unless its running the script all the time on startup waiting for me to hit it rather than the onoff board itself. Either way, I appreciate the advice and can do something else because once I start something and hit a wall, and everyone else says yay it works - lol it drives me batty


#6

For the on off shim “as far as I know” you should only have to run the install once. Then what ever is needed will automatically run on boot up. I’ve only had to run the one line installers once for any Pimoroni shim etc to work as advertised.
I have a couple of my headless Pi’s setup to shutdown with a button press. My code to do that is added to the python file I’m running on boot up. My python file is launched via crontab on boot up. Pressing my button does an OS shutdown. I have to kill my power manually but Raspbian is shutdown the proper way. I just wait for the status LED to stop blinking and remove power.