How do I add a PMBus sensor that will show up in webui Sensors?

Mike Jones proclivis at gmail.com
Wed Jul 29 08:52:51 AEST 2020


I need help configuring a sensor. The goal is for a PMBus Voltage Regulator to display sensor information, like load current, in the webui under Health/Sensors.

Some background:

- Rasp Pi 4
- meta-phosphor 
- bmcweb/webui working and can log in
- pmbus/ltc2978.c driver working
- hwmon working

In this case, we have this path:

/sys/bus/i2c/devices/i2c-1

Which has a new_device file. I can add my sensor with:

echo ltc3880 0x30 > new_device

This populates all the files with telemetry data here:

/sys/bus/i2c/devices/i2c01/1-0030/hwmon/hwmon1

Such as in1_input, in2_input, in3_input, which are VIN, VOUT0, VOUT1.

I assume there has to be a file that maps the path to inN_input to a d-bus object, some way to register the sensor with the chassis or similar concept, and some file with the label and warns, and other things you can do with it.

From a yocto recipe point of view, it would also have to do the equivalent of the “echo” into the new_device so that /sys/… gets populated. Perhaps part of some systemd based service.

I have looked at meta-ibm and see a tree under omjc/hwmon/ahb… i2c-bus at 200…

I do not know what these numbers are referring to. Perhaps these are paths in the sys tree for an ahb type architecture? And what is the number before .conf?

Then I see phosphor-hwmon_%.bbappend with more configuration in there.

Can someone explain how this recipe system works? The architecture doc was more than confusing. Perhaps just sketch out what I need to do for this case, and what files it will generate, so I can build and go look at the generated files, etc.

Or perhaps there is a completely different approach?

Mike




More information about the openbmc mailing list