I’ve installed the libraries by cloning the Github repo and running install.sh. 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)
True
>>> fanshim.get_fan()
1
>>> 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.
Rapa
1
22d
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.
bartabas
4d
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
Closing the loop on this, in case anyone arrives here via Google in the future!
I ended up ordering another Fan-Shim and it works absolutely perfectly on the RPi in question, so I assume there was a problem with the original unit.
I’ve also tried the original unit on another RPi and exactly the same problem occurs, which backs up that assumption.
2 Likes
Just seeing this post now. I just ordered the Fan SHIM and had the same problem. The required force to make the fan spin is sooooo little that it makes it hard to feel confident where the intermitten point is. I have a Raspberry Pi 4b and it runs in the mid 50’s. With an externa fan, I can get it to high 30’s. I just hate taking this all apart again, but thanks for the investigative work done here. It helps me not feel like I was crazy.
I’m not a big fan of the "shim part of it. I like this fan controller, just not as reliable, IMHO, as it should be. Most of mine have female headers soldered on. Or soldered right to the Pi’s GPIO pins. Neither one is ideal, but I get reliable operation.