i’ve just purchased the OnOff shim and i’ve wired up the shim (via breakout to breadboard) to 5v and ground as well as connecting up the status and power off pins.
when i press the button, the Pi will power up, but the moment i release the button the power will immediately shut off (no graceful shutdown), does not matter how long the button was originally pressed for.
i’ve tried just connecting the power and no logic signals but still the same result.
Have to ask the obvious question, power going in the micro USB on the shim?
I do believe the software is only for shut down. So it should latch the power on when you press the power button the first time. Are you just doing a quick button press? If yes, it sounds like its defective.
yes, power is going in the micro usb on the shim. the Pi gets power just fine when i press the button, but only when its pressed, the moment its released, the power is lost.
this is the first Pimoroni product ive bought (through a local vendor). a real shame if its a dud, is this common?
I don’t think so? I don’t own one myself. There were some other threads on the on off shim, don’t think it was the same issue though. Duds happen sometimes. The few times its happened to me I got quick replacements.
What are you referring to when you say “1 wire enabled”. Currently I have tested with just the 5v and ground connected and separately with the two logic signals. Is there anything more than the 5v, ground and two logic signals involved to used this?
Some more thorough documentation on this shim would be helpful. So far I’ve only found directions listed on the shopping blurb as any sort of guide as to how this works. If I don’t want to mount it directly, what do I need to connect up to make this work?
Pinout can be found here, https://pinout.xyz/pinout/onoff_shim#
You need GPIO 4 and 17 wired up along with GPIO Pin 2 for 5V to the Pi and GPIO Pin 6 for Ground.
Software install is listed there too, run the following from terminal. curl https://get.pimoroni.com/onoffshim | bash
1 Wire is a GPIO Interface you can enable to connect sensors etc. It also uses GPIO Pin 4. If you don’t know what it is, its likely its not an (the) issue. If you had enabaled it for something else you were using with that Pi it would interfere with how the on of shim works. Well I think it would @gadgetoid would know better than I would.
thanks,
seeing as iv been testing without the two logic pins connected, this does not sound like this is the issue (as an aside, even with the logic pins connected, im not using 4 and 17, ive moved them to 23 and 24 using the setup file, hence why i have not mounted the shim directly).
does it matter which ground/5v pins you use?
i should be receiving a second on/off shim tomorrow which should let me know if it has been a faulty unit all along. i will report back how it goes.
No as far as I know it doesn’t matter what 5V or ground Pin you connect to on the GPIO. All the Grounds will be a common connection anyway. The two 5V will be a common connection too.
Could you possibly post a photo of your wiring/setup? Could be worth me trying to recreate it.
Just a thought- have you connected 3.3v? It needs the 3.3v from the Pi as a reference to feed into the low-voltage comparator. Without this reference, it’ll simply think the battery is depleted and shut down.
That will be it, it’s not connected. I will have to try that tomorrow. Though this is the first I’ve read of this requiring the 3v. Everything else has only mentioned the 5v ground and logic
so ive change the dt-blob tree to have my trigger pin set as a pull up output, startup_state = active and that is now working. oddly enough, the shutdown configuration seems to set the other pins from the setup file correctly but this one i had to manually change the dt-blob tree.
the only remaining issue is the long press required at startup, but i can live with this i think, unless there is a solution out there (software or use a certain kind of switch etc.).
to summarize the whole thread thus far
-OnOff shim requires 5V, GND, 3.3V to function on a basic level
-if not using the default trigger pin, the config of the trigger pin needs to be set accordingly in the dt-blob tree: pullup, output, startup active (other pins are set correctly by the configuration file)
-extended press is still required at startup to avoid instant shutdown (solution would be much appreciated)
thanks for all the help thus far, despite being frustrated at the amount of work this has taken, at least ive learnt quite a bit.
Yean, most of the time learning can be fun. Sometimes not so much. Usually though there is a reward of great satisfaction at the end when you finally get it working. ;)
OnOff SHIM has a weak ~10Mohm onboard pull-up resistor to prevent the need for a long press. Otherwise without the shutdown pin connected it would be floating and potentially subject to random noise induced shutdowns.
You should be able to change your pin in the device tree overlay to an input with no pull, and allow it to be set up and asserted by the shutdown script only. I’m guessing it being set up as an output is what caused your problems - in retrospect I wasn’t paying as much attention to your overlay as I should have.
I’ve updated the Pinout.xyz documentation to reflect the need for 3.3v which, despite my disagreeing with myself, it actually does require.