pimoroni / clean-shutdown

Python daemon to watch a GPIO pin and trigger a clean shutdown.
MIT License
125 stars 40 forks source link

[bug] "hold_time" ignored #31

Closed passuff closed 1 year ago

passuff commented 2 years ago

I'm using ONOFF SHIM with clean shut down to be able to switch two devices at the same time (Raspi zero & active speaker). The speaker is activated if the power button is pressed longer than 1.0s and so I configured the hold_time setting. I recognized, that sometimes the raspi is already turned on while the speaker is not. I wrote a little tool running on the raspi that triggers the GPIO 17 with a specified time. I used 0.5 to 0.9s interrupts and found out, even at 0.5s the ONOFF SHIM sometimes turn the raspi on even if the hold_time is set to 1.0s. I would estimate a failure rate of approximately 10% which I think is quiet high. I'm a total programming noob so I'm totally lost where I should start to debug. I would appreciate it if some experienced folks could help.