CommentStreams:83b428d802e65a69d747634d2763f056

< CommentStreams:0f470ba1beb214a6e349acc9fe5034a8
Revision as of 07:53, 22 September 2021 by 46.165.138.243 (talk) (Migrated reply #1871)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Two ways to do this: - Add the following two lines to end (before the exit) of /etc/rc.local

  1. start fan control

python /home/pi/x735-v2.5/pwm_fan_control.py &

- Install it as a systemd service Copy the following text in a file with the name x735-fan.service

==============================

[Unit] Description=x735 Fan control

[Service] User=root WorkingDirectory=/ ExecStart=/home/pi/x735-v2.5/pwm_fan_control.py Restart=always

[Install] WantedBy=multi-user.target

====================================

Copy the file to the directory /usr/lib/systemd/system/ With the command

   systemctl start x735-fan

the service is started. You also have to do the following command that the service is started on a system boot:

   systemctl enable x735-fan

systemd also takes care that the service is restarted if it dies. This also has the advantage, that if you log in multiple times the script is not always started.