Testing Phosphor-pid-control
Tanous, Ed
ed.tanous at intel.com
Fri Dec 21 05:13:34 AEDT 2018
Assuming you’re using dbus-sensors (which I’m pretty sure you are):
Support for overriding sensor values was recently landed in this commit:
https://gerrit.openbmc-project.xyz/#/c/openbmc/dbus-sensors/+/16177/
Overriding a sensor value with a "fake" sensor reading should be as easy as simply calling SetProperty on the dbus interface.
Example as tested on my system (your path names may vary)
dbus-send --system --print-reply --dest=xyz.openbmc_project.CPUSensor /xyz/openbmc_project/sensors/temperature/Core_1_CPU0 org.freedesktop.DBus.Properties.Set string:xyz.openbmc_project.Sensor.Value string:Value variant:double:1.0
and verify by reading it back out:
dbus-send --system --print-reply --dest=xyz.openbmc_project.CPUSensor /xyz/openbmc_project/sensors/temperature/Core_1_CPU0 org.freedesktop.DBus.Properties.GetAll string:xyz.openbmc_project.Sensor.Value
method return time=1543267812.458169 sender=:1.16 -> destination=:1.153 serial=6398 reply_serial=2
array [
dict entry(
string "MaxValue"
variant double 127
)
dict entry(
string "MinValue"
variant double -128
)
dict entry(
string "Value"
variant double 1
)
]
More information about the openbmc
mailing list