ICE TOWER FAN CONTROL FOR THE RASPBERRY PI (PWM)
================================================

1. Save the file fan-control.py in a safe location where it will not get deleted.

2. Make the file executable:

chmod +x fan-control.py

3. Install lgpio dependency:

sudo apt install python3-lgpio

4. Create a file:

sudo nano /etc/systemd/system/fan-control.service

5. Paste this into it, save and exit (Ctrl + s, Enter, Ctrl + x):

[Unit]
Description=Ice Tower PWM Fan Control
After=multi-user.target

[Service]
ExecStart=/usr/bin/python3 /path/to/the/file/fan_control.py # Adjust the path to location of your script.
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

6. Enable the service:

sudo systemctl daemon-reload
sudo systemctl enable fan-control
sudo systemctl start fan-control

7. Check it's running:

sudo systemctl status fan-control
