Jump to content

PetrozPL

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by PetrozPL

  1. Please, post pictures with your FAN connection to the board. EDIT : I've just checked and FAN in okdo is only 2-wire: so to control it's speed via PWM you have to add additional circuit like on this page : https://forums.raspberrypi.com/viewtopic.php?t=194621&start=50 You need to connect GPIO wire to either PWM0 or PWM1 (one you would like to use to control FAN speed). Without this additional circuit you can't change the speed of 2-pin FAN. The other option is to buy the 3-pin FAN for 5V with additional speed control wire.
  2. Did you tried to call : sudo echo 0 > /sys/class/pwm/pwmchip1/export Before calling pwmset / pwmsts? EDIT : Ok, I've forgotten about permissions and initialization - on my system it's called once after power up, so there's no need for it on pwmset/pwmsts I've added to repo new file : udev-pwm-permissions.sh. call it with root priviliges or add it to execution on startup.
  3. I've created the repository on github with all required files, including 2 scripts I'm using to control and query PWM FAN speed. https://github.com/PetrozPL/rockpi4_pwm_overlay Hope You'll find it usefull. EDIT : Also, to control fan speed based on HDD temperature you can use smartctl tool to read HDD temperature from SMART. Example output for my NVMe : sudo smartctl -a /dev/nvme0 | grep Temperature Temperature: 76 Celsius Warning Comp. Temperature Time: 0 Critical Comp. Temperature Time: 0 Temperature Sensor 2: 83 Celsius If you would like to get system temperature instead hdd You can use another script to check thermal_zone0 temperature: #!/bin/bash _temp=`cat /sys/class/thermal/thermal_zone0/temp` _temp1=${_temp::-3} _temp2=${_temp::(-3)} echo ${_temp::-3}.${_temp:(-3)} C Best regards, PetrozPL
  4. Yhea, that makes two of us It took me some time and digging before I figured out the correct naming convention
  5. Hi, no I haven't. The previous configuration is still working, so no need to update to new images. The overlay should be compiled via dtc to file rockchip-pwm-gpio.dtbo, and put in location : /boot/dtb/rockchip/overlay/ The activation in /boot/armbianEnv.txt should be via overlays variable : overlay_prefix=rockchip overlays=pwm-gpio Hope this helps. Best regards
  6. ok, I've managed to sort this out on my own. I've decompiled the rockchip-rockpi4.dtb and find out that pwm is disabled by default. So I've wrote new overlay for pwm, just to enable it : /dts-v1/; / { compatible = "rockchip,rk3399"; fragment@0 { target-path = "/aliases"; __overlay__ { pwm0 = "/pwm@ff420000"; pwm1 = "/pwm@ff420010"; }; }; fragment@1 { target-path = "/pwm@ff420000"; __overlay__ { status = "okay"; }; }; fragment@2 { target-path = "/pwm@ff420010"; __overlay__ { status = "okay"; }; }; }; next, compiled it with dtc : dtc -O dtb -o rockchip-pwm-gpio.dtbo -b 0 -@ rockchip-pwm-gpio.dts and moved dtbo to /boot/dtc/rockchip/overlays, and activated it in overlays in /boot/armbianEnv.txt. Now PWM works like a charm. I'm just leaving this thread and my resolution as reference, for anyone with the same problem.
  7. Hi, I'm new to armbian and I've started with RockPi4b board. I would like to add fan control with PWM, but adding pwm (or pwm0) overlay doesn't work. I can't also find the overlay for it at /boot/dtb-5.8.6-rockchip64/rockchip/overlay/. Is it supported? I've checked and the /sys/class/pwm/pwmchip0 is present, but accessing export, as described here : doesn't work and /sys/class/pwm/pwmchip0/pwm0 is not present. I've tried to find pwm access examples for this board, but none of it works on armbian (all are vendor builds specific). Can anybody point me in the right direction or give any hint how to enable pwm? EDIT : I've managed to enable/dosable PWM pin with sudo mraa-gpio set 11 1 Although, its GPIO, rather PWM access so I can't control the FAN speed and only power on/off the fan.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines