Fanshim not working

Hi all

I just installed a fanshim on my pi4.
it turns on when I boot up the pi, but then it seems not to respond to my commands :(

pi@raspberrypi:~ $ ./ 

No argument specified, setting ON to 55C and OFF to 45C
Setting up with:
Off Threshold: 45 C
On Threshold: 55 C
Low Temp: 45 C
High Temp: 55 C
Delay: 2 seconds
Preempt: no
Disable LED: no
Disable Button: no
Brightness: 255
Extended Colours: no

To change these options, run:
sudo ./ --off-threshold --on-threshold --delay --brightness --low-temp --high-temp --venv <python_virtual_environment> (–preempt) (–noled) (–nobutton) (–extended-colours)

Or edit: /etc/systemd/system/pimoroni-fanshim.service

Checking for rpi.gpio >= 0.7.0 (for Pi 4 support)
rpi.gpio >= 0.7.0 already installed
Checking for Fan SHIM
Fan SHIM already installed
Checking for psutil >= 5.6.7
psutil >= 5.6.7 already installed

Installing service to: /etc/systemd/system/pimoroni-fanshim.service
● pimoroni-fanshim.service - Fan Shim Service
Loaded: loaded (/etc/systemd/system/pimoroni-fanshim.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2020-09-02 21:19:27 CEST; 26ms ago
Main PID: 4339 (python3)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/pimoroni-fanshim.service
└─4339 /usr/bin/python3 /home/pi/ --on-threshold 55 --off-threshold 45 --low-temp 45 --high-temp 55 --delay 2 --brigh…

Sep 02 21:19:27 raspberrypi systemd[1]: Started Fan Shim Service.
pi@raspberrypi:~ vim /etc/systemd/system/pimoroni-fanshim.service pi@raspberrypi:~ ./
Fan status is: 0
pi@raspberrypi:~ $ ./
Fan status is: 0

Basically I’m setting the fan to turn on between 45 and 55, but as you can see the fan stays off even when the temp is 59 or 64 degree. the led doesn’t turn on at all…

if I use script, I can see the led working and the fan turning on and off…

Usually its a contact issue, one or more pins not making a good contact.
If the fan is turning on off and the LED coming on via the thats likely not the issue.

The full install procedure goes something like this, make sure you are in the correct directory when you run them.

git clone
cd fanshim-python
sudo ./

Then to install the service you do the following. As far as I know the above needs to be installed for this to work

cd fanshim-python
cd examples
sudo ./ --on-threshold 55 --off-threshold 40 --delay 2

other options are as follows
–nobutton to turn button off and
–noled to turn the LED off.

If you want to change the service

cd fanshim-python
cd examples
sudo systemctl stop pimoroni-fanshim.service
sudo ./ --on-threshold 75 --off-threshold 60 --delay 5

To disable the service

cd fanshim-python
cd examples
sudo systemctl stop pimoroni-fanshim.service
sudo systemctl disable pimoroni-fanshim.service

enable again

cd fanshim-python
cd examples
sudo systemctl enable pimoroni-fanshim.service
sudo systemctl start pimoroni-fanshim.service

Hi and thanks for the asnwer

In the end I was able to solve the issue.
I was calling the script from another script located into another directory.
The generated .py file was then using a wrong base directory file.

Now in my script I cd into the the fanshim/examples directory before calling the script and everything works good :)

You can see how the temperature is correctly changing here according to the threshold I set :)

Ok, good stuff, now you get to have some fun with working code. =)