FanBridge is a Dockerised Unraid service designed to monitor hard drive temperatures and intelligently control external PWM fans via Arduino or RP2040 microcontrollers. It provides a seamless way to keep your drives cool by adjusting fan speeds based on drive temperature data, helping to extend drive lifespan and reduce noise.
Production‑ready fan control bridge for Unraid.
- Parses Unraid
disks.inifor drive state/temps and recommends PWM. - USB serial control for Arduino/RP2040; quick tools (PING, version).
- Configurable fan curves, overrides, excludes; reset to defaults.
- Auth (login, change password), CSRF, sensible security headers.
- Logs API (ring buffer) and basic Prometheus metrics.
- Clean UI with dark/light mode and responsive layout.
Below are a few key views from the web UI.
Login
Initial authentication screen with username/password.
Drives
Drive overview and configuration used to compute fan PWM.
Serial
USB serial controller status, quick tools, and send interface.
If you are building the physical controller, see the companion firmware/bridge repo: fanbridge-link.
Notes about the hub wiring:
- The hub used in our build presents the tach signal on the second wire/pin. Disconnect this tach line from the hub connector and instead tie that second wire to a ground point on the controller board.
- From the fan hub to the controller we only connect two signals: PWM and GND. Do not feed the tach line into the controller.
Schematic and a real‑world mockup are shown below.
Run fanbridge easily via Docker or as an Unraid app:
Install fanbridge directly through the Unraid Community Applications plugin for one-click deployment and management.
Unprivileged setup (device optional — container starts without it):
- Leave the Device mapping blank by default so Docker can start even if the controller is unplugged. You can add the device later when connected.
- Optionally map
/dev/serial/by-idinto the container read-only (for stable names). - Preferred serial port defaults to
/dev/ttyACM0(RP2040). You may override viaFANBRIDGE_SERIAL_PORT(by-id path recommended). - Keep “Privileged” off. No cgroup rules or group-add are required when using Device mapping.
Notes on hot‑plugging:
- Docker/Unraid cannot start a container if a specific
--devicepath is mapped but absent on the host. Leaving the Device blank avoids this. You can add the device later when it’s connected, or restart the container after mapping it. - Mapping
/dev/serial/by-id(ro) is safe even when empty; it helps the app find a stable path when the controller is connected.
Production tips:
- Reverse proxy/TLS recommended; set
FANBRIDGE_SECURE_COOKIES=1when HTTPS terminates in front. - Tune Gunicorn via env:
GUNICORN_WORKERS(default 2) andGUNICORN_TIMEOUT(default 30). - Metrics: scrape
/metrics(text format) for basic counters. - Session secret: generated on first run and persisted at
/config/secret.key(Docker) orcontainer/secret.key(local). This file is ignored by Git; do not commit it.
- Historical charts and richer dashboards.
- Live updates via WebSocket/SSE for smoother refresh.
- Modularized codebase (core/, services/, api/), added app factory.
- Production “sim” mode removed (local dev only). Starts without mounts/devices.
- Default preferred serial in Docker is
/dev/ttyACM0(RP2040); logs error if unplugged. - Unraid template clarifies serial device left blank by default; recommended
/dev/ttyACM0. - Image cleanup: removed unused
smartmontools.
See fanbridge/RELEASE.md for the full changelog.
container/app.py: Flask app entry, app factory, middleware, routes not yet moved to blueprints.container/api/: Route groups (blueprints):serial.py–/api/serial/*for status/tools/send/pwmappinfo.py–/api/app/version,/api/metricslogs.py–/api/logs*(list, level, clear, download)
container/services/: Core servicesdisks.py– Unraiddisks.iniparser, sysfs helpersserial.py– serial discovery/open/status and helpers
container/core/: Infrastructure utilitieslogging_setup.py– logging setup + in-memory ring buffermetrics.py– counters used by/api/metricshttp.py,appver.py– minimal HTTP JSON fetch and version helpers
container/templates/,container/static/: UI assetscontainer/Dockerfile: Runtime imagedocker-compose.yml: Local dev exampleunraid-templates/templates/my-fanbridge.xml: Unraid templateRELEASE.md: Canonical version + changelog
For the canonical version history and detailed changelog, see fanbridge/RELEASE.md.


