Tool to Control Fan - fanctl
Sorry, I wasn't clear. I want the fan to activate first when the SOC reaches 60*C and I want it to work continually at a temperature of 70*C.
I set the values accordingly in the config:

Code:
       -- Max Temperature Allowed for adjusting fan pwm( On this threshold, and above, fan is always on MaxValue )
       MAX_CONTINUOUS_THERMAL_TEMP     = 70,
       -- Min Temperature  threshold to activate/deactivate Fan
       MIN_CONTINUOUS_THERMAL_TEMP     = 60,


I checked with armbianmonitor that the SOC (which isn't really doing anything at the moment) hovers around ~45*C (max).
Despite this, the fan powers on for approx 2 seconds every minute or two.

I'll monitor whats happening using ats -t Smile
You can find me on IRC, Discord and Twitter


  Reply
(04-05-2019, 01:05 PM)Luke Wrote: Sorry, I wasn't clear. I want the fan to activate first when the SOC reaches 60*C and I want it to work continually at a temperature of 70*C.
I set the values accordingly in the config:

Code:
       -- Max Temperature Allowed for adjusting fan pwm( On this threshold, and above, fan is always on MaxValue )
       MAX_CONTINUOUS_THERMAL_TEMP     = 70,
       -- Min Temperature  threshold to activate/deactivate Fan
       MIN_CONTINUOUS_THERMAL_TEMP     = 60,


I checked with armbianmonitor that the SOC (which isn't really doing anything at the moment) hovers around ~45*C (max).
Despite this, the fan powers on for approx 2 seconds every minute or two.

I'll monitor whats happening using ats -t Smile

Try, point 3) and 4) on my last comment,

Ans show at least point 3)
ats -t , with the service running

I noticed in the past that, kernels above 4.4.138-1097, do some interference in pwm.
I don't know if that could be the case here..

One way of testing it,
Would be stopping ats service and monitor pwm..
Something like:

Code:
while true;do pwm=$( cat /sys/devices/platform/pwm-fan/hwmon/hwmon0/pwm1);if [ ${pwm} -ne 0 ];then echo "--->${pwm}"; fi; done
 
In this way, you can sort out if pwm automatically activates.. Shy
  Reply
Thumbs Up 
Hello Luke,
I think I understood what you were talking about..  Wink

I reproduced that behaviour..
stopping ats,
then running ats in test mode..
Code:
root@rockpro64:~# ats -t
info:'SYSTEM' Table
info:    'BOARD' Table
info:        'NAME' = ROCKPRO64
info:        'CPU'  = RK3399
info:    'THERMAL0_CTL' = /sys/class/thermal/thermal_zone0/temp
info:    'THERMAL1_CTL' = /sys/class/thermal/thermal_zone1/temp
info:    'PWM_CTL'      = /sys/class/hwmon/hwmon0/pwm1
warn:    'MAX_CONTINUOUS_THERMAL_TEMP' outside range] -20, 70 [
        'MAX_CONTINUOUS_THERMAL_TEMP' = 60
info:    'MIN_CONTINUOUS_THERMAL_TEMP' = 60

ATS, has hard-limits for temps..
When you configure it to:
Code:
      -- Max Temperature Allowed for adjusting fan pwm( On this threshold, and above, fan is always on MaxValue )
      MAX_CONTINUOUS_THERMAL_TEMP     = 70,
      -- Min Temperature  threshold to activate/deactivate Fan
      MIN_CONTINUOUS_THERMAL_TEMP     = 60,

You are hitting the higher hard limit range: ] -20, 70 [
So Ats warns you,
And corrects 'MAX_CONTINUOUS_THERMAL_TEMP' to 60C

In this situation you end with higher and lower trigger points equal..
Without code changes, the Closest you can get in /etc/ats.conf would be:

Code:
      -- Max Temperature Allowed for adjusting fan pwm( On this threshold, and above, fan is always on MaxValue )
      MAX_CONTINUOUS_THERMAL_TEMP     = 69,
      -- Min Temperature  threshold to activate/deactivate Fan
      MIN_CONTINUOUS_THERMAL_TEMP     = 60,


An output in test mode:

Code:
root@rockpro64:~# ats -t
info:'SYSTEM' Table
info:    'BOARD' Table
info:        'NAME' = ROCKPRO64
info:        'CPU'  = RK3399
info:    'THERMAL0_CTL' = /sys/class/thermal/thermal_zone0/temp
info:    'THERMAL1_CTL' = /sys/class/thermal/thermal_zone1/temp
info:    'PWM_CTL'      = /sys/class/hwmon/hwmon0/pwm1
info:    'MAX_CONTINUOUS_THERMAL_TEMP' = 69
info:    'MIN_CONTINUOUS_THERMAL_TEMP' = 60
info:    'MAX_PWM' = 255
info:    'MIN_PWM' = 40
info:    'ALWAYS_ON' = false
info:    'PROFILE_NAME' = profile0
info:    'PROFILE'      = 0
info:'Pratio' timers
info:    'Pratio[ -20 - 60 [' = 0
info:    'Pratio[ 60 ]'       = 40
info:    'Pratio[ 61 ]'       = 63
info:    'Pratio[ 62 ]'       = 87
info:    'Pratio[ 63 ]'       = 111
info:    'Pratio[ 64 ]'       = 135
info:    'Pratio[ 65 ]'       = 159
info:    'Pratio[ 66 ]'       = 183
info:    'Pratio[ 67 ]'       = 207
info:    'Pratio[ 68 ]'       = 231
info:    'Pratio[ 69 ]'       = 255
info:    'Pratio[ 69 - 70 ['  = 255
Stop ATS Service first [ service ats stop ]..

No more warnings, and so no internal adjustments..

But even So, I could reproduce your report:

Code:
--------------------
Running for[ seconds ]................ 0
CPU Temperature[ max 70 °C ].......... 58
GPU Temperature[ max 70 °C ].......... 49
Fan PWM Duty Cycle value[ 0 - 255 ]... 0
--------------------
Stopping for[ seconds ]............... 120
CPU Temperature[ max 70 °C ].......... 58
GPU Temperature[ max 70 °C ].......... 49
Fan PWM Duty Cycle value[ 0 - 255 ]... 0
--------------------

I will look into the code, and check it..
The power is activated in 2 phases, probably the first one is running, on this conditions..

Thanks for reporting that![Image: thumbsup.png]
  Reply
Many thanks tuxd3v ! I'll retest with the values you suggested today and let you know how it goes Smile

[edit] with your suggested values set in /etc/ats.conf

I am seeing same behaviour, the fan engages for a split second then spools back down. The log below is from ~4 min of ats -t running.


Code:
root@OpenMediaVault:~# ats -t
info:'SYSTEM' Table
info:    'BOARD' Table
info:        'NAME' = ROCKPRO64
info:        'CPU'  = RK3399
info:    'THERMAL0_CTL' = /sys/class/thermal/thermal_zone0/temp
info:    'THERMAL1_CTL' = /sys/class/thermal/thermal_zone1/temp
info:    'PWM_CTL'      = /sys/class/hwmon/hwmon0/pwm1
info:    'MAX_CONTINUOUS_THERMAL_TEMP' = 69
info:    'MIN_CONTINUOUS_THERMAL_TEMP' = 60
info:    'MAX_PWM' = 255
info:    'MIN_PWM' = 125
info:    'ALWAYS_ON' = false
info:    'PROFILE_NAME' = profile0
info:    'PROFILE'      = 2
info:'Pratio' timers
info:    'Pratio[ -20 - 60 [' = 0
info:    'Pratio[ 60 ]'       = 125
info:    'Pratio[ 61 ]'       = 139
info:    'Pratio[ 62 ]'       = 153
info:    'Pratio[ 63 ]'       = 168
info:    'Pratio[ 64 ]'       = 182
info:    'Pratio[ 65 ]'       = 197
info:    'Pratio[ 66 ]'       = 211
info:    'Pratio[ 67 ]'       = 226
info:    'Pratio[ 68 ]'       = 240
info:    'Pratio[ 69 ]'       = 255
info:    'Pratio[ 69 - 70 ['  = 255
Stopping for[ seconds ]............... 3
CPU Temperature[ max 70 °C ].......... 0
GPU Temperature[ max 70 °C ].......... 0
Fan PWM Duty Cycle value[ 0 - 255 ]... 0
--------------------
Running for[ seconds ]................ 0
CPU Temperature[ max 70 °C ].......... 45
GPU Temperature[ max 70 °C ].......... 46
Fan PWM Duty Cycle value[ 0 - 255 ]... 0
--------------------
Stopping for[ seconds ]............... 120
CPU Temperature[ max 70 °C ].......... 45
GPU Temperature[ max 70 °C ].......... 46
Fan PWM Duty Cycle value[ 0 - 255 ]... 0
--------------------
Running for[ seconds ]................ 0
CPU Temperature[ max 70 °C ].......... 44
GPU Temperature[ max 70 °C ].......... 46
Fan PWM Duty Cycle value[ 0 - 255 ]... 0
--------------------
Stopping for[ seconds ]............... 120
CPU Temperature[ max 70 °C ].......... 44
GPU Temperature[ max 70 °C ].......... 46
Fan PWM Duty Cycle value[ 0 - 255 ]... 0
--------------------
Running for[ seconds ]................ 0
CPU Temperature[ max 70 °C ].......... 43
GPU Temperature[ max 70 °C ].......... 45
Fan PWM Duty Cycle value[ 0 - 255 ]... 0
--------------------
Stopping for[ seconds ]............... 120
CPU Temperature[ max 70 °C ].......... 43
GPU Temperature[ max 70 °C ].......... 45
Fan PWM Duty Cycle value[ 0 - 255 ]... 0
--------------------
You can find me on IRC, Discord and Twitter


  Reply
(04-07-2019, 03:03 PM)Luke Wrote: Many thanks tuxd3v ! I'll retest with the values you suggested today and let you know how it goes Smile

[edit] with your suggested values set in /etc/ats.conf

I am seeing same behaviour, the fan engages for a split second then spools back down. The log below is from ~4 min of ats -t running.

Hello Luke,
Yes, I remember that at the time,
I wanted to make a optimisation , and that reflected in the first stage start outside active window too briefly..

I am in a project now, but has promised I will look into it, and correct it  Shy 
I suspect that for that, I will loose the optimisation I have done before( ..its around 0.0001% CPU time), but maybe I could improve, in another places to gain it back  Wink

Thanks for you post on this subject,
I confess, that with time I have forgotten it  Blush

Best Regards
  Reply
Hi, Rock64Pro OMV Nas up and running. Trying to install the ATS script.
1. Installed the dependencies - no errors.
2. Here's error when I attempt to install the ats.master and it tries to start the service.

Starting ATS Service..                                                                                                                                

● ats.service - ATS - Active Thermal Service                                                                                                          

   Loaded: loaded (/usr/local/lib/luarocks/rocks/ats/master-0/ats.service; enabled; vendor preset: enabled)                                           

   Active: activating (auto-restart) (Result: exit-code) since Tue 2019-04-30 11:28:30 CDT; 23ms ago                                                  

  Process: 3352 ExecStart=/usr/local/sbin/ats (code=exited, status=127)

 Main PID: 3352 (code=exited, status=127)                                                                                                             

                                                                                                                                                      

Apr 30 11:28:30 rock64pronas systemd[1]: ats.service: Unit entered failed state.                                                                      

Apr 30 11:28:30 rock64pronas systemd[1]: ats.service: Failed with result 'exit-code'.                                                                 

Makefile:224: recipe for target 'install' failed                                                                                                      

make: *** [install] Error 3                                                                                                                           

                                                                                                                                                      
Error: Build error: Failed installing.    
  Reply
(04-30-2019, 10:33 AM)Farley56 Wrote: Hi, Rock64Pro OMV Nas up and running. Trying to install the ATS script.
1. Installed the dependencies - no errors.
2. Here's error when I attempt to install the ats.master and it tries to start the service.
                                                          

Makefile:224: recipe for target 'install' failed                                                                                                      

make: *** [install] Error 3                                                                                                                           

                                                                                                                                                      
Error: Build error: Failed installing.    
Hello Farley56,
What I recommend, is to go always...to Stable Version..  Shy

1) Please, remove the version you have installed..

First stop the running service:
Code:
service ats stop

Then remove version installed:
Code:
luarocks remove ats

2) Install Again:
Code:
luarocks build https://raw.githubusercontent.com/tuxd3v/ats/master/ats-master-0.rockspec

2.1) This is the full output of a installation, using the master branch( Method 1. )
Code:
root@rockpro64:~# luarocks build https://raw.githubusercontent.com/tuxd3v/ats/master/ats-master-0.rockspec
Cloning into 'ats'...
remote: Enumerating objects: 24, done.
remote: Counting objects: 100% (24/24), done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 24 (delta 1), reused 9 (delta 0), pack-reused 0
Receiving objects: 100% (24/24), 105.25 KiB | 118.00 KiB/s, done.
Resolving deltas: 100% (1/1), done.
Warning: variable CFLAGS was not passed in build_variables
** PLATFORM = linux  **
** OS       = 64Bits **
** ARCH     = armv8-a+crc **
** TUNE     = cortex-a72.cortex-a53 **
gcc -c -march=armv8-a+crc -mtune=cortex-a72.cortex-a53 -fPIC -Wall -Werror -O3 -g -I/usr/include/lua5.3  -o debug.o src/debug.c
gcc -c -march=armv8-a+crc -mtune=cortex-a72.cortex-a53 -fPIC -Wall -Werror -O3 -g -I/usr/include/lua5.3  -o ats.o src/ats.c
gcc -shared -Wl,-soname,ats.so.0 -llua5.3  -o ats.so.0.9 debug.o ats.o
Install Method: LuaRocks ..
SystemD Detected ..
Searching for Previous Install, and Remove it:
removed '/etc/ats.conf'
removed '/lib/systemd/system/ats.service'
removed '/usr/local/sbin/ats'
removed '/usr/local/lib/lua/5.3/ats.so'
Install ATS Service File ..........: ats.service in '/usr/local/lib/luarocks/rocks/ats/master-0'
Install ATS Config ................: ats.config in '/usr/local/lib/luarocks/rocks/ats/master-0'
Install ATS Tool ..................: ats in '/usr/local/lib/luarocks/rocks/ats/master-0'
Install new ATS Library ...........: ats.so.0.9 in '/usr/local/lib/luarocks/rocks/ats/master-0'
Creating soname symLink ........: ats.so in '/usr/local/lib/luarocks/rocks/ats/master-0'
Creating Service symLink .......: ats.service in '/lib/systemd/system'
Creating Binary symLink ........: ats in '/usr/local/sbin/ats'
Creating Config symLink ........: ats.conf in '/etc/ats.conf'
Creating SharedObject symLink ..: ats.so.0.9 in '/usr/local/lib/lua/5.3'
Starting ATS Service..
● ats.service - ATS - Active Thermal Service
  Loaded: loaded (/usr/local/lib/luarocks/rocks/ats/master-0/ats.service; enabled; vendor preset: enabled)
  Active: active (running) since Tue 2019-04-30 18:17:03 WEST; 29ms ago
Main PID: 12959 (lua)
   Tasks: 1 (limit: 4642)
  CGroup: /system.slice/ats.service
          └─12959 lua /usr/local/sbin/ats

Apr 30 18:17:03 rockpro64 systemd[1]: Started ATS - Active Thermal Service.
ats master-0 is now installed in /usr/local (license: See License..)


3) Check if service is running:
Code:
root@rockpro64:~# service ats status
● ats.service - ATS - Active Thermal Service
  Loaded: loaded (/usr/local/lib/luarocks/rocks/ats/master-0/ats.service; enabled; vendor preset: enabled)
  Active: active (running) since Tue 2019-04-30 18:17:03 WEST; 18s ago
Main PID: 12959 (lua)
   Tasks: 1 (limit: 4642)
  CGroup: /system.slice/ats.service
          └─12959 lua /usr/local/sbin/ats

Apr 30 18:17:03 rockpro64 systemd[1]: Started ATS - Active Thermal Service.

4) Print ATS configuration running:
Code:
root@rockpro64:~# ats -t
info:'SYSTEM' Table
info:    'BOARD' Table
info:        'NAME' = ROCKPRO64
info:        'CPU'  = RK3399
info:    'THERMAL0_CTL' = /sys/class/thermal/thermal_zone0/temp
info:    'THERMAL1_CTL' = /sys/class/thermal/thermal_zone1/temp
info:    'PWM_CTL'      = /sys/class/hwmon/hwmon0/pwm1
info:    'MAX_CONTINUOUS_THERMAL_TEMP' = 60
info:    'MIN_CONTINUOUS_THERMAL_TEMP' = 40
info:    'MAX_PWM' = 255
info:    'MIN_PWM' = 40
info:    'ALWAYS_ON' = false
info:    'PROFILE_NAME' = profile0
info:    'PROFILE'      = 0
info:'Pratio' timers
info:    'Pratio[ -20 - 40 [' = 0
info:    'Pratio[ 40 ]'       = 40
info:    'Pratio[ 41 ]'       = 50
info:    'Pratio[ 42 ]'       = 61
info:    'Pratio[ 43 ]'       = 72
info:    'Pratio[ 44 ]'       = 83
info:    'Pratio[ 45 ]'       = 93
info:    'Pratio[ 46 ]'       = 104
info:    'Pratio[ 47 ]'       = 115
info:    'Pratio[ 48 ]'       = 126
info:    'Pratio[ 49 ]'       = 136
info:    'Pratio[ 50 ]'       = 147
info:    'Pratio[ 51 ]'       = 158
info:    'Pratio[ 52 ]'       = 169
info:    'Pratio[ 53 ]'       = 179
info:    'Pratio[ 54 ]'       = 190
info:    'Pratio[ 55 ]'       = 201
info:    'Pratio[ 56 ]'       = 212
info:    'Pratio[ 57 ]'       = 222
info:    'Pratio[ 58 ]'       = 233
info:    'Pratio[ 59 ]'       = 244
info:    'Pratio[ 60 ]'       = 255
info:    'Pratio[ 60 - 70 ['  = 255
Stop ATS Service first [ service ats stop ]..

Please, in the process above,
Provide me, the output of installation, like in 2.1), so that I can debug it..  Shy

Regards,
  Reply
1. a. Install didn't finish so trying to stop the service returned this;
Failed to stop ats.service: Unit ats.service not loaded.
b. Trying to un-install returned this;
Error: Could not find rock 'atsluarocks remove' in /usr/local
2. Trying to install the master-0 revision gave me the same error as previous attempt.
root@rock64pronas:~# luarocks build https://raw.githubusercontent.com/tuxd3v...0.rockspec
Cloning into 'ats'...
remote: Enumerating objects: 24, done.
remote: Counting objects: 100% (24/24), done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 24 (delta 1), reused 9 (delta 0), pack-reused 0
Receiving objects: 100% (24/24), 105.25 KiB | 0 bytes/s, done.
Resolving deltas: 100% (1/1), done.
Warning: variable CFLAGS was not passed in build_variables
** PLATFORM = linux **
** OS = 32Bits **
/usr/bin/env: 'lua': No such file or directory
** ARCH = armv7-a **
/usr/bin/env: 'lua': No such file or directory
gcc -c -march=armv7-a -fPIC -Wall -Werror -O3 -g -I/usr/include/lua5.3 -o debug.o src/debug.c
gcc -c -march=armv7-a -fPIC -Wall -Werror -O3 -g -I/usr/include/lua5.3 -o ats.o src/ats.c
gcc -shared -Wl,-soname,ats.so.0 -llua5.3 -o ats.so.0.9 debug.o ats.o
Install Method: LuaRocks ..
SystemD Detected ..
Searching for Previous Install, and Remove it:
removed '/etc/ats.conf'
removed '/lib/systemd/system/ats.service'
removed '/usr/local/sbin/ats'
removed '/usr/local/lib/lua/5.3/ats.so'
Install ATS Service File ..........: ats.service in '/usr/local/lib/luarocks/rocks/ats/master-0'
Install ATS Config ................: ats.config in '/usr/local/lib/luarocks/rocks/ats/master-0'
Install ATS Tool ..................: ats in '/usr/local/lib/luarocks/rocks/ats/master-0'
Install new ATS Library ...........: ats.so.0.9 in '/usr/local/lib/luarocks/rocks/ats/master-0'
Creating soname symLink ........: ats.so in '/usr/local/lib/luarocks/rocks/ats/master-0'
Creating Service symLink .......: ats.service in '/lib/systemd/system'
Creating Binary symLink ........: ats in '/usr/local/sbin/ats'
Creating Config symLink ........: ats.conf in '/etc/ats.conf'
Creating SharedObject symLink ..: ats.so.0.9 in '/usr/local/lib/lua/5.3'
Starting ATS Service..
● ats.service - ATS - Active Thermal Service
Loaded: loaded (/usr/local/lib/luarocks/rocks/ats/master-0/ats.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Tue 2019-04-30 21:37:55 CDT; 28ms ago
Process: 8244 ExecStart=/usr/local/sbin/ats (code=exited, status=127)
Main PID: 8244 (code=exited, status=127)

Apr 30 21:37:55 rock64pronas systemd[1]: ats.service: Failed with result 'exit-code'.
Makefile:224: recipe for target 'install' failed
make: *** [install] Error 3

Error: Build error: Failed installing.
  Reply
(04-30-2019, 08:42 PM)Farley56 Wrote: 1. a. Install didn't finish so trying to stop the service returned this;
Failed to stop ats.service: Unit ats.service not loaded.
b. Trying to un-install returned this;
Error: Could not find rock 'atsluarocks remove' in /usr/local
2. Trying to install the master-0 revision gave me the same error as previous attempt.
root@rock64pronas:~# luarocks build https://raw.githubusercontent.com/tuxd3v...0.rockspec

(...)
                                                                          
/usr/bin/env: 'lua': No such file or directory                                                                                                       Process: 8244 ExecStart=/usr/local/sbin/ats (code=exited, status=127)
Main PID: 8244 (code=exited, status=127)                                                                                                     

Hello,
Try to run this:
Code:
which lua
Probably you don't have the symbolic link, bellow, created..  Shy
Create it with:
Code:
ln -s /usr/bin/lua5.3 /usr/bin/lua

And install again,it should work  Wink
  Reply
Thanks for the suggestions.
1. which lua returned error.
2. Ran the ln command
3. which lua command now returns;
/usr/bin/lua
4. Install of master revision now gives me this error;
Starting ATS Service..
● ats.service - ATS - Active Thermal Service
Loaded: loaded (/usr/local/lib/luarocks/rocks/ats/master-0/ats.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Wed 2019-05-01 14:12:05 CDT; 27ms ago
Process: 21518 ExecStart=/usr/local/sbin/ats (code=exited, status=1/FAILURE)
Main PID: 21518 (code=exited, status=1/FAILURE)

May 01 14:12:05 rock64pronas systemd[1]: ats.service: Unit entered failed state.
May 01 14:12:05 rock64pronas systemd[1]: ats.service: Failed with result 'exit-code'.
Makefile:224: recipe for target 'install' failed
make: *** [install] Error 3

Error: Build error: Failed installing.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  PWM Fan Control Python Script superbox 0 1,659 02-04-2022, 10:02 PM
Last Post: superbox

Forum Jump:


Users browsing this thread: 12 Guest(s)