Open main menu

Changes

XScript

1,221 bytes added, 19:33, 15 June 2023
</pre>
''' PWM fan control''' (This is optional)
 
PS: You can ignore this step if you don't use the 3-Pin PWM fan to cool the CM4. In fact, the [[C235]] passive cooler can provide enough cooling capacity, and you can also avoid the trouble of fan noise, it is included in [[NASPi CM4-M2]] and [[NASPi CM4-2.5]]
 
Run the below command to get the fan running.
python3 /root/xscript/fan-rpi.py&
But when you reboot the device, the PWM fans won't run unless you run the above command again, so you need to create a crontab job to keep the fans running when the device reboots, Please refer to [[How to add crontab job]].
 
 
'''Test safe shutdown'''
xoff
* Please run 'xoff' to shut down or press the on-board button switch to shut down. <span style="color:red;">DON'T run the 'shutdown' linux command to shut down, otherwise the power of device will not be shut down.</span>
* press button switch `1-2` seconds to reboot
* press button switch `3` seconds to safe shutdown,
* press `7-8` seconds to force shutdown.
 
'''uninstall'''
<pre>
sudo sed -i '/pwr.sh/d' /etc/rc.local
sudo sed -i '/softsd.sh/d' ~/.bashrc
 
sudo rm -f /usr/local/bin/softsd.sh
sudo rm -f /etc/pwr.sh
sudo rm -rf ~/xscript
 
sudo reboot now
</pre>
<!--Add review function! -->