I got my 4 GB Pi 4 four days ago, and fitted it with a Pimoroni fan shim. Great. Idles at 40 C, can’t push it over about 64 even with cpuburn. Standard Raspbian Buster. This morning to my surprise, on boot up I saw that a bright blue LED was shining from the fan shim PCB. I can’t work out why it wasn’t lit before. Anyhow, I decided to download & install the software so I did
from fanshim import FanShim
fanshim = FanShim()
fanshim.set_fan(False)
#fanshim.set_fan(True)
fa=fanshim.get_fan() # returns 1 for 'on', 0 for 'off
print fa
# make LED red
fanshim.set_light(255, 0, 0)
The fan didn’t stop, the value of fa was printed as 0, and the LED went out. (permanently so far, despite numerous reboots).
The LED going out sounds normal enough- sometimes random electrical noise will be interpreted as a signal which can cause it to light up. The LED has a built-n driver which will, in theory, keep it lit to a specific colour, but that colour has to be sent from the Python library in the first instance- it shouldn’t normally do anything by itself.
Since the fan defaults to on, it could well just be a flaky connection that’s preventing your attempts to turn it off. Might be worth giving the SHIM a wiggle to make sure it’s seated well and making good electrical contact. Those friction fit headers are good, but they’re not perfect.
Well, I gave it a wiggle, in fact I used the plastic nut tightener that came with the Pibow case to prod the PCB a bit to make sure it was seated as far down as it could be. Now I can turn the fan on and off, and flash the LED. Thanks.
I found that in Python scripts, doing (e.g.) fanshim.set_light(0, 0, 255) flashes the LED for a tiny instant, and if you want it to appear steadily lit you have to repeat in a loop. Usually when I interrupt such a script with Ctrl + C, the LED goes out, but, every now and then, it stays lit with some random r,g,b value.
I am running the fan control script with the default settings: 55 5
The fan seems to go on and off fairly well but has no relation to the led color that I can determine. The led changes from green through red with several colors in between.
@contrex the LED is supposed to stick on whatever colour you pick with fanshim.set_light until it gets another instruction. With automatic.py the LED turns blue when you press the button (can’t remember the function). I’d suspect a bad connection. Is the button stuck or do you have anything else connected to gpio?
Nothing else connected to gpio. I don’t know if the button is stuck. I have prodded it a few times. The connection is as good as it is ever going to be. I have pushed the fan shim PCB onto the header and it is level and seems firm. I have tried wiggling it. If I run automatic.py the LED stays green (or red, depending) continuously. Prodding the button does nothing. If I run this:
The LED flashes green for an instant. It is not a big deal, because the fan shim does the cooling I want, and I didn’t buy it for a light show anyway. The Pi 4 is going to go somewhere I can’t see it quite soon. Just one of those riddles.
Well, I realised the mistake I was making with the LED on the fan shim. It lights with the r,g,b values you pass it with fanshim.set_light(r, g, b) until you send it another signal or the Python script ends! If I put a sleep() after the set_light command, the LED stays on as long as I want.
With my Pibow coupé case, the tactile button on the fan shim can’t be pressed unless the shim is mounted up high on the GPIO header pins, flapping about in the breeze, and seems to be a bit floppy and vulnerable. If you press it down to sit firmly, the side of the case covers the button.
I am confused about the LED on the fan shim. This is really a matter of curiosity at this point since I have turned off the LED.
I turned on the service using:
sudo ./install-service.sh 65 5
The fan works as advertised, but sometimes the LED would come on bright white even though the temperature was below 65 and the fan was not running. Also, the LED was never red when the fan was off, or green when the fan was on.
I am not sure if there is something wrong with the LED circuitry on my shim, or just some confusion as to how the install service command is supposed to work.
Did I do something incorrectly or do I have defective LED circuitry on my shim?