Skip to content

Auto Fan Control Plug-in Assumes Optional PWM Enable SysFS Attribute Exists #7

@Stonyx

Description

@Stonyx

The Auto Fan Control plug-in is hard coded to look for the pwmX_enable sysfs attribute, however, this is an optional attribute. For example, we're working on developing a driver for a 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 the Auto Fan Control plugin:

<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 plug-in 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 plug-in doesn't know if PWM is enabled and the developers don't feel comfortable assuming that it is enabled?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions