Sensor readings as 1-byte
Tom Joseph
tomjose at linux.vnet.ibm.com
Sun Mar 11 04:45:05 AEDT 2018
Hello Guhan,
The updated sensor-example.yaml has the Rexp field as well. These values
are calculated based on the minimum and maximum value of the sensor.
If a temperature sensor has a range of -127 - +128, means y is -127 to
+128 and the range of x is 0-255.
By substituting x = 0 and y = -127 (k2 is the decimal precision and
assume in this case as whole nos) implies Bexp = -127.
Similarly substitute x = 255 and y = 128 and M is evaluated as 1.
Regards,
Tom
On Saturday 10 March 2018 08:01 AM, guhan balasubramanian wrote:
> Hi,
>
> According to the IPMI spec, we represent all sensor readings (Volt,
> Temp, Amp, etc.) as 1-byte.
>
> Since we represent them as 1-byte, we use a linearization formula to
> convert to actual value as follows:
>
> y = (M*x + B*10^(k1))*10^(k2)
>
> where x is the 1-byte value that is filled in the get sensor reading
> command.
>
> We see in the ipmitool example on how an example of 3.36 V is
> represented as 1-byte.
> https://computercheese.blogspot.com/2013/10/ipmi-sensor-reading-conversion-formula.html?q=sensor
>
> Can any one please help on how the values for M, B, k1 and k2 are
> populated for each sensor?
>
> In the openbmc repo, I believe these values are present in the
> config.yaml of phosphor-ipmi-sensor-inventory (based on the following
> sample).
>
> 0xF1:
> sensorType: 0x01
> path: /xyz/openbmc_project/sensors/temperature/temp1
> sensorReadingType: 0x01
> *multiplierM*: 511
> *offsetB*: 0
> *bExp*: 0
> mutability: Mutability::Write|Mutability::Read
> serviceInterface: org.freedesktop.DBus.Properties
> readingType: readingData
> interfaces:
> xyz.openbmc_project.Sensor.Value:
> Value:
> Offsets:
> 0x0:
> type: int64_t
>
>
> Thanks,
> Guhan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20180310/5387d346/attachment.html>
More information about the openbmc
mailing list