PowerBlock automatically shutdown after startup
-
Hello,
Just received my PowerBlock. Installed the driver using the instructions at https://github.com/petrockblog/PowerBlock. When using a momentary button or just quickly jumping the pins, the Pi starts up but eventually automatically shuts down. When using a toggle button, power is sent to the Pi but then is immediately disconnected. At the moment I do not have any other devices, HATs, etc connected or installed. My Pi has the OctoPrint image. Any suggestions on how to resolve this issue? I prefer to use a momentary switch.Note:
When the driver is uninstalled, while using the PowerBlock, the Pi does boot but goes in an endless loop when using a momentary button.Pi Model: RPI 3 B+
Power Supply: Pi Approved Power Supply (will be moving to power over GPIO)
Built From: Octoprint (https://octoprint.org/download/)
USB Connected Device: SKR Mini E3
Eventually will install a UPS (https://www.pishop.us/product/raspberry-pi-ups-hat/)Logs:
...
Nov 4 11:44:08 ender3 systemd[1]: Starting LSB: powerblock init script...
Nov 4 11:44:08 ender3 systemd[1]: Started LSB: powerblock init script.
Nov 4 11:44:08 ender3 powerblockservice: Starting PowerBlock driver, version 2.0.0
Nov 4 11:44:08 ender3 powerblockservice: Shutdown is ACTIVATED
Nov 4 11:44:08 ender3 powerblockservice: Shutdown Pin is 18
Nov 4 11:44:08 ender3 powerblockservice: Status Pin is 17
Nov 4 11:44:08 ender3 powerblockservice: Setting RPi status signal to HIGH
Nov 4 11:44:09 ender3 powerblockservice: Shutdown signal observed. Executing shutdownscript /etc/powerblockswitchoff.sh and initiating shutdown.
... -
Thanks for the detailed information. I will try to reproduce your observations with a local installation of OctoPrint. I have never personally used it so far. I will get back to you after I set it up then!
-
@ryanatev I had a similar situation a couple months back on a project I was working on. The solution was a simple oversight. My setup used a python script to monitor a gpio pin. When that pin was grounded it initiated a shutdown. I found that the Pi would spontaneously shutdown for no apparent reason like you described.... my situation turned out to be that the pin was floating. Because I was going to logic low to initiate shutdown I enabled the internal pull up resistor on that pin to hold it high. That solved my problem. If you are going logic high to initiate action then perhaps an external pull down resistor( I used a 5.6k in the final project) to hold it low might be the solution? IDK if the Powerblock has a built in pull resistor or not... IDK if this helps, but it did sound similar to my issue a while back.
Cheers! -
@petrockblog, @journeymanDT , So I think I figured it out. Although I did not have my UPS HAT connected when testing the PowerBlock, the driver, located at https://github.com/buyapi/ups/blob/master/scripts/ups.sh was installed (I previously had the UPS installed as it arrived before the PowerBlock). I believe there is a conflict between the state the UPS expects the pins to be in and the state the PowerBlock expects the pins to be in. I want to use the PowerBlock to prevent my RPI from starting when plugged in or a power outage/restore but I also want a UPS so that the RPI can safely shutdown in the event of a power outage. My RPI also has an Ender 3 3D Printer connected to it. The UPS allows for the RPI, using OctoPrint, to pause the job and safely shutdown the RPI and Printer after x amount of time.
When I uninstall the ups.sh file, all works well minus the fact that I can't use 'reboot now' as it just shuts down the RPI but I saw that post in a previous thread.
Anyway to get the two to play well together? What is the impact of using different pins? I could try to modify the ups.sh file to work with the PowerBlock but my Python is rusty.
UPS Guide:
https://www.pishop.us/raspberry-pi-ups-hat-guide/ -
@ryanatev Hi, glad to hear that you are making progress!
You could change the pins used by the PowerBlock within its configuration file at/etc/powerblockconfig.cfg
. You can select any GPIOs that are available in your setup. -
@petrockblog Thanks for the feedback. I assume that in order to do what you've suggested, I would not connect the PowerBlock directly to the header pins but instead need to use jumper cables. Is that correct?
-
@petrockblog, I took a chance, from reading from other posts, to no connect the PowerBlock directly to the RPI but instead run wires to the respective pins. Thanks for the advice as it works as expected with my UPS. Not sure if you've thought about this but I think it would be a good idea to sell the PowerBlock without the black 12 pin connector (as an option) and allow users to solder. I guess users could just solder it off if needed. Anyway. Thanks for you help.
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.