Jump to content

[Support] SasaKaranovic - OpenFan Controller


Recommended Posts

Summary: Support thread for SasaKaranovic's OpenFan Controller Docker template

Application: OpenFan Controller Software

Source: https://github.com/SasaKaranovic/OpenFanController

 

This is a support thread for running OpenFan Controller on your Unraid server via Docker.

The provided template should work out-of-the-box with no modifications.

 

Note: You can specify exact USB device that you would like this docker instance to control. This can be useful in some (rare) cases. For example if you have multiple USB-to-Serial devices connected to your Unraid server or if you have multiple OpenFan controllers connected at the same time. This is done by changing the `OPENFANCOMPORT` environment variable.

 

Please note: In order to run this app, you will need to have OpenFan Controller physically connected to your  Unraid server. Otherwise the setup will fail.

Edited by SasaKaranovic
  • Like 1
Link to comment

This looks perfect!!

 

It wont let me install without giving it access to a controller (which I don't have yet) so just quick question - Is this able to access all server sensors? so all HD temps & CPU / motherboard temps too? Rather than solely external sensors on the openFan controller?

Edited by dopeytree
Link to comment
Posted (edited)

Thank you @dopeytree

 

I'm not sure what your target application is but let me describe what this is and how it can be used.

The OpenFAN Controller allows you to control up to ten 12V PWM fans individually and you can set target PWM value or target RPM for each individual fan.

It is designed to be platform and system agnostic. Meaning you can use it on Windows, Linux, Mac in a Docker container or whatever you desire.

It also has a public API that you can use to create a plugin for existing software (ie. like I did for FanControl) or to trigger/integrate into some other automation.

 

The application that is available on Community App store is an API server that also comes with a simple GUI. This allows you to interact with the OpenFAN controller.

 

So for example, on my desktop I use it with FanControl software. It has a very simple and clean UI that I like and it's the software I used before. But I can't run FanControl on my servers.

 

So on the Unraid server that I have in my living room I have a bit more "complex" setup.

I run it in a docker container and then have couple of separate applications/scripts/cron jobs that control the fans.

For example if the HDD temp is too high, I can spin up only the HDD fans. If the CPU/GPU temp is too high, I can spin up only the fans that move air in that area.

There is also a feature to define fan profiles. This is where I can specify RPM/PWM values for all 10 fans. Like for example I have a "idle" profile, "medium load" an "crank it to 11" profiles. Then I can make a simple API call from any application (ie. using some other docker container or even cron) to apply any of the profiles I have.

 

With that said, the API server will not monitor temperature sensors etc. It provides an API interface (it also has a Web UI interface) and you can use it to simply link any application (running locally or even remotely) with the fan controller.


I don't know if this sounds like a weird design decision, but I honestly think (hope) it's not that terrible idea. Please bear with me while I try to explain my view and motivation for this:

Instead of designing another fan controller and trying to "lock" people into vendor software that maybe won't work on your system or does not support (some of) your sensors, has terrible GUI, needs ton of ram just to run, annoys you every couple of days about new update that doesn't do anything and so on.
The idea was to make a fan controller that works on any OS and that gives you the flexibility to run it whichever way you want. It is your fan controller and you can control and interact with it in any way you want. There is nobody "prescribing" how you have to use it.

Now obviously this design decision also comes with a down-side for average user, in that it does not come with fancy software package. And if I gave it to my parents, it definitely will not be entirely plug&play out of the box. But I still think the ability to be used in almost every use-case is very valuable, at least for me.

 

Finally since the project is open-source and public, the API is open-source and public, you (the community) can use it however you want, integrate it with whatever you want or make custom apps for it and (hopefully/please) share back with the community so that we all can benefit from it.

 

Sorry about the very long reply to your question but I hope this gives you the answer you were looking for. :)

Edited by SasaKaranovic
Typos, so many typos
Link to comment

Sounds good at the moment I'm using a manual fan controller with a dial I turn but with your designed software & hardware I could automate this with some scripts.

 

Awesome project for me to get ready for the warmer summer months.

Edited by dopeytree
  • Like 1
Link to comment

Tried to install this but I get the below failed error. 

 

docker run
  -d
  --name='OpenFanController'
  --net='bridge'
  -e TZ="Australia/Brisbane"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="DarKnight"
  -e HOST_CONTAINERNAME="OpenFanController"
  -e 'OPENFANCOMPORT'='/dev/ttyACM0'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.webui='http://[IP]:[PORT:3000]'
  -l net.unraid.docker.icon='https://github.com/SasaKaranovic/OpenFanController/blob/master/assets/logo.png?raw=true'
  -p '3210:3000/tcp'
  --device='/dev/ttyACM0'
  --memory=512M 'ghcr.io/sasakaranovic/openfancontroller:release'
WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
bc17432da45ec7d414380d58678601895254edc6385c73aa074ef732387fcf38
docker: Error response from daemon: error gathering device information while adding custom device "/dev/ttyACM0": no such file or directory.

The command failed.

 

Link to comment
20 hours ago, z0ki said:

Tried to install this but I get the below failed error. 

 

docker run
  -d
  --name='OpenFanController'
  --net='bridge'
  -e TZ="Australia/Brisbane"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="DarKnight"
  -e HOST_CONTAINERNAME="OpenFanController"
  -e 'OPENFANCOMPORT'='/dev/ttyACM0'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.webui='http://[IP]:[PORT:3000]'
  -l net.unraid.docker.icon='https://github.com/SasaKaranovic/OpenFanController/blob/master/assets/logo.png?raw=true'
  -p '3210:3000/tcp'
  --device='/dev/ttyACM0'
  --memory=512M 'ghcr.io/sasakaranovic/openfancontroller:release'
WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
bc17432da45ec7d414380d58678601895254edc6385c73aa074ef732387fcf38
docker: Error response from daemon: error gathering device information while adding custom device "/dev/ttyACM0": no such file or directory.

The command failed.

 

 

Do you have OpenFAN Controller connected to your Unraid server? This docker application will not work without the hardware connected.

Link to comment
  • 2 weeks later...
On 2/24/2024 at 3:34 PM, SasaKaranovic said:

Please note: In order to run this app, you will need to have OpenFan Controller physically connected to your  Unraid server. Otherwise the setup will fail.

 

Does this only work with the OpenFan Controller hardware, or will any USB fan controller hardware work?

Link to comment
  • 2 months later...

Thank you for your work on this, will see if this fits my unraid fan needs.  Currently it looks like even just being able to tweak static RPMs will be a bit helpful.

 

I noticed on your project video, that you have other dockers setup to control your fans.

 

Some sort of specific examples would be nice in your documentation. particularly around sensor usage. 

 

Still need to dig more but first problem for me is where do I start for dynamic based on sensor/temp data, even a simplified version of your setup would help jump start and get the ideas flowing.

 

To be honest, I use Unraid specifically because I am lazy, I am fixing stuff for my day job :).  I am not opposed to writing simple scripts or config files, but I personally tend to have a complexity wall for my home server that I just do not pass without a benefit to that laziness.   Example would let me see if for my use, if it would even be worth it.

 

I realize this is your personal project, I don't want to sound demanding or ungrateful.  Just one person's personal input.

 

Again thank you for your work on this, very impressive!

Link to comment

Hey @dandirk thank you for your feedback.

 

I think everyone has a different use-case and different setup, so it's understandable that something that works well for me might not work well for you and vice-versa.

Right now my Unraid server is in my living room, and I'm using OpenFAN to add extra fans to that setup and also to be able to individually control those fans.

But as you noticed, I'm not really setting the fan curves or anything special, it's just turning on specific profiles (ie off, low, hdd, full on) based on what is going on in Unraid.

 

Right now the biggest challenge is reading sensor information reliably on every setup. There are so many different setups, so many variations of hardware and also different ways people are running Unraid...

If you or anyone else is a aware of open-source docker/app/package that works on "every" setup and can easily be integrate into a docker application, please let me know.

It would be relatively easy to then create a simple app that you can tell "When sensor X is at this temperature, set this/these fan/fans to this speed".

 

Also note that while here we are mostly talking about Unraid and OpenFAN community application. Keep in mind that OpenFAN is completely platform agnostic fan controller.

So by design it does not care if you are using Unraid, Linux, Windows, Mac or even no OS at all. It receives a simple API request to set FAN X to target RPM/PWM and it does just that.

Now you can make that request from a shell script, python script, docker container, specific app (ie FanControl), remotely, trough IFTT, HomeAssistant, manually... whichever way works for you, OpenFAN will do what you tell it to do.

 

I think that in the long run this gives people so many options and flexibility. And also the whole thing is open-source open-hardware so anyone can contribute if they want/can.

Personally I build it this way because I don't like buying something and ending up feeling like I really don't own that product or can't use it the way I want to.

 

And I agree with your point that this may not be a complete plug&play solution that requires no effort (at least not right now).

But also I think it's not that hard to interact with. Just as an example with a shell/python script you could read temperature of X and based on that set all/certain fans to target RPM/PWM. Maybe I should start a repository of example scripts that people could use or use as a starting point.

 

I have also been asking the Unraid team to see if there is any way to read temperature readings that are shown in the UI.

Because those should hopefully always work across all setups and is something that probably most people care about. Then it would be easy to poll that information and adjust fan speeds based on that information.

 

Again, thank you for taking the time to provide your honest feedback! :)

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...