PINE64
Tool to Control Fan - fanctl - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: ROCKPRO64 (https://forum.pine64.org/forumdisplay.php?fid=98)
+--- Forum: Linux on RockPro64 (https://forum.pine64.org/forumdisplay.php?fid=101)
+--- Thread: Tool to Control Fan - fanctl (/showthread.php?tid=6489)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20


RE: Tool to Control Fan - fanctl - romtorwator - 09-19-2018

In an unloaded state,
date, time, cores frequency, temperature, PWM:
2018-09-20,00:06:43,408,408,408,408,816,816,39,0
2018-09-20,00:06:44,408,408,408,408,816,816,40,0
2018-09-20,00:06:45,408,408,408,408,816,816,39,190
2018-09-20,00:06:46,408,408,408,408,816,816,40,190
2018-09-20,00:06:47,408,408,408,408,816,816,40,115
2018-09-20,00:06:48,408,408,408,408,408,408,40,115
2018-09-20,00:06:49,408,408,408,408,816,816,39,115
2018-09-20,00:06:50,408,408,408,408,816,816,39,115
2018-09-20,00:06:51,408,408,408,408,816,816,40,115
2018-09-20,00:06:52,408,408,408,408,816,816,40,0
2018-09-20,00:06:53,408,408,408,408,816,816,40,0
2018-09-20,00:06:54,408,408,408,408,816,816,39,0
2018-09-20,00:06:55,408,408,408,408,816,816,39,0

Code:
#!/bin/sh

while true :
do
 now=$(date "+%F,%H:%M:%S")
 temp=$(cat /sys/devices/virtual/thermal/thermal_zone0/temp)
 freq0=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)
 freq1=$(cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq)
 freq2=$(cat /sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq)
 freq3=$(cat /sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq)
 freq4=$(cat /sys/devices/system/cpu/cpu4/cpufreq/scaling_cur_freq)
 freq5=$(cat /sys/devices/system/cpu/cpu5/cpufreq/scaling_cur_freq)
 pwm1=$(cat /sys/class/hwmon/hwmon0/pwm1)
 echo $now,$(( freq0 /1000 )),$(( freq1 /1000 )),$(( freq2 /1000 )),$(( freq3 /1000 )),$(( freq4 /1000 )),$(( freq5 /1000 )),$(( temp / 1000 )),$(( pwm1 )) >> /var/log/temperature.log
 sleep 1
done



RE: Tool to Control Fan - fanctl - tuxd3v - 09-20-2018

(09-15-2018, 02:13 PM)amator_1 Wrote: wat am i doing wrong?
this is wat i get
:~# systemctl status fanctl                                                                                                  
● fanctl.service - Active Thermal Fan Service                                                                                            
  Loaded: loaded (/lib/systemd/system/fanctl.service; enabled; vendor preset: enabled)                                                  
  Active: activating (auto-restart) (Result: exit-code) since Sat 2018-09-15 22:10:16 CEST; 1s ago                                      
 Process: 1847 ExecStart=/usr/sbin/fanctl (code=exited, status=127)
Main PID: 1847 (code=exited, status=127)            
Can anyone help

Hello amator_1,

If you are in Ubuntu,
You need to upgrade kernel too(Debian Strech also needs kernel update), so that it will export to SysFs the Functionalities fanctl need.

To do so, you can:
Code:
apt-get clean
apt-get update
apt-get install linux-rockpro64 -y
apt-get install linux-image-4.4.138-1094-rockchip-ayufan-gf13a8a9a4eee linux-headers-4.4.138-1094-rockchip-ayufan-gf13a8a9a4eee cpufrequtils

Then reboot, and you should be fine.  Shy
Hope it helps


RE: Tool to Control Fan - fanctl - amator_1 - 09-21-2018

(09-15-2018, 04:05 PM)tuxd3v Wrote:
(09-15-2018, 02:13 PM)amator_1 Wrote: wat am i doing wrong?
this is wat i get
:~# systemctl status fanctl                                                                                                  
● fanctl.service - Active Thermal Fan Service                                                                                            
  Loaded: loaded (/lib/systemd/system/fanctl.service; enabled; vendor preset: enabled)                                                  
  Active: activating (auto-restart) (Result: exit-code) since Sat 2018-09-15 22:10:16 CEST; 1s ago                                      
 Process: 1847 ExecStart=/usr/sbin/fanctl (code=exited, status=127)
Main PID: 1847 (code=exited, status=127)            
Can anyone help

Hello amator_1,

Can you post the result of these 4 commands?
Code:
ls -l /sys/class/{thermal/thermal_zone{0,1}/temp,hwmon/hwmon0/pwm1}

ls: cannot access '/sys/class/hwmon/hwmon0/pwm1': No such file or directory
-r--r--r-- 1 root root 4096 Sep 21 09:42 /sys/class/thermal/thermal_zone0/temp
-r--r--r-- 1 root root 4096 Sep 21 09:42 /sys/class/thermal/thermal_zone1/temp


ls -l /usr/bin/lua
lrwxrwxrwx 1 root root 15 Sep 21 09:42 /usr/bin/lua -> /usr/bin/lua5.3



ls -l /usr/lib/aarch64-linux-gnu/lua/5.3/sleep.so
lrwxrwxrwx 1 root root 47 Sep 21 09:41 /usr/lib/aarch64-linux-gnu/lua/5.3/sleep.so -> /usr/lib/aarch64-linux-gnu/lua/5.3/sleep.so.0.1



ls -l /usr/sbin/fanctl
-r-xr-x--- 1 root root 8056 Sep 21 09:41 /usr/sbin/fanctl

regards

Hi tuxd3v
I added the results as copy past the questions above.
Thanks for the reply


RE: Tool to Control Fan - fanctl - tuxd3v - 09-21-2018

(09-21-2018, 01:54 AM)Hi tuxd3v Wrote: I added the results as copy past the questions above.
Thanks for the reply

Ok, the problem seems to be related with pwn:
"
ls -l /sys/class/{thermal/thermal_zone{0,1}/temp,hwmon/hwmon0/pwm1}
ls: cannot access '/sys/class/hwmon/hwmon0/pwm1': No such file or directory
"
Maybe is exported to SysFs with another name..
Check if it has another names on SysFs

For Example:
Code:
find /sys -name \*pwm\*

This is to Find were the pwm is  Shy
regards


RE: Tool to Control Fan - fanctl - romtorwator - 09-21-2018

While he does not update the kernel, he will not find it.
and the kernel is by ayufan


RE: Tool to Control Fan - fanctl - tuxd3v - 09-21-2018

(09-21-2018, 09:43 AM)romtorwator Wrote: While he does not update the kernel, he will not find it.
and the kernel is by ayufan

Yes its true,
first he need kernel update..

Without it, will not be able to get those Controls via SysFs.


RE: Tool to Control Fan - fanctl - amator_1 - 09-22-2018

[quote pid='40992' dateline='1537559674']
(09-21-2018, 09:43 AM)romtorwator Wrote: While he does not update the kernel, he will not find it.
and the kernel is by ayufan

Yes its true,
first he need kernel update..

Without it, will not be able to get those Controls via SysFs.
[/quote]

Ho do I update the kernel , I use openmediavault  see attachement


RE: Tool to Control Fan - fanctl - romtorwator - 09-22-2018

(09-22-2018, 03:27 AM)amator_1 Wrote: Ho do I update the kernel

4.4.132-1075 this is the old kernel, it does not yet have this, you need at least 4.4.132-1083, but better current:

Code:
sudo apt-get update
sudo apt-get install linux-image-4.4.138-1094-rockchip-ayufan-gf13a8a9a4eee
sudo apt-get install linux-headers-4.4.138-1094-rockchip-ayufan-gf13a8a9a4eee
sudo apt-get install linux-firmware-image-4.4.138-1094-rockchip-ayufan-gf13a8a9a4eee
sudo reboot

or download here and install the packages https://github.com/ayufan-rock64/linux-kernel/releases/tag/4.4.138-1094-rockchip-ayufan


RE: Tool to Control Fan - fanctl - amator_1 - 09-22-2018

(09-22-2018, 03:44 AM)romtorwator Wrote:
(09-22-2018, 03:27 AM)amator_1 Wrote: Ho do I update the kernel

4.4.132-1075 this is the old kernel, it does not yet have this, you need at least 4.4.132-1083, but better current:

Code:
sudo apt-get update
sudo apt-get install linux-image-4.4.138-1094-rockchip-ayufan-gf13a8a9a4eee
sudo apt-get install linux-headers-4.4.138-1094-rockchip-ayufan-gf13a8a9a4eee
sudo apt-get install linux-firmware-image-4.4.138-1094-rockchip-ayufan-gf13a8a9a4eee
sudo reboot

or download here and install the packages https://github.com/ayufan-rock64/linux-kernel/releases/tag/4.4.138-1094-rockchip-ayufan

Thank u romtorwator, i will try to update.


RE: Tool to Control Fan - fanctl - amator_1 - 09-22-2018

SOLVED

Thanks to everybody for the help.
kernel update did the job. Heart Heart Heart