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

[Chef] Create a ContactSensor to support LIT ICD (Linux Only) #37123

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8dbb7b3
Add chef icd contact sensor with zap only
erwinpan1 Jan 19, 2025
459d4ad
Enable Chef to build ICD LIT device type
erwinpan1 Jan 20, 2025
a7074e8
Merge branch 'master' into chef_icd_contactsensor
erwinpan1 Jan 20, 2025
91317d1
Enable Check-In timer when CHIP_CONFIG_ENABLE_ICD_CIP enabled
erwinpan1 Jan 20, 2025
ef66372
Fix Chef ContacSensor comformance issues
erwinpan1 Jan 20, 2025
0cc62c4
Merge branch 'master' into chef_icd_contactsensor
erwinpan1 Feb 5, 2025
387f7f2
Merge branch 'master' into chef_icd_contactsensor
erwinpan1 Feb 14, 2025
75ecb6f
Argumentize the ICD variables
erwinpan1 Feb 14, 2025
4c52ef3
Merge branch 'master' into chef_icd_contactsensor
erwinpan1 Feb 18, 2025
6763741
Merge branch 'master' into chef_icd_contactsensor
erwinpan1 Mar 7, 2025
4ccb849
Merge branch 'master' into chef_icd_contactsensor
erwinpan1 Mar 8, 2025
8e0efad
Merge branch 'master' into chef_icd_contactsensor
erwinpan1 Mar 10, 2025
f3b8c91
Set ICD Active/Idle Mode duration to linux cmdline
erwinpan1 Mar 12, 2025
bc994c9
Fix cmdline description
erwinpan1 Mar 12, 2025
aa2cae7
Not build ICD devices
erwinpan1 Mar 12, 2025
36008b5
Merge branch 'master' into chef_icd_contactsensor
erwinpan1 Mar 12, 2025
4c00c84
Fix zap comformance issue
erwinpan1 Mar 12, 2025
02b04ca
Fix restyle issue
erwinpan1 Mar 12, 2025
0c37543
Disable icd from Chef.py CI since it requires extra
erwinpan1 Mar 12, 2025
2340c3b
Rename notifyIcdActive to NotifyIcdActive
erwinpan1 Mar 12, 2025
0447721
Rename chef.py to --enable_lit_icd
erwinpan1 Mar 12, 2025
359366a
Fix cmdline help
erwinpan1 Mar 12, 2025
7a327ab
Implement RPC to send check-in in chef (not timer)
erwinpan1 Mar 13, 2025
487d1e9
Remove unused macro
erwinpan1 Mar 13, 2025
e7d92e3
Fix log message
erwinpan1 Mar 13, 2025
6c19c49
Merge branch 'master' into chef_icd_contactsensor
erwinpan1 Mar 13, 2025
07a6174
Fix description
erwinpan1 Mar 13, 2025
161ce0e
Fix description
erwinpan1 Mar 13, 2025
865e94a
Check ICD duration arguments or exit
erwinpan1 Mar 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,14 @@ def main() -> int:
action="store_true", dest="do_erase")
parser.add_option("-i", "--terminal", help="opens terminal to interact with with device",
action="store_true", dest="do_interact")
parser.add_option("-I", "--enable_icd", help="enable ICD (Intermittently Connected Device)",
action="store_true", default=False)
parser.add_option("", "--icd_idle_duration_sec", type=int,
help="ICD idle mode duration (seconds). Default is 60", metavar="ICD_IDLE_SEC", default=60)
parser.add_option("", "--icd_active_duration_ms", type=int,
help="ICD active mode duration (milliseconds). Default is 10000", metavar="ICD_ACTIVE_DURATION_MS", default=10000)
parser.add_option("", "--icd_active_threshold_ms", type=int,
help="ICD idle mode threshold (milliseconds). Default is 5000", metavar="ICD_ACTIVE_THRESHOLD_MS", default=5000)
parser.add_option("-m", "--menuconfig", help="runs menuconfig on platforms that support it",
action="store_true", dest="do_menuconfig")
parser.add_option("-z", "--zap", help="runs zap to generate data model & interaction model artifacts",
Expand Down Expand Up @@ -870,6 +878,18 @@ def main() -> int:
linux_args.append("chip_inet_config_enable_ipv4=true")
else:
linux_args.append("chip_inet_config_enable_ipv4=false")

flush_print("{options.icd_idle_duration_sec}")

if options.enable_icd:
linux_args.append("chip_enable_icd_server = true")
linux_args.append("chip_subscription_timeout_resumption = true")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the persistent subscription feature enabled? It is a requirement for this feature.
As a side comment, this changes the behavior on when check-in messages are sent out based on wether we are retrying to re-subscribe or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mkardous-silabs chip_persist_subscriptions hasn't been enabled. Thanks for the reminder. May I know what is your suggestion?

Actually I am not very familiar with these feature. So I'll leave this to @yunhanw-google to comment if we should enable both chip_persist_subscriptions and chip_subscription_timeout_resumption .

Copy link
Contributor

Choose a reason for hiding this comment

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

The ICDmanager behavior adapts based on the presence of both feature. The combos are

  • icd, without chip_persist_subscriptions and chip_subscription_timeout_resumption
  • icd, with chip_persist_subscriptions and without chip_subscription_timeout_resumption
  • all three

Subscription timeout cannot be present without chip_persist_subscriptions IIRC.

making these configurable might be valuable to enable most tests case.

linux_args.append("chip_icd_report_on_active_mode = true")
linux_args.append("chip_enable_icd_lit = true")
linux_args.append("chip_enable_icd_dsls = true")
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the contact sensor implement this feature?

Copy link
Contributor

Choose a reason for hiding this comment

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

The contact sensor is this current code under chef.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mkardous-silabs I think this feature chip_enable_icd_dsls is implemented in the SDK layer. Is there specific logic related to this feature needing to be implemented per device in the application layer?

Copy link
Contributor

Choose a reason for hiding this comment

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

The question is does the contact-sensor require this feature in the sense do we need to enable it? I don't think the current contact sensor implementation uses but i might be wrong.

The feature can be enabled without it being actually used. You can ignore the comment.

linux_args.append(f'chip_config_icd_idle_mode_duration_sec = {options.icd_idle_duration_sec}')
linux_args.append(f'chip_config_icd_active_mode_duration_ms = {options.icd_active_duration_ms}')
linux_args.append(f'chip_config_icd_active_mode_threshold_ms = {options.icd_active_threshold_ms}')

if sw_ver_string:
linux_args.append(
Expand Down
Loading
Loading