pimoroni / fanshim-python

Python library for the Fan SHIM for Raspberry Pi
https://shop.pimoroni.com/products/fan-shim
MIT License
295 stars 86 forks source link

Fan does not go off if the PI is powered down #97

Open neilyoung opened 3 years ago

neilyoung commented 3 years ago

As subject says. I'm having the service running to control the fan, but if I sudo shutdown now the PI powers off, but the fan still roars. Only a complete removal of power from the PI switches off the fan. Is that by design?

jpmvferreira commented 3 years ago

I'm getting the same problem, it's probably by design, and I'm unsure if it's a hardware thing or not because it's connected directly to the pins.

But I would also like to see it powering down and the RPI is powered off!

Gadgetoid commented 2 years ago

This is by design, but you may be able to force it off by asserting a GPIO pin on shutdown.

It'll require a script in /lib/systemd/system-shutdown/gpio-poweroff that looks something like this - https://github.com/pimoroni/clean-shutdown/blob/master/daemon/lib/systemd/system-shutdown/gpio-poweroff

And drop a config file in /etc/cleanshutd.conf with:

poweroff_pin=18
cmonty14 commented 2 years ago

This is by design, but you may be able to force it off by asserting a GPIO pin on shutdown.

It'll require a script in /lib/systemd/system-shutdown/gpio-poweroff that looks something like this - https://github.com/pimoroni/clean-shutdown/blob/master/daemon/lib/systemd/system-shutdown/gpio-poweroff

And drop a config file in /etc/cleanshutd.conf with:

poweroff_pin=18

I cannot confirm that this solution is working, means 120s after shutdown the fan is still running. Maybe I missed a step. Can you please explain what you mean by "[...] asserting a GPIO pin on shutdown."?