Onoff shim faulty gpio pins


I have purchased an onoff shim and having issues troubleshooting a problem I am having. It turns on via external momentary button and will shutdown but does not kill power.

Thinking it might have been my soldering I tested the onoff shim with a different pi and fresh rasbian and it works perfectly as it should (it therefore isn’t my soldering). With fresh rasbian image on the original pi it still doesn’t work as it should. Therefore, my conclusions is there must be something wrong with the gpio pins on the original pi. I had used the gpio pins for led’s previously. Is there any way to troubleshoot this to understand the hardware fault on the original pi?


You could maybe try gpiotest?
pigpio library (abyz.me.uk)


Thanks for the suggestion, I hadn’t seen pigpio library before. I ran a gpiotest and all the gpiotested fine. So I am still out of ideas. Any other suggestions?

Do you own a voltmeter? If yes with the on off shim daemon running ground pin 11, GPIO 17 on the Pi. Then watch for a ground signal (0V) on pin 7 GPIO 4 to happen when it shuts down. You can remove the on off shim to do this. That pin is likely 3.3V logic high until the shutdown happens so I would measure volts, not ohms.
If it’s just floating and not at 3.3V you could get away with measuring ohms and looking for a ground signal.

Measuring using a multimeter, with GPIO 4, pin7 and ground pin connected to a breadboard to measure voltage, it reads 3.3 v when pi is on a running. when GPIO 17, pin 11 is grounded, GPIO 4, pin 7 momentarily drops to 0v and then comes back to 3.3v

Ok, it is doing something then on the Pi. I’m not sure if that’s normal operation or not though, to be honest?
Is that with the on off shim removed? If yes try it with it on.

Normally, any GPIO pin that is set high or low while its running, goes back to a no state, floating state on shutdown. You have to do a special shutdown with a dtoverlay to hold a pin low or high on shutdown.
The entry in the config.txt file will be something like this.
dtoverlay=gpio-poweroff, gpio17=active_low.

Hi, So i have fixed the problem!

Firstly testing the shim with a working pi, the GPIO 4,pin7 goes from 3.3v to 0v and remains at 0v after shutdown.

With the shim on the not working pi, the GPIO 4, pin 7 goes from 3.3v to 0v and back to 3.3v and power remains on.

Looking at the config.txt file on the not working pi, I had the line below uncommented from when I was using a i2c component connected via gpio pins.
dtparam=i2c_arm=on, i2c_arm_baudrate=400000
by commenting out this line. the onoff shim now works as it should. Killing the power after shutdown.

Thanks for all your help troubleshooting

That is weird, but nice to know you figured it out. =)