Jetson nano controlled fan
Set the fan speed from the command line (the fan will not turn after restarting)
Set fan speed to 255 (speed range [0,255])
sudo sh -c 'echo 255 > /sys/devices/pwm-fan/target_pwm'
turn off the fan
sudo sh -c 'echo 0 > /sys/devices/pwm-fan/target_pwm'
Software setting fan speed (automatically turn on fan after reboot)
There is no need to add any automatic startup files, just call jetson nano's built-in function to set it up to control the fan speed and start the fan automatically
Jetson-stats library introduction
Jetson-stats is a library for Jetson series development boards that monitors the use of hardware devices such as CPU, GPU, and memory in real time, and at the same time facilitates turning on the fan and changing the number of revolutions of the fan.
Install pip3 (ignored if already installed)
sudo apt install python3-pip
Install the Jetson-stats library
sudo pip3 install jetson-stats
Start the Jetson-stats function to control the fan startup and speed
sudo jtop
The interface after opening
The interface is shown in the figure below,
and you can see that some data here will detect changes in real time. We need to set the fan, so we look at the bottom line of this page, which says 1ALL 2GPU 3CPU 4MEM 5ENG 6CTRL 7INFO QUIT , we can press 6 or the left mouse button Click **6CTRL** to jump to the fan control page (some may not be 6, the words are generally the same)
Press 6 or click with the mouse to jump to the fan control interface
The interface is shown in the figure below.
First, you can click the + - symbol shown by the green arrow in the figure above to increase or decrease the fan speed. If the speed is greater than 0, you will see that the fan is spinning. In fact, the setting has not been completed yet, otherwise the fan will still be off after restarting and will not turn on automatically. After setting the speed you want, click the manual option of the red arrow shown in the picture above, and then click the red cross in the upper left corner or press the esc button to exit
command line input
sudo reboot
After restarting, you can observe that the fan is automatically turned off when it is turned off, and it will automatically rotate when it is turned on.