-

CommentStreams:520aba0af9d994e60caadc84452745a2

From Geekworm Wiki
Jump to navigation Jump to search

There is an error in the "Configuring Different gpipchip number and pwmchip number for Raspberry Pi 5 hardware" section.

sed -i 's/pwmchip0/pwmchip2/g' x729-fan.sh

This command is changing pwmchip0 to pwmchip2 value in the x729-fan.sh script. It is incorrect because the Pi 5 board is using pwmchip0 as shown below:

$ sudo cat /sys/kernel/debug/pwm 0: platform/107d517a80.pwm, 2 PWM devices

pwm-0   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
pwm-1   (sysfs               ): requested enabled period: 500000 ns duty: 250000 ns polarity: normal

1: platform/1f00098000.pwm, 4 PWM devices

pwm-0   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
pwm-1   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
pwm-2   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
pwm-3   ((null)              ): period: 0 ns duty: 0 ns polarity: normal

Also, it can be proved according to the journal log where it is clearly seen that the service is failing with error.

Nov 24 01:07:51 pi5 systemd[1]: x729-fan.service: Scheduled restart job, restart counter is at 2. Nov 24 01:07:51 pi5 systemd[1]: Started x729-fan.service - Daemon to monitor and control fan speed. Nov 24 01:07:51 pi5 x729-fan.sh[1639]: Please enable the hardware pwm by adding 'dtoverlay=pwm-2chan' to /boot/config.txt and reboot Nov 24 01:07:51 pi5 x729-fan.sh[1639]: /usr/local/bin/x729-fan.sh: line 160: /sys/class/pwm/pwmchip2/unexport: No such file or directory Nov 24 01:07:51 pi5 systemd[1]: x729-fan.service: Main process exited, code=exited, status=1/FAILURE Nov 24 01:07:51 pi5 systemd[1]: x729-fan.service: Failed with result 'exit-code'

I have changed pwmchip2 back to pwmchip0 in the x729-fan.sh script, but the fan is not working.

sudo systemctl status x729-fan.service ● x729-fan.service - Daemon to monitor and control fan speed

    Loaded: loaded (/usr/lib/systemd/system/x729-fan.service; enabled; preset: enabled)
    Active: active (running) since Sun 2024-11-24 02:42:18 UTC; 18s ago
  Main PID: 4257 (bash)
     Tasks: 2 (limit: 9063)
    Memory: 688.0K (peak: 2.1M)
       CPU: 80ms
    CGroup: /system.slice/x729-fan.service
            ├─4257 bash /usr/local/bin/x729-fan.sh
            └─4442 sleep 5

Could you assist please if the problem with the fan itself or if the script is not working as expected? This is new x729 board that I recently received.