Fan-Shim fan runs for a second or two, then stops (Pi4)

I’ve installed the libraries by cloning the Github repo and running Then:

root@my-pi4:~/fanshim-python# python
Python 2.7.16 (default, Apr  6 2019, 01:42:57)
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from fanshim import FanShim
>>> fanshim = FanShim()
>>> fanshim.set_fan(True)
>>> fanshim.get_fan()
>>> exit()

…but, the fan’s not spinning.

If I give it a gentle manual nudge with my finger, it spins for a couple of seconds (definitely longer than if it was just the momentum from the nudge) and then stops.

LED is glowing bright white constantly.

Anything I can do to test/adjust it?

(FWIW, no difference if I’m running from a Python3 console)

Try running sudo pip3 install fanshim. Its what worked for me, I was getting a no module named FanShim error from Idle3 / Python3.

Thanks for the reply! But unfortunately that’s not what my problem is.

The code I pasted in my question indicates that I’ve successfully imported the Python library (which is basically also what sudo pip3 install fanshim does, but in a different way).

And the final line, where it’s returning a 1 when I call fanshim.get_fan(), indicates that Python thinks the fan should be running.

But the fan itself isn’t running, even when the Python library is telling me that it is.

So I think the problem is more hardware-related, than to do with if/how I’ve installed the libraries.

Ok, its likely one or more pads not making contact with its matting GPIO pin.

GPIO 18 physical Pin 12 is the fan control pin. Tug that pin gently sideways with your finger and see if the fan works as it should.

Could the fan unit be out of square, causing friction? Others have had gpio connection to the shim problem. I agree the issue seems hardware related, it seems there is call to spin but something is either causing that demand to be intermittent like a connection is loose or some resistance is causing the very weak motor to stick?
Others have mentioned lubrication issues causing the fan to stop, especially when mounted vertically.




FINALLY! Since the addon was “working”, I checked the Fan connections and when I twisted it a little bit it stopped spinning, the addon was/is working perfectly, I just had a connection problem between the GPIO and the Fan shim… probably the other scripts were working too =( happy to have the system working now,but sad to lost 2 days and a have a wiped OS

See. If the fan spins without the shim part attached. Run 5v directly to the fan. If it is spinning well you know the fan unit is ok. If not a faulty fan unit then it’s likely a connection between the shim and the gpio pins, it seems quite common below is a link from a thread of another example.



Congratulations, you won! I have bending pin 12 slightly and it worked.
Now I have to do some mechanic to establish the contact durably.

Many thanks!H