perlian Posted July 27, 2019 Posted July 27, 2019 i found a running task on friendlyelec desktop called "pwm fan" But i found no more informations how to connect a pwm fan to the Nanopi M4 Which pins are needed to connect ? Can i use a normal 5V Fan or is a special Fan needed ? Anyone aware of this ? 0 Quote
mindee Posted August 5, 2019 Posted August 5, 2019 Hi, The NVMe SSD Adapter/HAT for M4 has a fan connector. (https://www.friendlyarm.com/index.php?route=product/product&product_id=262) 0 Quote
grm Posted August 16, 2019 Posted August 16, 2019 Indeed there is a PH.2.0 connector on the hat and also on the SATA hat but there is not much info on this except that is driven by pwmchip1 (exposed on the 20pin header) and regulated by a P channel MOSFET, maybe FA should add some data about the compatible fans for the people less skiled in electronics. 0 Quote
justin.wills Posted January 11, 2020 Posted January 11, 2020 (edited) friendly desktop has service pwm-fan. it runs which I've found works fine under armbian. you can edit the temps at which fan turns on in the script all assuming you have the nvme hat Edited January 11, 2020 by justin.wills added requirement of nvme hat 0 Quote
Igor Posted January 12, 2020 Posted January 12, 2020 On 1/11/2020 at 1:09 PM, justin.wills said: which I've found works fine under armbian. In case you find a wish to implement it: script location:https://github.com/armbian/build/tree/master/packages/bsp/rk3399 install hooks:https://github.com/armbian/build/blob/master/config/sources/families/include/rockchip64_common.inc 0 Quote
mar0ni Posted January 18, 2020 Posted January 18, 2020 On 1/11/2020 at 1:09 PM, justin.wills said: friendly desktop has service pwm-fan. it runs which I've found works fine under armbian. you can edit the temps at which fan turns on in the script all assuming you have the nvme hat Hi, I would like to try this scipt, could you please point me to where to find this? 0 Quote
Sir Lazarus Posted January 18, 2020 Posted January 18, 2020 There is an example for an implementation of a fan controller for NVMe SSD Adapter/HAT. You can find it here Link to post 0 Quote
broodwich82 Posted January 19, 2020 Posted January 19, 2020 I'm confused about how this 2-pin fan header does PWM fan control. It sounds to me like the PWM pin just completely turns the power on/off to the 2-pin socket. But I just want to use standard 4-pin PWM fans with this board. Sounds like that would require extra hacking on the linked post (and an extra pin if monitoring fan RPM is desired). Is that correct? I may for the time being just buy a couple $5 4-pin PWM fan controllers with a temp sensor off Amazon, and worry about this later. Kinda wish they'd made it easy to support standard 4-pin 12V PWM fans, even with just a physical connector. 0 Quote
justin.wills Posted January 21, 2020 Posted January 21, 2020 On 1/19/2020 at 5:29 AM, mar0ni said: Hi, I would like to try this scipt, could you please point me to where to find this? I just copied the pwm-fan.service and associated script from the friendly distro. can't remember the name, rk3399-something, but it is defined in the service file 1 Quote
justin.wills Posted January 21, 2020 Posted January 21, 2020 On 1/13/2020 at 4:13 AM, Igor said: In case you find a wish to implement it: script location:https://github.com/armbian/build/tree/master/packages/bsp/rk3399 install hooks:https://github.com/armbian/build/blob/master/config/sources/families/include/rockchip64_common.inc AHA! thats where the min/max frequency is set. I did notice that it no longer scales back to 408. I'll have a play with that 0 Quote
mar0ni Posted January 25, 2020 Posted January 25, 2020 On 1/21/2020 at 1:12 AM, justin.wills said: I just copied the pwm-fan.service and associated script from the friendly distro. Hi Justin, thank you for the hint, worked like a charm for me also. Attached the service file and bash script. pwm-fan.tar.bz2 1 Quote
justin.wills Posted January 29, 2020 Posted January 29, 2020 On 1/26/2020 at 7:09 AM, mar0ni said: Hi Justin, thank you for the hint, worked like a charm for me also. Attached the service file and bash script. I have found that the default service doesn't allow systemd to finish loading. so I have modified the service file to use Type=simple and User=root Quote [Unit] Description=pwm-fan After=rc.local.service [Service] Type=simple User=root KillMode=control-group WorkingDirectory=/tmp ExecStart=/usr/bin/start-rk3399-pwm-fan.sh [Install] WantedBy=multi-user.target Alias=pwm-fan.service 0 Quote
mar0ni Posted February 13, 2020 Posted February 13, 2020 Slightly improved and simplified script (still room for improvement, I guess). #!/bin/bash if [ ! -d /sys/class/pwm/pwmchip1/pwm0 ]; then echo 0 > /sys/class/pwm/pwmchip1/export fi sleep 1 while [ ! -d /sys/class/pwm/pwmchip1/pwm0 ]; do sleep 1 done ISENABLE=`cat /sys/class/pwm/pwmchip1/pwm0/enable` if [ $ISENABLE -eq 1 ]; then echo 0 > /sys/class/pwm/pwmchip1/pwm0/enable fi echo 50000 > /sys/class/pwm/pwmchip1/pwm0/period echo 1 > /sys/class/pwm/pwmchip1/pwm0/enable # max speed run 5s echo 0 > /sys/class/pwm/pwmchip1/pwm0/duty_cycle sleep 5 echo 49994 > /sys/class/pwm/pwmchip1/pwm0/duty_cycle declare -a CpuTemps=(75000 63000 58000 52000 48000 0) declare -a PwmDutyCycles=(25000 37000 48300 49250 49300 49994) while true do temp=$(cat /sys/class/thermal/thermal_zone0/temp) for i in 0 1 2 3 4 5; do if [ $temp -gt ${CpuTemps[$i]} ]; then DUTY=${PwmDutyCycles[$i]} echo $DUTY > "/sys/class/pwm/pwmchip1/pwm0/duty_cycle"; #echo "temp: $temp, target: ${CpuTemps[$i]}, duty: $DUTY" break fi done sleep 2s; done 3 Quote
araynard Posted March 22, 2020 Posted March 22, 2020 Hello mar0ni, I'm trying your last script with a NanoPiM4v2, but bash gives me the following error: /usr/bin/start-rk3399-pwm-fan-v2.sh: line 33: echo: write error: Invalid argument But I can't find the problem in your code. Any idea ? EDIT: I had to add quotes around the file path: echo $DUTY > "/sys/class/pwm/pwmchip1/pwm0/duty_cycle"; It's working great now ! 1 Quote
mar0ni Posted March 23, 2020 Posted March 23, 2020 Thank you, I fixed the quotation in the script 0 Quote
i5Js Posted March 25, 2020 Posted March 25, 2020 Hello all, I've just bought my nanopc t4 and I'm trying to run the script but I got the following: echo 0 > /sys/class/pwm/pwmchip1/export echo: write error: Device or resource busy then + sleep 1 + '[' '!' -d /sys/class/pwm/pwmchip1/pwm0 ']' + sleep 1 + '[' '!' -d /sys/class/pwm/pwmchip1/pwm0 ']' + sleep 1 + '[' '!' -d /sys/class/pwm/pwmchip1/pwm0 ']' + sleep 1 Can you help me? Many thanks. 0 Quote
Igor Posted March 25, 2020 Posted March 25, 2020 Providing logs with armbianmonitor -u significantly raises chances that issue is getting addressed. 0 Quote
i5Js Posted March 25, 2020 Posted March 25, 2020 Hi Igor, Thanks for your answer, and my apologies if I'm not doing things properly This is the url with the output http://ix.io/2fds Regards 0 Quote
Igor Posted March 25, 2020 Posted March 25, 2020 I am not sure we have enabled PWM on a modern kernel. Try with images with stock 4.4.y kernel. 0 Quote
i5Js Posted March 25, 2020 Posted March 25, 2020 I'm unable now to boot from MicroSD and flash other Arabian version on the EMMC memory... It's quite desperate because always boot from EMMC 0 Quote
martinayotte Posted March 25, 2020 Posted March 25, 2020 27 minutes ago, i5Js said: I'm unable now to boot from MicroSD and flash other Arabian version on the EMMC memory... It's quite desperate because always boot from EMMC eMMC has boot priority on RK3399. So, You need to temporarily disable it byt pressing "boot" button and kept it pressed for few second while pressing "reset" button ... 0 Quote
i5Js Posted March 25, 2020 Posted March 25, 2020 Hi Thanks for your answer, do you know how many secs? Because it’s imposible!! Thanks. 0 Quote
martinayotte Posted March 25, 2020 Posted March 25, 2020 23 minutes ago, i5Js said: do you know how many secs? Maybe around 5-6 secs after releasing the "reset" button. In other words, it until you see "Starting Kernel" on Serial Debug port... 0 Quote
i5Js Posted March 25, 2020 Posted March 25, 2020 Ufff this is insane, now says: mount: no such device Failed to mount /dev/mmcblk1p2 as root file system. (This I gues is still EMMC) (initramfs) 0 Quote
martinayotte Posted March 25, 2020 Posted March 25, 2020 1 hour ago, i5Js said: Failed to mount /dev/mmcblk1p2 as root file system. (This I gues is still EMMC) I don't think so, because eMMC is /dev/mmcblk2 ... But /dev/mmcblk1p2 means second partition, where ususally Armbian have a single partition. What image are you using ? 0 Quote
i5Js Posted March 25, 2020 Posted March 25, 2020 Buster server with kernel 4.4 I’ll reflash the sd card again and give it a second chance. 0 Quote
martinayotte Posted March 25, 2020 Posted March 25, 2020 6 minutes ago, i5Js said: give it a second chance. ... and check the partition layout of this image to figure out why it try to mount /dev/mmcblk1p2 ... 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.