Skip to content

Commit

Permalink
small changes of python script in order to reduce the noise level fur…
Browse files Browse the repository at this point in the history
…ther
  • Loading branch information
FUEL4EP committed Jan 17, 2022
1 parent 01ede48 commit 5e47ec7
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
> reboot
- the fan control software is derived from [here](https://www.internauta37.altervista.org/en/blog/install-melopero-fan-hat-raspberry-pi-4-libreelec). Many thanks to [internauta37](https://www.internauta37.altervista.org/en) !
- installation procedure for the fan control (derived from [here](https://www.internauta37.altervista.org/en/blog/install-melopero-fan-hat-raspberry-pi-4-libreelec).)
- major change is that the fan is turning at full speed for 1 second after each change of the fan speed
- major change is that the fan is turning at 'turn_on_speed (default: 65%)' speed for 1 second after each change of the fan speed
- to make the fan working on LibreELEC it is necessary to perform the following steps:

+ install the Addon Raspberry Pi Tools in LibreELEC
Expand Down
38 changes: 38 additions & 0 deletions debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
example of a debug log during the streaming of a Youtube video

LibreELEC:~ # python3 /storage/.config/fan_controller/fan_controller.py
initial PWM duty cycle = 100
temperature = 41.3
new PWM duty cycle = 30
temperature = 40.9
new PWM duty cycle = 30
temperature = 42.3
new PWM duty cycle = 30
temperature = 44.3
new PWM duty cycle = 30
temperature = 44.8
new PWM duty cycle = 30
temperature = 45.2
new PWM duty cycle = 30
temperature = 46.7
new PWM duty cycle = 30
temperature = 47.2
new PWM duty cycle = 30
temperature = 46.2
new PWM duty cycle = 30
temperature = 46.7
new PWM duty cycle = 30
temperature = 45.7
new PWM duty cycle = 30
temperature = 47.2
new PWM duty cycle = 30
temperature = 48.2
new PWM duty cycle = 30
temperature = 46.7
new PWM duty cycle = 30
temperature = 47.2
new PWM duty cycle = 30
temperature = 48.2
new PWM duty cycle = 30
temperature = 48.2
new PWM duty cycle = 30
9 changes: 5 additions & 4 deletions fan_controller.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# (C) 2021 FUEL4EP (Creative Commons)
# (C) 2022 FUEL4EP (Creative Commons)
# license: https://creativecommons.org/licenses/by-nc-sa/4.0/
import sys
sys.path.append('/storage/.kodi/addons/virtual.rpi-tools/lib')
Expand All @@ -11,8 +11,9 @@

minimum_always_ON=True
minimum_speed=30
turn_on_speed=65
target_temp=52
sleepTime=10
sleepTime=20
debugFlag=False

current_speed=0
Expand Down Expand Up @@ -54,8 +55,8 @@ def setDutyCycle(new_duty):
if (current_speed != new_duty):
if (new_duty < 50 ):
if (new_duty > 0 ):
#set duty cycle to 100% for 1 second after a change of the duty cycle in order to ensure the start of the fan
myPWM.ChangeDutyCycle(100)
#set duty cycle to turn_on_speed % for 1 second after a change of the duty cycle in order to ensure the start of the fan
myPWM.ChangeDutyCycle(turn_on_speed)
time.sleep(1)
myPWM.ChangeDutyCycle(new_duty)
current_speed=new_duty
Expand Down

0 comments on commit 5e47ec7

Please sign in to comment.