• Posts

  • Joined

  • Last visited

PetrozPL's Achievements

  1. 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 : call it with root priviliges or add it to execution on startup.
  2. I've created the repository on github with all required files, including 2 scripts I'm using to control and query PWM FAN speed. 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
  3. Yhea, that makes two of us It took me some time and digging before I figured out the correct naming convention
  4. 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
  5. 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.
  6. 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.