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

Commissioning Problem on release/v1.4 branch. (Received ArmFailSafe (0s), CHIP Error 0x000000AC: Internal error) (CON-1527) #1257

Open
halilakpinarr opened this issue Jan 23, 2025 · 17 comments

Comments

@halilakpinarr
Copy link

halilakpinarr commented Jan 23, 2025

Describe the bug

We are doing matter bridge development with ESP32 Ethernet.
During commissioning with ESP Matter, we had no problem working with this commit ID. esp-matter commit id -> 7d3ec1e

We migrated ESP Matter to release/v1.4 and now commissioning fails.
We migrated ESP-IDF from v5.2.1 to v5.2.3.
ESP32 -> GeneralCommissioning: Received ArmFailSafe (0s)
chip-tool -> CHIP Error 0x000000AC: Internal error

Environment

  • ESP-Matter Commit Id: release/v1.4 a6da273

  • ESP-IDF Commit Id: v5.2.3

  • SoC (eg: ESP32 or ESP32-C3): esp32

  • Device Logs (Please attach the log file):
    esp32_log.txt

  • Host Machine OS: Ubuntu 22.04

  • Home hub apps: apple tv, chip tool

  • Commissioner's logs if present:
    chip-tool-log.txt

ESP MFG tool

esp-matter-mfg-tool --dac-in-secure-cert
-cn "Bridge"
-v 0xFFF2
-p 0x8001
-dm 2
--discriminator 3840
--vendor-name "manufacturer"
--product-name "test device"
--passcode 20202021
--hw-ver-str 1.0
--serial-num 12345678
--product-label "bridge"
--pai
-k ~/esp/esp-matter/connectedhomeip/connectedhomeip/credentials/test/attestation/Chip-Test-PAI-FFF2-8001-Key.pem
-c ~/esp/esp-matter/connectedhomeip/connectedhomeip/credentials/test/attestation/Chip-Test-PAI-FFF2-8001-Cert.pem
-cd ~/esp/esp-matter/connectedhomeip/connectedhomeip/credentials/test/certification-declaration/Chip-Test-CD-FFF2-8001.der

two binaries are flashed on the correct nvs partitions.

SDK Config
CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER=y
CONFIG_ENABLE_ESP32_DEVICE_INSTANCE_INFO_PROVIDER=y
CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER=y
CONFIG_SEC_CERT_DAC_PROVIDER=y
CONFIG_ENABLE_SET_CERT_DECLARATION_API=y

CONFIG_CHIP_FACTORY_NAMESPACE_PARTITION_LABEL="fctry"

CONFIG_DEVICE_VENDOR_ID=0xFFF2
CONFIG_DEVICE_PRODUCT_ID=0x8001
CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION=1
CONFIG_DEVICE_SOFTWARE_VERSION_NUMBER=1
CONFIG_DEVICE_TYPE=14

Regarding Release/v1.4;
I compiled the zigbee bridge application in release/v1.4, I changed only ethernet and telemetry parameters on it.
Comissioning failed again, I think there is a problem with release/v1.4.

@github-actions github-actions bot changed the title Commissioning Problem on release/v1.4 branch. (Received ArmFailSafe (0s), CHIP Error 0x000000AC: Internal error) Commissioning Problem on release/v1.4 branch. (Received ArmFailSafe (0s), CHIP Error 0x000000AC: Internal error) (CON-1527) Jan 23, 2025
@shubhamdp
Copy link
Contributor

This is the error in your chip-tool logs, which says you used the wrong setup passcode.

[1737611961.000] [48645:48647] [SC] Failed to verify peer's MAC. This can happen when setup code is incorrect.

chip-tool command from your logs shows that you are using setup passcode as 7580858. But you built the partition with setup passcode 20202021 using mfg-tool.

chip-tool pairing onnetwork 0x1234 7580858

For chip-tool command help please add --help to the command, eg:

chip-tool pairing onnetwork --help

@halilakpinarr
Copy link
Author

halilakpinarr commented Jan 23, 2025

I tried to enter the issue in Github.
I tried again with the default settings. I also get this error when I enter the installation password properly.
Actually this is exactly the error I am getting.(CHIP Error 0x000000CA: Interaction Model Error)
I can not pair the qr code I created with apple home either.

chip-tool pairing onnetwork 0x7283 20202021

esp32_log.txt
chip-tool-log.txt

@shubhamdp
Copy link
Contributor

@halilakpinarr please please provide the device and chip-tool logs in the file, similar to what you have done in the issue description

@halilakpinarr
Copy link
Author

@shubhamdp logs are like this.

chip-tool-log.txt
esp32_log.txt

@shubhamdp
Copy link
Contributor

@halilakpinarr Thanks for the logs. Can you please pull the latest release/v1.4 and try with the below patch?

cd esp-matter
git pull origin release/v1.4
curl https://github.com/shubhamdp/esp-matter/commit/b1a4697eb7f2d2ae62f8623218cf7bd5b99de9dd.patch | git am

@halilakpinarr
Copy link
Author

@shubhamdp i did what you said. commissioning failed again. i tried again by doing fullclean and erase_flash. i flashed the application and factory partitions. i am leaving the new logs below.

chip-tool-log.txt
esp32_log.txt

@shubhamdp
Copy link
Contributor

@halilakpinarr I got the problem, and its in the controller code, you will have to use connectedhomeip's latest master branch to build the chip-tool, it has the fix.

On v1.4-branch, I removed this code which reads the ConnectMaxTimeSeconds. (https://github.com/project-chip/connectedhomeip/blob/v1.4-branch/src/controller/CHIPDeviceController.cpp#L2355-L2378) and re-built the chip-tool and commissioning worked. I'll discuss with folks to see how to back port the fix on v1.4, controllers with v1.4 are broke without this, I guess.

For esp-matter, the patch I mentioned above is anyway needed, so I'll get that merged soon.

Until then please try with any one option.

Follow-up, does this fails on ecosystems as well? eg: Apple Home.

@halilakpinarr
Copy link
Author

@shubhamdp
yes, commissioning can not be done with apple home.
I tried the zigbee bridge application in the esp-matter sdk, i have the same problem.

I will continue my development from the old version.

I will try what you mentioned in v1.4 and come back.

@shubhamdp
Copy link
Contributor

@halilakpinarr can you please share the device logs when commissioning fails with Apple Home for further debugging? If possible can you please set the log-defaul-level to debug through menuconfig to help debug this issue.

Additionally, can you please help me with the Apple Home version details.

  • Phone used, Phone iOS version, Home app version
  • Hub used (Apple tv), Apple tv OS version, (not sure if there's a home app on tv please share the version details)

@halilakpinarr
Copy link
Author

halilakpinarr commented Jan 23, 2025

@shubhamdp

I haven't updated connectedhomeip yet, I need to downgrade and make my own developments.
Error Log is below. (log level "Debug")

esp32_log.txt

Commissioner;
Apple iphone 15
IOS version: 18.1.1
Apple Home App version: Latest version of App Store

Another Topic,
Actually, we are planning to move to the application step for certification in a short time, can you suggest me a stable version? We can also stay with a slightly older version rather than staying with versions that increase product risk.

@bzbarsky-apple
Copy link

Looking at the logs attached in #1257 (comment), ConnectMaxTime has nothing to do with anything: chip-tool is sending an AttestationRequest command and the server is responding with FAILURE, which is why commissioning fails.

@halilakpinarr
Copy link
Author

halilakpinarr commented Jan 24, 2025

@shubhamdp
There is a topic that I think may help you.

I downgraded and was working on this version.
a6da273

I flashed the application code compiled with this version (a6da273)
Then I created qr code in esp-matter release/v1.4 and flashed it.
The commissioning in a6da273 failed again.
Then, i create a new qr code in a6da273, and flashed again. commissioning completed successfully.
Maybe it will help.

@shubhamdp
Copy link
Contributor

By default, the factory data provider implementation reads the Certification Declaration (CD) from the 'chip-factory'. You have enabled CONFIG_ENABLE_SET_CERT_DECLARATION_API=y option, which enables the API which lets you set the CD from the application and the configured CD will be used for during attestation validation.

Please check the documentation here, https://github.com/project-chip/connectedhomeip/blob/master/src/platform/ESP32/ESP32SecureCertDACProvider.h#L35-L55.

Either you can se the CD using this API, or please disable that option so that the certification declaration that you have provided during mfg-tool will be used.

@shubhamdp
Copy link
Contributor

In #1257 (comment), commits that you have mentioned in are all same(a6da273).

For setting the CD through application, we will push an example code for reference.

@shubhamdp
Copy link
Contributor

@halilakpinarr Patch that I provided you in #1257 (comment) has been merged into release/v1.4 in 30af618, please pull the latest changes when testing.

@shubhamdp
Copy link
Contributor

@halilakpinarr did above comments help resolve the problem?

@halilakpinarr
Copy link
Author

@shubhamdp I have not had a chance to try it yet, but I will let you know when I do.

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