openbmc/phosphor-host-ipmid

ipmitool dcmi power reading do not work

hieuhuynh-ampere opened this issue · 1 comments

Hi,

The command dcmi power reading return zero value:
$ ipmitool dcmi power reading

Instantaneous power reading:                     0 Watts
Minimum during sampling period:                  0 Watts
Maximum during sampling period:                  0 Watts
Average power reading over sample period:        0 Watts
IPMI timestamp:                           Thu Jan  1 00:00:00 1970
Sampling period:                          00000000 Seconds.
Power reading state is:                   deactivated

By adding the power_reading.json with the below content to support power reading:

{
  "path": "/xyz/openbmc_project/sensors/power/total_power"
}

And some modify in the source code, now can get the power reading:
$ ipmitool dcmi power reading

Instantaneous power reading:                   360 Watts
Minimum during sampling period:                360 Watts
Maximum during sampling period:                360 Watts
Average power reading over sample period:      360 Watts
IPMI timestamp:                           Thu Jan  1 00:00:00 1970
Sampling period:                          00000000 Seconds.
Power reading state is:                   deactivated

The issue is the total_power return with the double value, while the ipmitool will report the power reading value with unsigned short value. That way the result always is an integer type.

  1. How does dcmi power reading adapt with ipmitool?
  2. Currently, the Power reading state always returns with the deactivated value. The phosphor-host-ipmid does not handle it.
    How to support the Power reading state?

Thanks,

where should we add power_reading.json ?