This will create a hwmon device in /sys/class/hwmon/.
The fan speed can be read from the file fan1_input in the hwmon device directory: cat fan1_input
The pwm level (0-255) can be set by the file pwm1 in the hwmon device directory. echo 0 | sudo tee pwm1
To make it permanent:
sudo ldto merge pwm-a
sudo ldto merge pwm-a-fan
From here, you can write userspace software in any language to implement control systems by reading fan1_input and writing to pwm1.
Most users prefer to link fan speed to SoC temperatures. To enable temperature-based fan speed control, run the previous merge commands and then add:
sudo ldto merge pwm-a-fan-auto
After rebooting, fan speed should be directly controlled by SoC temperatures. This profile deactivates the fan < 50C and peaks at 60C for maintaining maximum performance.
Using latest Raspbian image form downloads section for the board
For some reason the final step just didn’t work. “sudo ldto merge pwm-a-fan-auto” just kept poping up saying could not be created.
So for a work around I installed fancontroller and lm-sensors. I ran my fan wires exactly as shown in your image BYR in S/PDIF Header and Blue running to pin 33. sensors detected the pwm1 and temp1_input for the CPU no issue. following this guide here. https://www.libe.net/en-fan-control-debian#sudo-pwmconfig
but when I got to running sudo pwnconfig the fans would turn off but not back on drove me crazy. figured out pwmconfig would set pwm1_enable to a value of 0 and pwm1 to a value of 0. without a 1 in the pwm1_enable file the pwmconfigure program thought my fans had died.
nuts to all of that I just needed a clean config file that’s all.
here’s what I did.
took root using sudo su
from here as root I did this
pwmconfig && echo 1 | sudo tee pwm1_enable && echo 255 | sudo tee pwm1
that command just ran pwmconfig but then enabled pwm1 and set pwm1 value to 255 the setting pwmconfig wanted to set.
after that i finished the config wizard then saved and closed
now to see if i can do the same to the Emuelec image