Skip to content

Voltage and Current Sensors support with PDDF#22444

Merged
Praveen-Brcm merged 1 commit intosonic-net:masterfrom
michaelc-nexthop:pddf_support_for_voltage_current_sensors
May 23, 2025
Merged

Voltage and Current Sensors support with PDDF#22444
Praveen-Brcm merged 1 commit intosonic-net:masterfrom
michaelc-nexthop:pddf_support_for_voltage_current_sensors

Conversation

@michaelc-nexthop
Copy link
Contributor

@michaelc-nexthop michaelc-nexthop commented Apr 25, 2025

Why I did it

Sensormon is currently not integrated with PDDF. Adding voltage and current sensor monitoring with PDDF support in order to expose system-level current and voltage readouts from peripheral sensors.
Fixes #17032

Work item tracking
  • Microsoft ADO (number only):

How I did it

Implement pddf parsing for current and voltage sensors, as well as pddf_voltage_sensor and pddf_current_sensor classes.

How to verify it

Run commands "show platform voltage" and "show platform current".
Should see "Sensor not detected" for platforms that do not have current/voltage sensors implemented.
For platforms that do have it implemented, should see an output like this:

admin@sonic:~$ show platform voltage
    Sensor     Voltage    High TH    Low TH    Crit High TH    Crit Low TH    Warning          Timestamp
----------  ----------  ---------  --------  --------------  -------------  ---------  -----------------
POS0V75_S0    749.0 mV        825       674               0              0      False  20250409 21:00:23
POS0V75_S5    747.0 mV        825       674               0              0      False  20250409 21:00:23
POS0V78_S0    781.0 mV        858       701               0              0      False  20250409 21:00:23
    POS1V0    998.0 mV       1100       899               0              0      False  20250409 21:00:23
 POS1V0_A7    996.0 mV       1100       899               0              0      False  20250409 21:00:23
 POS1V1_S0   1101.0 mV       1200       990               0              0      False  20250409 21:00:23
 POS1V2_A7   1191.0 mV       1320      1080               0              0      False  20250409 21:00:23
 POS1V8_A7   1796.0 mV       1979      1619               0              0      False  20250409 21:00:23
 POS1V8_S0   1811.0 mV       1979      1619               0              0      False  20250409 21:00:23
 POS1V8_S5   1796.0 mV       1979      1619               0              0      False  20250409 21:00:23
    POS3V3   3312.0 mV       3630      2970               0              0      False  20250409 21:00:23
 POS3V3_S0   3370.0 mV       3630      2970               0              0      False  20250409 21:00:23
 POS3V3_S5   3298.0 mV       3630      2970               0              0      False  20250409 21:00:23
    POS5V0   4978.0 mV       5500      4500               0              0      False  20250409 21:00:23
 POS5V0_S0   5030.0 mV       5500      4500               0              0      False  20250409 21:00:23
   POS12V0  12397.0 mV      13199     10800               0              0      False  20250409 21:00:23

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 25, 2025

CLA Signed

  • ✅login: michaelc-nexthop / (5272398)

The committers listed above are authorized under a signed CLA.

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@michaelc-nexthop michaelc-nexthop marked this pull request as ready for review April 25, 2025 22:52
@vmittal-msft vmittal-msft requested a review from judyjoseph May 7, 2025 15:15
@judyjoseph
Copy link
Contributor

@FuzailBrcm to have broadcom team review as well

@michaelc-nexthop
Copy link
Contributor Author

@judyjoseph @FuzailBrcm any updates on this? Thanks

Copy link
Contributor

@FuzailBrcm FuzailBrcm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me

@Praveen-Brcm Praveen-Brcm merged commit 985d059 into sonic-net:master May 23, 2025
12 checks passed
raise ValueError(f"Current sensor {self.sensor_obj_name} not found in PDDF data")

self.sensor_obj = self.pddf_obj.data[self.sensor_obj_name]
self.display_name = self.sensor_data.get('dev_attr', {}).get('display_name', self.sensor_obj_name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo error in line 27. The self.display_name = self.sensor_data.get should change to self.display_name = self.sensor_obj.get

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #22997

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sensormon (Voltage and Current Sensors) support with PDDF

7 participants