I just migrated from Hamvoip to ASL 3. The Hamvoip script I used, to control the CPU fan, doesn't work with ASL 3. I did do some research, along with some trial and error, for a couple of hours, I guess it's time to admit defeat. Would someone please be kind enough to help me modify this script, to work with ASL 3?
#!/bin/bash
ontemp=48
gpio -g mode 3 out
temp=$(vcgencmd measure_temp | egrep -o '[0-9].[0-9]')
echo $temp #use BCM pin 3, as pin 2 is used for PSU control
temp0=${temp%.*}
echo $temp0
if [ $temp0 -gt $ontemp ]
then
echo greater than $ontemp fan on
gpio -g write 3 1
else
echo less than or equal to $ontemp fan off
gpio -g write 3 0
fi
I suspected this. The script is written to use a command called gpio but I could not find that command on my system, nor could I find any Debian 12 package that supplies that command, so there doesn't seem to be a replacemetn for it.
You would need to run pigpiod as a system service, and then modify your script to change gpio -g write 3 1 to probably look like pigs w 3 1. This is just a guess as I have not tried it.
On my RPi I appear to have the gpiod package installed. That package looks to provide a number of commands. You can use man -k gpio to see the related "man" pages ... and then man <page-of-interest> for more info.
Thanks to everyone who tried to help. I finally managed to get the fan working through a python script I found on Github. The Rasperry Pi OS has a built in fan control but for whatever reason it was removed from this particular distro.
If it's something packaged with stock Raspberry Pi OS, it's simply a matter of doing apt install for the package you seek. It's likely just not installed by default in the "lite" image that is the basis of the ASL3 Pi Appliance image.