pi4-fan-control – npm


Run the fan when the temperature will get excessive

This module is designed to be put in globally and can compile to a single executable referred to as fan which is able to most likely be in /usr/native/bin.

The executable can be utilized to show the fan on or off however is primarily designed to be run out of systemd to observe the temperature and switch the fan on and off as crucial.

This system was written for the pi4 with the official case fan however ought to work on any fan with its management set to a single gpio pin.

It'll work on Ubuntu on the pi4 the place not one of the official options appears to do the job. For wiring of the case fan, please see the web page at raspberrypi.com.

Set up

npm set up -g pi4-fan-control

Utilization

fan [options] [on|off]
    Run with out [on|off], the fan program will flip the fan on and off
      relying on temperature
    fan on  - Flip the fan on and exit
    fan off - Flip the fan off and exit
    choices:
       -h --help:       Present this message
       -v --version:    Show model and exit
       -x --max:        Temperature to show the fan on    (default: 85)
       -n --min:        Temperature to show the fan off   (default: 80)
       -p --pin         Pin to make use of for management            (default: 14)
       -y --delay       Polling frequency in seconds      (default:  2)
       -d --debug       Activate debugging mode

Working from systemd

You will have to create a service file: /and so on/systemd/system/pi4-fan.service.

The contents must be one thing like:

[Unit]
Description=Fan controller for the pi4

[Service]
Sort=notify
Consumer=root
Group=root
ExecStart=/usr/native/bin/fan
TimeoutStartSec=60
NotifyAccess=all
Restart=at all times
KillSignal=SIGTERM
TimeoutStopSec=20
RestartSec=20

[Install]
WantedBy=multi-user.goal

Having created this file, please run the next instructions:

$ sudo systemctl daemon-reload
$ sudo systemctl allow pi4-fan.service
$ sudo systemctl begin  pi4-fan.service
$ sudo systemctl standing pi4-fan.service

This could present the service as operating.

Node model situation

As of the time of writing, pkg-fetch doesn't assist node model 17. Please both revert to node model 16 or run the javascript file straight from node, moderately than the executable.

Changelog

v1.0.0: First public launch
v1.0.2: Documentation fixes solely

Issues

Any points or feedback could be appreciated at Github.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *