222 lines
7.5 KiB
HTML
222 lines
7.5 KiB
HTML
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link rel="shortcut icon" type="image/jpg" href="https://branding.ewpratten.com/pfp/2022/460x460.webp" />
|
|
|
|
<link rel="canonical" href="https://ewpratten.com/blog/udm-fan/" />
|
|
|
|
|
|
<link rel="alternate" type="application/rss+xml" title="RSS" href="https://ewpratten.com/rss.xml">
|
|
|
|
<meta name="twitter:card" content="summary" />
|
|
<meta name="og:site" content="ewpratten.com" />
|
|
<meta name="og:site_name" content="Evan Pratten" />
|
|
|
|
|
|
<meta name="og:image"
|
|
content="https://branding.ewpratten.com/pfp/2022/460x460.webp" />
|
|
|
|
|
|
<meta property="og:description" content="Remote fan control for the Unifi Dream Machine Pro" />
|
|
<meta property="description" content="Remote fan control for the Unifi Dream Machine Pro" />
|
|
<meta name="description" content="Remote fan control for the Unifi Dream Machine Pro">
|
|
|
|
|
|
<meta property="og:title" content="Making my UDM-Pro scream - Evan Pratten" />
|
|
|
|
|
|
|
|
<meta property="og:type" content="article" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<title>Making my UDM-Pro scream | Evan Pratten</title>
|
|
|
|
|
|
<link rel="stylesheet" href="/global.css">
|
|
|
|
|
|
<link rel="stylesheet" href="/dist/github-markdown-css/github-markdown-light.css" lazyload>
|
|
<link rel="stylesheet" href="/styles/bootstrap.css" lazyload>
|
|
<link rel="stylesheet" href="/styles/typography.css">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
<div class="page">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="/styles/components/heading-card.css">
|
|
|
|
|
|
<div class="heading-card">
|
|
<div class="profile-photo-container">
|
|
<img src="https://branding.ewpratten.com/pfp/2022/460x460.webp" alt="Profile Photo" loading="lazy">
|
|
</div>
|
|
<div class="text-container">
|
|
<h1>Evan Pratten</h1>
|
|
<p>Software Developer</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="container">
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="/styles/components/navbar.css">
|
|
|
|
|
|
<div class="ewp-navbar">
|
|
<hr>
|
|
<ul class="navbar-items">
|
|
<li><a href="/">Home</a></li>
|
|
<li class="separator">|</li>
|
|
<li><a href="/timeline">Timeline</a></li>
|
|
<li class="separator">|</li>
|
|
<li class="dropdown-center">
|
|
<a href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
|
More
|
|
</a>
|
|
<ul class="dropdown-menu">
|
|
|
|
|
|
<li><a class="dropdown-item" href="/photography">Photography</a></li>
|
|
<li><a class="dropdown-item" href="/contact">Contact</a></li>
|
|
</ul>
|
|
</li>
|
|
|
|
</ul>
|
|
<hr>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<article id="content" class="container markdown-body">
|
|
|
|
<h1 style="margin-bottom:0;padding-bottom:0;">Making my UDM-Pro scream</h1>
|
|
<em>Remote fan control for the Unifi Dream Machine Pro</em>
|
|
<br><br>
|
|
|
|
<p><a rel="noopener" target="_blank" href="https://www.ui.com/">Ubiquiti</a>'s <a rel="noopener" target="_blank" href="https://www.ubnt.com/products/unifi-dream-machine-pro">Unifi Dream Machine Pro</a> is a powerful medium-scale business-oriented rack-mount router, capable of handling 10/100/1000/10000 ethernet traffic. Really quite a nice device.</p>
|
|
<p>One day, I had the thought: <em>I've never heard the fans ramp up on this</em>. And so, I started looking into the possibilities of manual fan control.</p>
|
|
<p>As it turns out, this Linux-based device allows you (like any embedded Linux computer) override its I/O with some clever shell commands.</p>
|
|
<h2 id="enter-ssh">Enter: SSH</h2>
|
|
<p>If you own a UDM-Pro, you surely know how to log in to it via SSH. If not, look it up 😄.</p>
|
|
<p>With an SSH connection open, the following commands let you control the fans on the device!</p>
|
|
<pre data-lang="sh" style="background-color:#2b303b;color:#c0c5ce;" class="language-sh "><code class="language-sh" data-lang="sh"><span style="color:#65737e;"># Override the fans with a speed (0-255)
|
|
</span><span style="color:#b48ead;">export </span><span style="color:#bf616a;">FAN_SPEED</span><span>=</span><span style="color:#a3be8c;">128
|
|
</span><span style="color:#bf616a;">killall -9</span><span> S04ubnt-fan-speed ubnt-fan-speed
|
|
</span><span style="color:#96b5b4;">echo</span><span> 1 > /sys/class/hwmon/hwmon0/device/pwm1_enable
|
|
</span><span style="color:#96b5b4;">echo</span><span> 1 > /sys/class/hwmon/hwmon0/device/pwm2_enable
|
|
</span><span style="color:#96b5b4;">echo </span><span>$</span><span style="color:#bf616a;">FAN_SPEED </span><span>> /sys/class/hwmon/hwmon0/device/pwm1
|
|
</span><span style="color:#96b5b4;">echo </span><span>$</span><span style="color:#bf616a;">FAN_SPEED </span><span>> /sys/class/hwmon/hwmon0/device/pwm2
|
|
</span><span>
|
|
</span><span style="color:#65737e;"># Return control back to the device
|
|
</span><span style="color:#bf616a;">/etc/init.d/S04ubnt-fan-speed</span><span> start
|
|
</span></code></pre>
|
|
<h2 id="exit-stage-left">Exit stage left</h2>
|
|
<p>Who needs SSH anyways? </p>
|
|
<p>When I discovered this, I decided to write a little program that wraps the SSH commands with a little bit of error checking, and support for auto-discovery of UDM-Pro devices on your network.</p>
|
|
<div class="zola-github-card" >
|
|
<a href="https://github.com/ewpratten/udm-fan">
|
|
<img src="https://opengraph.githubassets.com/1/ewpratten/udm-fan" alt="GitHub: ewpratten/udm-fan">
|
|
</a>
|
|
</div>
|
|
<br>
|
|
<p>The following commands can be used to control the fans on a local UDM-Pro:</p>
|
|
<pre data-lang="sh" style="background-color:#2b303b;color:#c0c5ce;" class="language-sh "><code class="language-sh" data-lang="sh"><span style="color:#65737e;"># Set the fans to half speed
|
|
</span><span style="color:#bf616a;">udm-fan</span><span> set 128
|
|
</span><span>
|
|
</span><span style="color:#65737e;"># Set the fans to full speed (with a custom IP address)
|
|
</span><span style="color:#bf616a;">udm-fan</span><span> set 255</span><span style="color:#bf616a;"> --override-ip</span><span> 172.16.11.5
|
|
</span><span>
|
|
</span><span style="color:#65737e;"># Bring the fans back to automatic control
|
|
</span><span style="color:#bf616a;">udm-fan</span><span> auto
|
|
</span></code></pre>
|
|
<p>Passwords can be provided through:</p>
|
|
<ul>
|
|
<li>The <code>--ssh-password</code> flag</li>
|
|
<li>The <code>UDM_SSH_PASS</code> environment variable</li>
|
|
<li>A <code>.netrc</code> entry with the hostname being the UDM's IP address</li>
|
|
<li>The terminal at runtime</li>
|
|
</ul>
|
|
|
|
|
|
</article>
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="/styles/components/footer.css">
|
|
|
|
|
|
<div class="footer">
|
|
<br>
|
|
<span class="gray">-- EOF --</span>
|
|
<p>
|
|
Site design & content by: <a href="/contact">Evan Pratten</a><br>
|
|
Consider <a href="/donate" target="_blank">supporting my work</a> if you like what you see<br>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"
|
|
integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3"
|
|
crossorigin="anonymous"></script>
|
|
|
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
<script defer src="https://www.googletagmanager.com/gtag/js?id=G-5912H4H03P"></script>
|
|
<script>
|
|
window.dataLayer = window.dataLayer || [];
|
|
function gtag() { dataLayer.push(arguments); }
|
|
gtag('js', new Date());
|
|
|
|
gtag('config', 'G-5912H4H03P');
|
|
</script>
|
|
</body>
|
|
|
|
</html> |