Name Date Size #Lines LOC

..Today-

control/H20-Aug-2024-30,56223,261

cooling-type/H20-Aug-2024-348252

docs/H07-Mar-2021-2,4831,936

evdevpp/H11-May-2023-218135

monitor/H20-Aug-2024-7,6424,861

presence/H20-Aug-2024-4,2792,835

sensor-monitor/H24-Sep-2024-1,7911,071

subprojects/H08-Dec-2023-5236

test/H08-Dec-2023-7956

.clang-formatH A D20-Aug-20243.7 KiB137135

.gitignoreH A D07-Sep-202250 54

LICENSEH A D07-Mar-202111.1 KiB202169

OWNERSH A D13-Oct-20221.6 KiB4944

README.mdH A D24-Sep-20247.4 KiB231158

dbus_paths.hppH A D18-Aug-2022637 208

hwmon_ffdc.cppH A D01-Mar-20243.1 KiB138109

hwmon_ffdc.hppH A D24-Jun-2021341 186

json_config.hppH A D20-Aug-202413 KiB380209

logger.hppH A D25-Aug-20234.2 KiB17697

meson.buildH A D24-Sep-20246.5 KiB217183

meson.optionsH A D24-Sep-20243.7 KiB137108

power_state.hppH A D20-Aug-202411.2 KiB384215

sdbusplus.hppH A D20-Aug-202421.3 KiB585458

sdeventplus.hppH A D01-Jul-20211 KiB4014

utility.hppH A D25-Aug-20233.1 KiB12389

README.md

1# Repository Details
2
3## Table of Contents
4
5- [Overview](#overview)
6- [Building](#building)
7- [Contents](#contents)
8
9## Overview
10
11The phosphor-fan-presence repository provides a set of thermal related
12applications that control and monitor the cooling of a system using fans. Each
13application independently controls or monitors an area related to the thermal
14status of a system that uses fans as its primary cooling mechanism. Since each
15application independent in its functionality, they can individually be included
16in a BMC image at _configure_ time to provide only the functionality needed by a
17user's machine.
18
19## Building
20
21By default, runtime JSON configuration file(s) are used for each application.
22The use of YAML configuration file(s) has been deprecated in favor of the JSON
23method. Support for the use of YAML based configuration files may be removed
24once all applications completely support getting their configuration from JSON
25file(s) at runtime.
26
27The following applications are built by default:
28
29- [Fan Control](#fan-control)
30
31  - To disable from building, use the `-Dcontrol-service=disabled` meson option:
32
33    meson build -Dcontrol-service=disabled
34
35- [Fan Presence Detection](#fan-presence-detection)
36
37  - To disable from building, use the `-Dpresence-service=disabled` meson
38    option:
39
40    meson build -Dpresence-service=disabled
41
42- [Fan Monitoring](#fan-monitoring)
43
44  - To disable from building, use the `-Dmonitor-service=disabled` meson option:
45
46    meson build -Dmonitor-service=disabled
47
48- [Sensor Monitoring](#sensor-monitoring)
49
50  - To disable from building, use the `-Dsensor-monitor-service=disabled` meson
51    option:
52
53    meson build -Dsensor-monitor-service=disabled
54
55The following applications must be enabled at _configure_ time to be built:
56
57- [Cooling Type](#cooling-type)
58
59  - To enable building this, set the `-Dcooling-type-service=enable` meson
60    option:
61
62    meson build -Dcooling-type-service=enabled
63
64### YAML (Deprecated)
65
66The location of the YAML configuration file(s) are provided at _configure_ time
67to each application thru environment variables. The default YAML configuration
68file(s) used are the examples found within each application's example directory.
69See each application below ([Contents](#contents)) for more information on how
70to set their specific _configure_ time options, including the location of the
71YAML configuration file(s).
72
73Meson defaults to JSON based runtime configuration, so to select the YAML
74configuration use the '-Djson-config=disabled' option when building:
75
761. meson build -Djson-config=disabled
772. ninja -C build
78
79### JSON
80
81See each application below ([Contents](#contents)) for more information on how
82to set their specific _configure_ time options and details on how to configure
83each using JSON.
84
85As JSON based runtime configuration is the default option, no extra options are
86required to build:
87
881. meson build
892. ninja -C build
90
91**Note: Features/Restrictions of applications in this package that are only
92supported using the JSON based configuration are listed below:**
93
94#### Features
95
96- [Fan Presence Detection](#fan-presence-detection)
97  - Error logging for missing fans
98- [Fan Monitoring](#fan-monitoring)
99  - Error logging for nonfunctional fans
100  - System power off due to missing or nonfunctional fans
101- [Sensor Monitoring](#sensor-monitoring) - Only supports JSON
102
103## Contents
104
105### Fan Control
106
107Controls the fans based on a set of events that are configured using a group of
108D-Bus objects and one-or-more triggers that run a configured set of actions.
109These events are meant to be configured to handle all aspects of controlling the
110fans within a system. Fans are added to zones that then have events configured
111against the zone to control the fans based on the state of any sized group of
112D-Bus objects.
113
114- Available meson options:
115  - `control-persist-root-path` - Base location to persist zone property states
116    on the BMC
117    - Default = '/var/lib/phosphor-fan-presence/control'
118
119#### YAML (Deprecated)
120
121- Available meson options:
122  - `fan-def-yaml-file` - Build time fan configuration file
123    - Default = ['control/example/fans.yaml'](control/example/fans.yaml)
124  - `fan-zone-yaml-file` - Build time zone configuration file
125    - Default = ['control/example/zones.yaml'](control/example/zones.yaml)
126  - `fan-events-yaml-file` - Build time events configuration file
127    - Default = ['control/example/events.yaml'](control/example/events.yaml)
128  - `zone-conditions-yaml-file` Build time zone conditions configuration file
129    - Default =
130      ['control/example/zone_conditions.yaml'](control/example/zone_conditions.yaml)
131
132[Example](control/example/)
133
134#### JSON
135
136[README](docs/control/README.md)
137
138---
139
140### Fan Presence Detection
141
142Monitors the presence state of fans using GPIOs, nonzero tach feedbacks, or a
143combination of both. This updates a configured location of a fan D-Bus object's
144`Present` property according to the state of the methods used to detect the
145fan's presence.
146
147- Available meson options:
148  - `num-presence-log-entries` - Maximum number of entries in the message log
149    - Default = 50
150
151#### YAML (Deprecated)
152
153- Available meson options:
154  - `presence-config` - Location of the config file
155    - Default = ['presence/example/example.yaml'](presence/example/example.yaml)
156
157Example: [example.yaml](presence/example/example.yaml)
158
159#### JSON
160
161[README](docs/presence/README.md)
162
163---
164
165### Fan Monitoring
166
167Monitors the functional state of fans by comparing the fan feedback speed
168against the current target, applying any configured adjustments to the target
169due to fan hardware properties. In addition to updating the configured location
170of a fan D-Bus object's `Functional` property in inventory, actions can be
171configured\* to be taken based on the state of fans, i.e.) creating event logs
172or powering off the system.
173
174Another feature that can be configured is the ability to cancel the monitoring
175of a set of fans that may be necessary to workaround designs of the fan hardware
176and/or controller used.
177
178\*_Actions to be taken based on the state of fans is only available using a JSON
179based configuration_
180
181- Available meson options:
182  - `num-monitor-log-entries` - Maximum number of entries in the message log
183    - Default = 75
184
185#### YAML (Deprecated)
186
187- Available meson options:
188  - `fan-monitor-yaml-file` - Location of the config file
189    - Default = ['monitor/example/monitor.yaml'](monitor/example/monitor.yaml)
190
191Example: [monitor.yaml](monitor/example/monitor.yaml)
192
193#### JSON
194
195[README](docs/monitor/README.md)
196
197---
198
199### Cooling Type
200
201Sets the `AirCooled` and `WaterCooled` property on the
202`xyz.openbmc_project.Inventory.Decorator.CoolingType` interface in inventory
203based on a given GPIO. No configuration files are used with this application as
204it is command line driven.
205
206---
207
208### Sensor Monitoring
209
210Takes actions, such as powering off the system, based on sensor thresholds and
211values.
212
213- Available meson options:
214  - `sensor-monitor-persist-root-path` - Base location to persist sensor
215    monitoring data
216    - Default = '/var/lib/phosphor-fan-presence/sensor-monitor'
217  - `sensor-monitor-hard-shutdown-delay` - Milliseconds to delay the alarm hard
218    shutdown
219    - Default = 23000
220  - `sensor-monitor-soft-shutdown-delay` - Milliseconds to delay the alarm soft
221    shutdown
222    - Default = 900000
223  - `use-host-power-state` - Use the host state for the power state as opposed
224    to the PGOOD state.
225  - `skip-power-checking` - Skip power state checking while sending threshold
226    alarm event.
227
228[README](docs/sensor-monitor/README.md)
229
230---
231