Skip to content

Comments

Scope link-local IPv6 addresses received from WebSocket#501

Merged
marcelveldt merged 6 commits intomatter-js:mainfrom
agners:scope-link-local-addresses-for-commissioning-with-ip
Jan 11, 2024
Merged

Scope link-local IPv6 addresses received from WebSocket#501
marcelveldt merged 6 commits intomatter-js:mainfrom
agners:scope-link-local-addresses-for-commissioning-with-ip

Conversation

@agners
Copy link
Collaborator

@agners agners commented Jan 11, 2024

Scope link-local IPv6 addresses received from WebSocket

When receiving link-local IPv6 addresses, remove the scope by default
as the scope id is typically from a remote machine (e.g. from the Android
phone).

If the Matter server got started with a primary interface set, scope the
link-local address to that interface instead.

This fixes commissioning issue for WiFi devices when using the Android
in-app commissioning flow which sends the IP address of the device
to be commissioned alongside.

This also bumps the CHIP wheels to the latest version v2024.1.0 which is
required for interface id support in the ConnectIP IP (see
home-assistant-libs/chip-wheels#27).

Related-to: #463

This release supports scope_id in the CommissionIP API.
When receiving link-local IPv6 addresses, remove the scope by default
as the scope id is typically from a remote machine (e.g. from the Android
phone).

If the Matter server got started with a primary interface set, scope the
link-local address to that interface instead.

This fixes commissioning issue for WiFi devices when using the Android
in-app commissioning flow which sends the IP address alongside.

Related-to: matter-js#463
@agners
Copy link
Collaborator Author

agners commented Jan 11, 2024

I've tested that with an Android App build which has #4069 merged, and things seem to work as they should:

2024-01-11 20:02:58 core-matter-server matter_server.server.client_handler[915] DEBUG [548573940624] Received CommandMessage(message_id='f68961725b51426cb9063a29c7a0ce9c', command='commission_on_network', args={'setup_pin_code': 16026640, 'ip_addr': 'fe80::daa0:11ff:fe92:6a65%47'})
2024-01-11 20:02:58 core-matter-server matter_server.server.client_handler[915] DEBUG [548573940624] Handling command commission_on_network
2024-01-11 20:02:58 core-matter-server matter_server.server.server[915] DEBUG Setting scope of link-local IP address fe80::daa0:11ff:fe92:6a65 to end0
2024-01-11 20:02:58 core-matter-server matter_server.server.device_controller[915] INFO Starting Matter commissioning with IP using Node ID 96 via IP address fe80::daa0:11ff:fe92:6a65%end0.

This will need an add-on change (to pass --primary-interface).

@agners agners added the bugfix Pull request that fixes a (known) issue/bug label Jan 11, 2024
Copy link
Collaborator

@marcelveldt marcelveldt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left one comment (to fix the lint issue)

@marcelveldt marcelveldt merged commit 234b80d into matter-js:main Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes a (known) issue/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants