pimoroni / fanshim-python

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

Can't get fan to run using manual.py #92

Closed futurelucas4502 closed 4 years ago

futurelucas4502 commented 4 years ago

I can change the colours of the LED but the fan does nothing.

Interestingly if I install the service using sudo ./install-service.sh --on-threshold 65 --off-threshold 55 --delay 2 and the temperature is above 65 it will work now and again as well as this if I push down on the board the fan turns on I've tested this using a piece of plastic to make sure I'm not bridging any pins so I'm not sure what's happening

Gadgetoid commented 4 years ago

I wonder if I've regressed something in the library- I've definitely tried this recently locally and it was working.

Can you toggle the fan if you run the library in isolation, or use toggle.py and press the button?

futurelucas4502 commented 4 years ago

Hi there I made this:

from fanshim import FanShim
fanshim = FanShim()

fanshim.set_fan(True)
fanshim.set_light(0, 255, 0)

try:
    while True:
    print(fanshim.get_fan())

except KeyboardInterrupt:
    pass

And after some testing using it it looks like i might just have a faulty board as if i hold the board down everything works fine i can toggle it on and off using the code above but if i let go the fan stops sorry for posting as this seems to be a hardware fault

Gadgetoid commented 4 years ago

Sounds like it's a contact fault between the Fan SHIM and the GPIO- that's not uncommon with shim-style boards since they literaly involve putting square pegs (pins) into round holes.

You can very gently bend the offending pins for better contact. I know this sounds like a horrible and unecessary thing to do... but my headers are a bent mess most of the time anyway and it might save you the trouble of getting it replaced.

futurelucas4502 commented 4 years ago

Oof after bending the pins everything works perfectly thanks for the suggestion