{"id":18368623,"url":"https://github.com/openbmc/dbus-sensors","last_synced_at":"2025-04-06T16:15:40.728Z","repository":{"id":41039892,"uuid":"159212910","full_name":"openbmc/dbus-sensors","owner":"openbmc","description":"D-Bus configurable sensor scanning applications","archived":false,"fork":false,"pushed_at":"2024-10-30T00:39:49.000Z","size":13731,"stargazers_count":27,"open_issues_count":15,"forks_count":44,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-10-30T02:52:24.649Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openbmc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-26T18:15:22.000Z","updated_at":"2024-10-30T00:39:53.000Z","dependencies_parsed_at":"2023-12-22T06:34:31.197Z","dependency_job_id":"3086f68c-46ec-47ca-9afe-42e90e627575","html_url":"https://github.com/openbmc/dbus-sensors","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openbmc%2Fdbus-sensors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openbmc%2Fdbus-sensors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openbmc%2Fdbus-sensors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openbmc%2Fdbus-sensors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openbmc","download_url":"https://codeload.github.com/openbmc/dbus-sensors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509238,"owners_count":20950232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T23:26:45.907Z","updated_at":"2025-04-06T16:15:40.697Z","avatar_url":"https://github.com/openbmc.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dbus-sensors\n\ndbus-sensors is a collection of sensor applications that provide the\nxyz.openbmc_project.Sensor collection of interfaces. They read sensor values\nfrom hwmon, d-bus, or direct driver access to provide readings. Some advance\nnon-sensor features such as fan presence, pwm control, and automatic cpu\ndetection (x86) are also supported.\n\n## key features\n\n- runtime re-configurable from d-bus (entity-manager or the like)\n\n- isolated: each sensor type is isolated into its own daemon, so a bug in one\n  sensor is unlikely to affect another, and single sensor modifications are\n  possible\n\n- async single-threaded: uses sdbusplus/asio bindings\n\n- multiple data inputs: hwmon, d-bus, direct driver access\n\n## dbus interfaces\n\nA typical dbus-sensors object support the following dbus interfaces:\n\n```text\nPath        /xyz/openbmc_project/sensors/\u003ctype\u003e/\u003csensor_name\u003e\n\nInterfaces  xyz.openbmc_project.Sensor.Value\n            xyz.openbmc_project.Sensor.Threshold.Critical\n            xyz.openbmc_project.Sensor.Threshold.Warning\n            xyz.openbmc_project.State.Decorator.Availability\n            xyz.openbmc_project.State.Decorator.OperationalStatus\n            xyz.openbmc_project.Association.Definitions\n\n```\n\nSensor interfaces collection are described\n[here](https://github.com/openbmc/phosphor-dbus-interfaces/tree/master/yaml/xyz/openbmc_project/Sensor).\n\nConsumer examples of these interfaces are\n[Redfish](https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/sensors.hpp),\n[Phosphor-Pid-Control](https://github.com/openbmc/phosphor-pid-control),\n[IPMI SDR](https://github.com/openbmc/phosphor-host-ipmid/blob/master/dbus-sdr/sensorcommands.cpp).\n\n## Reactor\n\ndbus-sensor daemons are [reactors](https://github.com/openbmc/entity-manager)\nthat dynamically create and update sensors configuration when system\nconfiguration gets updated.\n\nUsing asio timers and async calls, dbus-sensor daemons read sensor values and\ncheck thresholds periodically. PropertiesChanged signals will be broadcasted for\nother services to consume when value or threshold status change. OperationStatus\nis set to false if the sensor is determined to be faulty.\n\nA simple sensor example can be found\n[here](https://github.com/openbmc/entity-manager/blob/master/docs/my_first_sensors.md).\n\n## configuration\n\nSensor devices are described using Exposes records in configuration file. Name\nand Type fields are required. Different sensor types have different fields.\nRefer to entity manager\n[schema](https://github.com/openbmc/entity-manager/blob/master/schemas/legacy.json)\nfor complete list.\n\n## sensor documentation\n\n- [ExternalSensor](https://github.com/openbmc/docs/blob/master/designs/external-sensor.md)\n  virtual sensor\n\n## Sensor Type Documentation\n\n### ADC Sensors\n\nADC sensors are sensors based on an Analog to Digital Converter. They are read\nvia the Linux kernel Industrial I/O subsystem (IIO).\n\nOne of the more common use cases within OpenBMC is for reading these sensors\nfrom the ADC on the Aspeed ASTXX cards.\n\nTo utilize ADC sensors feature within OpenBMC you must first define and enable\nit within the kernel device tree.\n\nWhen using a common OpenBMC device like the AST2600 you will find a \"adc0\" and\n\"adc1\" section in the aspeed-g6.dtsi file. These are disabled by default so in\nyour system-specific dts you would enable and configure what you want with\nsomething like this:\n\n```text\niio-hwmon {\n    compatible = \"iio-hwmon\";\n    io-channels = \u003c\u0026adc0 0\u003e;\n    ...\n}\n\n\u0026adc0 {\n    status = \"okay\";\n    ...\n};\n\n\u0026adc1 {\n    status = \"okay\";\n    ...\n};\n```\n\n**Note** that this is not meant to be an exhaustive list on the nuances of\nconfiguring a device tree but really to point users in the general direction.\n\nYou will then create an entity-manager configuration file that is of type \"ADC\"\nA very simple example would like look this:\n\n```text\n            \"Index\": 0,\n            \"Name\": \"P12V\",\n            \"PowerState\": \"Always\",\n            \"ScaleFactor\": 1.0,\n            \"Type\": \"ADC\"\n```\n\nWhen your system is booted, a \"in0_input\" file will be created within the hwmon\nsubsystem (/sys/class/hwmon/hwmonX). The adcsensor application will scan d-bus\nfor any ADC entity-manager objects, look up their \"Index\" value, and try to\nmatch that with the hwmon inY_input files. When it finds a match it will create\na d-bus sensor under the xyz.openbmc_project.ADCSensor service. The sensor will\nbe periodically updated based on readings from the hwmon file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenbmc%2Fdbus-sensors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenbmc%2Fdbus-sensors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenbmc%2Fdbus-sensors/lists"}