New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't seem to work with 1.8.3 on UDM-Pro #3
Comments
Any interest in updating this for current FW? Happy to help debug also (wish I had the skills to help code). The fan is driving me nuts. |
I just use this method: https://community.ui.com/questions/UDM-Pro-Fan-Speed-Question/4735dc49-43f2-4d01-b50d-0d10ec8b9057#answer/32ff52cf-fdff-434b-85df-6e3892126d24 it lowers the fan speed to 40% and keeps the UDM Pro quieter until the next reboot or firmware update. |
FYI: I've also installed the netdata docker/podman. It shows me the actual fan speeds and temps in a graph. It helped me a lot to solve this issue.
Fan1 === CPU fan === pwm2 The CPU fan minimum start offset is "77" and is ~800 rpm . CPU fan: Disk fan: Making this survive a reboot does indeed need the on-boot-script. I've made a simple script which surives a reboot:
11-set-fan-speed.sh:
I can confirm that it DOES survive a reboot. Got it working on 1.8.5. Display also shows correct values. Running stable at 44 degrees Celsius on CPU and 41 degrees Celsius board-temp. |
Here some more raw data I just pulled from my UDMP. @renedis will fan control when temperature rises (in summer) still work? Sorry if I ask for the obvious. |
Seems the board is using the ADT7475 kernel driver for monitoring fans, temps and setting PWM. https://www.kernel.org/doc/html/v5.4/hwmon/adt7475.html (this is for 5.4, couldn't find 4.1.37) Welcome to UniFi Dream Machine!
# dmesg | grep adt7475
[ 3.421487] adt7475 4-002e: ADT7475 device, revision 1
[ 3.421491] adt7475 4-002e: Optional features: fan4 pwm2 Excerpt on the fan speed control: (bold markup done by me)
And from the ADT7475 data sheet:
So maybe there is a way to steer the initial parameters? In my case - contrary to what @nekuz0r aspires to achieve - I want this thing to just shut up and be as silent as possible. Ideally without toasting something, so the fans spooling up when required would be nice. I'm eying on the "Enhanced Acoustics Register", which is linked in the module source code to the pwm1_stall_disable sysfs attribute. At least there is a function addressing bit 5 to keep the HDD fan spinning.
This may be the culprit for not stopping the HDD fan at all, when a drive is installed. I found a discussion around this topic, but I don't find a *_stall_disable on my system, so this may be a dead end. For my UDM pro without HDD installed, the HDD Fan temp1_auto_point2_temp pwm1_auto_point1_pwm With HDD only these value change: HDD Fan CPU Fan pwm2_auto_point1_pwm How I interpret this): HDD Fan: CPU Fan: So my hope is to find a way of pulling `pwm[1-2]_auto_point1_pwm' down from 128 to something more reasonable for the HDD fan (30 to 50 seems to be nice enough to my ears). Maybe this is as simple as putting a shell-script to #!/bin/sh
echo 80 >/sys/class/hwmon/hwmon0/device/pwm2_auto_point1_pwm
echo 45
>/sys/class/hwmon/hwmon0/device/pwm1_auto_point1_pwm Just replacing "pwm1" with "pwm1_auto_point1_pwm", trying to not set a fan speed directly but adjusting the limits without interfering. Update Sorry for dropping all such detail without knowing how to implement it properly. Update 2 There is a statement by a Ubiquiti employee. heXeo has referred to this already and linked to this repo.
Full dump of /sys/class/hwmon/hwmon0/ - no HDD. |
OK, if lockdown is good for anything... now I'm onto something. I found an interface description for the ADT7475 driver.
This gives at least some hints:
No cigar, seems like the fan speed control is clamped to manual. Here's where my efforts end. Update: yes it's clamped in # more S04ubnt-fan-speed
#!/bin/sh
#
# ubnt-fan-speed
#
case "$1" in
start)
if ! pidof ubnt-fan-speed &>/dev/null; then
{ while true; do /usr/sbin/ubnt-fan-speed; sleep 1; done } &
fi
;;
stop)
echo "This is a critical service. Stopping it is unsupported."
;;
*)
echo "Usage: $0 {start}"
exit 1
;;
esac |
In short: I/We need to automate these commandlines:
|
I've got it working with shell boot script on firmware 1.8.5! |
Excellent, thanks! Will test it during the next days on 1.8.6! |
I don't have the 1.8.5 or 1.8.6 firmware on my UDM Pro installed, can one of you attach the stock ubnt-fan-speed binary to this issue so i can decompile it and figure out what's different about it ? |
@conligwx , could you # cat /sys/class/hwmon/hwmon0/device/pwm1_enable
1
# cat /sys/class/hwmon/hwmon0/device/pwm2_enable
1
# cat /sys/class/hwmon/hwmon0/device/pwm3_enable
2
#
# cat /sys/class/hwmon/hwmon0/device/pwm1_auto_point1_pwm
128 What are your settings then?
We are looking for a "2" in the first three settings, and a number around 30 to 50 in the last item. There is a feature request to UI with very limited exposure, but maybe the right people at UI read and consider implementing it. |
This is what I found.
Hope that helps. I tried the touch screen last night, which now seems to lower the fan speed from a default(after reboot) of 50% to 19% - most times. if however you try to raise the fan speed it gets stuck sometimes and runs at 100% or gets stuck at 80%(reported speed on screen) yet the fans are not running. I'm guessing UI has done some work on the last beta build 1.9.0-12 Improvements and bug fixes for LCM. but still far from perfect. at 19% temps were rising from an approx 36c to 43c in my location when running at 19% fan speed. 1.9.x has had changes to it. the 1.8.x firmware allowed you to lower to 40% by flicking downwards the fan speed 10 times until 40% was shown. this bug/feature has bsince been removed from the 1.9.0.x builds |
1.9.0.x seems to automatically restart the ubnt-fan-speed process after it’s killed. This fan noise is so frustrating. I upgraded the one fan to a Noctua, but that’s not enough to keep this thing relatively quiet at 50% speed. The old trick to get it down to 40% speed worked well enough for me — it’s noticeably quieter at that level. But of course that trick doesn’t work with 1.9.0.x. I wasn’t able to get the fan to stick to anything other than returning to 50% using the LCD. When I change the slider it say “testing fan”. I did see the bug where once or twice the fan would cut off completely. But I couldn’t get it to stick to, say, 30% or 40%. I had to upgrade to 1.9.0.x for an EA device I’m getting. |
This works for me on 1.9.0 to write to the pwm values. You should just kill BOTH S04ubnt-fan-speed and ubnt-fan-speed first, which will prevent the ubnt-fan-speed program from restarting. E.g.: For auto fan mode according to @renedis' values: killall -9 S04ubnt-fan-speed ubnt-fan-speed
echo 2 >/sys/class/hwmon/hwmon0/device/pwm1_enable
echo 2 >/sys/class/hwmon/hwmon0/device/pwm2_enable
echo 0 >/sys/class/hwmon/hwmon0/device/pwm1_auto_point1_pwm
echo 60 >/sys/class/hwmon/hwmon0/device/pwm2_auto_point1_pwm
echo 40000 >/sys/class/hwmon/hwmon0/device/temp1_auto_point1_temp
echo 66000 >/sys/class/hwmon/hwmon0/device/temp1_auto_point2_temp
echo 40000 >/sys/class/hwmon/hwmon0/device/temp2_auto_point1_temp
echo 66000 >/sys/class/hwmon/hwmon0/device/temp2_auto_point2_temp
echo 40000 >/sys/class/hwmon/hwmon0/device/temp3_auto_point1_temp
echo 66000 >/sys/class/hwmon/hwmon0/device/temp3_auto_point2_temp For manual fan mode (adjust pwm1 and pwm2, 0->255 range, 0 for min fan speed, 255 for max fan speed): killall -9 S04ubnt-fan-speed ubnt-fan-speed
echo 1 >/sys/class/hwmon/hwmon0/device/pwm1_enable
echo 1 >/sys/class/hwmon/hwmon0/device/pwm2_enable
echo 0 >/sys/class/hwmon/hwmon0/device/pwm1
echo 0 >/sys/class/hwmon/hwmon0/device/pwm2 This worked for me on boot as well by putting it in an on boot script. Adjust for your own fan speed values. |
Aha I didn’t even see S04ubnt-fan-speed in there, thanks for the tip! |
Looks like all PWM channels are controlled by temp 1. Do you know what temperatures temp1, 2 and 3 are tied with? ie. which one is for CPU, board and HDD (If any)?
Update - comparing the numbers in the UI for CPU temp and what I see in netdata, temp1 is CPU temp. So the only missing puzzle is temp 3 - not sure which temp is that |
Having a few issues getting this to work on 1.10, when I run the above command it kicks in for almost a second before something overrides the sys class settings and the fans immediately kick back into gear at their jet turbine level. |
Anyone want to provide a little assistance on how exactly to do this? I know how to ssh into my udmp. I just don't know exactly what to do from there if I want to set me fans to minimum. |
I have used this settings now for a week, room is about 20C and UDM Pro stay below 40C with HDD installed. Sound is good almost silent, same noise level as when HDD seek. Much better than original settings which I have hard time to understand when installed in fairly cold place. Below 40C shall be good enough killall -9 S04ubnt-fan-speed ubnt-fan-speed Thanks for you finding this settings |
Confirmed working on 1.11.4 - thanks to everyone contributing to this! |
I get this error -bash: echo: write error: Invalid argument |
running v1.12.30 I can't get the HDD fan to change. No matter what settings I try i'ts always running at 100% |
This didn't change anything on my UDM SE. Anyone have experience with an SE? |
This solution is broken on version 3.2.12.14768. Processes no longer exist and root no longer has permissions to write to devices... Tried manually chmoding the device files but to no avail... Would love to see if anybody comes up with a solution. |
@willisiswillis see ubnt-auto-fan-speed, more directly the readme under on_boot.d for installation instructions. |
As the title says, running on the latest 1.8.3 firmware and following the instructions it doesn't seem to have any effect.
The on-device screen shows the fan speed at 50% (I've set it to 25% via the conf file) and it also no longer responds to the slider as well. As in, I can move the slider but the fan stays at the same 50% duty cycle as before.
More than happy to help debug so let me know if more info or testing help is required :)
The text was updated successfully, but these errors were encountered: