espressif/esp-matter

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

MaplestoryAlen opened this issue · 11 comments

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

@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

Thank you very much. The issue has been resolved

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);