RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Powerblock conflict with GPIO control (Resolved)

    Scheduled Pinned Locked Moved ControlBlock, PowerBlock & Co.
    powerblockgpio
    3 Posts 2 Posters 893 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DougAD
      DougA
      last edited by DougA

      Pi4B 4GB
      Retropie 4.7.1
      Dragon Rise USB button/joystick interface
      3A psu from Canakit
      3 yr old micro-use Powerblock with 1Kohm resistor mod
      Generic USB-C to micro-USB adaptor

      I am currently rebuilding an arcade cabinet I built 3 years ago that had a Pi3B powering it. At the time, I had the power on and off for the Pi under Powerblock control, and used a ground and a 3.3V GPIO pin to drive an optoisolator-switched power strip from digitalloggers.com that turned on a power strip with the monitor, amplifier etc on when the Pi powered up.

      Cut forward to today, and the Pi3B was plundered for another project and replaced by a Pi4B. I modded the power block as required and wired everything up as before using the more powerful psu that came with the Pi4B. At that point I found that unlike on the Pi3B driving the 3.3v pin to ground via the optoisolator just shorted the Pi4, so I looked for a different solution. First I verified that the Powerblock worked as normal, which it did, and then I added

      dtoverlay=gpio-poweroff,gpiopin=26,active_low

      to /boot/config.txt, and wired GPIO pin 26 and a ground pin to the isolator and it worked perfectly. The problem is when I do that while having the Powerblock software enabled. When I do, on shutdown the system reports a “kernel crisis” and hangs. As soon as I comment out the GPIO instruction, it shuts down correctly.

      Is there anything I can do to get the two working together?

      Edit: I guess I could just use the same pins as previously and add a resistor into the circuit, but I would prefer a software solution.

      DougAD 1 Reply Last reply Reply Quote 0
      • DougAD
        DougA @DougA
        last edited by

        @douga The issue was not with the Powerblock. I did some googling and found that the way I was switching on and off the gpio pins can be problematic anyway.

        I found a more elegant way to switch the pin high at boot, and now it works perfectly. I just added the line below to the end of /boot/control.txt

        gpio=26=op,dh

        which sets gpio26 to output (op), and drives it high (dh), ie switches it on.

        P 1 Reply Last reply Reply Quote 0
        • P
          petrockblog Global Moderator @DougA
          last edited by

          @douga Glad to hear that things are working for you now!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          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.