1# Fan Control tool
2
3A tool that enables a user to view the status of a system in regard to fan
4control including the ability to manually set the fans to a desired RPM (or PWM
5if supported by the system). This tool has been tested against systems utilizing
6the phosphor-fan-presence repository set of fan applications (i.e. romulus,
7witherspoon, etc...) and is not warranted to work on systems using some other
8set of BMC fan applications.
9
10## Intention
11
12The intention of this tool is to temporarily stop the automatic fan control
13algorithm and allow the user to manually set the fans within the system chassis
14to a given target. Once a user no longer has a need to manually control the
15fans, the resume operation re-enables and restarts the phosphor-fan-control
16service. The status command provides a simple way to get the status of the fans
17along with the the main system states and fan control systemd service, while the
18reload command is available to commit JSON changes made to config files
19(YAML-based configurations are not reloadable).
20
21Note: In the case where a system does not have an active fan control algorithm
22enabled yet, an intended safe fan target should be set prior to resuming.
23
24## Usage
25
26```
27NAME
28  fanctl - Manually control, get fan tachs, view status, reload config,
29  and resume automatic control of all fans within a chassis.
30
31SYNOPSIS
32  fanctl [OPTION]
33
34OPTIONS
35set <TARGET> [TARGET SENSOR LIST]
36    <TARGET>
37        - RPM/PWM target to set the fans
38    [TARGET SENSOR LIST]
39        - space-delimited list of target sensors to set
40get
41    - Get the current fan target and feedback speeds for all rotors
42status
43    - Get the full system status in regard to fans
44reload
45    - Reload phosphor-fan configuration JSON files (YAML configuration not
46      supported)
47resume
48    - Resume automatic fan control
49    * Note: In the case where a system does not have an active fan control
50      algorithm enabled yet, an intended safe fan target should be set
51      prior to resuming
52dump
53    - Tell fan control to dump its caches and flight recorder.
54query_dump
55    - Provides arguments to search the dump file.
56help
57    - Display this help and exit
58```
59
60## Examples:
61
62- Set all fans to a target value (The tool determines whether the machine is
63  using RPM or PWM fan speeds, and sets them to the value provided):
64
65  > fanctl set 10500
66
67- Set only fan_0, fan1_0, fan2_0 to target 8500:
68
69  > fanctl set 8500 fan0_0 fan1_0 fan2_0
70
71- Resume automatic fan control:
72
73  > fanctl resume
74
75- Get the current fan target and feedback speeds for all rotors:
76
77  > fanctl get
78
79  ```
80  > fanctl get
81  TARGET SENSOR    TARGET(RPM)   FEEDBACK SENSOR    FEEDBACK(RPM)
82  ===============================================================
83  fan0_0             10000            fan0_0            7020
84                                      fan0_1           10000
85  fan1_0              2300            fan1_0            2192
86                                      fan1_1            2300
87  fan2_0              2300            fan2_0            2192
88                                      fan2_1            2300
89  fan3_0              3333            fan3_0            2839
90                                      fan3_1            3333
91  fan4_0              3333            fan4_0            2839
92                                      fan4_1            3333
93  fan5_0             10000            fan5_0            7020
94                                      fan5_1           10000
95  ```
96
97- Get the full system status in regard to fans:
98
99  > fanctl status
100
101  ```
102  Fan Control Service State   : loaded, inactive(dead)
103
104  CurrentBMCState     : xyz.openbmc_project.State.BMC.BMCState.Ready
105  CurrentPowerState   : xyz.openbmc_project.State.Chassis.PowerState.Off
106  CurrentHostState    : xyz.openbmc_project.State.Host.HostState.Off
107
108   FAN        TARGET(RPM)   FEEDBACK(RPM)  PRESENT     FUNCTIONAL
109  ===============================================================
110   fan0         10000        7020/10000      true         true
111   fan1         10000        7020/10000      true         true
112   fan2         10000        7020/10000      true         true
113   fan3         10000        7020/10000      true         true
114   fan4         10000        7020/10000      true         true
115   fan5         10000        7020/10000      true         true
116
117  ```
118
119- Reload all json config files in the order each is found: override location,
120  given `Compatible` interface location, default location.
121
122  > fanctl reload
123
124- Tell the fan control daemon to dump debug data to /tmp/fan_control_dump.json
125
126  > fanctl dump
127
128- Print all temperatures in the fan control cache after running 'fanctl dump':
129
130  > fanctl query_dump -s objects -n sensors/temperature -p Value
131
132- Print every interface and property in the Ambient temp sensor's cache entry:
133
134  > fanctl query_dump -s objects -n Ambient
135
136- Print the flight recorder after running 'fanctl dump':
137  > fanctl query_dump -s flight_recorder
138