Temperature controlled cooling fan (usb powered) on R7000

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
jase80
DD-WRT Novice


Joined: 20 Jan 2018
Posts: 5

PostPosted: Sun Jan 21, 2018 3:19    Post subject: Temperature controlled cooling fan (usb powered) on R7000 Reply with quote
I’m mainly typing this up for my own reference, but since I’d never keep it filed anywhere logical I figured it’d be best to throw it to the web and let google look after it.

I decided my R7000 was getting to hot running constantly at 70C, so I purchased a cheap USB powered laptop cooler to sit it on. Works a treat, easily dropping temp by >10C. Then I decided I wanted it to be temperature controlled.

Apparently you’re supposed to be able to issue commands like
Code:
echo on > /sys/bus/usb/devices/usb1/power/level 
or /sys/bus/usb/devices/usbX/power/autosuspend_delay_ms

depending on kernel version and control the power to specific USB ports. However, the /power sub-directory doesn’t appear to exist under any of the usb devices for my installation.

After spending hours trying many variants on that theme, I realised the port powered on and off when enabling/disabling “Core USB Support” in the web GUI under Services > USB, so I looked up the USB related nvramoptions and found “usb_enable”. Sadly, using nvram set usb_enable 1 wouldn’t immediately apply the change, even when followed by a nvram commit. I couldn’t find any way to get it to apply on demand like you can in the GUI. So that lead ran dry.

Eventually I came across the gpio approach as a possibility. As most of us know it’s the way we kill most of the LEDs to stop the router blinding us at night. I tried playing around with every gpio number that wasn’t already listed as identified, but none seemed to do anything.

Then I remembered 0 is a number too.
Fortunately gpio 0 is power to the usb, so using gpio enable 0 and gpio disable 0 I can power on and off the fan. It’s a bit ham-fisted as it takes out both ports, so you can’t have anything useful plugged in the other one, but since I don’t it works for me.
If anyone knows a way to target just one of the ports then please let us know!
Here’s the script I made, there’s probably a more elegant way of doing this, so let me know that too…

Code:

# TURN FAN ON (I.E. USB POWER) WHEN ROUTER IS HOT
usbgpiopin=0

#Temperature above which to turn on fan (650 = 65C)
hightemp=650

#Turn fan back off when temperature gets below (600 = 60C)
lowtemp=600

gpio disable usbgpiopin           #get it to a known state before we start

while [ 0 ];do
  temp=$(cat /proc/dmu/temperature)             #Get temperature

  if [ $temp -gt $hightemp ];then               #power on if greater than high temp
    gpio enable usbgpiopin
    echo $(date) "FAN ON" >> /tmp/var/log/messages
    while [ $temp -gt $lowtemp ];do
        sleep 10
        temp=$(cat /proc/dmu/temperature)       #Get temperature
    done
    gpio disable usbgpiopin                     #power off now we're less than low temp
    echo $(date) "FAN OFF" >> /tmp/var/log/messages
  fi
 sleep 10   #wait 10s before checking temps again
done



Last edited by jase80 on Sun Jan 21, 2018 18:40; edited 1 time in total
Sponsor
Xeon2k8
DD-WRT Guru


Joined: 11 Feb 2016
Posts: 1324

PostPosted: Sun Jan 21, 2018 12:58    Post subject: Re: Temperature controlled cooling fan (usb powered) on R700 Reply with quote
jase80 wrote:

I decided my R7000 was getting to hot running constantly at 70C,

You decided haha... So funny. Indeed you did it because you were bored (and because you have no clue about thermal specs on these chips architecture), it has no use at all.

_________________
R6400v2 (boardID:30) - Kong 36480 running since 03/09/18 - (AP - DNSMasq - AdBlocking - QoS)
R7800 - BS 31924 running since 05/26/17 - (AP - OpenVPN Client - DNSMasq - AdBlocking - QoS)
R7000 - BS 30771 running since 12/16/16 - (AP - NAS - FTP - SMB - OpenVPN Server - Transmission - DDNS - DNSMasq - AdBlocking - QoS)
R6250 - BS 29193 running since 03/20/16 - (AP - NAS - FTP - SMB - DNSMasq - AdBlocking)


Last edited by Xeon2k8 on Sun Jan 21, 2018 14:47; edited 1 time in total
thunderhead
DD-WRT User


Joined: 11 Nov 2017
Posts: 136

PostPosted: Sun Jan 21, 2018 14:44    Post subject: Reply with quote
Neat post but doubtful that anyone will repeat your project since 70C is within range of many reported temps for this CPU.
_________________
*3x R7000 on DD-WRT v3.0-r36070M kongac (05/31/2018) both radios on/primary router.
*1x R7000 on DD-WRT v3.0-r39575M kongac (04/20/2019) both radios disabled configured as a switch.
*R7800 on OpenWRT 18.06.5
jase80
DD-WRT Novice


Joined: 20 Jan 2018
Posts: 5

PostPosted: Sun Jan 21, 2018 18:44    Post subject: Reply with quote
It's usually a good sign you're doing something useless when you don't find anything about it in your web searches...

I did note that 70C is well within operating range, however with 43C days coming here and 70C showing when I thought the thing was under base load I embarked on my little learning exercise.

If nothing else I've learnt more about hos this thing operates!
FurryNutz
DD-WRT User


Joined: 31 Oct 2010
Posts: 231

PostPosted: Sun Jan 21, 2018 19:10    Post subject: Reply with quote
Interesting and I presume is something neat. However I have found that just keeping a laptop cooler running 24/7 is simple and keeps the router cooler at all times. Rather then relying upon a temp to be reached and trigger additional cooling, I find it more simple to just have the fan running all the time. Most routers are designed well and work with the design and cooling them selves as long as placement is good and good air flow is available. However over the years working with electronics and routers, I've found that having additional external air flow doesn't hurt either. Heat eventually has a impact on electronics and slowly degrades components. Having additional cooling is good too.

I just have a laptop cooler which came with variable fan speed and keep it on all the time.
jase80
DD-WRT Novice


Joined: 20 Jan 2018
Posts: 5

PostPosted: Mon Jan 22, 2018 5:03    Post subject: Reply with quote
FurryNutz wrote:
Interesting and I presume is something neat. However I have found that just keeping a laptop cooler running 24/7 is simple and keeps the router cooler at all times.


You're not wrong! The noise bothered me and I let myself go down this rabbit hole... Specifically I don't want the fan resonating away overnight if it doesn't need to be. And yeah, maybe it isn't even needed on hot days under high load.

Hopefully the fact I've documented the gpio 0 thing will be useful to someone for something in the future as it's not something I could find elsewhere.

Doesn't need to be triggered by temperature, and it doesn't need to be a fan that's powered on and off by the USB.
tedm
DD-WRT User


Joined: 13 Mar 2009
Posts: 287

PostPosted: Mon Jan 22, 2018 6:08    Post subject: Reply with quote
Well seems to me you could have accomplished the same thing by buying a temperature controlled fan with an external thermistor and mounting the thermistor on the CPU but each to his own!!! Smile
d0ug
DD-WRT Guru


Joined: 31 Jul 2015
Posts: 777

PostPosted: Mon Jan 22, 2018 7:23    Post subject: Reply with quote
There are a lot of examples online of people going overkill on cooling that just is not needed. Raspberry Pis are good example. You see multiple examples of people heatsinking the hell out of them when it just is not needed. I myself have multiple raspberry pis, one of each generation. None are heatsinked, all of them are enclosed in laser cut Plexiglas enclosures which would limit air circulation and none of them have ever exhibited any kind of stability issues. Checking the temperature on them and they all have stayed within acceptable temperature ranges per the SOC datasheet.

If you're going to be overclocking devices that is one thing, but if you're keeping them at stock specifications it just isn't needed.
jase80
DD-WRT Novice


Joined: 20 Jan 2018
Posts: 5

PostPosted: Mon Jan 22, 2018 7:59    Post subject: Reply with quote
d0ug wrote:
There are a lot of examples online of people going overkill on cooling that just is not needed. Raspberry Pis are good example. You see multiple examples of people heatsinking the hell out of them when it just is not needed.


So what I'm hearing is I should control a cooling system for the router (which doesn't need cooling) with an overclocked raspberry pi that in turn needs a cooling system...

tedm wrote:
Well seems to me you could have accomplished the same thing by buying a temperature controlled fan with an external thermistor and mounting the thermistor on the CPU but each to his own!!! Smile


Yeah, I just plugged in a fan and wrote a script. Didn't have to touch a screw. :p
jwh7
DD-WRT Guru


Joined: 25 Oct 2013
Posts: 2374
Location: Indy

PostPosted: Tue Jul 09, 2019 16:00    Post subject: Reply with quote
jase80 wrote:
So what I'm hearing is I should control a cooling system for the router (which doesn't need cooling) with an overclocked raspberry pi that in turn needs a cooling system...
Lol, nicely done. Wink

What I read is...now that you've dropped the temp more than 10degC, you need to overclock and get the temp back up to spec! Razz

_________________
# NAT/SFE/CTF: limited speed w/ DD # Repeater issues # DD-WRT info: FAQ, Builds, Types, Modes, Changes, Demo #
x64 OPNsense 19.7.7|FT2019.3: EA6900v1.1@1GHz, F7D8302|DD 41596: WNDR4500v2, WNDR4000@533, R6300v1,
E2500, E1500@353, WRT54*@250: GLv1.1 nsg, GSv6 µ, RT-N66U@663
|OEM: WGR614v10@400 -> WNR1000v3 mod
MuzzleVelocity
DD-WRT Novice


Joined: 23 Apr 2010
Posts: 42

PostPosted: Wed Jul 10, 2019 18:50    Post subject: Reply with quote
so how often and for how long does the fan cycle on/off now?

its a cool idea for a project (no pun intended) if for nothing else then to learn something.

besides, regardless of what the thermal specs of that one chip say, the heat is going to affect other components on the board also. capacitors in particular can have a lifetime directly affected by temperature.

_________________
Linksys EA6200 DD-WRT v3.0-r29396

Belkin F7D3302 v1
dd-wrt.v24-16214_NEWD-2_K2.6_big.bin
OTRW
amnesico
DD-WRT Novice


Joined: 16 Dec 2011
Posts: 2

PostPosted: Wed Sep 18, 2019 20:10    Post subject: Reply with quote
I can't understand why so much criticism for something that's actually useful.

The critics should know, for example, that an AC68U (BCM4708A0), witch has a Tj Max of 130ºC, becomes unstable above 90ºC. Many reports of this at SNB... What's causing it? CPU? The neighboring components?

@jase80
I have no suggestion to improve your code, and for that reason, I just want to thank you for sharing your findings. I am using your script.
dahosepipe
DD-WRT Novice


Joined: 24 Mar 2015
Posts: 20

PostPosted: Thu Sep 19, 2019 5:47    Post subject: Reply with quote
Very cool! Love your ingenuity.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum