Fanshim threshold

I was installing my fanshim yesterday, and followed the setup found on the pimoroni site. But the thresholds are higher than I want, but I can’t seem to change them with the method explained there. Is there someone who can help me? Just ask for the info you need :)

Cheers

Rpi 3b
Retropie

Try this, from a terminal window run
cd fanshim-python
then
cd examples
Now you run sudo systemctl stop pimoroni-fanshim.service to stop the service.
then run sudo ./install-service.sh --on-threshold 75 --off-threshold 60 --delay 5
BUT change the threshold values to the new ones you want to use.

It seems to work, at least what it tells me in terminal, but the fan still won’t turn on, even the temps on my rpi are higher according to RaspiCheck

I seem to remeber if you don’t cd to that specific folder first running the commands doesn’t work and give an error.
Does the LED on the shim light up? Can you spin the fan if you gently spin it with your finger tip?
You can add the “CPU Temperature” panel applet to the task bar on the Raspbian desktop.
Right click the tray and select add remove panel items.
Then click the Add in the upper right corner and scroll through the list for “CPU temperature”.
Once you find it and select it hit the Add button at the bottom of that window.

1 Like

I did cd into that directory, the fans spins under boot. I can easily spin it with my finger when it has stopped. The led does not light up, the button shuts down the pi.

I am booting directly into retropie on this one, but checking temperature with an android app called RaspiCheck.

Does retropie run on top of Raspbian?
The Fan should run continuously with no Pimoroni software installed. As long as it has power it should run. The Pimoroni Daemon actually turns the fan off by pulling the fan control pin low. With no software installed it should be a high and the fan should be on.
Do you have anything else installed on the GPIO that might be messing with the pins used by the Fan Shim?

EDIT: If you want to try turning the service off just to see what happens, in case its wahts keeping the fan off for some reason. Go back to that folder and run the following.

sudo systemctl stop pimoroni-fanshim.service
sudo systemctl disable pimoroni-fanshim.service

to enable again

sudo systemctl enable pimoroni-fanshim.service
sudo systemctl start pimoroni-fanshim.service

These are I believe the alternate install instructions if you want to give it a try.

git clone https://github.com/pimoroni/fanshim-python
cd fanshim-python
sudo ./install.sh

to install the service

cd examples
sudo ./install-service.sh --on-threshold 65 --off-threshold 55 --delay 2```

I have a power button, but it acts the same without these connected too.

Seems like it:

Isn’t this what the service or script does?

With the service deactivated, the fan spins as long the power is on.

First command throws a error;

@retropie:~ $ git clone GitHub - pimoroni/fanshim-python: Python library for the Fan SHIM for Raspberry Pi
fatal: destination path ‘fanshim-python’ already exists and is not an empty directory.
pi@retropie:~ $

The second command seems to work ok, but after setting threshold in the third command nothing seems to heppend. There is just a > there.

I’m going to rehash some of what I posted so bare with me.
Out of the box with no software installed the fan should run as long as the fan shim gets power. That I believe is a default fail safe mode.
If the fan control pin is a high or floating the fan is on. If it’s pulled low the fan stops. This is how the service controls the fan, it turns it “off” by pulling the fan control pin low. And on by letting the pin go high.
Your fan runs with the service stopped so the hardware is fine, its a software issue, something is pulling that pin low. Something on the Pi side of things.
What that something is, I have no idea?
The fan control pin is BCM 18 physical pin 12 on the GPIO header. The default state for that pin on bootup is floating (not grounded).

The normal sequence of events would be the fan starts when the Pi is powered up. Then once the service starts, if the temp is below the threshold, it turns the fan off by pulling the control pin low. Then if the temp rises above the threshold it puts the control pin high to turn the fan on. Yours isn’t doing that last step for some reason?
I have a Fan Shim and it worked as advertised in plain Buster so my best guess is something in RetoPi is messing with it. Only way to confirm it is to install just Buster on your Pi and setup the fan shim and see if it works as normal.
I added a pull down resistor to my Fan Shim fan control pin. With no input from the service, it pulls the pin low turning the fan off. I toggled the default state to off instead of on. The fan still turns on and off as before via software.
I use the button on the fam shim to do a shutdown and wanted the fan to stop when I do that, and now it does. No having to unplug my power supply to make it stop. And pressing the button again does a boot up. And once the service starts the fan starts. “Something” is pulling your fan control pin low and holding it there.