Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding RTC battery voltage sensor to SDR list #111

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

nv-ynissan
Copy link
Contributor

Sensor name is "rtc_voltage". Sensor is discrete with two value, 0x0 and 0x80, which correspond to expected and low voltage, respectively. The values are mapped to their corresponding voltage values, 3V and 2V, respectively, so they can be represented as a non-discrete sensor (supported by the Redfish schema). A critical lower threshold is set in 2.3V to allow assertion in case of low voltage.

Test 1:
# ipmitool -I ipmb sensor

...
rtc_voltage      | 3.000      | Volts      | ok    | na        | 2.300     | na        | na        | na

Test 2:
# ipmitool sensor

...
rtc_voltage      | 3.000      | Volts      | ok    | na        | 2.302     | na        | na        | na

Test 3:
# curl -k -u <USERNAME>:<PASSWORD> -H "Content-Type: application/json" -X GET https://<BMC_IP>/redfish/v1/Chassis/Card1/Sensors

{
    "@odata.id": "/redfish/v1/Chassis/Card1/Sensors",
    "@odata.type": "#SensorCollection.SensorCollection",
    "Description": "Collection of Sensors for this Chassis",
    "Members": [
        ...
        {
            "@odata.id": "/redfish/v1/Chassis/Card1/Sensors/rtc_voltage"
        }
    ],
    "[email protected]": 21,
    "Name": "Sensors"
}

Test 4:
# curl -k -u <USERNAME>:<PASSWORD> -H "Content-Type: application/json" -X GET https://<BMC_IP>/redfish/v1/Chassis/Card1/Sensors/rtc_voltage

{
    "@odata.id": "/redfish/v1/Chassis/Card1/Sensors/rtc_voltage",
    "@odata.type": "#Sensor.v1_7_0.Sensor",
    "Id": "rtc_voltage",
    "Name": "rtc voltage",
    "Reading": 3.0,
    "ReadingRangeMax": 3.0,
    "ReadingRangeMin": 2.0,
    "ReadingType": "Voltage",
    "ReadingUnits": "V",
    "RelatedItem": [
        {
            "@odata.id": "/redfish/v1/Systems/Bluefield"
        }
    ],
    "Status": {
        "Conditions": [],
        "Health": "OK",
        "HealthRollup": "OK",
        "State": "Enabled"
    },
    "Thresholds": {
        "LowerCritical": {
            "Reading": 2.3
        }
    }
}

Fixes jira https://redmine.mellanox.com/issues/4016381

Signed-off-by: Yuval Nissan [email protected]

lanserv/mellanox-bf/mlx-bf.sdrs Outdated Show resolved Hide resolved
lanserv/mellanox-bf/mlx-bf.sdrs Show resolved Hide resolved
lanserv/mellanox-bf/set_emu_param.sh Show resolved Hide resolved
lanserv/mellanox-bf/set_emu_param.sh Show resolved Hide resolved
Sensor name is "rtc_voltage" and is derived from sysfs. Sensor is discrete with two value, 0x0 and 0x80, which correspond to expected and low voltage, respectively. The values are mapped to their corresponding voltage values, 3V and 2V, respectively, so they can be represented as a non-discrete sensor (supported by the Redfish schema). A critical lower threshold is set in 2.3V to allow assertion in case of low voltage.

'''
Test 1:

...
rtc_voltage      | 3.000      | Volts      | ok    | na        | 2.300     | na        | na        | na

Test 2:

...
rtc_voltage      | 3.000      | Volts      | ok    | na        | 2.302     | na        | na        | na

Test 3:

{
    "@odata.id": "/redfish/v1/Chassis/Card1/Sensors",
    "@odata.type": "#SensorCollection.SensorCollection",
    "Description": "Collection of Sensors for this Chassis",
    "Members": [
        ...
        {
            "@odata.id": "/redfish/v1/Chassis/Card1/Sensors/rtc_voltage"
        }
    ],
    "[email protected]": 21,
    "Name": "Sensors"
}

Test 4:

{
    "@odata.id": "/redfish/v1/Chassis/Card1/Sensors/rtc_voltage",
    "@odata.type": "#Sensor.v1_7_0.Sensor",
    "Id": "rtc_voltage",
    "Name": "rtc voltage",
    "Reading": 3.0,
    "ReadingRangeMax": 3.0,
    "ReadingRangeMin": 2.0,
    "ReadingType": "Voltage",
    "ReadingUnits": "V",
    "RelatedItem": [
        {
            "@odata.id": "/redfish/v1/Systems/Bluefield"
        }
    ],
    "Status": {
        "Conditions": [],
        "Health": "OK",
        "HealthRollup": "OK",
        "State": "Enabled"
    },
    "Thresholds": {
        "LowerCritical": {
            "Reading": 2.3
        }
    }
}
'''

Fixes jira https://redmine.mellanox.com/issues/4016381

Signed-off-by: Yuval Nissan <[email protected]>
@odrang odrang merged commit 80df640 into Mellanox:main Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants