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

Error: Not a Matter-certified device #133

Closed
OlivierGre opened this issue May 25, 2023 · 25 comments
Closed

Error: Not a Matter-certified device #133

OlivierGre opened this issue May 25, 2023 · 25 comments
Labels
question Further information is requested

Comments

@OlivierGre
Copy link

I have a Thread Matter device which is not yet certified. I'm able to commission it using:

  • a Google Nest Hub 2
  • an android phone with Google Home app
    To do so, I have created a project on Google Home developper console. Google Home is not complaining anymore when I commission this non certified device and I'm able to control it.

I'm now trying to do the same with Google Home Sample App for Matter but I'm always getting the error "Not a Matter-certified device".

Can you please point me what I need to do to enable the commissioning of non certified devices? "Google Home Sample App for Matter" and "Google Home" are running on the same smartphone so with the same google account. So I was expecting that the project added on Google Home developper console would work also for GHSAM but that's not the case.

Thanks for your advices
Regards

Olivier

@KhushbuShah25
Copy link

Hi @OlivierGre , please check this issue #93
Hope this will help.

@OlivierGre
Copy link
Author

OlivierGre commented May 25, 2023

Thanks.
I have read it earlier today but I haven't found the solution to my issue.

I have seen also this message: #29 (comment)
so I would like to clarify which version to use. I have pulled the latest version of main branch from https://github.com/google-home/sample-app-for-matter-android
When I go to "About this app", it says: Version: 1.4.1-default.
Is it the correct version to use when using a non certified device?

By the way, my Vendor ID is 0xFFF1 and my Product ID is 0x8004 (this is not what is indicated in readme.md for virtual devices). I'm using a Thead Matter device base on STM32WB.

@OlivierGre
Copy link
Author

I'm using a Google Pixel 6 phone and here is the logcat when I get the error "Not a Matter-certified device"

GHSAFM_logcat.txt

@pierredelisle
Copy link
Contributor

Yes, version 1.4.1 is the latest release.
It should work. Unfortunately your logs are not complete. Please do the following:
$ adb logcat -c
$ adb logcat > logs.txt
... then use GHSAFM normally

When the app fails, you can kill the above command and send us the logs.txt.

@pierredelisle pierredelisle added the question Further information is requested label May 25, 2023
@OlivierGre
Copy link
Author

Thanks for your help. Here is the log:

GHSAFM_logcat3.zip

I can see:

05-26 10:46:08.121  4126  4126 E SetupDeviceViewModel: Commissioning failed with state Attestation failure. [CONTEXT service_id=336 ]
05-26 10:46:08.121  4126  4126 E SetupDeviceViewModel: m.epr: Device did not pass attestation (error(s)=[5, 10])

@pierredelisle
Copy link
Contributor

pierredelisle commented May 26, 2023

GHSAFM uses the Device Attestation Delegate to properly handle issues with device attestion.

Looking at your logs, I see that the call is properly done:

05-26 10:44:56.880  4041  4041 D CTL     : setDeviceAttestationDelegate() called

Device Attestion should trigger the following callback, and debug messages should show up in the logs
https://github.com/google-home/sample-app-for-matter-android/blob/main/app/src/main/java/com/google/homesampleapp/screens/home/HomeFragment.kt#L436

          if (errorCode == STATUS_PAIRING_SUCCESS) {
            Timber.d("DeviceAttestationDelegate: Success on device attestation.")
            lifecycleScope.launch {
              chipClient.chipDeviceController.continueCommissioning(devicePtr, true)
            }
          } else {
            Timber.d("DeviceAttestationDelegate: Error on device attestation [$errorCode].")

However this is not triggered. Not sure why.
I'll have to try to reproduce.

In the meantime, could you make sure to do a complete reset of your testing environment and test again.

Settings > Apps > GHSAFM > > Storage & cache > Clear storage

Factory reset the device and remove it from GHA if it is showing there.
Also, make sure it does not show up in the Local Android Fabric:

Settings > Google > Devices & sharing > Matter devices
Select "This Android device" in the drop down on the top right.
If any device is shown in "Linked Matter devices", remove them.

@OlivierGre
Copy link
Author

OlivierGre commented May 29, 2023

Hi Pierre,

Thank you very much for your help.

I have followed your instructions but I still get the same issue. I have put a breakpoint in the callback that you mention and indeed it never gets called.
FYI, I had nothing in "Linked Matter devices" and no devices was shown by Google Home. When I commisison a device with google Home, I remove it from Google Home before switching to GHSAFM and I factory reset the device t so that should be fine.

I'm attaching the log obtained with GHSAFM after doing the clean up that you recommended and a commissioning. I have put also the traces of the Matter device. This matter device is not certified but it is working when I commission it with Google Home.

traces.zip

Best regards
Olivier

@OlivierGre
Copy link
Author

I don't know if it will help but here are the traces (android phone and matter device) when doing a commissioning with GHA.
traces_GHA.zip

@OlivierGre
Copy link
Author

When using GHA, after scanning the QRCode, it asks to choose an App (I choose Google Home), then it asks if I want to connect this device to my Google account, then there is the message "Connecting device to Google Home...".

When using GHSAFM , I don't get such questions. After scanning the QRCode, it immediately display "Connecting device with GHSAFM ...".

Is it expected?

@pierredelisle
Copy link
Contributor

Hi Olivier,

When using GHSAFM , I don't get such questions. After scanning the QRCode, it immediately display "Connecting device with GHSAFM ...".

Is it expected?

Yes it is.

GHA commissions to the Google ecosystem and a Google account is required.

With GHSAFM, we use the GPS Commissioning APIs but it commissions first to a Local Android Fabric (not the Google ecosystem fabric), and then to GHSAFM's fabric (which is just a demo fabric for the purpose of our sample app). No Google account is needed.

I'll make some time this week to dig more into this. Hang in there :-)

@OlivierGre
Copy link
Author

Hi Pierre,

GHA commissions to the Google ecosystem and a Google account is required.

With GHSAFM, we use the GPS Commissioning APIs but it commissions first to a Local Android Fabric (not the Google ecosystem fabric), and then to GHSAFM's fabric (which is just a demo fabric for the purpose of our sample app). No Google account is needed.

This is here that something is not clear to me:
When using GHA, I have first created a project on Google Home developper console and this is the reason why Google Home doesn't complain when I commission a non certified device.
When using GHSAFM, you say that no Google account is used so GHSAFM doesn't know that I want to use a developper mode and it looks normal that it refuses a non certified device. What did I miss? How do you configure GHSAFM to accept non certified devices?

I'll make some time this week to dig more into this. Hang in there :-)
Ok thanks.

@pierredelisle
Copy link
Contributor

When using GHA, I have first created a project on Google Home developper console and this is the reason why Google Home doesn't complain when I commission a non certified device.

Correct.

When using GHSAFM, you say that no Google account is used so GHSAFM doesn't know that I want to use a developper mode and it looks normal that it refuses a non certified device. What did I miss? How do you configure GHSAFM to accept non certified devices?

As I mentioned above,
"GHSAFM uses the Device Attestation Delegate to properly handle issues with device attestion."
It should work (as it's definitely been tested). Not sure what's going on, will have a look.

@OlivierGre
Copy link
Author

Hi Pierre,
Do you have some news regarding this issue?

@pierredelisle
Copy link
Contributor

Hey Olivier,

I tried it again (I built from the tip of tree), and works fine for me.

Note that we've just announced the "Matter Virtual Device". See #140.

Could you give that a try as the device to be commissioned?

I've included the logs that I get. You will see this:

06-07 21:05:30.485 21385 21418 D CTL     : Sending Attestation Request to the device.
06-07 21:05:30.485 21385 21418 D CTL     : Sending Attestation request to 0xb40000734b6bc118 device
...
06-07 21:05:30.495 21385 21418 D CTL     : Received Attestation Information from the device
06-07 21:05:30.496 21385 21418 D GHSAFM-BaseCompletionListener: onCommissioningStatusUpdate nodeId [7547431994755794471]  stage [SendAttestationRequest]  errorCode [0]
06-07 21:05:30.496 21385 21418 D CTL     : Successfully finished commissioning step 'SendAttestationRequest'
06-07 21:05:30.496 21385 21418 D CTL     : AutoCommissioner setting attestationElements buffer size 583/583
06-07 21:05:30.496 21385 21418 D CTL     : Commissioning stage next step: 'SendAttestationRequest' -> 'AttestationVerification'
...
06-07 21:05:30.657 21385 21418 D CTL     : Device attestation completed, delegating continuation to client
06-07 21:05:30.657 21385 21418 D CTL     : OnDeviceAttestationCompleted with result: 0
06-07 21:05:30.658 21385 21418 D GHSAFM-HomeFragment: Device attestation errorCode: 0, Look at 'src/credentials/attestation_verifier/DeviceAttestationVerifier.h' AttestationVerificationResult enum to understand the errors
06-07 21:05:30.658 21385 21418 D GHSAFM-HomeFragment: DeviceAttestationDelegate: Success on device attestation.
06-07 21:05:30.660 21385 21418 D DMG     : ICR moving to [AwaitingDe]
06-07 21:05:30.660 21385 21418 D EM      : <<< [E:8843i S:37998 M:204905022 (Ack:216583508)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0000:10 (SecureChannel:StandaloneAck)
06-07 21:05:30.660 21385 21418 D IN      : (S) Sending msg 204905022 on secure session with LSID: 37998
06-07 21:05:30.660 21385 21418 D EM      : Flushed pending ack for MessageCounter:216583508 on exchange 8843i
06-07 21:05:30.660 21385 21385 D CTL     : continueCommissioning() called.
06-07 21:05:30.660 21385 21385 D CTL     : Continuing commissioning after attestation failure for device ID 0x68BDDD6945D64627
06-07 21:05:30.660 21385 21385 D CTL     : Overriding attestation failure per client and continuing commissioning
06-07 21:05:30.661 21385 21385 D GHSAFM-BaseCompletionListener: onCommissioningStatusUpdate nodeId [7547431994755794471]  stage [AttestationVerification]  errorCode [0]
06-07 21:05:30.661 21385 21385 D CTL     : Successfully finished commissioning step 'AttestationVerification'

If it still fails on your side while using MVD, you should compare your logs against this one to see where things fall apart.

commissioning_logs.txt

@OlivierGre
Copy link
Author

Hi Pierre,
Thank you, I'm going to look at that.

@OlivierGre
Copy link
Author

Hi Pierre,
Today I was looking at this but I'm facing some problems.
When working with Matter, I use a Wifi hot spot (usually my mobile) and I have some various equipments (Google Nest Hub 2, Raspberry Pi4 + RCP, Thread devices, android phones...etc). I cannot use them on the company Wifi network.

I have thought that I could install MVD on the Raspberry pi4 (that would not be used as a border router in that case) but I see that the installation is done through a Debian Package for 64-bit x86 processor machines. So I'm afraid that it cannot be used on my Raspberry Pi which has an ARM processor.

@OlivierGre
Copy link
Author

Hi Pierre,
My Matter device is supporting Matter 1.0 and not Matter 1.1.
Is there a branch to take for GHSA for devices running 1.0?
Thank you

@sushantr5
Copy link

CSA certification is acting like a big barrier for small startups. I have developed a matter device but exhorbitant CSA certification and testing cost is really lot than my device manufacturing setup and investment.

Moreover, Google Home app is not allowing to add non-certified devices. Which again makes CSA certification mandatory.

Apple and Alexa allows non-certified devices to be added but Google Home is not. Developers can add their own devices but he cannot sell un-certified devices because it is not allowed in Google Home.

@pierredelisle
Copy link
Contributor

@sushantr5
Correct, the Google Home App (GHA) currently doesn't allow users to commission unattested Matter devices.
We have been working on a solution for developers and users to commission devices without Matter certification. We will share updates through our regular channels soon.

@sushantr5
Copy link

sushantr5 commented Aug 27, 2023

I hope this will happen soon. I am waiting for it. Please update us here if possible timeline for it. @pierredelisle

@OlivierGre
Copy link
Author

OlivierGre commented Aug 29, 2023

@pierredelisle I'm now able to commission a non certified device. In June it was not working and I know now that it was due to my device which was running Matter 1.0. Now that my device has moved to Matter 1.1, I'm able to commission it with GHSAM.
Regards

@pierredelisle
Copy link
Contributor

Thanks for the update Olivier. Glad to hear it's finally working!

@sushantr5
Copy link

sushantr5 commented Aug 30, 2023

@pierredelisle I'm now able to commission a non certified device. In June it was not working and I know now that it was due to my device which was running Matter 1.0. Now that my device has moved to Matter 1.1, I'm able to commission it with GHSAM. Regards

Is it because of Matter 1.1 or due to update in Google Home ? @pierredelisle @OlivierGre

@OlivierGre
Copy link
Author

It was due to my device which was running Matter 1.0. The FW has been updated to Matter 1.1 and now it works.

A side comment:
As mentioned in the first message, I had created a project on Google Home developper console in order to be able to commission a non certified device.

@sushantr5
Copy link

It was due to my device which was running Matter 1.0. The FW has been updated to Matter 1.1 and now it works.

A side comment: As mentioned in the first message, I had created a project on Google Home developper console in order to be able to commission a non certified device.

@OlivierGre Thank you for update. I am waiting for the day when I can commission TEST matter device in Google Home WITHOUT Developer Console Project. Amazon Alexa and Apple Homekit can do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants