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

hwmontempsensor crashes when given (mis) configuration for NCT7802 Sensor #24

Open
pointbazaar opened this issue May 3, 2023 · 2 comments

Comments

@pointbazaar
Copy link
Contributor

{
      "Address": "0x28",
      "Bus": 5,
      "Name": "GARBO_SENSOR",
      "Name1": "SYS_Air_Inlet",
      "Name2": "MB_Air_Inlet",
      "Name3": "MB_Air_Outlet",
      "Thresholds": [
        {
          "Direction": "greater than",
          "Label": "temp1",
          "Name": "upper critical",
          "Severity": 1,
          "Value": 40
        },
        {
          "Direction": "greater than",
          "Label": "temp2",
          "Name": "upper critical",
          "Severity": 1,
          "Value": 50
        },
        {
          "Direction": "greater than",
          "Label": "temp3",
          "Name": "upper critical",
          "Severity": 1,
          "Value": 70
        }
      ],
      "Type": "NCT7802"
    },

one solution is to remove the code for reading the thresholds from hwmontempsensor.
Then ofc no thresholds but atleast the sensors show up.

the reason for crash is dbus related, it tries to create an interface which already exists.
the interface in question is related to the thresholds.

@pointbazaar
Copy link
Contributor Author

When providing an empty Thresholds Array, it also works.

@pointbazaar
Copy link
Contributor Author

hwmontempsensor works when using Index based configuration instead of "Label" like in the above example.

Still not good that configuration can crash hwmontempsensor so i leave this open.

    {
      "Address": "0x28",
      "Bus": 5,
      "Name": "GARBO_SENSOR",
      "Name1": "SYS_Air_Inlet",
      "Name2": "MB_Air_Inlet",
      "Name3": "MB_Air_Outlet",
      "Thresholds": [
         {
           "Direction": "less than",
           "Name": "lower critical",
           "Index": 2,
           "Severity": 1,
           "Value": 0
         },
         {
           "Direction": "less than",
           "Name": "lower critical",
           "Index": 3,
           "Severity": 1,
           "Value": 0
         },
         {
           "Direction": "less than",
           "Name": "lower critical",
           "Index": 4,
           "Severity": 1,
           "Value": 0
         },
         {
           "Direction": "greater than",
           "Name": "upper critical",
           "Index": 2,
           "Severity": 1,
           "Value": 40
         },
         {
           "Direction": "greater than",
           "Name": "upper critical",
           "Index": 3,
           "Severity": 1,
           "Value": 40
         },
         {
           "Direction": "greater than",
           "Name": "upper critical",
           "Index": 4,
           "Severity": 1,
           "Value": 60
         }
      ],
      "Type": "NCT7802"
    },

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

No branches or pull requests

1 participant