Page 1 of 1

Envisalink 3 lock up

Posted: Tue Jan 24, 2023 11:19 pm
by ufodone
Hi, I've been troubleshooting an issue with someone's Envisalink 3 module when used through the envisalink integration in Home Assistant.

The connection to the envisalink becomes unresponsive for a couple of minutes. Any attempts to reconnect during that time are met with connection reset errors (I assume indicating that the device still thinks it has the original connection open). The symptoms look very similar to the bug resolved in this thread:

https://forum.eyezon.com/viewtopic.php? ... &start=10
We found a potential scenario whereby the TPI connection locks up for a couple of minutes and needs a socket reset to recover. You need a pretty noisy network to cause it to happen.
The issue appears to be very timing dependent and at one point it seemed related to both a send and receive happening within less than a millisecond. However, I wrote a script to try and reproduce this issue in a standalone manner but was unable to trigger the issue.

I have a set of network captures showing the problem that I'm happy to share. Here's a snippet of the problem:

Code: Select all

356	0.000505	envisalink.home	homeassistant.local	TCP	107	4025 → 45202 [PSH, ACK] Seq=5142 Ack=107 Win=1300 Len=53
357	0.000351	homeassistant.local	envisalink.home	TCP	60	45202 → 4025 [ACK] Seq=114 Ack=5195 Win=63965 Len=0
358	0.000298	envisalink.home	homeassistant.local	TCP	60	4025 → 45202 [ACK] Seq=5142 Ack=114 Win=1300 Len=0
359	0.000293	homeassistant.local	envisalink.home	TCP	60	[TCP Dup ACK 357#1] 45202 → 4025 [ACK] Seq=114 Ack=5195 Win=63965 Len=0
360	0.207263	homeassistant.local	envisalink.home	TCP	61	[TCP Spurious Retransmission] 45202 → 4025 [PSH, ACK] Seq=107 Ack=5195 Win=63965 Len=7
361	0.000686	envisalink.home	homeassistant.local	TCP	60	4025 → 45202 [ACK] Seq=5142 Ack=114 Win=1300 Len=0
362	0.290739	envisalink.home	homeassistant.local	TCP	63	[TCP Spurious Retransmission] 4025 → 45202 [PSH, ACK] Seq=5142 Ack=114 Win=1300 Len=9
363	0.000458	homeassistant.local	envisalink.home	TCP	60	[TCP Dup ACK 357#2] 45202 → 4025 [ACK] Seq=114 Ack=5195 Win=63965 Len=0
364	0.116122	homeassistant.local	envisalink.home	TCP	61	[TCP Spurious Retransmission] 45202 → 4025 [PSH, ACK] Seq=107 Ack=5195 Win=63965 Len=7
365	0.000688	envisalink.home	homeassistant.local	TCP	60	4025 → 45202 [ACK] Seq=5142 Ack=114 Win=1300 Len=0
From this trace it would appear that the envisalink's network stack just stops processing packets from the client as it doesn't seem to accept the client's ACK of the last data it sent (356).

I realize that the envisalink 3 is very old at this point so I don't know if there's interest in tracking this issue down but I do have the network captures and have someone who's system it is easily reproducible on.

Thanks!

Re: Envisalink 3 lock up

Posted: Wed Jan 25, 2023 10:04 pm
by tastycarp
I have been having weird things happening with my EnvisaLink 3
and home assistant lately.

I would be interested in playing with your script on my system to see if I have a similar issue.

Re: Envisalink 3 lock up

Posted: Thu Jan 26, 2023 11:01 am
by GrandWizard
Are you running the latest firmware? 1.12.204?

Re: Envisalink 3 lock up

Posted: Thu Jan 26, 2023 12:37 pm
by ufodone
Hi, the person I've been working with was running 1.12.203A. He did an update now to the latest although it is showing as 1.12.205A rather than the 1.12.204 you suggested. Is this to be expected?

I'll work with him to see if this firmware fixes the issue.

@tastycarp If you're having issues with your system an Home Assistant, feel free to open an issue there and I can try to help. I am working on a fairly big revamp of the integration which is what initially made this issue show up so if you're looking to confirm if it's the same issue, I'd suggest you head on over to https://github.com/ufodone/envisalink_new where I'm working on the changes and I can get you setup with a version that repros the issues much more rapidly.

Re: Envisalink 3 lock up

Posted: Thu Jan 26, 2023 6:55 pm
by tastycarp
I was running 01.12.202, I just requested 204 update.. will see how that goes.

Re: Envisalink 3 lock up

Posted: Fri Jan 27, 2023 11:52 pm
by tastycarp
Update: I think 205 firmware has fixed my issue.
In the end I don't think my issue was tpi related ... I suspected this as I was getting a fair few TPI login mails a day, but the main issue was slow or no update of zones and occasionally multiple open/closing extra mails instead of one. Testing I have done over the last day was to totally remove envisalink from home assistant and monitor on local and portal app and slow zone updates remained. After firmware finally updated to 205 I have just reconnected Home Assistant with the default integration and zones are updating live again. I will monitor it like this for a bit.

Re: Envisalink 3 lock up

Posted: Mon Jan 30, 2023 11:13 pm
by ufodone
After the upgrade to 205 this issue seems mostly gone. After the upgrade I think it happened a couple times over a couple days but has been good since. Previously this would happen non-stop.

Thanks!