|
1 | 1 | # nanopim4-satahat-fan |
2 | | -A fan control script written in bash for the [**2-pin PH2.0 12v fan connector of the NanoPi M4 SATA hat**](http://wiki.friendlyarm.com/wiki/index.php/NanoPi_M4_SATA_HAT). By default, the script uses a bounded [logistic model](https://en.wikipedia.org/wiki/Logistic_function) with a moving mid-point (based on the average temperature over time) to set the fan speed. |
| 2 | +A fan control script written in bash for the [**2-pin PH2.0 12v fan connector of the NanoPi M4 SATA hat**](http://wiki.friendlyarm.com/wiki/index.php/NanoPi_M4_SATA_HAT). By default, the script uses a bounded [logistic model](https://en.wikipedia.org/wiki/Logistic_function) with a moving mid-point (based on the average temperature over time) to set the fan speed. |
3 | 3 |
|
4 | 4 | Many of the variables used in this fan controller can be modified directly from the CLI, such as setting custom temperature thresholds (`-t`, `-T`) or disabling temperature monitoring altogether (`-f`). For a more detailed description, see [**Usage**](#usage). |
5 | 5 |
|
6 | 6 | There's arguably more code here than necessary to run a fan controller. This was a hobby of mine (I wanted to revisit the first version which used a fixed table to set the speed) and an opportunity to learn more about bash and the sysfs interface. |
7 | 7 |
|
8 | | -This is free. There is NO WARRANTY. Use at your own risk. |
| 8 | +This is free. There is NO WARRANTY. Use at your own risk. |
9 | 9 |
|
10 | | -If you have any issues or suggestions, open an issue or [send me an e-mail ](mailto:[email protected]). |
| 10 | +If you have any issues or suggestions, open an issue or [send me an e-mail ](mailto:[email protected]). |
11 | 11 |
|
12 | 12 |
|
13 | 13 | # Requisites |
@@ -46,13 +46,10 @@ cd /opt |
46 | 46 | git clone https://github.com/cgomesu/nanopim4-satahat-fan.git |
47 | 47 | cd nanopim4-satahat-fan |
48 | 48 |
|
49 | | -# Allow the script to be executed |
50 | | -chmod +x pwm-fan.sh |
51 | | -
|
52 | 49 | # Test the script |
53 | | -./pwm-fan.sh |
| 50 | +./pwm-fan.sh -F 10 |
54 | 51 |
|
55 | | -# Check for any error messages |
| 52 | +# Check for any error messages |
56 | 53 | # When done, press Ctrl+C after to send a SIGINT and stop the script |
57 | 54 | ``` |
58 | 55 |
|
@@ -130,11 +127,11 @@ This is free. There is NO WARRANTY. Use at your own risk. |
130 | 127 |
|
131 | 128 |
|
132 | 129 | # Run in the background |
133 | | -If you're running options different than the default values, first edit the `pwm-fan.service` file to include those options into the `ExecStart=` command execution. |
| 130 | +If you're running options different than the default values, first edit the `pwm-fan.service` file to include those options into the `ExecStart=` command execution. |
134 | 131 |
|
135 | 132 | ``` |
136 | 133 | # Enable the service and start it |
137 | | -systemctl enable /opt/nanopim4-satahat-fan/pwm-fan.service |
| 134 | +systemctl enable /opt/nanopim4-satahat-fan/systemd/pwm-fan.service |
138 | 135 | systemctl start pwm-fan.service |
139 | 136 |
|
140 | 137 | # Check the service status to make sure it's running without issues |
|
0 commit comments