[Pi 4B] [LE12.0.1] Autostart.sh with python script for fan control won't work

  • Hey everyone ! Hope you are well !^^

    I am trying to have a fan control script working at startup. I have a Pi 4 with Libreelec 12.0.1 freshly installed with RPi tools addon. Fan is controlled by PWM on PIN 18.

    The control script runs well when I use the command: python /storage/fan_control.py

    I have created an autostart.sh file and it also works (fan is controlled) when I execute sh /storage/.config/autostart.sh

    When I boot the Raspberry, the fan is always running at full speed which means the python script isn't launched.

    Here is the result of systemctl status kodi-autostart.service:

    I have tried to increase the sleep delay in autostart.sh to 60 and 120 but it does not make any difference.

    Any idea ? :blush:

  • It works !!!! Thank you so much HarryH :D


    For those who wants details, here is the content of fan_control.py:


    Here is the content of autostart.sh:

    Bash
    #!/bin/bash
    (
    sleep 180
    sh /storage/.config/fan_control.sh start
    )&


    Here is the content of fan_control.sh: