-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pi does not shutdown any more after upgrade to bookworm #37
Comments
I think a systemd service was always a bit overkill for poweroff, and no doubt has been hopelessly broken by bookworm- if not due to be shortly, since it uses sysfs GPIO. Might be worth trying to add:
To uh... I can't remember if it needs to be active low or not 😬 |
Strange is, that is was working before the OS and kernel update. I will check /boot/firmware/config.txt anyway. But I guess it is active_low. If I check the pin manually with
with the lo values while pressing the button. |
I did some more testing: Shutdown works if I set the PIN 4 explicitly on the shell: The clean shutdown daemon confiuration look slike this: What is the correct setup: PIN 4 for shutdown and 17 for the restart trigger? |
That looks right-
If There's also a straight dtoverlay approach for the shutdown button, but it doesn't have any long-press or LED indicator functionality: https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts And from the docs:
|
The straight power off is not really what I want. The question is then, why the shutdown daemon does not react on the PIN 17 lo signal. How can I debug the daemon script? |
I found several problems with the bash script itself, with the outputs of raspi-gpio, that seem to have changed and some number comparison errors in if statements. |
Yup Bookworm has broken a whole lot, and I'm nearly 5 months in to trying to fix it all with no end in sight. The lack of sysfs GPIO (needed IIRC for the GPIO to do anything from bash after the system has torn everything else down) means this script probably isn't (easily) fixable. (Note: I haven't touched this code for ~5 years.)
Which on/off / power control board are you using?
Not sure what you mean- the mentioned dtoverlays - gpio-shutdown and gpio-poweroff, respectively:
Combined, they pretty much make this script obsolete. And it seems if you set a high debounce it'll give you a push-and-hold-to-shutdown to avoid any accidental triggers. The only thing missing is fancy LED wrangling, which there's probably a proper driver for too. |
I am using the OnOffShim. Do I understand right, that the dtoverlay triggers a real shutdown like the command "shutdown -h". What is the better overlay gpio-shutdown or gpio-poweroff in my case? In bullseye the pi completely shut down (red LED off). What am I doing wrong if the pi immediately stops again after booting? Is this caused by active_low=0? |
I use |
You need to use both OnOffShim, IIRC, then can latch the power back on when you press the button again. So maybe:
Then OnOffShim will cycle the power for you. (Though only if you have the power connected via OnOffShim, if you use the Pi's power connector it can't work) |
OK, will try the proposed config. Of course I use the power connector of the OnOffShim as I did before with bulleseye, too EDIT: Works perfectly fine, now! Thanks a lot for your support. |
@elhennig could you share the working config you ended up with? EDIT: Ok, so I read back a bit and adding the following from @Gadgetoid
... works, but it causes the pi to shutdown immediately. One super nice thing about the original implementation was the use of systemd's shutdown hooks to cause a clean shutdown. In my case a clean shutdown is definitely necessary. Execing Here's my modification to the scripts to make a clean shutdown work with bookworm
|
Hello, excuse my abrupt writing. I think one of the causes of the trouble is that the number given to /sys/class/gpio was changed by bookwarm, and the other is that the format of the return value of raspi-gpio get was changed. /lib/systemd/system-shutdown/gpio-poweroff /user/bin/cleanshutd Please refer to the following. |
Hi. The original installation worked in my RPi4 with raspios_arm64-2024-07-04 after:
Haven't checked more details about any other possible changes in setup.sh, but it was the quick and dirty way to fix :) |
Hi,
I upgraded my raspberry pi 4 to bookworm and kernel 6.6 and even if the GPIO pin 17 is triggered the clean shutdown down does not respond or shutdown the raspberry pi anymore.
I also changed the command from raspi-gpio to pinctrl as messages lead to the info the the command raspi-gpio is deprecated.
Any idea how to debug this more or even better solve the issue?
The text was updated successfully, but these errors were encountered: