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

ESP32 door lock example crashing (CON-977) #809

Closed
bilalahmaddev opened this issue Jan 23, 2024 · 15 comments
Closed

ESP32 door lock example crashing (CON-977) #809

bilalahmaddev opened this issue Jan 23, 2024 · 15 comments

Comments

@bilalahmaddev
Copy link

Describe the bug
ESP32 door lock example available in connected home IP example causes ESP32 to crash and reboot when I press the door lock button:
image

@github-actions github-actions bot changed the title ESP32 door lock example crashing ESP32 door lock example crashing (CON-977) Jan 23, 2024
@shubhamdp
Copy link
Contributor

@bilalmalik76 It would help debug and resolve issues faster if you fill the other details in the template.

Environment

  • ESP-Matter Commit Id:
  • ESP-IDF Commit Id:
  • SoC (eg: ESP32 or ESP32-C3):
  • Device Logs (Please attach the log file):
  • Host Machine OS:
  • Commissioner app and versions if present:
  • Commissioner's logs if present:

Any additional details

@bilalahmaddev
Copy link
Author

Even if I don't use ScheduleWork to execute UpdateClusterState and call it directly still get this error:
chip::DeviceLayer::SystemLayer().ScheduleWork(UpdateClusterState, nullptr);

error by calling UpdateClusterState function directly:
image

@bilalahmaddev
Copy link
Author

@shubhamdp
Environment

ESP-Matter Commit Id: 01bebca
ESP-IDF Commit Id: cbce221e88d52665523093b2b6dd0ebe3f1243f1
SoC (eg: ESP32 or ESP32-C3): ESP32
Device Logs (Please attach the log file):
Host Machine OS: Linux
Commissioner app and versions if present: Apple home app
Commissioner's logs if present: NA

@dhrishi
Copy link
Collaborator

dhrishi commented Jan 24, 2024

@bilalmalik76 If you are trying out the connectedhomeip lock-app example, then can you confirm if you have this commit: project-chip/connectedhomeip#31500 . If not, can you cherry-pick the commit and try?

The connectedhomeip submodule in esp-matter repo is not updated to use this commit yet

@bilalahmaddev
Copy link
Author

@dhrishi I think you didn't get the reason for the application creash and assumed that it is related to another issue. This issue is not related to Factory Reset Triggered. The commit you shared fixes Factory Reset Triggered. project-chip/connectedhomeip#31500

My issue is different whenever this UpdateClusterState function executes it crashes application and reason for crashing is:
image

and if you see this ChipLogError is being used in the following function. I think, in your sample application, UpdateClusterState function is not being called correctly.
image

@dhrishi
Copy link
Collaborator

dhrishi commented Jan 25, 2024

@bilalmalik76 Yes, my bad. Similar fix was done some time back project-chip/connectedhomeip#31171. Can you please try with project-chip/connectedhomeip latest master branch directly instead of esp-matter connectedhomeip submodule (not updated to the latest yet) so that we are sure that you have all the required fixes.

@dhrishi
Copy link
Collaborator

dhrishi commented Jan 30, 2024

@bilalmalik76 Is there any update you can share

@bilalahmaddev
Copy link
Author

Same issue with project-chip/connectedhomeip latest master. @dhrishi can you please try on your side?

@dhrishi
Copy link
Collaborator

dhrishi commented Jan 30, 2024

@bilalmalik76 I just tested the lock example on an ESP32 devkit with the latest project-chip/connectedhomeip master branch - head commit https://github.com/project-chip/connectedhomeip/commits/f5ca5ad8492b498cd946af87efead0fd8cefd7f6

The device boots up fine, and no crash is seen. I was also able to commission the device successfully and then successfully execute the unlock-door and lock-door commands.

Can you please share the head commit id?

@bilalahmaddev
Copy link
Author

@dhrishi This error occurs only when I try to lock and unlock from esp32 button, not from app. Can you share how did you send unlock-door and lock-door commands?

@dhrishi
Copy link
Collaborator

dhrishi commented Jan 31, 2024

@bilalmalik76 The screenshot you've added in this comment shows that it failed while you were controlling it from an ecosystem Matter app or chip-tool. See the prints of Invoke command response. These should not be seen if you are controlling it through the button. Please let me know if I am missing anything.

Edit: Looks like you first controlled it through the app and then through the button. Ideally, that should work fine now

I also tried changing the state with button. Note that I had to change the lock/unlock GPIO to 0 (APP_LOCK_BUTTON) as per my ESP32 devkit in examples/platform/esp32/lock/AppConfig.h. Please see the logs for lock, unlock below -

I (15665) lock-app: Lock Action has been initiated
I (17665) lock-app: Lock Action has been completed
I (17665) chip[ZCL]: 0x3f40e948 ep 1 clus 0x0000_0006 attr 0x0000_0000 not supported 
I (17665) lock-app: ERR: updating on/off c3 # Ignore this as cluster 6 (OnOff) on ep 1 is not there
I (26885) lock-app: Unlock Action has been initiated
I (28885) lock-app: Unlock Action has been completed

@dhrishi
Copy link
Collaborator

dhrishi commented Feb 6, 2024

@bilalmalik76 Any update to share? Please close the issue if it works fine

@bilalahmaddev
Copy link
Author

@dhrishi Yes I changed the lock/unlock GPIO according to my dev kit but it is still crashing even after using latest commit of connect home ip.

@dhrishi
Copy link
Collaborator

dhrishi commented Feb 11, 2024

This should not happen. Please share the connectedhomeip latest commit id you are using

@dhrishi
Copy link
Collaborator

dhrishi commented Feb 26, 2024

Please provide the exact commit id used and re-open the issue.

@dhrishi dhrishi closed this as completed Feb 26, 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

No branches or pull requests

3 participants