My Rpi4 fanshim had been working great for months. Today, I checked on the fan and saw it was not running. The temps are high enough that it should be running. I followed the instructions to install the scripts (https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-fan-shim) and I’m not having any luck. Below are the errors I get. Any help would be greatly appreciated.
root@omv:~/fanshim-python/examples# ./install-service.sh --on-threshold 65 --off-threshold 55 --delay 2
Setting up with:
Off Threshold: 55 C
On Threshold: 65 C
Delay: 2 seconds
Preempt: no
Disable LED: no
Disable Button: no
Brightness: 255
To change these options, run:
sudo ./install-service.sh --off-threshold --on-threshold --delay --brightness --venv <python_virtual_environment> (–preempt) (–noled) (–nobutton)
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
psutil already installed
Installing service to: /etc/systemd/system/pimoroni-fanshim.service
Failed to restart pimoroni-fanshim.service: Unit pimoroni-fanshim.service is not loaded properly: Invalid argument.
See system logs and ‘systemctl status pimoroni-fanshim.service’ for details.
● pimoroni-fanshim.service - Fan Shim Service
Loaded: error (Reason: Invalid argument)
Active: inactive (dead)
Feb 06 10:32:18 omv systemd[1]: [/etc/systemd/system/pimoroni-fanshim.service:8] Executable path is not absolute, ignoring: python3 /root/fanshim-python/examples/automatic.py --on-threshold 55 --off-threshold 45 --delay 2 --brightness 255
Feb 06 10:32:18 omv systemd[1]: pimoroni-fanshim.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Feb 06 10:41:16 omv systemd[1]: [/etc/systemd/system/pimoroni-fanshim.service:8] Executable path is not absolute, ignoring: python3 /root/fanshim-python/examples/automatic.py --on-threshold 65 --off-threshold 55 --delay 2 --brightness 255
Feb 06 10:41:16 omv systemd[1]: pimoroni-fanshim.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Feb 06 10:41:17 omv systemd[1]: [/etc/systemd/system/pimoroni-fanshim.service:8] Executable path is not absolute, ignoring: python3 /root/fanshim-python/examples/automatic.py --on-threshold 65 --off-threshold 55 --delay 2 --brightness 255
Feb 06 10:41:17 omv systemd[1]: pimoroni-fanshim.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Feb 06 10:42:06 omv systemd[1]: [/etc/systemd/system/pimoroni-fanshim.service:8] Executable path is not absolute, ignoring: python3 /root/fanshim-python/examples/automatic.py --on-threshold 65 --off-threshold 55 --delay 2 --brightness 255
Feb 06 10:42:06 omv systemd[1]: pimoroni-fanshim.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Feb 06 10:42:06 omv systemd[1]: [/etc/systemd/system/pimoroni-fanshim.service:8] Executable path is not absolute, ignoring: python3 /root/fanshim-python/examples/automatic.py --on-threshold 65 --off-threshold 55 --delay 2 --brightness 255
Feb 06 10:42:06 omv systemd[1]: pimoroni-fanshim.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
I think old versions of systemctl insist on the command path being absolute but the later version that comes with Buster does not. If you change python3 to /usr/bin/python3 in install.sh it will probably fix it.
To change the fan shim service settings you have to stop it first. I’m not sure if your doing that.
cd fanshim-python
cd examples
sudo systemctl stop pimoroni-fanshim.service
sudo ./install-service.sh --on-threshold 75 --off-threshold 60 --delay 5
Change that last line to the new values you want to use.
You could also try this
cd fanshim-python
cd examples
sudo systemctl stop pimoroni-fanshim.service
sudo systemctl disable pimoroni-fanshim.service
Then reboot. The default state for the fan even with no software installed is on. It should just run continuously as long as the Pi has power. If you do the above and the fan still doesn’t run, you have a hardware issue.
nophead - That removed the previous errors.
alphanumeric - I did exactly what you said, all the way into reboot. The fan wasn’t running on startup.
I then did “./install-service.sh” followed by “systemctl status pimoroni-fanshim.service” and the results are below. I’m guessing I have a hardware failure?
root@omv:~/fanshim-python/examples# ./install-service.sh
Setting up with:
Off Threshold: 55 C
On Threshold: 65 C
Delay: 2 seconds
Preempt: no
Disable LED: no
Disable Button: no
Brightness: 255
To change these options, run:
sudo ./install-service.sh --off-threshold --on-threshold --delay --brightness --venv <python_virtual_environment> (–preempt) (–noled) (–nobutton)
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
psutil 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 Fri 2020-02-07 15:44:10 CST; 89ms ago
Main PID: 15727 (python3)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/pimoroni-fanshim.service
└─15727 /usr/bin/python3 /root/fanshim-python/examples/automatic.py --on-threshold 65 --off-threshold 55 --delay 2 -…55
Feb 07 15:44:10 omv systemd[1]: Started Fan Shim Service.
root@omv:~/fanshim-python/examples# systemctl status pimoroni-fanshim.service
● pimoroni-fanshim.service - Fan Shim Service
Loaded: loaded (/etc/systemd/system/pimoroni-fanshim.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2020-02-07 15:44:12 CST; 6s ago
Process: 15736 ExecStart=/usr/bin/python3 /root/fanshim-python/examples/automatic.py --on-threshold 65 --off-threshold 55 --dela
Main PID: 15736 (code=exited, status=1/FAILURE)
Feb 07 15:44:12 omv systemd[1]: pimoroni-fanshim.service: Failed with result ‘exit-code’.
Feb 07 15:44:12 omv systemd[1]: pimoroni-fanshim.service: Service hold-off time over, scheduling restart.
Feb 07 15:44:12 omv systemd[1]: Stopped Fan Shim Service.
Feb 07 15:44:12 omv systemd[1]: pimoroni-fanshim.service: Start request repeated too quickly.
Feb 07 15:44:12 omv systemd[1]: Failed to start Fan Shim Service.
Feb 07 15:44:12 omv systemd[1]: pimoroni-fanshim.service: Unit entered failed state.
Feb 07 15:44:12 omv systemd[1]: pimoroni-fanshim.service: Failed with result ‘exit-code’.
If the fan doesn’t run on boot up, even briefly, you must have a hardware failure. That or the fan shim isn’t making good contact with the Pi’s GPIO pins and is not getting power.
The fan has been running fine since August 2019. Just noticed a few days ago that it wasn’t running though it should have been. I’m leaning towards a hardware failure :-(
Thank you for the help!