We have discontinued this forum and moved support tickets to the GitHub issue tracker. More info

Feature request: command line interface

Control fans on Apple hardware: iMacs, Macbooks, etc

Moderator: Steven

Post Reply
fogr4
Posts: 2
Joined: 30 Jan 2014, 00:31

Feature request: command line interface

Post by fogr4 »

It would be nice to be able to run Macs Fan Control from the command line. That way one could remote ssh login to the computer and to monitor temperature, and possibly also control the fan speed.

I realize that allowing a remote login to control fan speed could potentially be a serious security threat, so perhaps that feature should be limited to only a local terminal session.

Being able to view temperature through a remote login would be a great feature.
User avatar
Steven
CrystalIDEA Developer
Posts: 2294
Joined: 21 Dec 2009, 11:48
Location: CrystalIDEA headquarters
Contact:

Re: Feature request: command line interface

Post by Steven »

That's a great idea, fogr4

I'm putting this to the TODO list.
fogr4
Posts: 2
Joined: 30 Jan 2014, 00:31

Re: Feature request: command line interface

Post by fogr4 »

Steve,

Hey, that's great.

I don't want to be too pushy ... but I assume the TODO list is probably lengthy. When do you think this might happen?

thanks.
User avatar
Steven
CrystalIDEA Developer
Posts: 2294
Joined: 21 Dec 2009, 11:48
Location: CrystalIDEA headquarters
Contact:

Re: Feature request: command line interface

Post by Steven »

fogr4
Sorry, can't say. Thought the feature is not difficult to implement so it might appear soon.
FanofMacsFan
Posts: 2
Joined: 28 Oct 2014, 09:05

Re: Feature request: command line interface

Post by FanofMacsFan »

If CrystaLIdea won't mind this POST, there is a command line utility (as well as source code), here:
http://www.derman.com/iMac-Fan-Control


Namely:
1. smc -- A terminal exectutable
2. sensors.app -- Provides Feedback of readings

Example below shows it in use.
Last two lines are setting HDD Fan on iMac to a constant Speed of 2500 (i.e. forced).

bash-3.2$ sudo ./smc
Apple System Management Control (SMC) tool 0.01
Usage:
./smc [options]
-f : fan info decoded
-h : help
-k <key> : key to manipulate
-l : list all keys and values
-r : read the value of a key
-w <value> : write the specified value to a key
-v : version

bash-3.2$ sudo ./smc -f
Total fans in system: 3

Fan #0:
Actual speed : 2226
Minimum speed: 800
Maximum speed: 4800
Safe speed : 0
Target speed : 4800
Mode : auto

Fan #1:
Actual speed : 3074
Minimum speed: 2866
Maximum speed: 2866
Safe speed : 0
Target speed : 3072
Mode : forced

Fan #2:
Actual speed : 1898
Minimum speed: 3600
Maximum speed: 3600
Safe speed : 0
Target speed : 3600
Mode : auto

bash-3.2$ sudo ./smc -k "FS! " -w 0002
bash-3.2$ sudo ./smc -k F1Tg -w 2500
sashok2k
Posts: 1
Joined: 01 Sep 2015, 06:28

Re: Feature request: command line interface

Post by sashok2k »

Really need this feature on bootcamp.
For different tasks i need setup different settings, doing this from UI tooks a lot time.
FanofMacsFan
Posts: 2
Joined: 28 Oct 2014, 09:05

Re: Feature request: command line interface

Post by FanofMacsFan »

This may be of interest when running bootcamp with Windows:

1) http://www.howtogeek.com/50786/using-sr ... ws-service

Create a Handle:
sc create MacFan Displayname= "MacFan" binPath= "srvstart svc MacFan -w c:\MacFan\MacFan.exe 2500 2500 2500" start= auto
SC DESCRIPTION MacFan "iMac Fans”

From command line:
srvstart cmd window_title [ options ... ] program [ program_parameters ... ]
srvstart cmd MacFan -w c:\MacFan\MacFan.exe 2500 2500 2500

As a service to be passed in the SC create:
srvstart [ svc ] service_name [ options ... ] program [ program_parameters ... ]
srvstart svc MacFan -w c:\MacFan\MacFan.exe 2500 2500 2500
Post Reply