<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello Guhan,</p>
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.<br>
<br>
If a temperature sensor has a range of -127 - +128, means y is -127
to +128 and the range of x is 0-255.<br>
By substituting x = 0 and y = -127 (k2 is the decimal precision and
assume in this case as whole nos) implies Bexp = -127.<br>
Similarly substitute x = 255 and y = 128 and M is evaluated as 1. <br>
<br>
Regards,<br>
Tom<br>
<br>
<div class="moz-cite-prefix">On Saturday 10 March 2018 08:01 AM,
guhan balasubramanian wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAMNAJg3dMki4zJhDyAFfJndwo_j8NA7UjTek0LUD3SCMfQwf1w@mail.gmail.com">
<div dir="ltr">Hi,
<div><br>
</div>
<div>According to the IPMI spec, we represent all sensor
readings (Volt, Temp, Amp, etc.) as 1-byte. </div>
<div><br>
</div>
<div>Since we represent them as 1-byte, we use a linearization
formula to convert to actual value as follows:</div>
<div><br>
</div>
<div>y = (M*x + B*10^(k1))*10^(k2)</div>
<div><br>
</div>
<div>where x is the 1-byte value that is filled in the get
sensor reading command.</div>
<div><br>
</div>
<div>We see in the ipmitool example on how an example of 3.36 V
is represented as 1-byte. </div>
<div><a
href="https://computercheese.blogspot.com/2013/10/ipmi-sensor-reading-conversion-formula.html?q=sensor"
moz-do-not-send="true">https://computercheese.blogspot.com/2013/10/ipmi-sensor-reading-conversion-formula.html?q=sensor</a></div>
<div><br>
</div>
<div>Can any one please help on how the values for M, B, k1 and
k2 are populated for each sensor? </div>
<div><br>
</div>
<div>In the openbmc repo, I believe these values are present in
the config.yaml of phosphor-ipmi-sensor-inventory (based on
the following sample). </div>
<div><br>
</div>
<div>
<div>0xF1:</div>
<div> sensorType: 0x01</div>
<div> path: /xyz/openbmc_project/sensors/temperature/temp1</div>
<div> sensorReadingType: 0x01</div>
<div> <b>multiplierM</b>: 511</div>
<div> <b>offsetB</b>: 0</div>
<div> <b>bExp</b>: 0</div>
<div> mutability: Mutability::Write|Mutability::Read</div>
<div> serviceInterface: org.freedesktop.DBus.Properties</div>
<div> readingType: readingData</div>
<div> interfaces:</div>
<div> xyz.openbmc_project.Sensor.Value:</div>
<div> Value:</div>
<div> Offsets:</div>
<div> 0x0:</div>
<div> type: int64_t</div>
</div>
<div>
<table class="gmail-highlight gmail-tab-size
gmail-js-file-line-container"
style="box-sizing:border-box;border-collapse:collapse;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe
UI",Helvetica,Arial,sans-serif,"Apple Color
Emoji","Segoe UI Emoji","Segoe UI
Symbol";font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">
<tbody style="box-sizing:border-box">
<tr style="box-sizing:border-box">
<td id="gmail-LC18" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;color:rgb(36,41,46);word-wrap:normal;white-space:pre">
</td>
</tr>
</tbody>
</table>
<br>
</div>
<div>Thanks,</div>
<div>Guhan</div>
<div><br>
</div>
</div>
</blockquote>
<br>
</body>
</html>