Fan control

can we get the fan status like if the fan is connected, Fan running, Fan pwm/rpm, Fan Disconnected (off)
Can this be read by using cat command

is it possible to read frequency

Hi amb018753,

Are you using the devkit or custom board for Orin Nano?
What’s your Jetpack version in use?

Please share the result of the following command on your board.

$ ls -l /sys/class/hwmon/

custom board
jetpack 5.1.1

total 0
lrwxrwxrwx 1 root root 0 Mar 27  2023 hwmon0 -> ../../devices/platform/39c0000.tachometer/hwmon/hwmon0
lrwxrwxrwx 1 root root 0 Mar 27  2023 hwmon1 -> ../../devices/platform/soctherm-oc-event/hwmon/hwmon1
lrwxrwxrwx 1 root root 0 Mar 27  2023 hwmon2 -> ../../devices/platform/pwm-fan/hwmon/hwmon2
lrwxrwxrwx 1 root root 0 Mar 27  2023 hwmon3 -> ../../devices/platform/c240000.i2c/i2c-1/1-0040/hwmon/hwmon3
lrwxrwxrwx 1 root root 0 Apr 16 04:41 hwmon4 -> ../../devices/virtual/thermal/thermal_zone9/hwmon4```

Hi , can i know the remaining command or steps for this

Yes, please run the following command to get the rpm of your fan.

Get rpm:
$ cat /sys/class/hwmon/hwmon0/rpm

Check pwm and write it to full speed.
$ cat /sys/class/hwmon/hwmon2/pwm1
$ sudo su
# echo 255 > /sys/class/hwmon/hwmon2/pwm1
1 Like

sudo su
cd /sys/class/pwm/pwmchip0
echo 0 > export
cd pwm0
echo 200 > period

echo 100 > /sys/devices/platform/pwm-fan/hwmon/hwmon2/pwm1

cat /sys/devices/platform/pwm-fan/hwmon/hwmon2/pwm1

cat /sys/devices/platform/39c0000.tachometer/hwmon/hwmon0/rpm

if i run echo 255 > /sys/devices/platform/pwm-fan/hwmon/hwmon2/pwm1
the fan will be running at full speed

is these values which i echo into are byte values for period , rpm and pwm ??

Yes, it is byte value for pwm and 255 is for the max speed.
For rpm, it should be the “revolutions per minute”.
For period, the unit should be nano-seconds.

what about duty_cycle ?

similar as period, the unit is nano-second.
e.g.
If you want to get PWM with 20Hz, 50% duty cycle

You should configure as following: (Frequency: 20Hz → Period: 0.05s = 50M ns)
period = 50000000
duty_cycle = 25000000