This is a bug report for the Auto Fan Control functionality. The code (in the include/SystemFan.php file and possibly others) is hard coded to assume that the pwmX_enable sysfs attribute exists, however, this is an optional attribute that some drivers do not implement. For example, we're working on developing a driver for an embedded controller chip used in many QNAP NAS devices so that Unraid and other Linux based OSes can read and control fan speeds, however, this embedded controller chip doesn't provide a enable/disable PWM function (PWM is always enabled) therefore according to the hwmon/sysfs standards our driver should not be creating a PWM enable sysfs attribute. However, without that attribute we get the following error from Auto Fan Control:
<br /><b>Warning</b>: file_get_contents(/sys/devices/platform/qnap-ec/hwmon/hwmon2/pwm7_enable): failed to open stream: No such file or directory in <b>/usr/local/emhttp/plugins/dynamix.system.autofan/include/SystemFan.php</b> on line <b>40</b><br /><br /><b>Warning</b>: file_put_contents(/sys/devices/platform/qnap-ec/hwmon/hwmon2/pwm7_enable): failed to open stream: Permission denied in <b>/usr/local/emhttp/plugins/dynamix.system.autofan/include/SystemFan.php</b> on line <b>42</b><br /><br /><b>Warning</b>: file_put_contents(/sys/devices/platform/qnap-ec/hwmon/hwmon2/pwm7_enable): failed to open stream: Permission denied in <b>/usr/local/emhttp/plugins/dynamix.system.autofan/include/SystemFan.php</b> on line <b>50</b><br />
Is it possible to change the code to check if this attribute exists before trying to open it and if it doesn't exist assume PWM is enabled? Or is the concern that without this attribute the code doesn't know if PWM is enabled and the developers don't feel comfortable assuming that it is enabled?
There are also reports of the same issue with other drivers. Here's one just for reference:
Thanks,
Harry
Recommended Comments