README.md (1274B)
1 # MACCHIATObin Fan daemon 2 3 The [MACCHIATObin](http://macchiatobin.net/) board has a PWM fan connected to the J10 header. 4 By default the fan spin at maximum speed, but it can be switched on/off via GPIO #80 (precisely GPIO #16 of the second chip). 5 6 ## mcbinfand 7 `mcbinfand` is a small daemon which reads the temperature from the _armada-cp110-thermal"_ hwmon iterface, and sets the fan speed via a software PWM. 8 The fan duty cycle is set at 0% with temperature below 40 °C and 100% when temperature goes above 55 °C. 9 For temperatures in the middle, duty cycle is scaled proportionally. 10 11 ## Compiling 12 `mcbinfand` only depends on [libgpiod](https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/) 13 14 ## Running 15 `mcbinfand` is not configurable at runtime yet, if you want to tune it, set these variables in `fand.c`: 16 * MIN_TEMP the min temperature, e.g. the one with 0% duty cycle 17 * MAX_TEMP the max temperature, e.g. with 100% duty cycle 18 * PWM_USECS the interval in microseconds of the PWM loop. Lower values will keep the CPU busy 19 20 On exit the daemon will leave the GPIO on, so the fan will spin at maximum speed and your CPU won't burn. 21 `fand.service` is a systemd unit file which starts the daemon just after the creation of the `/dev/gpiochip1` character device.