Tool to Control Fan - fanctl
(05-23-2019, 02:00 PM)tuxd3v Wrote: Hello tikonen,

You need to install the tool has root..

Hello  tikonen,
Can you share the output of:
Code:
systemctl status ats

Also the output of:
Code:
journalctl -u ats

(05-21-2019, 11:16 AM)deathisunknown Wrote: Hi tuxd3v,

Here is the output from the commands you requested:

Code:
root@RockPro:~# uname -a
Linux RockPro 5.0.0-rockchip64 #5.85 SMP Wed May 8 19:38:28 CEST 2019 aarch64 GNU/Linux

Thanks again!

Hello deathisunknown,

Can you share, as root the output of:
Code:
find /sys -name pwm[0-9] -type f -exec cat {} \;

Regards
  Reply
(05-24-2019, 09:17 AM)tuxd3v Wrote:
(05-23-2019, 02:00 PM)tuxd3v Wrote: Hello tikonen,

You need to install the tool has root..

Hello  tikonen,
Can you share the output of:
Code:
systemctl status ats

Also the output of:
Code:
journalctl -u ats
Hi, here are the outputs.


Code:
rock64@rockpro64:~$ sudo luarocks build https://raw.githubusercontent.com/tuxd3v/ats/master/ats-0.2-0.rockspec
Warning: variable CFLAGS was not passed in build_variables
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 ATS Tool ..................: ats in /usr/local/sbin
Install ATS Config ................: ats.config in /etc
Install ATS Service File ..........: ats.service in systemd
Remove previous ATS Library .......: ats.so.* from /usr/local/lib/lua/5.3
Install new ATS Library ...........: ats.so.0.9 in /usr/local/lib/lua/5.3
Create soname symLink .............: ats.so in /usr/local/lib/lua/5.3
Failed to enable unit: Unit file ats.service does not exist.
Makefile:103: recipe for target 'install' failed
make: *** [install] Error 1

Error: Build error: Failed installing.
rock64@rockpro64:~$ 


Code:
rock64@rockpro64:~$ systemctl status ats
● ats.service - ATS - Active Thermal Service
   Loaded: loaded (/lib/systemd/system/ats.service; bad; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Mon 2019-05-27 11:16:18 UTC; 5s ago
  Process: 1631 ExecStart=/usr/local/sbin/ats (code=exited, status=1/FAILURE)
 Main PID: 1631 (code=exited, status=1/FAILURE)

May 27 11:16:18 rockpro64 systemd[1]: ats.service: Failed with result 'exit-code'.




Code:
rock64@rockpro64:~$ journalctl -u ats
....
May 27 11:16:18 rockpro64 systemd[1]: Started ATS - Active Thermal Service.
May 27 11:16:18 rockpro64 ats[1631]: getConditions: Warning, Values { THERMAL0_CTL, THERMAL1_CTL, FAN_CTL }: /sys/class/thermal/thermal_zone0/te
May 27 11:16:18 rockpro64 ats[1631]: exit 1
May 27 11:16:18 rockpro64 systemd[1]: ats.service: Main process exited, code=exited, status=1/FAILURE
May 27 11:16:18 rockpro64 systemd[1]: ats.service: Failed with result 'exit-code'.
May 27 11:16:26 rockpro64 systemd[1]: ats.service: Service hold-off time over, scheduling restart.
May 27 11:16:26 rockpro64 systemd[1]: ats.service: Scheduled restart job, restart counter is at 322.
May 27 11:16:26 rockpro64 systemd[1]: Stopped ATS - Active Thermal Service.
May 27 11:16:26 rockpro64 systemd[1]: Started ATS - Active Thermal Service.
May 27 11:16:26 rockpro64 ats[1636]: getConditions: Warning, Values { THERMAL0_CTL, THERMAL1_CTL, FAN_CTL }: /sys/class/thermal/thermal_zone0/te
May 27 11:16:26 rockpro64 ats[1636]: exit 1
May 27 11:16:26 rockpro64 systemd[1]: ats.service: Main process exited, code=exited, status=1/FAILURE
May 27 11:16:26 rockpro64 systemd[1]: ats.service: Failed with result 'exit-code'.
May 27 11:16:34 rockpro64 systemd[1]: ats.service: Service hold-off time over, scheduling restart.
May 27 11:16:34 rockpro64 systemd[1]: ats.service: Scheduled restart job, restart counter is at 323.
May 27 11:16:34 rockpro64 systemd[1]: Stopped ATS - Active Thermal Service.
May 27 11:16:34 rockpro64 systemd[1]: Started ATS - Active Thermal Service.
May 27 11:16:34 rockpro64 ats[1637]: getConditions: Warning, Values { THERMAL0_CTL, THERMAL1_CTL, FAN_CTL }: /sys/class/thermal/thermal_zone0/te
May 27 11:16:34 rockpro64 ats[1637]: exit 1
May 27 11:16:34 rockpro64 systemd[1]: ats.service: Main process exited, code=exited, status=1/FAILURE
May 27 11:16:34 rockpro64 systemd[1]: ats.service: Failed with result 'exit-code'.


Code:
rock64@rockpro64:~$ uname -a
Linux rockpro64 4.4.138-1097-rockchip-ayufan-gb5128c0a1684 #1 SMP Sat Sep 29 15:08:06 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux


Thanks, Teemu
  Reply
(05-27-2019, 05:24 AM)tikonen Wrote:
(05-24-2019, 09:17 AM)tuxd3v Wrote:
(05-23-2019, 02:00 PM)tuxd3v Wrote: Hello tikonen,

You need to install the tool has root..

Code:
rock64@rockpro64:~$ journalctl -u ats
....
May 27 11:16:34 rockpro64 ats[1637]: getConditions: Warning, Values { THERMAL0_CTL, THERMAL1_CTL, FAN_CTL }: /sys/class/thermal/thermal_zone0/te

Thanks, Teemu

Hello Teemu,
You welcome.

That is a little bit strange, I use the same kernel..
seems that you don't have the sysfs files for control:
Code:
/sys/devices/virtual/thermal/thermal_zone0/temp
/sys/devices/virtual/thermal/thermal_zone1/temp
/sys/devices/platform/pwm-fan/hwmon/hwmon0/pwm1

find them with:

Code:
find /sys -name pwm[0-9] -o -name temp -type f

Then you need to change /etc/ats.conf, so that it would have same locations..
But post the output of that command..

regards
  Reply
[quote pid='46691' dateline='1559247732']




That is a little bit strange, I use the same kernel..
seems that you don't have the sysfs files for control:
Code:
/sys/devices/virtual/thermal/thermal_zone0/temp
/sys/devices/virtual/thermal/thermal_zone1/temp
/sys/devices/platform/pwm-fan/hwmon/hwmon0/pwm1

find them with:

Code:
find /sys -name pwm[0-9] -o -name temp -type f

Then you need to change /etc/ats.conf, so that it would have same locations..
But post the output of that command..

regards
[/quote]

Hi, I had to change distro to aarch64 based, will have to check with that again when I've a change. Will report here if I encounter any issues.
Thanks!
  Reply
(06-03-2019, 04:12 AM)tikonen Wrote: [quote pid='46691' dateline='1559247732']
That is a little bit strange, I use the same kernel..
seems that you don't have the sysfs files for control:
Code:
/sys/devices/virtual/thermal/thermal_zone0/temp
/sys/devices/virtual/thermal/thermal_zone1/temp
/sys/devices/platform/pwm-fan/hwmon/hwmon0/pwm1

[/quote]
Hi again, 
Got the pwm1 working with aarch64 distro version and kernel rockpro64 4.4.167-1197-rockchip-ayufan-ga7ca17f30176.  I can do echo 0-255 to sysfs /sys/class/hwmon/hwmon0/pwm1 and speed changes accordingly.
Also install with luarocks works fine now. 
Btw, there seems to be a small glitch in the installer as it fails this if there are more than one lua version installed.

Code:
root@rockpro64:~# luarocks build https://raw.githubusercontent.com/tuxd3v/ats/master/ats-0.2-0.rockspec
Missing dependencies for ats 0.2-0:
   lua >= 5.3 (5.1-1 provided by VM)

ats 0.2-0 depends on lua >= 5.3 (5.1-1 provided by VM)

Error: Could not satisfy dependency lua >= 5.3: No results matching query were found.
root@rockpro64:~# which vm
root@rockpro64:~# which lua
/usr/bin/lua
root@rockpro64:~# /usr/bin/lua
Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
> ^C
root@rockpro64:~# ls /usr/bin/lua5.3 
/usr/bin/lua5.3
root@rockpro64:~# /usr/bin/lua5.3 
Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio

root@rockpro64:~# apt list --installed |grep lua

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

liblua5.1-0/bionic,now 5.1.5-8.1build2 arm64 [installed,automatic]
liblua5.1-0-dev/bionic,now 5.1.5-8.1build2 arm64 [installed,automatic]
liblua5.3-0/bionic-security,bionic-updates,now 5.3.3-1ubuntu0.18.04.1 arm64 [installed,automatic]
liblua5.3-dev/bionic-security,bionic-updates,now 5.3.3-1ubuntu0.18.04.1 arm64 [installed]
lua-any/bionic,now 24 all [installed,automatic]
lua5.1/bionic,now 5.1.5-8.1build2 arm64 [installed,automatic]
lua5.3/bionic-security,bionic-updates,now 5.3.3-1ubuntu0.18.04.1 arm64 [installed]
luarocks/bionic,now 2.4.2+dfsg-1 all [installed]



Thank you!
  Reply
Trying to install ats on new install of lxde aarach64 upgraded to 0.8.3 but I'm getting following error:

Code:
Warning: variable CFLAGS was not passed in build_variables
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 ATS Tool ..................: ats in /usr/local/sbin
Install ATS Config ................: ats.config in /etc
Install ATS Service File ..........: ats.service in systemd
Remove previous ATS Library .......: ats.so.* from /usr/local/lib/lua/5.3
Install new ATS Library ...........: ats.so.0.9 in /usr/local/lib/lua/5.3
Create soname symLink .............: ats.so in /usr/local/lib/lua/5.3
Starting ATS Service..
��� ats.service - ATS - Active Thermal Service
  Loaded: loaded (/lib/systemd/system/ats.service; enabled; vendor preset: enab
  Active: activating (auto-restart) (Result: exit-code) since Fri 2019-06-28 15
 Process: 3105 ExecStart=/usr/local/sbin/ats (code=exited, status=127)
Main PID: 3105 (code=exited, status=127)

Jun 28 15:41:39 rockpro64 systemd[1]: ats.service: Main process exited, code=exi
Jun 28 15:41:39 rockpro64 systemd[1]: ats.service: Failed with result 'exit-code


All packages that are named in the repository are installed and up to date, because I don't find any answer with the error-code here in the Forum with the search tool, I#ll try to ask here now.
  Reply
(06-28-2019, 09:51 AM)TheSupercomputer Wrote: Trying to install ats on new install of lxde aarach64 upgraded to 0.8.3 but I'm getting following error:

All packages that are named in the repository are installed and up to date, because I don't find any answer with the error-code here in the Forum with the search tool, I#ll try to ask here now.

Hello TheSupercomputer,
What is the output of:
Code:
uname -a

Also, if you stop the service, and run it manually, what is the output:
Code:
systemctl stop ats
ats --test

It coud be also a kernel requirement..
But first, please post the output of commands above.

Best Regards,

(06-06-2019, 01:10 AM)tikonen Wrote: Hi again, 
Got the pwm1 working with aarch64 distro version and kernel rockpro64 4.4.167-1197-rockchip-ayufan-ga7ca17f30176.  I can do echo 0-255 to sysfs /sys/class/hwmon/hwmon0/pwm1 and speed changes accordingly.
Also install with luarocks works fine now. 
Btw, there seems to be a small glitch in the installer as it fails this if there are more than one lua version installed.

Hello tikonen,
Indeed,
'luarocks' has 'lua5.1' vm has a primary dependency..

I updated, the installation process, in that way, when you install 'luarocks', it will not use lua5.1 has default, it already have lua5.3 as default..  Shy
Code:
apt-get install lua5.3 lua5.3-dev gcc make
update-alternatives --install /usr/bin/lua lua /usr/bin/lua5.3 1
update-alternatives --install /usr/bin/luac luac /usr/bin/luac5.3 1
apt-get install luarocks

thanks for your observation,
I had detected it in the past..., but forgot to update the instructions, sorry for that  Blush

Best Regards,
  Reply
The outputs are:

Code:
rock64@rockpro64:~$ uname -a
Linux rockpro64 4.4.167-1213-rockchip-ayufan-g34ae07687fce #1 SMP Tue Jun 18 20:44:49 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux
rock64@rockpro64:~$ sudo systemctl stop ats
[sudo] password for rock64:
rock64@rockpro64:~$ sudo ats --test
/usr/bin/env: ‘lua’: No such file or directory

It seems that there is a symlink missing while installing lua 5.3, am I right with that?
  Reply
(06-30-2019, 03:55 PM)TheSupercomputer Wrote: The outputs are:

Code:
rock64@rockpro64:~$ sudo ats --test
/usr/bin/env: ‘lua’: No such file or directory

It seems that there is a symlink missing while installing lua 5.3, am I right with that?

You right, probably, you forgot to create it..  Shy
Repeat all the steps to install dependencies, and then reinstall  Wink
  Reply
Repeating every step seems to fix it, the fan is now spinning for some seconds goes of for a few seconds and start spinning again.
The Rockpr64 temps readed from Pihole are always above 50 degrees so there should be an pwm signal al the time, or is the on of cycle the pwm control?

EDIT: With "always on" option I got the behavior i was expected, exept for that if the minimum temp is reached ats produces an load spike pushing the temp above the minimum so the fan will speed up, slow down until near stop and spin up again.
  Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)