# Fan SHIM service failing

**URL:** <https://forums.pimoroni.com/t/fan-shim-service-failing/14689>\
**Category:** Support\
**Created:** [August 8, 2020, 8:39pm UTC](https://forums.pimoroni.com/t/fan-shim-service-failing/14689 "2020-08-08T20:39:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PiMax2](https://avatars.discourse-cdn.com/v4/letter/p/cdc98d/32.png) [@PiMax2](https://forums.pimoroni.com/u/PiMax2)\
**Post date:** [August 8, 2020, 8:39pm UTC](https://forums.pimoroni.com/t/fan-shim-service-failing/14689/1 "2020-08-08T20:39:02Z")

</div>

I am trying to set up the Fan SHIM service, but am running into a bit of an error (see below). Any help would be appreciated.

Some background… this is a Pi 4 with 2GB of RAM, running Volumio as the operating system, which is based on raspbian jesse. Initially, it only had python2.7, so I had to install python3 in order to run the Fan SHIM software. It does say that the debug log for the failure is in /root/.pip/pip.log, but that doesn’t seem to exist. The service does install, but fails to start.

Error follows…

Cleaning up…  
Command python setup.py egg\_info failed with error code 1 in /tmp/pip-build-3rkv40r8/psutil  
Storing debug log for failure in /root/.pip/pip.log

Installing service to: /etc/systemd/system/pimoroni-fanshim.service  
● pimoroni-fanshim.service - Fan Shim Service  
Loaded: loaded (/etc/systemd/system/pimoroni-fanshim.service; enabled)  
Active: activating (auto-restart) (Result: exit-code) since Sat 2020-08-08 16:12:44 EDT; 14ms ago  
Process: 7940 ExecStart=/usr/bin/python3 /home/volumio/fanshim-python/examples/automatic.py --on-threshold 50 --off-threshold 45 --low-temp 45 --high-temp 50 --delay 2 --brightness 255 (code=exited, status=1/FAILURE)  
Main PID: 7940 (code=exited, status=1/FAILURE)

Aug 08 16:12:44 rpi41w-vo systemd[1]: Unit pimoroni-fanshim.service entered failed state.  
volumio@rpi41w-vo:~/fanshim-python/examples$ ls  
automatic.py button.py install-service.sh led2.py led.py manual.py README.md toggle.py  
volumio@rpi41w-vo:~/fanshim-python/examples$ sudo systemctl status pimoroni-fanshim.service  
● pimoroni-fanshim.service - Fan Shim Service  
Loaded: loaded (/etc/systemd/system/pimoroni-fanshim.service; enabled)  
Active: failed (Result: start-limit) since Sat 2020-08-08 16:12:45 EDT; 2min 30s ago  
Process: 7966 ExecStart=/usr/bin/python3 /home/volumio/fanshim-python/examples/automatic.py --on-threshold 50 --off-threshold 45 --low-temp 45 --high-temp 50 --delay 2 --brightness 255 (code=exited, status=1/FAILURE)  
Main PID: 7966 (code=exited, status=1/FAILURE)

Aug 08 16:12:45 rpi41w-vo systemd[1]: Unit pimoroni-fanshim.service entered failed state.  
Aug 08 16:12:45 rpi41w-vo systemd[1]: pimoroni-fanshim.service holdoff time over, scheduling restart.  
Aug 08 16:12:45 rpi41w-vo systemd[1]: Stopping Fan Shim Service…  
Aug 08 16:12:45 rpi41w-vo systemd[1]: Starting Fan Shim Service…  
Aug 08 16:12:45 rpi41w-vo systemd[1]: pimoroni-fanshim.service start request repeated too quickly, refusing…tart.  
Aug 08 16:12:45 rpi41w-vo systemd[1]: Failed to start Fan Shim Service.  
Aug 08 16:12:45 rpi41w-vo systemd[1]: Unit pimoroni-fanshim.service entered failed state.  
Hint: Some lines were ellipsized, use -l to show in full.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [August 8, 2020, 9:32pm UTC](https://forums.pimoroni.com/t/fan-shim-service-failing/14689/2 "2020-08-08T21:32:22Z")

</div>

Volumio as the operating system, which is based on raspbian Jesse. \<\< That seems contradictory? A Pi 4 will not run on Jessie? It will only boot from Buster / PiOS.  
You can control the Fan via a dtoverlay by the way. If you add the following to the config.txt file  
`dtoverlay=gpio-fan,gpiopin=18,temp=55000`  
the fan will turn on a 55c, and off again at 45c. You can change the 55000 to what ever turn on temp you want.  
That will get you temperature control until you sort out your other issue.  
What was the full command you entered to setup the service?  
It goes something like this  
cd fanshim-python  
cd examples  
sudo ./install-service.sh --on-threshold 55 --off-threshold 40 --delay 2

---

<div class="post-metadata">

**Author:** ![PiMax2](https://avatars.discourse-cdn.com/v4/letter/p/cdc98d/32.png) [@PiMax2](https://forums.pimoroni.com/u/PiMax2)\
**Post date:** [August 9, 2020, 12:21am UTC](https://forums.pimoroni.com/t/fan-shim-service-failing/14689/3 "2020-08-09T00:21:40Z")

</div>

@alphanumeric Thanks for your reply.

The full command I entered was:

sudo ./install-service.sh --on-threshold 50 --off-threshold 45 --delay 2

This was copied directly from the instructions that came with the software.

---

<div class="post-metadata">

**Author:** ![PiMax2](https://avatars.discourse-cdn.com/v4/letter/p/cdc98d/32.png) [@PiMax2](https://forums.pimoroni.com/u/PiMax2)\
**Post date:** [August 9, 2020, 12:33am UTC](https://forums.pimoroni.com/t/fan-shim-service-failing/14689/4 "2020-08-09T00:33:33Z")

</div>

BTW, you’re right about ‘jessie’ vs ‘buster’. That was a typo on my part. I was thinking ‘buster’, but I typed ‘jessie’. Thanks for the dtoverlay info. I’ll give that a shot. Are there similar options for controlling the LED and button?

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [August 9, 2020, 8:53am UTC](https://forums.pimoroni.com/t/fan-shim-service-failing/14689/5 "2020-08-09T08:53:50Z")

</div>

The button can be used to boot up and shut down the Pi, its what i use it for.  
If you shut down and leave the Pi Powered up, pressing the button will have it boot up.  
The button grounds GPIO 3 when pressed and grounding GPIO 3 will boot up a powered Pi. That’s a function etched into the Pi’s silicon. It’s built in, no software or special config required.  
The Pi can also be shutdown via GPIO 3. All you do is add the following line to the config.txt file.  
`dtoverlay=gpio-shutdown`  
If i2c is enabled it doesn’t work with GPIO 3 so I use the following with my fan shim just to play it safe. I switch it to GPIO 17.  
`dtoverlay=gpio-shutdown,gpio_pin=17,active_low=1,gpio_pull=up`  
The button actually grounds GPIO 3 and GPIO 17.

> **[Fan SHIM at Raspberry Pi GPIO Pinout](https://pinout.xyz/pinout/fan_shim)**
>
> Mini cooling fan shim for Raspberry Pi

  
I have my fan shim modified so when the Pi is shutdown the fan is off. I cut a track on the board. It still runs when commanded on, it just won’t run all on its own by default anymore.

I don’t use the LED so I haven’t done anything with it so far. It can be used, you’d just have to do it with some python code, same deal with the button if you wanted to use it to control the fan. There is info here on the python commands to use.

> **[pimoroni/fanshim-python](https://github.com/pimoroni/fanshim-python)**
>
> Python library for the Fan SHIM for Raspberry Pi. Contribute to pimoroni/fanshim-python development by creating an account on GitHub.
