xref: /openbmc/dbus-sensors/README.md (revision 2049bd26)
1# 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
11-   runtime re-configurable from d-bus (entity-manager or the like)
12
13-   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
16
17-   async single-threaded: uses sdbusplus/asio bindings
18
19-   multiple data inputs: hwmon, d-bus, direct driver access
20
21## 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```
36Sensor interfaces collection are described [here](https://github.com/openbmc/phosphor-dbus-interfaces/tree/master/yaml/xyz/openbmc_project/Sensor).
37
38Consumer examples of these interfaces are [Redfish](https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/sensors.hpp), [Phosphor-Pid-Control](https://github.com/openbmc/phosphor-pid-control), [IPMI SDR](https://github.com/openbmc/phosphor-host-ipmid/blob/master/dbus-sdr/sensorcommands.cpp).
39## Reactor
40dbus-sensor daemons are [reactors](https://github.com/openbmc/entity-manager)
41that dynamically create and update sensors configuration when
42system configuration gets updated.
43
44Using asio timers and async calls, dbus-sensor daemons read sensor values and check thresholds periodically.
45PropertiesChanged signals will be broadcasted for other services to consume when
46value or threshold status change.
47OperationStatus is set to false if the sensor is determined to be faulty.
48
49A simple sensor example can be found [here](https://github.com/openbmc/entity-manager/blob/master/docs/my_first_sensors.md).
50
51## configuration
52Sensor devices are described using Exposes records in configuration file.
53Name and Type fields are required. Different sensor types have different fields.
54Refer to entity manager [schema](https://github.com/openbmc/entity-manager/blob/master/schemas/legacy.json) for complete list.
55## sensor documentation
56
57-   [ExternalSensor](https://github.com/openbmc/docs/blob/master/designs/external-sensor.md)
58    virtual sensor
59