[Tutorial] OnOff SHIM exposed - neat Powerswitch from Pimoroni
-
@cyperghost It's very strange, because I install Raspbian Stretch Lite Kernel version: 4.9 on my pi zero w, and use
curl https://get.pimoroni.com/onoffshim | bash
command and it works ...
I buy 5 OnOff Shim board at the same time on Pimoroni.
Do you think the OnOff Shim board use on my Rpi 3 has a problem ? -
SOLVED! Proceed with Tutorial as descriped!
-
@cyperghost Ok that's very strange ! And thanks for the explaination.
I will do a test on the Pi3 with Raspbian OS on a new SD card, if it's working.Which OS can I test to help us understanding the problem ?
-
@necsus The RetroPie image is built on top of Raspbian, so you could keep using Raspbian to test things.
-
@mitu Yes that's right! Raspbian would be the first choice.
The reason why I ripped this out of the PIMORONI SHIM service is, that the installer will likely not work on systems like RECALBOX, LibreELEC or OSMC.But the two bash files and the explaination to setup them would likely work. I think I can test just on weekend so I would be glad if someone else could take over.
-
-
For whomever stumbles upon this topic trying to customize the On-Off Shim, please note that not all GPIO PINs are usable for this circuit.
This is an undocumented bug, which is quite important to know if you try to change the default pins on which the board is connected.
In fact, for the "poweroff pin", which is by default on GPIO 4, only GPIO pins from 0 to 8 can be used. If you use pins over 9, the raspberry will never turn on.
This is because the OnOff Shim relies (undocumented) on the "poweroff_pin" being "ON" all the time, since startup.
As documented on https://elinux.org/RPi_BCM2835_GPIOs the pins 0-8 are by default "pulled HIGH", while all the other pins are "pulled LOW".
There is no problem for the other pin "trigger" (or "status" as it is labeled on the circuit), which can be moved to any other GPIO pin.
Personally, I moved them to pins GPIO 6 (physical 31) and GPIO 16 (physical 36) so they do not interfere with any other attached circuit.
It took me a couple of hours to figure this out, I hope this could be of help to someone else.
-
@kzar said in [Tutorial] OnOff SHIM exposed - neat Powerswitch from Pimoroni:
For whomever stumbles upon this topic trying to customize the On-Off Shim, please note that not all GPIO PINs are usable for this circuit.
This is an undocumented bug, which is quite important to know if you try to change the default pins on which the board is connected.
In fact, for the "poweroff pin", which is by default on GPIO 4, only GPIO pins from 0 to 8 can be used. If you use pins over 9, the raspberry will never turn on.
This is because the OnOff Shim relies (undocumented) on the "poweroff_pin" being "ON" all the time, since startup.
As documented on https://elinux.org/RPi_BCM2835_GPIOs the pins 0-8 are by default "pulled HIGH", while all the other pins are "pulled LOW".
There is no problem for the other pin "trigger" (or "status" as it is labeled on the circuit), which can be moved to any other GPIO pin.
Personally, I moved them to pins GPIO 6 (physical 31) and GPIO 16 (physical 36) so they do not interfere with any other attached circuit.
It took me a couple of hours to figure this out, I hope this could be of help to someone else.
Kzar, would you know or quickly be able to see if the very oldest pi (the A, not A+) would be able to work with the on-off shim? The pinout for the 26 Pi looks very similar for pin 1-12, including GPIO4 but I am not an expert and Pimoroni only mentions they are compatible with 40 pin Pis? But from the pinout I do not understand why. Just checking as I have a pi-hole running great on this old Pi, but an on-off button would be amazing.
Many thanks for any thoughts on this.
-
@muze I have the shim running on a 1st generation Pi B 256Mb. Runs flawless even with 26 pin header.
And yes Pihole rules 😋😍
-
@cyperghost Do I need to modify your script if I am using a non momentary button? Right now, I followed your script and instructions press the button in the off position the pi shuts off immediately.
-
@cnoto The script in this posting does not need to be modified it supports both kind of switches
Momentary buttons and latching ones -
@cyperghost got it. I am attempting to change my setup from a nespi case to an onoffshim with a non momentary switch. I used your instructions, to setup the onoffshim, but the system cuts power as soon as i press the button to initiate the shutdown script. (No 3 blinks, just off).
Could the original install of the raspi-gpio for the nespi case impacting things?
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.