Luligu / matterbridge

Matterbridge plugin manager for Matter
https://github.com/Luligu/matterbridge/blob/main/README.md
Apache License 2.0
255 stars 25 forks source link

Reconnection issue with Alexa and 3 interfaces #128

Closed viama closed 1 month ago

viama commented 2 months ago

Hello,

I am running Matterbridge v1.5.5 and the v2.1.16 z2m plugin in the docker container, and have been facing an issue with the container exiting with exit code 1. I've been getting Alexa to consume the fabric as a test, but I'd like to add Google Home at some point. I have 87 devices exposed at the moment, having filtered out some of the >100 I have.

The container restarts as configured, but it's apparent that all of the devices are then rediscovered by Alexa.

I've attached the logs from the container: _ha_matterbridge.1.03k0sun2a23p52k3flieemt5b_logs.txt

Thanks for a great project

Luligu commented 2 months ago

Hi, first of all thanks for your appreciation. I need the full log from start to at least 10 minutes. So please leave the log level to debug and log on file on for both Matterbridge and Matter, restart, wait a few minutes then download both logs and send them.

Apollon77 commented 2 months ago

Also out of interest: @viama how many Alexa/Echo devices you have in your network?

viama commented 2 months ago

I think I've got 4 active echos on my network. A newish Pop and the others are 1st gen Dots

I've attached the logs you requested: matter.log matterbridge.log

Apollon77 commented 2 months ago

I think you need to wait longer ... this is just the start of the matterbridge... no echo did yet connected at all, so bridge was also not crashing :-) ideally get debug log from start till crash

Apollon77 commented 2 months ago

PS: The log is just interesting in a way that it added NEW endpoints for all the devices, so as if the bridge was configured freshly

Luligu commented 2 months ago

HI, use this settings please: image And yes wait at least 10 minutes so we have the full logs.

Concerning alexa, (at least my 2 echos) are very sensitive to the mdns interface: I saw you have 3 eth0 eth1 eth2. I would put the one for the matter network in mdns matter interface...

Also what machine you ran the matterbridge docker on?

Btw very interesting network and z2m setup.

Thanks.

viama commented 2 months ago

matter.log matterbridge.log Please try these, it hasn't crashed since 1500 UK odd.

Yes, the network is a little funky. I'm using a small Dell Wyse 7060 to run HA, and that's where matterbridge is running too. I use a macvlan interface in docker swarm for stuff like this that needs to do mDNS / broadcast stuff. I have been considering moving matterbridge to another docker host thats a bit more straightforward (not swarm!)

cheers

Apollon77 commented 2 months ago

In fact the crash reason of initial log I already found and will fix in a next matter.js version and it should be special case because he was not able to find any communication channel, so likely it was something strange with the network.

When looking at the log I see again ew endpoint ids got assigned which is all strange beause that way the bridge is always new so also Alexa needs to reinit all devices on each start and would also loose all routines ... so thats tsrange and shuld be checked @Luligu ... likely this is also a reason for "that many stuff" going on here on start because alexa needs to throw away all devices and re-learn them.

I still need to look into that log deeper because stuff is happening tat I can not understand currently ... there are issues with sending subscription updates and this leads to a constantly resubscribes which costs a lot of traffic ...

viama commented 2 months ago

I have moved the container to a simpler host for a stability test, I'll let you know if I have any issues. I can shift it back again if you need me to test anything.

Apollon77 commented 2 months ago

Why you renamed the issue? There are no commissioning issues here ... it is just reconnection issues with Alexa. In fact I found the reasons why the crash happened and one more thing I saw in the log. Why alexa is not reavhable to send subscription updates which then leads to resubscribe basically every hour I do not know :)

Luligu commented 2 months ago

I have moved the container to a simpler host for a stability test, I'll let you know if I have any issues. I can shift it back again if you need me to test anything.

Did you try before to use mdns interface to limit matter mdns? Was it useful?

viama commented 2 months ago

I have moved the container to a simpler host for a stability test, I'll let you know if I have any issues. I can shift it back again if you need me to test anything.

Did you try before to use mdns interface to limit matter mdns? Was it useful?

yes, it didn't help, I limited the interfaces and has the same issue.

Luligu commented 2 months ago

Hi, @Apollon77 published a fix in 0.10.3. I updated the dev now. Can you please try to use the dev instead of the latest from docker hub and let us know? I'm interested also about any other observations from you about the dev cause is on Debian 12 with node 22 ( @tammeryousef1006 and I are testing it since a while before moving also the latest to Debian 12 and node 22). Thank you.

Luligu commented 1 month ago

@viama can I close this issue? Cause matter.js is 0.10.6 and matterbridge is 1.5.9 so all is a little too old.

viama commented 1 month ago

Working well for me now, but did move to a single interfaced machine