forked from tuxd3v/ats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ats.conf
129 lines (107 loc) · 4.32 KB
/
ats.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
--- PREFACE:
--
-- ATS - Active Thermal Solution
-- This program control fan for RockPro64, or other boards
--
-- Nota :
-- Temperature can be more than real because of self heating..
----------------------------------------------------------------------
-- Copyright (c) 2018 Carlos Domingues, aka tuxd3v <[email protected]>
-- see licence..
-- Use at your own risk..
-- Nota:
-- Since many people have its own thermal Solution, and there are a so great variation in Temperature/Humidity around the globe,
-- Its virtually impossible to create a solution to fit all..
--[[ By Experience, without Underclock, with cpufreq Scalling 'Ondemand',
And with all CPUs at 100%, the temperature should not grow more than ~57/58C,
But it depends of the HeatSink/Fan characteristics/Environment around..
Nota:
For Safety Reasons,
It Starts with 'MAX_CONTINUOUS_THERMAL_TEMP' limit( in the worst case cenario, we could not be able to read correctly the temps initially... )
In the absence of proper Active Thermal Solution, to cool down( weak or dead fan? ),
It will adjust temps only until 'ABSOLUTE_MAX_THERMAL_TEMP' were reached, were then, it Shutdown in 10s( for safety reasons.. )
]]
---- Tests Done
--
--[[ This tool was tested 24x7, for more than 12 months, under Full Load, with:
< Minimal Debian Strech release >, and also < Ubuntu bionic >, both by ayufan,
But it should work with DietPi,Armbian, ArchLinux, etc
In next releases SysVinit based OSes, such Devuan ASCII should also work..
Adjust Values Bellow to Get best Conditions, for your board, heatsink, and Fan specs..
To add comments, just put "--" before the comment
]]
--- Defenition Boards,
-- You can create more Defenitions, at the **End of File**, **Assign your to 'SYSTEM'**...see bellow
SYSTEM = {
--- Board Specs..
--
BOARD = {
-- Board Name
NAME = "ROCKPRO64",
-- CPU used on this Board
CPU = "RK3399"
},
--- Assigning SysFs Locations for control..
--
-- CPU Thermal Zone[ String ]
THERMAL0_CTL = {
"/sys/class/thermal/thermal_zone0/temp"
},
-- GPU Thermal Zone[ String ]
THERMAL1_CTL = {
"/sys/class/thermal/thermal_zone1/temp"
},
-- FAN Control[ String ]
PWM_CTL = {
"/sys/class/hwmon/hwmon0/pwm1",
"/sys/devices/platform/pwm-fan/hwmon/hwmon0/pwm1",
"/sys/devices/platform/pwm-fan/hwmon/hwmon1/pwm1",
"/sys/devices/platform/pwm-fan/hwmon/hwmon2/pwm1",
"/sys/devices/platform/pwm-fan/hwmon/hwmon3/pwm1"
},
--- Temperature Control Constants
--
-- Max Temperature Allowed for adjusting fan pwm( On this threshold, and above, fan is always on MaxValue )
MAX_CONTINUOUS_THERMAL_TEMP = 60,
-- Min Temperature threshold to activate/deactivate Fan
MIN_CONTINUOUS_THERMAL_TEMP = 40,
--- PWM Parameters Constants
--
-- Adjust conform your Fan specs, some neds greater values, others work with less current( currently not being used .. )
MAX_PWM = 255,
-- Adjust conform your Fan specs, some neds greater values, others work with less current( currently not being used .. )
MIN_PWM = 40,
--- Fan Cycling ON/OFF [ boolean ]
--
-- true - Fan will be always on
-- false - Fan will start/stop, cycling..
ALWAYS_ON = false,
--- Active profiles, 3 profiles{ profile0, profile1, profile2 }
--
-- Equation to get PWM, PWM( TEMP )
--
-- if( TEMP < MIN_CONTINUOUS_THERMAL_TEMP )
-- then
-- -- In this case fan will stop
-- 0
-- else
-- -- In this case fan will run, with the power resulting from equation bellow,
-- -- on active envelope( MIN_CONTINUOUS_THERMAL_TEMP <= TEMP < MAX_CONTINUOUS_THERMAL_TEMP )
-- -- For situation were TEMP > MAX_CONTINUOUS_THERMAL_TEMP. pwm is Maximun, until ABSOLUTE_MAX_THERMAL reached, were it will shutdown system..
--
-- MIN_PWM + ( ( MAX_PWM - MIN_PWM )/( MAX_CONTINUOUS_THERMAL_TEMP - MIN_CONTINUOUS_THERMAL_TEMP ) ) * ( TEMP - MIN_CONTINUOUS_THERMAL_TEMP )
-- end
-- Chose Fan Profile,
-- 0 - Smaller fan { ~40*40*10 mm taller, CFM < 4, 12v, ~0.1A, ~4000rpm max }
-- 1 - Talller fan options {
-- 40*40*20mm ( CFM ~4-5, 12v, ~0.1A, ~5000rpm max ),
-- 40*40*10mm ( CFM >4, 12v, ~0.1A, >=5000rpm )
-- }
-- 2 - Taller/Bigger, NAS Case fan( ~80*70*20mm, CFM 25.15 CFM, 12v, 0.10A )
PROFILE_NAME = "profile0",
PROFILE_NR = 0
}
--- Assign SYSTEM, to your Linux Board
--
--SYSTEM = ROCKPRO64
return SYSTEM