Skip to content

Commit

Permalink
replaced udev fancontrol
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Welz committed Oct 15, 2020
1 parent a2c9f66 commit f8efadb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 29 deletions.
2 changes: 1 addition & 1 deletion roles/pi-fancontrol/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# Variables for Fan control
fancontrol_enabled: true
fan_config_file: /etc/udev/rules.d/50-rpi-fan.rules
fan_config_file: /boot/firmware/usercfg.txt
fan_config_template: fancontrol.jinja2
8 changes: 0 additions & 8 deletions roles/pi-fancontrol/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,3 @@
dest: "{{ fan_config_file }}"
register: fancontrol
when: fancontrol_enabled

- name: reload udev
command: "udevadm control --reload-rules"
when: fancontrol.changed

- name: trigger udev
command: "udevadm trigger"
when: fancontrol.changed
28 changes: 8 additions & 20 deletions roles/pi-fancontrol/templates/fancontrol.jinja2
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
SUBSYSTEM=="thermal"
KERNEL=="thermal_zone0"

# If the temp hits 81C, highest RPM
ATTR{trip_point_0_temp}="82000"
ATTR{trip_point_0_hyst}="3000"
#
# If the temp hits 80C, higher RPM
ATTR{trip_point_1_temp}="81000"
ATTR{trip_point_1_hyst}="2000"
#
# If the temp hits 70C, higher RPM
ATTR{trip_point_2_temp}="71000"
ATTR{trip_point_2_hyst}="3000"
#
# If the temp hits 60C, turn on the fan
ATTR{trip_point_3_temp}="61000"
ATTR{trip_point_3_hyst}="5000"
#
# Fan is off otherwise
# Place "config.txt" changes (dtparam, dtoverlay, disable_overscan, etc.) in
# this file. Please refer to the README file for a description of the various
# configuration files on the boot partition.
dtoverlay=rpi-poe
dtparam=poe_fan_temp0=61000,poe_fan_temp0_hyst=2000
dtparam=poe_fan_temp1=70000,poe_fan_temp1_hyst=5000
dtparam=poe_fan_temp2=75000,poe_fan_temp2_hyst=3000
dtparam=poe_fan_temp3=81000,poe_fan_temp3_hyst=5000

1 comment on commit f8efadb

@philwelz
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.