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

[BUG] IdleModeDuration attribute read failure #37867

Closed
agatah2333 opened this issue Mar 4, 2025 · 5 comments
Closed

[BUG] IdleModeDuration attribute read failure #37867

agatah2333 opened this issue Mar 4, 2025 · 5 comments
Labels
bug Something isn't working needs triage

Comments

@agatah2333
Copy link

Reproduction steps

I modified the zap file for the virtual device so it could enable the ICDManagement cluster in endpoint 1. However, when I try to read using the command:

./chip-tool any read-by-id 0x0046 0x0000 0x654324 1

I receive the following error:

[1741099120.761] [891979:891979] [TOO] Run command failure: IM Error 0x00000501: General error: 0x01 (FAILURE)

I checked the specification, and the IdleModeDuration (id = 0x0000) should have a default value of 1, so it should return 1 rather than a failure.

The virtual device returns the log as follows:

[1741099120.757] [889126:889126] [IM] Received Read request
[1741099120.757] [889126:889126] [DMG] ReadRequestMessage =
[1741099120.757] [889126:889126] [DMG] {
[1741099120.757] [889126:889126] [DMG]  AttributePathIBs =
[1741099120.757] [889126:889126] [DMG]  [
[1741099120.757] [889126:889126] [DMG]          AttributePathIB =
[1741099120.757] [889126:889126] [DMG]          {
[1741099120.757] [889126:889126] [DMG]                  Endpoint = 0x1,
[1741099120.757] [889126:889126] [DMG]                  Cluster = 0x46,
[1741099120.757] [889126:889126] [DMG]                  Attribute = 0x0000_0009,
[1741099120.757] [889126:889126] [DMG]          }
[1741099120.757] [889126:889126] [DMG] 
[1741099120.757] [889126:889126] [DMG]  ],
[1741099120.757] [889126:889126] [DMG] 
[1741099120.757] [889126:889126] [DMG]  isFabricFiltered = true, 
[1741099120.757] [889126:889126] [DMG]  InteractionModelRevision = 12
[1741099120.757] [889126:889126] [DMG] },
[1741099120.757] [889126:889126] [DMG] IM RH moving to [CanStartReporting]
[1741099120.757] [889126:889126] [DMG] Building Reports for ReadHandler with LastReportGeneration = 0x0000000000000000 DirtyGeneration = 0x0000000000000000
[1741099120.757] [889126:889126] [DMG] <RE:Run> Cluster 46, Attribute 9 is dirty
[1741099120.757] [889126:889126] [DMG] AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0046 e=1 p=v r=r
[1741099120.757] [889126:889126] [DMG] AccessControl: allowed
[1741099120.757] [889126:889126] [DMG] Reading attribute: Cluster=0x0000_0046 Endpoint=0x1 AttributeId=0x0000_0009 (expanded=0)
[1741099120.757] [889126:889126] [DMG] Failed to read attribute: src/data-model-providers/codegen/CodegenDataModelProvider_Read.cpp:136: IM Error 0x00000501: General error: 0x01 (FAILURE)
[1741099120.757] [889126:889126] [DMG] Fail to retrieve data, roll back and encode status on clusterId: 0x0000_0046, attributeId: 0x0000_0009err = src/data-model-providers/codegen/CodegenDataModelProvider_Read.cpp:136: IM Error 0x00000501: General error: 0x01 (FAILURE)

Bug prevalence

each time

GitHub hash of the SDK that was being used

ab3d5ae

Platform

core, other

Platform Version(s)

No response

Anything else?

No response

@agatah2333 agatah2333 added bug Something isn't working needs triage labels Mar 4, 2025
@bzbarsky-apple
Copy link
Contributor

bzbarsky-apple commented Mar 4, 2025

I modified the zap file for the virtual device so it could enable the ICDManagement cluster in endpoint 1

A few things:

  1. No idea what "virtual device" is.
  2. ICD management always goes on endpoint 0 per spec, and the code will register it on endpoint 0 only. So it sounds like you created a ZAP config that does not match the code, and the ZAP config claims the attribute exists but it does not in fact exist.

the IdleModeDuration (id = 0x0000) should have a default value of 1,

That's the value a client should assume if the server does not provide a value.

@agatah2333
Copy link
Author

agatah2333 commented Mar 4, 2025

I modified the zap file for the virtual device so it could enable the ICDManagement cluster in endpoint 1

A few things:

  1. No idea what "virtual device" is.
  2. ICD management always goes on endpoint 0 per spec, and the code will register it on endpoint 0 only. So it sounds like you created a ZAP config that does not match the code, and the ZAP config claims the attribute exists but it does not in fact exist.

the IdleModeDuration (id = 0x0000) should have a default value of 1,

That's the value a client should assume if the server does not provide a value.

@bzbarsky-apple The virtual device is chip-all-clusters-app based on Linux. Following your guidance, I enabled the ICD Management on endpoint 0; however, the chip-tool still cannot read the IdleModeDuration attribute.
Should I manually set the IdleModeDuration as 1 (even 1 is the default value per spec?) when using ZAP to enable the ICD Management cluster?

@bzbarsky-apple
Copy link
Contributor

The virtual device is chip-all-clusters-app based on Linux

OK.

I enabled the ICD Management on endpoint 0; however, the chip-tool still cannot read the IdleModeDuration attribute.

Did you also enable the relevant compile flags to actually build ICD support, etc?

Should I manually set the IdleModeDuration as 1 (even 1 is the default value per spec?) when using ZAP

It doesn't matter what you set in ZAP for this attribute, and in fact it should not allow you to set a default value for it it all, since it's always external, right?

@agatah2333
Copy link
Author

agatah2333 commented Mar 5, 2025

Thanks for your guidance! @bzbarsky-apple

Did you also enable the relevant compile flags to actually build ICD support, etc?

Yes. The failure occurred after I enabled the compile flags as follows: I set in icd.gni the variables chip_enable_icd_lit, chip_icd_report_on_active_mode, and chip_enable_icd_dsls as true, which automatically sets chip_enable_icd_checkin as true in icd/server/build.gn.

It doesn't matter what you set in ZAP for this attribute, and in fact it should not allow you to set a default value for it it all, since it's always external, right?

I made this assumption while trying to figure out why it's failing. It might be because the default value is set as null in the zap file if I didn't provide any value when using the zap tool to enable the ICD manage cluster.

And one thing to confirm: according to the spec, the default value should be 1 even without any value given in the zap tool, right?

      "name": "IdleModeDuration",
              "code": 0,
              "mfgCode": null,
              "side": "server",
              "type": "int32u",
              "included": 1,
              "storageOption": "External",
              "singleton": 0,
              "bounded": 0,
              "defaultValue": null,
              "reportable": 1,
              "minInterval": 1,
              "maxInterval": 65534,
              "reportableChange": 0
            },

@bzbarsky-apple
Copy link
Contributor

The "default value" in the spec does not matter for anything in practice. Just don't think about it.

If you have a situation where you think you have correctly enabled all the ICD stuff on the server and it's not working, please file a new issue, describe the exact server setup, and attach (not paste) the complete logs from the client and server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants