Firefly Open Source Community

Title: Firefly-RK3399 fan control [Print This Page]

Author: abutkov    Time: 2/10/2019 03:31
Title: Firefly-RK3399 fan control
Last edited by abutkov In 2/10/2019 20:41 Editor

I noticed that according to schematics FAN_12V is switched with Q20 that is controlled by Q21 over BL_EN line. And the latter corresponds to GPIO1_A1. So if I export the correct gpio number I can write a simple script that reads temperature from /sys/class/thermal/thermal_zone0/temp and turns the fan on/off due to setpoint (t_high and t_low for hysteresis).
Supposing GPIO1_A1 should be 33 I do:
  1. echo 33 > /sys/class/gpio/export
  2. echo out > /sys/class/gpio/gpio33/direction
  3. echo 0 > /sys/class/gpio/gpio33/value
Copy the code
And see  the fan keeps turnung. Please correct me if I'm wrong with that idea or I just picked the wrong number for gpio.

UPD1: Seems I have to desolder 10K R702 from PWR_EN_SYS and put it on R701

Author: abutkov    Time: 2/10/2019 23:40
Last edited by abutkov In 2/10/2019 20:43 Editor

It was a kind of surgery to perform soldering, I've lost original 0402 so had to put 0805 with wire
And finally it does work:
  1. #!/bin/bash

  2. FAN_ON_TEMP="39000"    # operating temperature range in milliC
  3. FAN_OFF_TEMP="35000"   # OFF is less than ON for hysteresis

  4. if [ ! -d /sys/class/gpio/gpio33 ];
  5.     then
  6.     echo 33 > /sys/class/gpio/export;
  7.     echo out > /sys/class/gpio/gpio33/direction;
  8. fi

  9. echo 1 > /sys/class/gpio/gpio33/value;

  10. while [ 1 ]; do
  11.   read CPUTEMP < /sys/class/thermal/thermal_zone0/temp
  12.   if [ "$CPUTEMP" -gt "$FAN_ON_TEMP" ]; then echo 1 > /sys/class/gpio/gpio33/value; fi
  13.   if [ "$CPUTEMP" -lt "$FAN_OFF_TEMP" ]; then echo 0 > /sys/class/gpio/gpio33/value; fi
  14.   sleep 30
  15. done
Copy the code
You can even create  a systemd service if you wish.
Author: penguin    Time: 2/12/2019 11:07
Great work! Thanks for sharing!
Author: bobknig708    Time: 1/12/2026 10:44
弊社はAZ-801問題集の英語版と日本語版をリリースしています。英語版と日本語版の内容は同じですけど、言語だけ違いがあります。それなので、AZ-801に関する英語試験や日本語試験に参加する予定があるご客様は安心に問題集を購入できます。AZ-801試験のために、気楽に準備したり、参加したりしています。その他、我々のAZ-801日本語問題集を購入すると、英語版を送ります。
Author: liammar420    Time: 2/3/2026 01:31
By reading this article, I feel that I have experienced a lot of growth. Good luck on your exam! Here are the free 1z1-809 braindumps torrent resources.




Welcome Firefly Open Source Community (https://bbs.t-firefly.com/) Powered by Discuz! X3.1