Onoff Shim not restart


#1

Hi ,

I just bought 2 cards OnOff Shim. When i plug it on my RPI (With Retropie) after run the one-line-installer :

  1. add micro-usb on shim, RPI direct start (but I have not pressed the button card yet…)
  2. After boot, I press button card and the RPI shutdown but the red light of the RPI
    is always on…
  3. I press the button for restart the RPI, but just the led of the OnOff Shim card turns on and the RPI does not start

I test 2 OnOffShim card, and i have exactly the same problem. I dont understand why the RPI card is already power on (the red led is constantly active).

Cheers for your help,

Arnaud


#2

To confirm- are you powering your Pi through the OnOff SHIM? IE: Your power supply should be connected to the microUSB socket on OnOff SHIM and not the Pi.

If this is the case, what else do you have connected to your Pi?


#3

My Pi is powering by OnOffShim. And nothing else is connected to the Pi.

I think the problem comes from the PI that always stays powered.

Here is a photo of the PI after shutdown, he is still powered :


#4

No USB peripherals or anything plugged in?


#5

Nothing plugged to Pi.

I reinstalled new retropie, and install only run the one-line-installer by curl (install without error).

I confirm that the same problems are occurring on my 2 onoffShim cards :

  • Auto-Start without push button, just after plug onoffShim
  • Shutdown retropie work but red led of Pi stays powered
  • Can’t restart with button, i must reconnect usb to onoffShim to restart.

#6

It’s possible the software is either not installed correctly, or there’s something different in the new RetroPie that’s conflicting with it.

Do you have the file /lib/systemd/system-shutdown/gpio-poweroff

And what happens if you run:

sudo /lib/systemd/system-shutdown/gpio-poweroff poweroff

#7

Yes I have this file.

Result :

Reading config file /etc/cleanshutd.conf
Using power off pin 4
Using LED pin 17

#8

Running that should have instantly triggered a power off.

Do you have 1-wire enabled on BCM 4 or anything else that might be running/interfering with that pin?


#9

Nothing else, just the OnOff SHIM. :(


#10

I can’t think of anything else to try at this point - you should drop us an email to support@pimoroni.com referencing this thread, and stating your order number if you ordered directly from us. They’ll sort you out with a replacement!


#11

Hello everybody!

Is there anything new to this topic? I’m having the exactly same problem…

Thank you!


#12

What have you tried so far @Simon01? Could you post a photo of your setup?

On recent-ish versions of Raspbian it should be possible to get on/off functionality by adding these two lines to /boot/config.txt:

dtoverlay=gpio-poweroff,gpiopin=4,active_low=1,input=1
dtoverlay=gpio-shutdown,gpio_pin=17,active_low=1

#13

Thank you for your answer!

I’m sorry, I don’t have a photo at the moment. But it looks the same as above.

I use a raspberry pi 1 with the onoff shim (I bought two of them, but they both are not working). The USB cable is connected to the onoff shim. After pressing the button the pi boots up. If I press the button for one second while running, the pi shuts down. But the power LED on the pi is still red and the pi will not boot again if I press the button.

Then I added the lines you proposed to my config.txt file. Now it works, almost. The strange thing is if I try dtoverlay -l in the console, I get No overlays loaded. But after pressing the button the pi shuts down and the lights on the pi go out. It is without power then. But it is enough to press the button shortly, not one second as before, and the pi shuts down.

I don’t know why it is like that, but it is okay for me. On the weekend I will test it with my new pi 3.

Thanks again!


#14

This is because the dtoverlay reads the power off button directly, and converts it into a KEY_POWER event, using a virtual keyboard. Raspbian responds to this immediately with no delay.

It looks like in your case the script that should run at shutdown to assert the power off pin was not running at all. I wonder if the location for this script has changed in newer versions of Raspbian, or if it’s just not working properly.

The dtoverlay method is generally better since it relies on software shipped with Raspbian- it’s a shame the shutdown key can’t have a delay though. That said there’s nothing stopping you from using gpio-poweroff to handle the actual powering off, and then our script to handle reading the shutdown button.


#15

Ok, I did some more investigations. I installed the software for the onoff shim by downloading it from https://github.com/pimoroni/clean-shutdown as a zip file. I extracted the zip file on my Windows computer and transferred it to Raspbian via WinSCP. The problem is that - after extracting and copying - the file /daemon/lib/systemd/system-shutdown/gpio-poweroff lost its executable bit. Everything works perfectly if I set it manually. A fix would be to add to the setup.sh file in the repository

sudo cp ./daemon/lib/systemd/system-shutdown/gpio-poweroff /lib/systemd/system-shutdown/gpio-poweroff
sudo chmod +x /lib/systemd/system-shutdown/gpio-poweroff

The second line is currently missing!

So I’m happy with the shim, everything works now as expected