Query Sensor

Mike Jones proclivis at gmail.com
Wed Jan 12 04:16:58 AEDT 2022


This is how to do it:

dbus-send --system --print-reply \
--dest=xyz.openbmc_project.Hwmon-5a446562b1a2e55ef11da905907088a187a66b71eb7a1f29187594c05bb8fd9a.Hwmon1 \
/xyz/openbmc_project/sensors/temperature/lm75temp \
org.freedesktop.DBus.Properties.Get string:xyz.openbmc_project.Sensor.Value string:Value \
double:

It is not clear to me why the second parameter string:Value

I guessed on that and it works. Perhaps xyz…Sensor.Value is the Property name, and properties have values, so the second parameter says get the Value of a property whose name ends in .Value.

To test that, I tried string:MaxValue, and that works.

I confirmed with this:

busctl introspect xyz.openbmc_project.Hwmon-5a446562b1a2e55ef11da905907088a187a66b71eb7a1f29187594c05bb8fd9a.Hwmon1 /xyz/openbmc_project/sensors/temperature/lm75temp

A very useful command.

Also useful:

dbus-send --system --print-reply \
--dest=xyz.openbmc_project.ObjectMapper /\
xyz/openbmc_project/object_mapper \
xyz.openbmc_project.ObjectMapper.GetSubTree \
string:"/" int32:0 array:string:"xyz.openbmc_project.Sensor.Value"


Mike

Sent from my iPad

> On Jan 10, 2022, at 4:50 PM, Ed Tanous <edtanous at google.com> wrote:
> On Mon, Jan 10, 2022 at 3:47 PM Mike Jones <proclivis at gmail.com> wrote:
>> 
>> Hi,
>> 
>> I could not find an example of a sensor query in the docs. I assume something like this:
>> 
>> dbus-send --system --print-reply \
>> 
>> --dest=xyz.openbmc_project.Hwmon-5a446562b1a2e55ef11da905907088a187a66b71eb7a1f29187594c05bb8fd9a.Hwmon1 \
>> 
>> /xyz/openbmc_project/sensors/temperature/lm75temp
>> 
>> xyz.openbmc_project.Sensor.Property.Get xyz.openbmc_project.Sensor.Value \
>> 
>> double:
> 
> I don't have an example offhand, but the interface you're looking for
> in the bolded area is
> org.freedesktop.DBus.Properties.Get
> 
> Stack overflow for essentially the same question with an example:
> https://stackoverflow.com/questions/48648952/set-get-property-using-dbus-send
> 
>> 
>> With the bold interface replaced with something correct.
>> 
>> Can some one give me an example, and a url about how to query properties?
>> 
>> Mike
>> 
>> Sent from my iPad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20220111/6524f47e/attachment-0001.htm>


More information about the openbmc mailing list