If you add --noled to the end of the sudo ./install-service.sh --on-threshold 55 --off-threshold 40 --delay 2 when you run it the LED will be off.
`sudo ./install-service.sh --on-threshold 55 --off-threshold 40 --delay 2 --noled"
To find out if the fan is on its
fanshim.get_fan() # returns 1 for ‘on’, 0 for ‘off’
then set the LED accordingly
Fan Shim includes one RGB APA-102 LED.
Set it to any color with:
fanshim.set_light(r, g, b)
Arguments r, g and b should be numbers between 0 and 255 that describe the color you want.
I was hoping for a software edit to tell fan to stop before service shuts down.
My RPi can shutdown in the middle of the night if there’s a power outage, but the UPS comes back when power is restored.
Because the USB 3.0 hub is back-powering the RPi, it has power, but doesn’t boot, and without the service running the Fan Shim stays on until I wake up in the morning.
Can I tell the fan to stop via software by editing its config file (if any) when the RPi shuts down? Or by executing a command during shutdown?
The way it works is with no signal to the fan control pin the fan runs. Its fail safe state is on. If you plug it in and don’t install any control software it just runs continuously.
The fan control pin has to be pulled low to turn the fan off. If its a logic high or a floating no state, the fan is on.
When the Pi shuts down the Pimoroni fan daemon stops, the pin goes to a floating state, and the fan turns on.
You’d have to use the dtoverlay=gpio-poweroff, param = val in config.txt. I did this and it works if the pi is properly shut down. The problem for me was I couldn’t boot it back up by grounding GPIO 3. I had to power cycle it or ground the run pin. I don’t think it will work on a power failure though, and I don’t remember what values I used for the param and val
Thank you for the information, very detailed. Will check it.
Wanted to leave this fragment here from another post:
With Pibow coupé case, the tactile button can’t be pressed unless the shim is mounted up high on the GPIO header pins, flapping about in the breeze, and seems a bit floppy and vulnerable. If you press it down to sit firmly, the side of the case covers the button.
I also have by necessity a RTC partially on top of the Fan Shim.
I notched out that top layer with my dremel tool to get good access to the button. I use it to shut down and boot up the Pi. And I cut a track on the board so my fan turns off when the Pi shuts down. I don’t bother with the Pimoroni software I just do a config.txt edit.
Yes, that is all correct. If you do a shutdown and don’t unplug the power supply, momentarily grounding GPIO 3 will have it boot up. The Button on the fan shim grounds GPIO 3 and GPIO 17 when pressed. Adding dtoverlay=gpio-shutdown to config.txt will have it do a proper shutdown when GPIO 3 is grounded. That works as long as you don’t enable i2c. I often use i2c so I use the expanded entry switching the shutdown pin to GPIO 17. That works if i2c is on or off.
The fan control pin is GPIO 18. and the “temp =” is where it turns on. There is now an option in Raspberry Pi Configuration menu to enable fan control, and it will add the dtoverlay entry. It’s minimum temp is 60c. I’m usually going in to add the shutdown dtoverlay anyway so I just do both at the same time and don’t bother with the fan control menu option. Fan SHIM at Raspberry Pi GPIO Pinout
It’s always nice to have options. Nothing wrong with the Pimoroni software, I just find the config.txt edit easier for how I use the Fan Shim. If you want more than that 10 degree spread between on and off temperatures you don’t have a choice. Or if you want to show temperature on the LED etc.
install service cd fanshim-python cd examples sudo ./install-service.sh --on-threshold 55 --off-threshold 40 --delay 2
–nobutton to turn button off and
–noled to turn the LED off.
change service, run this from fanshim-python / examples folder