Skip to content

"Something went wrong" when commissioning through Android app #463

@agners

Description

@agners

When trying to commission a device through the Android App sometimes simply "Something went wrong" is returned.

Note: There might be multiple issue behind that particular error, but this outlines what I've been able to reproduce here.

There are two ways to on-board a Matter device to Home Assistant using Android:

  1. Waiting for the half-screen pop-up to appear, then choose the Home Assistant app
  2. Open the Home Assistant App, then adding a Matter device by navigating to Settings > Devices & services > Devices > Add Device > Add Matter device

When using method 2, the Android app uses the matter/commission_on_network WS command is used. The passcode is passed to this endpoint, no further information. The Matter Server (SDK) then searches for any commissionable device on the network, and (presumably) picks the first it hears about. This of course could be a different one.

Furthermore, a BR might cache DNS-SD entry for a commissionable device (any BR runs a SRP server, which caches service announcements on behalf of Thread devices). Now if a Thread device got reset during commissioning at one point, such a stale entry might linger around for up to 2h (in my particular test case).

I've noticed this by checking the service announcements during a failed commissioning attempt. Two announcements were present:

$ sudo dns-sd -B _matterc._udp local
Browsing for _matterc._udp.local
DATE: ---Wed 13 Dec 2023---
19:45:23.143  ...STARTING...
Timestamp     A/R    Flags  if Domain               Service Type         Instance Name
19:45:23.143  Add        3   2 local.               _matterc._udp.       14C551B182BE1DB4
19:45:23.143  Add        2   2 local.               _matterc._udp.       9FD5C3686D913371  

And it turned out that in this case the second announcement was from a stale Thread device from the OTBR Add-on:

(I've run this command for debugging from within the container)

$ ot-ctl srp server service
...
9FD5C3686D913371._matterc._udp.default.service.arpa.
    deleted: false
    subtypes: _V4447,_T65535,_S15,_L3840
    port: 5540
    priority: 0
    weight: 0
    ttl: 7200
    lease: 7200
    key-lease: 680400
    TXT: [VP=343434372b38313934, DT=3635353335, SII=35333030, SAI=353530, T=30, D=33383430, CM=30, RI=303230304539314145334235424534423833304331314237334346463637464334423335, PH=3336, PI=]
    host: 86579A470F4CE412.default.service.arpa.
    addresses: [fd82:c9e9:5cb7:1:3b2a:c0f6:fcfd:7e61]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions