Skip to content

Commit 0fc580d

Browse files
authored
Merge pull request #9 from cgomesu/development
Reorganization, making better use of variable substitution, and fix multiple (potential) issues
2 parents c027682 + 2ae381e commit 0fc580d

File tree

4 files changed

+461
-464
lines changed

4 files changed

+461
-464
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.git
2+
examples
3+
tmp
4+
tests
5+
doc
6+

README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# 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.
33

44
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).
55

66
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.
77

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.
99

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]).
1111

1212

1313
# Requisites
@@ -46,13 +46,10 @@ cd /opt
4646
git clone https://github.com/cgomesu/nanopim4-satahat-fan.git
4747
cd nanopim4-satahat-fan
4848
49-
# Allow the script to be executed
50-
chmod +x pwm-fan.sh
51-
5249
# Test the script
53-
./pwm-fan.sh
50+
./pwm-fan.sh -F 10
5451
55-
# Check for any error messages
52+
# Check for any error messages
5653
# When done, press Ctrl+C after to send a SIGINT and stop the script
5754
```
5855

@@ -130,11 +127,11 @@ This is free. There is NO WARRANTY. Use at your own risk.
130127

131128

132129
# 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.
134131

135132
```
136133
# 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
138135
systemctl start pwm-fan.service
139136
140137
# Check the service status to make sure it's running without issues

0 commit comments

Comments
 (0)