This is my workaround. It will work as long as some reboots are successful. Basically, my workaround is to automate the reboots until the pwm fan works.
Run the following script upon boot using crontab.
Note that if the pwm fan were to be totally broken, my script will result in the pi going into an infinite reboot loop. In the event, I will need to boot up my pi using another means and edit my crontab.
Run the following script upon boot using crontab.
Code:
@reboot ~/tools/on_boot.sh
Code:
#!/usr/bin/bashSCRIPT_DIR=$(dirname $0)echo "SCRIPT_DIR: $SCRIPT_DIR"pushd "$SCRIPT_DIR"FAN_DIRECTORY=/sys/devices/platform/cooling_fan/if [ -d "$FAN_DIRECTORY" ]; then echo "$FAN_DIRECTORY exists"else echo "$FAN_DIRECTORY does not exist. Rebooting ..." sudo rebootfipopd
Statistics: Posted by manworld — Sat Jun 29, 2024 4:50 am