openbmc / entity-manager

Run-time JSON driven system configuration manager
Other
26 stars 48 forks source link

Unable to activate FANs using Entity-manager. #12

Open selvamuthuks opened 3 years ago

selvamuthuks commented 3 years ago

Hi All,

I am working on to add fans in my BMC. As I am new to entity-manager, I have looked at other system's fan implementation. I have added the code. It seems I have not added code properly and I am getting improper output. Please view my files and provide your comments.

I have created two .json file for baseboard and chassis.
I have created daytonax-baseboard.json and added content like this,

    "Exposes": [
        {
            "BindConnector": "System Fan connector 1",
            "Index": 0,
            "Name": "Fan 1a",
            "Type": "AspeedFan"
        },
        {
            "BindConnector": "System Fan connector 1",
            "Index": 1,
            "Name": "Fan 1b",
            "Type": "AspeedFan"
        },
        {
            "BindConnector": "System Fan connector 2",
            "Index": 2,
            "Name": "Fan 2a",
            "Type": "AspeedFan"
        },
        {
            "BindConnector": "System Fan connector 2",
            "Index": 3,
            "Name": "Fan 2b",
            "Type": "AspeedFan"
        },
        {
            "BindConnector": "System Fan connector 3",
            "Index": 4,
            "Name": "Fan 3a",
            "Type": "AspeedFan"
        },
        {
            "BindConnector": "System Fan connector 3",
            "Index": 5,
            "Name": "Fan 3b",
            "Type": "AspeedFan"
        },
        {
            "BindConnector": "System Fan connector 4",
            "Index": 6,
            "Name": "Fan 4a",
            "Type": "AspeedFan"
        },
        {
            "BindConnector": "System Fan connector 4",
            "Index": 7,
            "Name": "Fan 4b",
            "Type": "AspeedFan"
        },
        {
            "BindConnector": "System Fan connector 5",
            "Index": 8,
            "Name": "Fan 5a",
            "Type": "AspeedFan"
        },
        {
            "BindConnector": "System Fan connector 5",
            "Index": 9,
            "Name": "Fan 5b",
            "Type": "AspeedFan"
        },
        {
            "BindConnector": "System Fan connector 6",
            "Index": 10,
            "Name": "Fan 6a",
            "Type": "AspeedFan"
        },
        {
            "BindConnector": "System Fan connector 6",
            "Index": 11,
            "Name": "Fan 6b",
            "Type": "AspeedFan"
        },
        {
            "Name": "2U System Fan connector 1",
            "Pwm": 1,
            "Status": "disabled",
            "Tachs": [
                0,
                1
            ],
            "Type": "IntelFanConnector"
        },
        {
            "Name": "2U System Fan connector 2",
            "Pwm": 2,
            "Status": "disabled",
            "Tachs": [
                2,
                3
            ],
            "Type": "IntelFanConnector"
        },
        {
            "Name": "2U System Fan connector 3",
            "Pwm": 3,
            "Status": "disabled",
            "Tachs": [
                4,
                5
            ],
            "Type": "IntelFanConnector"
        },
        {
            "Name": "2U System Fan connector 4",
            "Pwm": 4,
            "Status": "disabled",
            "Tachs": [
                6,
                7
            ],
            "Type": "IntelFanConnector"
        },
        {
            "Name": "2U System Fan connector 5",
            "Pwm": 5,
            "Status": "disabled",
            "Tachs": [
                8,
                9
            ],
            "Type": "IntelFanConnector"
        },
        {
            "Name": "2U System Fan connector 6",
            "Pwm": 6,
            "Status": "disabled",
            "Tachs": [
                10,
                11
            ],
            "Type": "IntelFanConnector"
        }, 
        {
            "Class": "fan",
            "FFGainCoefficient": 1.0,
            "FFOffCoefficient": 0.0,
            "ICoefficient": 0.0,
            "ILimitMax": 0.0,
            "ILimitMin": 0.0,
            "Inputs": [
                "Fan 1a",
                "Fan 1b"
            ],
            "Name": "Fan 1",
            "NegativeHysteresis": 0.0,
            "OutLimitMax": 100.0,
            "OutLimitMin": 30.0,
            "Outputs": [
                "Pwm 1"
            ],
            "PCoefficient": 0.0,
            "PositiveHysteresis": 0.0,
            "SlewNeg": 0.0,
            "SlewPos": 0.0,
            "Type": "Pid",
            "Zones": [
                "Left"
            ]
        },
        {
            "Class": "fan",
            "FFGainCoefficient": 1.0,
            "FFOffCoefficient": 0.0,
            "ICoefficient": 0.0,
            "ILimitMax": 0.0,
            "ILimitMin": 0.0,
            "Inputs": [
                "Fan 2a",
                "Fan 2b"
            ],
            "Name": "Fan 2",
            "NegativeHysteresis": 0.0,
            "OutLimitMax": 100.0,
            "OutLimitMin": 30.0,
            "Outputs": [
                "Pwm 2"
            ],
            "PCoefficient": 0.0,
            "PositiveHysteresis": 0.0,
            "SlewNeg": 0.0,
            "SlewPos": 0.0,
            "Type": "Pid",
            "Zones": [
                "Left"
            ]
        },
        {
            "Class": "fan",
            "FFGainCoefficient": 1.0,
            "FFOffCoefficient": 0.0,
            "ICoefficient": 0.0,
            "ILimitMax": 0.0,
            "ILimitMin": 0.0,
            "Inputs": [
                "Fan 3a",
                "Fan 3b"
            ],
            "Name": "Fan 3",
            "NegativeHysteresis": 0.0,
            "OutLimitMax": 100.0,
            "OutLimitMin": 30.0,
            "Outputs": [
                "Pwm 3"
            ],
            "PCoefficient": 0.0,
            "PositiveHysteresis": 0.0,
            "SlewNeg": 0.0,
            "SlewPos": 0.0,
            "Type": "Pid",
            "Zones": [
                "Left"
            ]
        },
        {
            "Class": "fan",
            "FFGainCoefficient": 1.0,
            "FFOffCoefficient": 0.0,
            "ICoefficient": 0.0,
            "ILimitMax": 0.0,
            "ILimitMin": 0.0,
            "Inputs": [
                "Fan 4a",
                "Fan 4b"
            ],
            "Name": "Fan 4",
            "NegativeHysteresis": 0.0,
            "OutLimitMax": 100.0,
            "OutLimitMin": 30.0,
            "Outputs": [
                "Pwm 4"
            ],
            "PCoefficient": 0.0,
            "PositiveHysteresis": 0.0,
            "SlewNeg": 0.0,
            "SlewPos": 0.0,
            "Type": "Pid",
            "Zones": [
                "Left"
            ]
        },
        {
            "Class": "fan",
            "FFGainCoefficient": 1.0,
            "FFOffCoefficient": 0.0,
            "ICoefficient": 0.0,
            "ILimitMax": 0.0,
            "ILimitMin": 0.0,
            "Inputs": [
                "Fan 5a",
                "Fan 5b"
            ],
            "Name": "Fan 5",
            "NegativeHysteresis": 0.0,
            "OutLimitMax": 100.0,
            "OutLimitMin": 30.0,
            "Outputs": [
                "Pwm 5"
            ],
            "PCoefficient": 0.0,
            "PositiveHysteresis": 0.0,
            "SlewNeg": 0.0,
            "SlewPos": 0.0,
            "Type": "Pid",
            "Zones": [
                "Right"
            ]
        },
        {
            "Class": "fan",
            "FFGainCoefficient": 1.0,
            "FFOffCoefficient": 0.0,
            "ICoefficient": 0.0,
            "ILimitMax": 0.0,
            "ILimitMin": 0.0,
            "Inputs": [
                "Fan 6a",
                "Fan 6b"
            ],
            "Name": "Fan 6",
            "NegativeHysteresis": 0.0,
            "OutLimitMax": 100.0,
            "OutLimitMin": 30.0,
            "Outputs": [
                "Pwm 6"
            ],
            "PCoefficient": 0.0,
            "PositiveHysteresis": 0.0,
            "SlewNeg": 0.0,
            "SlewPos": 0.0,
            "Type": "Pid",
            "Zones": [
                "Right"
            ]
        },          
        {
            "Address": "0x48",
            "Bus": 7,
            "Name": "MB_TEMP1",
            "Thresholds": [
                {
                    "Direction": "greater than",
                    "Name": "upper critical",
                    "Severity": 1,
                    "Value": 40000
                },
                {
                    "Direction": "greater than",
                    "Name": "upper non critical",
                    "Severity": 0,
                    "Value": 5000
                },
                {
                    "Direction": "less than",
                    "Name": "lower non critical",
                    "Severity": 0,
                    "Value": 38000
                },
                {
                    "Direction": "less than",
                    "Name": "lower critical",
                    "Severity": 1,
                    "Value": 0
                }
            ],
            "Type": "TMP112"
        }        
    ],
    "Name": "AMD Daytonax Baseboard",
    "Probe": "TRUE",    
    "Type": "Board",
    "xyz.openbmc_project.Inventory.Decorator.Asset": {
        "Manufacturer": "Quanta Cloud Technology Inc.",
        "Model": "QuantaGrid D52BQ-2U (3.5 LFF_SATA_SAS)",
        "PartNumber": "---",
        "SerialNumber": "ZU401000254"
    }    
}

I have created daytonax-chassis.json and added content like this,

    "Exposes": [
        {
            "BindConnector": "2U System Fan connector 1",
            "Index": 0,
            "Name": "Fan 1",
            "Thresholds": [
                {
                    "Direction": "less than",
                    "Name": "lower critical",
                    "Severity": 1,
                    "Value": 1750
                },
                {
                    "Direction": "less than",
                    "Name": "lower non critical",
                    "Severity": 0,
                    "Value": 2000
                }
            ],
            "Type": "AspeedFan"
        },
        {
            "BindConnector": "2U System Fan connector 2",
            "Index": 1,
            "Name": "Fan 2",
            "Thresholds": [
                {
                    "Direction": "less than",
                    "Name": "lower critical",
                    "Severity": 1,
                    "Value": 1750
                },
                {
                    "Direction": "less than",
                    "Name": "lower non critical",
                    "Severity": 0,
                    "Value": 2000
                }
            ],
            "Type": "AspeedFan"
        },
        {
            "BindConnector": "2U System Fan connector 3",
            "Index": 2,
            "Name": "Fan 3",
            "Thresholds": [
                {
                    "Direction": "less than",
                    "Name": "lower critical",
                    "Severity": 1,
                    "Value": 1750
                },
                {
                    "Direction": "less than",
                    "Name": "lower non critical",
                    "Severity": 0,
                    "Value": 2000
                }
            ],
            "Type": "AspeedFan"
        },
        {
            "BindConnector": "2U System Fan connector 4",
            "Index": 3,
            "Name": "Fan 4",
            "Thresholds": [
                {
                    "Direction": "less than",
                    "Name": "lower critical",
                    "Severity": 1,
                    "Value": 1750
                },
                {
                    "Direction": "less than",
                    "Name": "lower non critical",
                    "Severity": 0,
                    "Value": 2000
                }
            ],
            "Type": "AspeedFan"
        },
        {
            "BindConnector": "2U System Fan connector 5",
            "Index": 4,
            "Name": "Fan 5",
            "Thresholds": [
                {
                    "Direction": "less than",
                    "Name": "lower critical",
                    "Severity": 1,
                    "Value": 1750
                },
                {
                    "Direction": "less than",
                    "Name": "lower non critical",
                    "Severity": 0,
                    "Value": 2000
                }
            ],
            "Type": "AspeedFan"
        },
        {
            "BindConnector": "2U System Fan connector 6",
            "Index": 5,
            "Name": "Fan 6",
            "Thresholds": [
                {
                    "Direction": "less than",
                    "Name": "lower critical",
                    "Severity": 1,
                    "Value": 1750
                },
                {
                    "Direction": "less than",
                    "Name": "lower non critical",
                    "Severity": 0,
                    "Value": 2000
                }
            ],
            "Type": "AspeedFan"
        }                                  
    ],
    "Name": "AMD DaytonaX Chassis",
    "Probe": "FOUND('AMD Daytonax Baseboard')",
    "Type": "Chassis"
}

my phosphor-pid-control_%.bbappend will have content like this,


inherit obmc-phosphor-systemd

I am observing only current value of FANs and not all the values, image

In the journal ctl log, I am observing this error,


-- Journal begins at Thu 1970-01-01 00:00:12 UTC. --
Jul 20 14:46:10 daytonax entity-manager[267]: configuration file dependency error, could not find BindConnector "System Fan connector 2"
Jul 20 14:46:10 daytonax entity-manager[267]: configuration file dependency error, could not find BindConnector "System Fan connector 2"
Jul 20 14:46:10 daytonax entity-manager[267]: configuration file dependency error, could not find BindConnector "System Fan connector 3"
Jul 20 14:46:10 daytonax entity-manager[267]: configuration file dependency error, could not find BindConnector "System Fan connector 3"
Jul 20 14:46:10 daytonax entity-manager[267]: configuration file dependency error, could not find BindConnector "System Fan connector 4"
Jul 20 14:46:10 daytonax entity-manager[267]: configuration file dependency error, could not find BindConnector "System Fan connector 4"
Jul 20 14:46:10 daytonax entity-manager[267]: configuration file dependency error, could not find BindConnector "System Fan connector 5"
Jul 20 14:46:10 daytonax entity-manager[267]: configuration file dependency error, could not find BindConnector "System Fan connector 5"
Jul 20 14:46:10 daytonax entity-manager[267]: configuration file dependency error, could not find BindConnector "System Fan connector 6"
Jul 20 14:46:10 daytonax entity-manager[267]: configuration file dependency error, could not find BindConnector "System Fan connector 6"
edtanous commented 3 years ago

Please get the above submitted in a code review and we can discuss more there. Reviewing config code like this in a bug is difficult.

selvamuthuks commented 3 years ago

@edtanous I have pushed my changes here https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/45112 . Please view it and provide your comments.

selvamuthuks commented 3 years ago

@edtanous Based on your comments, I have changed basedboard and chassis json file. Please review this https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/45112 and provide your comments.