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

How to read pairing codes and QR codes in a program (CON-1174) #943

Open
MaplestoryAlen opened this issue May 30, 2024 · 7 comments
Open

Comments

@MaplestoryAlen
Copy link

I saw that there are pairing codes and QR codes printed in the log, but I know where to read them. Please let me know

chip[SVR]: SetupQRCode: [MT:Y.K9042C00KA0648G00]
...
chip[SVR]: Manual pairing code: [34970112332]
..
log:

I (1533) chip[DL]: CHIPoBLE advertising started
I (1533) chip[DL]: Starting ESP WiFi layer
I (1553) wifi:mode : sta (34:85:18:52:51:c4)
I (1553) wifi:enable tsf
W (1553) wifi:Haven't to connect to a suitable AP now!
I (1553) chip[DL]: Done driving station state, nothing else to do...
W (1563) wifi:Haven't to connect to a suitable AP now!
I (1563) chip[DL]: Done driving station state, nothing else to do...
I (1583) chip[SVR]: SetupQRCode: [MT:Y.K9042C00KA0648G00]
I (1583) chip[SVR]: Copy/paste the below URL in a browser to see the QR Code:
I (1593) chip[SVR]: https://project-chip.github.io/connectedhomeip/qrcode.html?data=MT%3AY.K9042C00KA0648G00
I (1593) chip[SVR]: Manual pairing code: [34970112332]
I (1603) chip[SVR]: Initializing subscription resumption storage...
I (1613) chip[SVR]: Server initializing...
I (1623) chip[TS]: Last Known Good Time: [unknown]
I (1623) chip[TS]: Setting Last Known Good Time to firmware build time 2024-05-28T02:03:22
I (1633) chip[DMG]: AccessControl: initializing
I (1643) chip[DMG]: Examples::AccessControlDelegate::Init
I (1643) chip[DMG]: AccessControl: setting
I (1653) chip[DMG]: DefaultAclStorage: initializing
I (1653) chip[DMG]: DefaultAclStorage: 0 entries loaded

@github-actions github-actions bot changed the title How to read pairing codes and QR codes in a program How to read pairing codes and QR codes in a program (CON-1174) May 30, 2024
@dhrishi
Copy link
Collaborator

dhrishi commented May 31, 2024

@MaplestoryAlen You can find the details about the onboarding payloads (QR code and manual code) here

Although, note that, due to security considerations listed in Matter Specification section 5.1.7. Generation of the Passcode, we do not store/generate the pairing code in the firmware in esp-matter

@MaplestoryAlen
Copy link
Author

Thank you very much. The issue has been resolved

@MaplestoryAlen MaplestoryAlen closed this as not planned Won't fix, can't repro, duplicate, stale Jun 3, 2024
@MaplestoryAlen MaplestoryAlen reopened this Jun 3, 2024
@MaplestoryAlen
Copy link
Author

I am sending a question now. If I use the home app to add devices on two phones, the data below will be read out when the first device is added
log:
I (28907) app_driver: QRCode: MT:Y.K90AFN00KA0648G00
I (28913) app_driver: manualPairingCode: 34970112332
I (28918) app_driver: VendorId: 65521
I (28923) app_driver: ProductID:32768
I (28927) app_driver: Discriminator: 3840
I (28932) app_driver: PinCode: 20202021

The first phone has been added, and the data read by the second phone is the same
log:

I (98541) app_main: Commissioning window opened
I (98545) app_driver: QRCode: MT:Y.K90AFN00KA0648G00
I (98551) app_driver: manualPairingCode: 34970112332
I (98556) app_driver: VendorId: 65521
I (98561) app_driver: ProductID:32768
I (98565) app_driver: Discriminator: 3840
I (98570) app_driver: PinCode: 20202021

Actually, the pairing code has changed at this time, why is the data read still the same?

API interface read:PrintOnboardingCodes(chip::RendezvousInformationFlag::kOnNetwork);

@VaishaliAvhale
Copy link
Contributor

Can you please tell me which example are you trying to commission and have you made any changes in a code if yes please mention it here.
Home App means Apple Home App?
Please attach complete logs and the SDK commit and also tell me the other 2 phone applications which you are using for commissiong the device.

@dhrishi
Copy link
Collaborator

dhrishi commented Jun 14, 2024

The first phone has been added, and the data read by the second phone is the same

@MaplestoryAlen Are you trying to add the device to a new fabric using the second phone, using the add pairing option? In that case, a new and random onboarding payload (QR code) will be generated by the second phone. The print you are using on the device console won't correspond to that. The print function just prints the default onboarding payload values.

@MaplestoryAlen
Copy link
Author

The first phone has been added, and the data read by the second phone is the same

@MaplestoryAlen Are you trying to add the device to a new fabric using the second phone, using the add pairing option? In that case, a new and random onboarding payload (QR code) will be generated by the second phone. The print you are using on the device console won't correspond to that. The print function just prints the default onboarding payload values.

After adding the device, retrieve the pairing code again in HOME to pair the second phone. However, this code has already changed, not 34970112332. However, what I read in the program is still 34970112332. Is it possible to read this changed pairing code?
image

@MaplestoryAlen
Copy link
Author

Can you please tell me which example are you trying to commission and have you made any changes in a code if yes please mention it here.
Home App means Apple Home App?
Please attach complete logs and the SDK commit and also tell me the other 2 phone applications which you are using for commissiong the device.

It is an Apple Home App. Reopen pairing mode to generate a pairing code, and select 'light' as an example in the SDK

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