


Step-by-step guide on how to install temperature control scripts for the Nanopi R4S router development board.
If you complete the installation correctly according to our tutorial, you will notice that the fan will automatically start and stop after about 5 minutes of booting, indicating that your firmware includes the temperature control script. If your fan does not turn on at all within 5 minutes of booting, it means your firmware does not have the temperature control script or the script has issues. Please follow the methods below.
First, ensure that you have purchased the C or E type fan with Fan port, and that the R4S version is after 2103.
1: Download and install MobaXterm software from the cloud drive, and download three temperature control scripts.
Link: https://pan.baidu.com/s/1nafuhPiqUD1US5z5lR2s9A?pwd=bjbh
2: Click on Session to create a new SSH session, enter your R4S LAN management address in the Remote host field, and click 【OK】 to log in.
3: Enter your username and password to log in.
4: Click on the folder icon on the left, go back to the root directory, and then enter the /usr/bin directory. Check if there are two scripts containing the fan field names fa-fancontrol.sh and fa-fancontrol-direct.sh. If so, right-click to select Delete and remove both.
5: Upload the two temperature control scripts fa-fancontrol.sh and fa-fancontrol-direct.sh according to steps 1, 2, and 3 in the image below.
6: Execute the following three commands in the command line.
cd /usr/bin
chmod 777 fa-fancontrol.sh
chmod 777 fa-fancontrol-direct.sh
7: Click on the folder icon on the left, go back to the root directory, and then enter the /etc/init.d directory. Check if there are any scripts containing the fan field name fa-fancontrol. If so, right-click to select Delete to remove them.
8: Upload the fa-fancontrol temperature control script according to steps 1, 2, and 3 in the image below.
9: Execute the following three commands in the command line.
cd /etc/init.d
chmod 777 fa-fancontrol
/etc/init.d/fa-fancontrol enable
10: Then log in to the backend web management interface. Under 【System】–【Startup Items】–“Startup Script,” you will see a script named fa-fancontrol with priority 21. Click the second 【Start】 button, and the fan will start running. When the temperature drops to your set minimum threshold, the fan will automatically stop. When the temperature reaches your set startup threshold, the fan will automatically start. Finally, restart your router to ensure the settings take effect.
11:
Appendix:
Below are some test commands. If you are sure that your operations are correct but the fan still does not turn on, it may be that your temperature has not reached the threshold. The following benchmarking commands can quickly raise your CPU temperature, causing the fan to start.
1. AES Benchmark Command: After SSH connecting to openWRT, enter
openssl speed -evp aes-256-gcm
2. Check CPU temperature: After SSH connecting to openWRT, enter
cat /sys/class/thermal/thermal_zone0/temp
If you confirm that your operation method and motherboard hardware are correct and the fan still does not turn on, please reply with “Fan does not turn on” to the public account and follow the prompt steps to troubleshoot;