blob: 2b6a463b3c23f0fb738501664ffd4bbaa3fede9d [file] [log] [blame] [view]
James Feist2a408b92019-01-31 10:02:07 -08001# dbus-sensors
2
3dbus-sensors is a collection of sensor applications that provide the
4xyz.openbmc_project.Sensor collection of interfaces. They read sensor values
5from hwmon, d-bus, or direct driver access to provide readings. Some advance
6non-sensor features such as fan presence, pwm control, and automatic cpu
7detection (x86) are also supported.
8
9## key features
10
Patrick Williams1e384252022-12-08 06:12:58 -060011- runtime re-configurable from d-bus (entity-manager or the like)
James Feist2a408b92019-01-31 10:02:07 -080012
Patrick Williams1e384252022-12-08 06:12:58 -060013- isolated: each sensor type is isolated into its own daemon, so a bug in one
14 sensor is unlikely to affect another, and single sensor modifications are
15 possible
James Feist2a408b92019-01-31 10:02:07 -080016
Patrick Williams1e384252022-12-08 06:12:58 -060017- async single-threaded: uses sdbusplus/asio bindings
James Feist2a408b92019-01-31 10:02:07 -080018
Patrick Williams1e384252022-12-08 06:12:58 -060019- multiple data inputs: hwmon, d-bus, direct driver access
Josh Lehan0947d7c2021-03-30 15:04:22 -070020
Zhikui Rene1a18f32021-11-05 14:47:40 -070021## dbus interfaces
22
23A typical dbus-sensors object support the following dbus interfaces:
24
25```
26Path /xyz/openbmc_project/sensors/<type>/<sensor_name>
27
28Interfaces xyz.openbmc_project.Sensor.Value
29 xyz.openbmc_project.Sensor.Threshold.Critical
30 xyz.openbmc_project.Sensor.Threshold.Warning
31 xyz.openbmc_project.State.Decorator.Availability
32 xyz.openbmc_project.State.Decorator.OperationalStatus
33 xyz.openbmc_project.Association.Definitions
34
35```
Zhikui Rene1a18f32021-11-05 14:47:40 -070036
Patrick Williams1e384252022-12-08 06:12:58 -060037Sensor interfaces collection are described
38[here](https://github.com/openbmc/phosphor-dbus-interfaces/tree/master/yaml/xyz/openbmc_project/Sensor).
39
40Consumer examples of these interfaces are
41[Redfish](https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/sensors.hpp),
42[Phosphor-Pid-Control](https://github.com/openbmc/phosphor-pid-control),
43[IPMI SDR](https://github.com/openbmc/phosphor-host-ipmid/blob/master/dbus-sdr/sensorcommands.cpp).
44
Zhikui Rene1a18f32021-11-05 14:47:40 -070045## Reactor
Patrick Williams1e384252022-12-08 06:12:58 -060046
Zhikui Rene1a18f32021-11-05 14:47:40 -070047dbus-sensor daemons are [reactors](https://github.com/openbmc/entity-manager)
Patrick Williams1e384252022-12-08 06:12:58 -060048that dynamically create and update sensors configuration when system
49configuration gets updated.
Zhikui Rene1a18f32021-11-05 14:47:40 -070050
Patrick Williams1e384252022-12-08 06:12:58 -060051Using asio timers and async calls, dbus-sensor daemons read sensor values and
52check thresholds periodically. PropertiesChanged signals will be broadcasted for
53other services to consume when value or threshold status change. OperationStatus
54is set to false if the sensor is determined to be faulty.
Zhikui Rene1a18f32021-11-05 14:47:40 -070055
Patrick Williams1e384252022-12-08 06:12:58 -060056A simple sensor example can be found
57[here](https://github.com/openbmc/entity-manager/blob/master/docs/my_first_sensors.md).
Zhikui Rene1a18f32021-11-05 14:47:40 -070058
59## configuration
Patrick Williams1e384252022-12-08 06:12:58 -060060
61Sensor devices are described using Exposes records in configuration file. Name
62and Type fields are required. Different sensor types have different fields.
63Refer to entity manager
64[schema](https://github.com/openbmc/entity-manager/blob/master/schemas/legacy.json)
65for complete list.
66
Josh Lehan0947d7c2021-03-30 15:04:22 -070067## sensor documentation
68
Patrick Williams1e384252022-12-08 06:12:58 -060069- [ExternalSensor](https://github.com/openbmc/docs/blob/master/designs/external-sensor.md)
70 virtual sensor