How to set, change , read fan speed in Jetson AGX xavier?

Hi, I am working on Jetson AGX Xavier L4T 32.4.3 and trying to read a heat synk fan connected.

used below commands:
enable tach :
echo 1 > /sys/devices/pwm-fan/tach_enable

set speed :
echo 255 > /sys/devices/pwm-fan/target_pwm

read tach :
cat /sys/devices/pwm-fan/rpm_measured

but I an not able to set the tacho meter here
getting
below error when I try to enable tachometer :
nv@nv:/sys/devices/pwm-fan$ cd
nvidia@nv:~$ echo 1 > /sys/devices/pwm-fan/tach_enable
-bash: /sys/devices/pwm-fan/tach_enable: Permission denied
nv@nv:~$ sudo su
[sudo] password for nvidia:
root@nv:/home/nvidia# echo 1 > /sys/devices/pwm-fan/tach_enable
bash: echo: write error: Operation not permitted
root@nv:/home/nvidia# cat /sys/devices/pwm-fan/rpm_measured
0
root@nv:/home/nvidia# echo 255 > /sys/devices/pwm-fan/target_pwm
root@nv:/home/nvidia# cat /sys/devices/pwm-fan/rpm_measured
0
root@nv:/home/nvidia# echo 1 > /sys/devices/pwm-fan/tach_enable
bash: echo: write error: Operation not permitted
root@nv:/home/nvidia# echo 1 > /sys/devices/pwm-fan/tach_enable
bash: echo: write error: Operation not permitted
root@nv:/home/nvidia# dmesg | grep FAN
[ 1.881811] FAN dev name: pwm-fan
[ 1.881876] FAN:gpio request success.
[ 1.881887] FAN: can’t find tach_gpio
root@nv:/home/nvidia#

please suggest me what needs to be done

hello venkatraman.bhat,

since we have tachometer, we don’t use tach-gpio,
please read rpm from tachometer, for example, # cat /sys/class/hwmon/hwmon1/rpm

you may also refer to this thread as see-also.
thanks

Hi, if I need to change the rpm, I mean to change the speed of fan what needs to be done?

hello venkatraman.bhat,

there’s target_pwm for you to control fan speed, its range between 0 to 255.
thanks

Hi, I am using Xavier NX and L4T 32.3.1 and when I try to enable tacho, Im getting this error
root@nvidia-desktop:/home/nvidia# echo 1 > /sys/devices/pwm-fan/tach_enable
bash: echo: write error: Operation not permitted

and if fan is rotationg at high speed (or even fan is rotating), tacho read is giving 0 all the time.

using below commands:
Below command set also should work:
enable tach :
echo 1 > /sys/devices/pwm-fan/tach_enable

set speed :
echo 255 > /sys/devices/pwm-fan/target_pwm

read tach :
cat /sys/devices/pwm-fan/rpm_measured
please help.

hello venkatraman.bhat,

please also check # cat hwmon/hwmon2/pwm_rpm_table for the all available settings.
thanks