All of lore.kernel.org
 help / color / mirror / Atom feed
* Query Sensor
@ 2022-01-10 23:47 Mike Jones
  2022-01-10 23:50 ` Ed Tanous
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Jones @ 2022-01-10 23:47 UTC (permalink / raw)
  To: OpenBMC Maillist

[-- Attachment #1: Type: text/plain, Size: 543 bytes --]

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:

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

[-- Attachment #2: Type: text/html, Size: 1659 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Query Sensor
  2022-01-10 23:47 Query Sensor Mike Jones
@ 2022-01-10 23:50 ` Ed Tanous
  2022-01-11  0:07   ` Mike
  0 siblings, 1 reply; 9+ messages in thread
From: Ed Tanous @ 2022-01-10 23:50 UTC (permalink / raw)
  To: Mike Jones; +Cc: OpenBMC Maillist

On Mon, Jan 10, 2022 at 3:47 PM Mike Jones <proclivis@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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Query Sensor
  2022-01-10 23:50 ` Ed Tanous
@ 2022-01-11  0:07   ` Mike
  0 siblings, 0 replies; 9+ messages in thread
From: Mike @ 2022-01-11  0:07 UTC (permalink / raw)
  To: Ed Tanous; +Cc: OpenBMC Maillist

Ed,

Ok, now I feel dumb. I assumed it was obmc/redfish, not generic.

Thanks,

Mike

Sent from my iPhone

> On Jan 10, 2022, at 4:50 PM, Ed Tanous <edtanous@google.com> wrote:
> 
> On Mon, Jan 10, 2022 at 3:47 PM Mike Jones <proclivis@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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Query Sensor
  2022-01-13 21:16       ` Mike Jones
@ 2022-01-28 18:30         ` Ed Tanous
  0 siblings, 0 replies; 9+ messages in thread
From: Ed Tanous @ 2022-01-28 18:30 UTC (permalink / raw)
  To: Mike Jones; +Cc: Ed Tanous, OpenBMC Maillist

On Thu, Jan 13, 2022 at 1:16 PM Mike Jones <proclivis@gmail.com> wrote:
>
> Ed,
>
> What translates the redfish query into a dbus query?

The code in bmcweb.  Look in the redfish-core folder for the redfish
specific bits.

>
> Mike
>
> Sent from my iPad
>
> On Jan 11, 2022, at 7:04 PM, Ed Tanous <ed@tanous.net> wrote:
>
> 
>
>
> On Tue, Jan 11, 2022 at 9:53 AM Mike Jones <proclivis@gmail.com> wrote:
>>
>> Ed,
>>
>> So to be sure I understand, dbus-sensors implements the dbus services for each sensor type, and the requests I made were serviced by one of these.
>
>
> Correct.
>
>>
>>
>> The interface is defined by yaml files in phosphor-dbus-interfaces.
>
>
> Yep.
>
>>
>>
>> phosphor-dbus- interfaces generates c++ base classes, and dbus-sensors probably have c++ classes inheriting from them.
>
>
>
> For various technical and social reasons which I’ve detailed in mail to this list in the past, dbus-sensors doesn’t depend directly on phosphor-dbus-interfaces, nor rely on the generated code. It instead generates code from c++ template expansion in sdbusplus.
>
>>
>>
>> These interfaces are not Redfish interfaces.
>
>
> Correct.
>
>>
>>
>> When WebUI fetches sensor values, is it using these interfaces, or is there another Redfish layer involved that translates the query? Or perhaps Redfish only matters for things like a PSU?
>
>
>
> Depends on which webui you’re talking about, there are two.
>
> Phosphor-webui (ie the “old” one) goes directly to dbus through the rest-dbus abstraction in bmcweb.  This was very good for initial prototyping (aside from a port to c++, the code largely hasn’t changed since it was written) but not great at keeping a consistent or standardized API.
>
> Webui-vue (ie, the new one) relies on Redfish directly, which in-effect makes a very nice Redfish gui, and minimizes the chance that the dbus interfaces are correct, but redfish is broken.  It also keeps us standard compliant, so in theory webui-vue could be used on another non-openbmc project in the future.
>
> Ed
>
>>
>>
>> Mike
>>
>>
>> Sent from my iPad
>>
>> > On Jan 11, 2022, at 10:22 AM, Ed Tanous <edtanous@google.com> wrote:
>> >
>> > On Tue, Jan 11, 2022 at 9:17 AM Mike Jones <proclivis@gmail.com> wrote:
>> >>
>> >> 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.\
>> >
>> > For better or worse, the term "Value" is overloaded in both the
>> > interface name, yz.openbmc_project.Sensor.Value, and the property name
>> > within the interface, Value.  That's why you see it twice in this
>> > case.  They are distinct things within the request that just happen to
>> > share a name.  Docs for the interface and property are here:
>> > https://github.com/openbmc/phosphor-dbus-interfaces/blob/e0674c894ed36a2e8cf96207907a531d2f514054/yaml/xyz/openbmc_project/Sensor/Value.interface.yaml#L24
>> >
>> > Happy to see you figured it out.
>> >
>> >>
>> >>
>> >> 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@google.com> wrote:
>> >>
>> >> On Mon, Jan 10, 2022 at 3:47 PM Mike Jones <proclivis@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
>
> --
> -Ed

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Query Sensor
  2022-01-12  2:04     ` Ed Tanous
@ 2022-01-13 21:16       ` Mike Jones
  2022-01-28 18:30         ` Ed Tanous
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Jones @ 2022-01-13 21:16 UTC (permalink / raw)
  To: Ed Tanous; +Cc: Ed Tanous, OpenBMC Maillist

[-- Attachment #1: Type: text/plain, Size: 5525 bytes --]

Ed,

What translates the redfish query into a dbus query?

Mike

Sent from my iPad

> On Jan 11, 2022, at 7:04 PM, Ed Tanous <ed@tanous.net> wrote:
> 
> 
> 
> 
>> On Tue, Jan 11, 2022 at 9:53 AM Mike Jones <proclivis@gmail.com> wrote:
>> Ed,
>> 
>> So to be sure I understand, dbus-sensors implements the dbus services for each sensor type, and the requests I made were serviced by one of these.
> 
> Correct.
> 
>> 
>> 
>> The interface is defined by yaml files in phosphor-dbus-interfaces.
> 
> Yep.
> 
>> 
>> 
>> phosphor-dbus- interfaces generates c++ base classes, and dbus-sensors probably have c++ classes inheriting from them.
> 
> 
> For various technical and social reasons which I’ve detailed in mail to this list in the past, dbus-sensors doesn’t depend directly on phosphor-dbus-interfaces, nor rely on the generated code. It instead generates code from c++ template expansion in sdbusplus.
> 
>> 
>> 
>> These interfaces are not Redfish interfaces.
> 
> Correct.
> 
>> 
>> 
>> When WebUI fetches sensor values, is it using these interfaces, or is there another Redfish layer involved that translates the query? Or perhaps Redfish only matters for things like a PSU?
> 
> 
> Depends on which webui you’re talking about, there are two.
> 
> Phosphor-webui (ie the “old” one) goes directly to dbus through the rest-dbus abstraction in bmcweb.  This was very good for initial prototyping (aside from a port to c++, the code largely hasn’t changed since it was written) but not great at keeping a consistent or standardized API.
> 
> Webui-vue (ie, the new one) relies on Redfish directly, which in-effect makes a very nice Redfish gui, and minimizes the chance that the dbus interfaces are correct, but redfish is broken.  It also keeps us standard compliant, so in theory webui-vue could be used on another non-openbmc project in the future.
> 
> Ed
> 
>> 
>> 
>> Mike
>> 
>> 
>> Sent from my iPad
>> 
>> > On Jan 11, 2022, at 10:22 AM, Ed Tanous <edtanous@google.com> wrote:
>> > 
>> > On Tue, Jan 11, 2022 at 9:17 AM Mike Jones <proclivis@gmail.com> wrote:
>> >> 
>> >> 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.\
>> > 
>> > For better or worse, the term "Value" is overloaded in both the
>> > interface name, yz.openbmc_project.Sensor.Value, and the property name
>> > within the interface, Value.  That's why you see it twice in this
>> > case.  They are distinct things within the request that just happen to
>> > share a name.  Docs for the interface and property are here:
>> > https://github.com/openbmc/phosphor-dbus-interfaces/blob/e0674c894ed36a2e8cf96207907a531d2f514054/yaml/xyz/openbmc_project/Sensor/Value.interface.yaml#L24
>> > 
>> > Happy to see you figured it out.
>> > 
>> >> 
>> >> 
>> >> 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@google.com> wrote:
>> >> 
>> >> On Mon, Jan 10, 2022 at 3:47 PM Mike Jones <proclivis@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
> -- 
> -Ed

[-- Attachment #2: Type: text/html, Size: 8977 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Query Sensor
  2022-01-11 17:52   ` Mike Jones
@ 2022-01-12  2:04     ` Ed Tanous
  2022-01-13 21:16       ` Mike Jones
  0 siblings, 1 reply; 9+ messages in thread
From: Ed Tanous @ 2022-01-12  2:04 UTC (permalink / raw)
  To: Mike Jones; +Cc: Ed Tanous, OpenBMC Maillist

[-- Attachment #1: Type: text/plain, Size: 5165 bytes --]

On Tue, Jan 11, 2022 at 9:53 AM Mike Jones <proclivis@gmail.com> wrote:

> Ed,
>
> So to be sure I understand, dbus-sensors implements the dbus services for
> each sensor type, and the requests I made were serviced by one of these.


Correct.


>
> The interface is defined by yaml files in phosphor-dbus-interfaces.


Yep.


>
> phosphor-dbus- interfaces generates c++ base classes, and dbus-sensors
> probably have c++ classes inheriting from them.



For various technical and social reasons which I’ve detailed in mail to
this list in the past, dbus-sensors doesn’t depend directly on
phosphor-dbus-interfaces, nor rely on the generated code. It instead
generates code from c++ template expansion in sdbusplus.


>
> These interfaces are not Redfish interfaces.


Correct.


>
> When WebUI fetches sensor values, is it using these interfaces, or is
> there another Redfish layer involved that translates the query? Or perhaps
> Redfish only matters for things like a PSU?



Depends on which webui you’re talking about, there are two.

Phosphor-webui (ie the “old” one) goes directly to dbus through the
rest-dbus abstraction in bmcweb.  This was very good for initial
prototyping (aside from a port to c++, the code largely hasn’t changed
since it was written) but not great at keeping a consistent or standardized
API.

Webui-vue (ie, the new one) relies on Redfish directly, which in-effect
makes a very nice Redfish gui, and minimizes the chance that the dbus
interfaces are correct, but redfish is broken.  It also keeps us standard
compliant, so in theory webui-vue could be used on another non-openbmc
project in the future.

Ed


>
> Mike
>
>
> Sent from my iPad
>
> > On Jan 11, 2022, at 10:22 AM, Ed Tanous <edtanous@google.com> wrote:
> >
> > On Tue, Jan 11, 2022 at 9:17 AM Mike Jones <proclivis@gmail.com> wrote:
> >>
> >> 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.\
> >
> > For better or worse, the term "Value" is overloaded in both the
> > interface name, yz.openbmc_project.Sensor.Value, and the property name
> > within the interface, Value.  That's why you see it twice in this
> > case.  They are distinct things within the request that just happen to
> > share a name.  Docs for the interface and property are here:
> >
> https://github.com/openbmc/phosphor-dbus-interfaces/blob/e0674c894ed36a2e8cf96207907a531d2f514054/yaml/xyz/openbmc_project/Sensor/Value.interface.yaml#L24
> >
> > Happy to see you figured it out.
> >
> >>
> >>
> >> 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@google.com> wrote:
> >>
> >> On Mon, Jan 10, 2022 at 3:47 PM Mike Jones <proclivis@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
>
-- 
-Ed

[-- Attachment #2: Type: text/html, Size: 8527 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Query Sensor
  2022-01-11 17:22 ` Ed Tanous
@ 2022-01-11 17:52   ` Mike Jones
  2022-01-12  2:04     ` Ed Tanous
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Jones @ 2022-01-11 17:52 UTC (permalink / raw)
  To: Ed Tanous; +Cc: OpenBMC Maillist

Ed,

So to be sure I understand, dbus-sensors implements the dbus services for each sensor type, and the requests I made were serviced by one of these.

The interface is defined by yaml files in phosphor-dbus-interfaces.

phosphor-dbus- interfaces generates c++ base classes, and dbus-sensors probably have c++ classes inheriting from them.

These interfaces are not Redfish interfaces.

When WebUI fetches sensor values, is it using these interfaces, or is there another Redfish layer involved that translates the query? Or perhaps Redfish only matters for things like a PSU?

Mike


Sent from my iPad

> On Jan 11, 2022, at 10:22 AM, Ed Tanous <edtanous@google.com> wrote:
> 
> On Tue, Jan 11, 2022 at 9:17 AM Mike Jones <proclivis@gmail.com> wrote:
>> 
>> 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.\
> 
> For better or worse, the term "Value" is overloaded in both the
> interface name, yz.openbmc_project.Sensor.Value, and the property name
> within the interface, Value.  That's why you see it twice in this
> case.  They are distinct things within the request that just happen to
> share a name.  Docs for the interface and property are here:
> https://github.com/openbmc/phosphor-dbus-interfaces/blob/e0674c894ed36a2e8cf96207907a531d2f514054/yaml/xyz/openbmc_project/Sensor/Value.interface.yaml#L24
> 
> Happy to see you figured it out.
> 
>> 
>> 
>> 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@google.com> wrote:
>> 
>> On Mon, Jan 10, 2022 at 3:47 PM Mike Jones <proclivis@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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Query Sensor
  2022-01-11 17:16 Mike Jones
@ 2022-01-11 17:22 ` Ed Tanous
  2022-01-11 17:52   ` Mike Jones
  0 siblings, 1 reply; 9+ messages in thread
From: Ed Tanous @ 2022-01-11 17:22 UTC (permalink / raw)
  To: Mike Jones; +Cc: OpenBMC Maillist

On Tue, Jan 11, 2022 at 9:17 AM Mike Jones <proclivis@gmail.com> wrote:
>
> 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.\

For better or worse, the term "Value" is overloaded in both the
interface name, yz.openbmc_project.Sensor.Value, and the property name
within the interface, Value.  That's why you see it twice in this
case.  They are distinct things within the request that just happen to
share a name.  Docs for the interface and property are here:
https://github.com/openbmc/phosphor-dbus-interfaces/blob/e0674c894ed36a2e8cf96207907a531d2f514054/yaml/xyz/openbmc_project/Sensor/Value.interface.yaml#L24

Happy to see you figured it out.

>
>
> 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@google.com> wrote:
>
> On Mon, Jan 10, 2022 at 3:47 PM Mike Jones <proclivis@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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Query Sensor
@ 2022-01-11 17:16 Mike Jones
  2022-01-11 17:22 ` Ed Tanous
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Jones @ 2022-01-11 17:16 UTC (permalink / raw)
  To: Ed Tanous; +Cc: OpenBMC Maillist

[-- Attachment #1: Type: text/plain, Size: 2216 bytes --]

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@google.com> wrote:
> On Mon, Jan 10, 2022 at 3:47 PM Mike Jones <proclivis@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

[-- Attachment #2: Type: text/html, Size: 7662 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-01-28 18:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-10 23:47 Query Sensor Mike Jones
2022-01-10 23:50 ` Ed Tanous
2022-01-11  0:07   ` Mike
2022-01-11 17:16 Mike Jones
2022-01-11 17:22 ` Ed Tanous
2022-01-11 17:52   ` Mike Jones
2022-01-12  2:04     ` Ed Tanous
2022-01-13 21:16       ` Mike Jones
2022-01-28 18:30         ` Ed Tanous

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.