Socket error

Posted on
Sun Jan 27, 2019 7:16 am
msageryd offline
Posts: 23
Joined: Jan 24, 2019

Socket error

I'm using the DCS plugin with an EnvisaLink 4 connected to my DCS 1864. Everything connects fine and I get all the data I want from the alarm. But the plugin frequently reloads due to socket errors. This happens every couple of minutes. Sometimes it even fails to reload due to the same error. Here is a section from the log:

What should I do to investigate this further?

Code: Select all
27 Jan 2019 at 13:52:06
   DSC Alarm Error                 Connection RX Error: socket disconnected
   DSC Alarm Error                 Tried to read data but socket seems to have closed.  Trying to re-initialize.
   DSC Alarm                       Initializing communication at address: 10.0.0.13:4025
   DSC Alarm                       Communication established
   DSC Alarm                       Connected to Envisalink.
   DSC Alarm Error                 Timed out after waiting for response to command 0561 for 3 seconds, retrying.
   DSC Alarm Error                 Timed out after waiting for response to command 0561 for 3 seconds, retrying.
   DSC Alarm Error                 Connection RX Error: connection failed ([Errno 54] Connection reset by peer)
   DSC Alarm Error                 Connection TX Error: socket connection failed: [Errno 32] Broken pipe
   Error                           plugin "DSC Alarm 2.2.2" (pid 13560) unexpectedly stopped -- restarting in 5 seconds
   Reloading plugin "DSC Alarm 2.2.2"
   Starting plugin "DSC Alarm 2.2.2" (pid 13717)
   DSC Alarm                       Log level preferences are set to "Normal".
   Started plugin "DSC Alarm 2.2.2"
   DSC Alarm                       Your plugin version, v2.2.2, is current.
   DSC Alarm                       Initializing communication at address: 10.0.0.13:4025
   DSC Alarm                       Communication established
   DSC Alarm                       Connected to Envisalink.
   DSC Alarm Error                 Connection RX Error: socket disconnected
   DSC Alarm Error                 Tried to read data but socket seems to have closed.  Trying to re-initialize.
   DSC Alarm                       Initializing communication at address: 10.0.0.13:4025
   DSC Alarm                       Communication established
   DSC Alarm                       Connected to Envisalink.
   DSC Alarm Error                 Timed out after waiting for response to command 0561 for 3 seconds, retrying.
   DSC Alarm Error                 Timed out after waiting for response to command 0561 for 3 seconds, retrying.
   DSC Alarm Error                 Connection RX Error: connection failed ([Errno 54] Connection reset by peer)
   DSC Alarm Error                 Connection TX Error: socket connection failed: [Errno 32] Broken pipe
   Error                           plugin "DSC Alarm 2.2.2" (pid 13717) unexpectedly stopped -- restarting in 20 seconds

Posted on
Sun Jan 27, 2019 12:16 pm
Monstergerm offline
Posts: 274
Joined: Sep 01, 2009

Re: Socket error

Is this a new error or did the EVL-4 never properly work?
Have you tried the obvious things: restart Mac, IndigoServer, Router?

The error points to an issue with the EVL-4 and your network.
Can you connect directly to the internal website of the EVL-4 (in your case at 10.0.0.13)?
Do you have the latest firmware version 01.02.130?
Try restarting the EVL-4 from its internal website.

I also suggest to assign a fixed IP address in the upper range to the EVL-4 to avoid any potential conflicts with duplicate IP addresses.

Posted on
Mon Jan 28, 2019 4:32 am
msageryd offline
Posts: 23
Joined: Jan 24, 2019

Re: Socket error

Thanks.
I'll check out the firmware version and restart the EVL. Yes, I can connect directly to EVL. Just to clarify, everything works. I can create trigger based on events in the DCS. I also get all the reporting from EVL, such as zone status, etc.

I don't know what could cause a socket to close regularly. There is no firewall activated on the MacMini. Before installing Indigo I made a clean install of Mojave from USB stick. I have since installed Postscript via Homebrew. There shouldn't be any port clashes (and if there were, I suppose more stuff would broke).

Re. the IP address. I'm using the upper range for DHCP.The lower range is for my server-stuff. I have full control over the static addresses, both in my documentation and live in my Unifi controller.

Who is responsible for the socket communication? Is the DCS plugin opening and maintaining its own sockets, or are the sockets managed centrally by Indigo?

One more thing. I have not set up an EnvisaLink account. Could there be any problems with the plugin when no external communication is allowed? I'm absolutely not going to setup communication with my alarm from outside of my network.

Posted on
Mon Jan 28, 2019 3:02 pm
msageryd offline
Posts: 23
Joined: Jan 24, 2019

Re: Socket error

I have now upgraded firmware (substantial upgrade). I'm hoping this will solve the problem..

It seems that the only way to upgrade firmware is to create an account at eyezone.com. A couple of minutes after I created the account and linked my EVL4 the firmware was automatically upgraded from 01.00.100 to 01.02.136. That's quite an upgrade, so I'm hoping it had some fixes in it.

I'm really not comfortable with having my alarm connected to a server outside of my local network, so I removed the device link as soon as the firmware was upgraded.

I'll report back here when it has been running for a while.

Posted on
Mon Jan 28, 2019 6:53 pm
agame offline
Posts: 514
Joined: Jul 13, 2017
Location: Melbourne, Australia

Re: Socket error

I also have an Envisalink 4, and can confirm that (in my instance) it runs without generating errors without an active Envisalink account.

Posted on
Mon Jan 28, 2019 10:55 pm
msageryd offline
Posts: 23
Joined: Jan 24, 2019

Re: Socket error

No luck..
The error hunt continues.
The errors are sometimes very frequent (within minutes). I doubt that the socket is closed by the os due to inactivity within this short time.

Often the error is resolved after a retry, but sometimes it seems like the plugin has to be restarted by Indigo:

Code: Select all
   DSC Alarm Error                 Connection RX Error: socket disconnected
   DSC Alarm Error                 Tried to read data but socket seems to have closed.  Trying to re-initialize.
   DSC Alarm                       Initializing communication at address: 10.0.0.13:4025
   DSC Alarm                       Communication established
   DSC Alarm                       Connected to Envisalink.
   DSC Alarm Error                 Timed out after waiting for response to command 0561 for 3 seconds, retrying.
   DSC Alarm Error                 Timed out after waiting for response to command 0561 for 3 seconds, retrying.
   DSC Alarm Error                 Connection RX Error: connection failed ([Errno 54] Connection reset by peer)
   DSC Alarm Error                 Connection TX Error: socket connection failed: [Errno 32] Broken pipe
   Error                           plugin "DSC Alarm 2.2.2" (pid 20912) unexpectedly stopped -- restarting in 20 seconds


On a side note:
While upgrading the firmware, the EVS triggered a battery failure alarm in my DCS panel. My alarm is monitored, so the monitor firm called me due to this alarm. This is quite bad behaviour from the EVS (IMO), and is argument in itself to stay away from the automatic updates which you get when EVS is linked to EyezOn.

Posted on
Tue Jan 29, 2019 11:45 am
Monstergerm offline
Posts: 274
Joined: Sep 01, 2009

Re: Socket error

Definitively something weird going on here. The EVL-4 firmware upgrade should not trigger battery alarms. I went through many firmware upgrades without problems.

The socket error was an issue of an earlier firmware version but has since then been fixed. I do get sometimes a single socket error but only once every 2-3 months and it immediately fixes itself.
I wonder whether Mojave introduced this problem because of tighter security. Are you sure nothing else is using port 4025? Is the network connection of the EVL-4 solid (good cable, not Wifi)? No old computer still trying to connect to the EVL-4?

Posted on
Tue Jan 29, 2019 11:14 pm
msageryd offline
Posts: 23
Joined: Jan 24, 2019

Re: Socket error

Hmm, this morning EVL missed an event. I have a trigger for turning lights on when I disarm in the morning. This has worked well, but this morning there was no disarm-event to trigger from.

I disarmed at about 05:53. Three minutes before this there was a socket error. I don't know if the error is related to the missed event. But this behaviour is a no go..

The EVL is connected to the same Gbit switch as the MacMini running Indigo. They sit next to each other with a patch cable length of 0.5 m respectively. I'll try to switch out the patch cables to rule bad cable scenario. Otherwise I'm leaning towards my EVL is a bad unit.

Code: Select all
30 Jan 2019 at 05:51:18
   DSC Alarm Error                 Connection RX Error: socket disconnected
   DSC Alarm Error                 Tried to read data but socket seems to have closed.  Trying to re-initialize.
   DSC Alarm                       Initializing communication at address: 10.0.0.13:4025
   DSC Alarm                       Communication established
   DSC Alarm                       Connected to Envisalink.


I got no motion detector events either. About 10 seconds after disarming I should have got a zone event from a nearby motion detector. This didn't happen. I got a new error two minutes later though:

Code: Select all
   DSC Alarm Error                 Connection RX Error: connection failed ([Errno 54] Connection reset by peer)
   DSC Alarm Error                 Tried to send data but socket seems to have closed.  Trying to re-initialize.
   DSC Alarm                       Initializing communication at address: 10.0.0.13:4025
   DSC Alarm                       Communication established
   DSC Alarm                       Connected to Envisalink.


30 seconds after this error I started to receive zone events again.

Posted on
Wed Jan 30, 2019 2:39 am
msageryd offline
Posts: 23
Joined: Jan 24, 2019

Re: Socket error

I searched some for socket problems on Mojave. Found this:
http://www.yellow-bricks.com/2018/11/26/ssh-broken-pipe-osx/

It's an SSH problem, but the "broken pipe" part might be related. I might be on deep water here, mind you.. The solution to the linked problem was to add IPQoS=throughput to the SSH command. Is there a setting like this for the socket communication that the DCS plugin uses?

N.B. I'm using SSH all day on Mojave with no problems whatsoever. Cannot relate to the linked problem, but it still seems interesting. Did Apple add something in Mojave that forces software to ask for prioritised traffic in order to work stably?

Posted on
Wed Jan 30, 2019 12:22 pm
Monstergerm offline
Posts: 274
Joined: Sep 01, 2009

Re: Socket error

The plugin imports the python serial module. It then sends this command in your case:
serial.serial_for_url('socket://10.0.0.13:4025', baudrate=115200)

You can look at all the communication routines starting around line 870 in the plugin.py file.

It would be good to hear from any Mojave users whether they have similar problems. There probably aren't many Indigo users out there because of the known problems with Mojave or High Sierra and the PowerLinc adaptor.

You can also check the EyezOn forum for similar issues although I did not see anything.
http://forum.eyez-on.com/FORUM/

Posted on
Thu Jan 31, 2019 11:02 am
msageryd offline
Posts: 23
Joined: Jan 24, 2019

Re: Socket error

I have now tried with a new patch cable. I also tried to change the speed negotiation in the switch from Auto to 10Mbit. Still the same errors.

I just discovered that directly after a recovery from an error, either by a plugin restart or by a socket retry, the EVL seems to send the current arm status as an event. During the night I got "Armed in stay mode" after every error, i.e. about each 5-10 minutes. Is this normal behaviour for the EVL?'

I reached out to the shop where I bought the EVL. They said: "if you can logon to the EVL via the web interface it's a working unit and we cannot help you".

This seems to boil down to one of two things:
1. My EVL is a lemon
2. Mojave gets the DCS plugin into trouble

I have no idea of how to go further with this :(

Posted on
Thu Jan 31, 2019 11:09 am
msageryd offline
Posts: 23
Joined: Jan 24, 2019

Re: Socket error

While examining the log a bit closer I noticed that some of the errors are different. This might be a result of the actual socket error, but I'll post it here, should it give anyone an idea..

Code: Select all
31 Jan 2019 at 17:50:41
   DSC Alarm Error                 Connection RX Error: connection failed ([Errno 54] Connection reset by peer)
   DSC Alarm Error                 Tried to send data but socket seems to have closed.  Trying to re-initialize.
   DSC Alarm                       Initializing communication at address: 10.0.0.13:4025
   DSC Alarm                       Communication established
   DSC Alarm Error                 Connection RX Error: socket disconnected
   DSC Alarm Error                 Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 2144, in runConcurrentThread
ValueError: invalid literal for int() with base 10: '-'

   DSC Alarm Error                 plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   DSC Alarm Error                 Connection RX Error: socket disconnected
   DSC Alarm Error                 Connection RX Error: socket disconnected
   DSC Alarm Error                 Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 2144, in runConcurrentThread
ValueError: invalid literal for int() with base 10: '-'

   DSC Alarm Error                 plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   DSC Alarm Error                 Connection RX Error: connection failed ([Errno 54] Connection reset by peer)
   DSC Alarm Error                 Connection TX Error: socket connection failed: [Errno 32] Broken pipe
   Error                           plugin "DSC Alarm 2.2.2" (pid 30315) unexpectedly stopped -- restarting in 5 seconds
   Reloading plugin "DSC Alarm 2.2.2"
   Starting plugin "DSC Alarm 2.2.2" (pid 30718)
   DSC Alarm                       Log level preferences are set to "Normal".
   Started plugin "DSC Alarm 2.2.2"
   DSC Alarm                       Initializing communication at address: 10.0.0.13:4025
   DSC Alarm Error                 Error opening socket: Could not open port socket://10.0.0.13:4025: timed out
   DSC Alarm                       Plugin will attempt to re-initialize again in 3 minutes.

Posted on
Thu Jan 31, 2019 12:34 pm
Monstergerm offline
Posts: 274
Joined: Sep 01, 2009

Re: Socket error

This is interesting. The plugin expects a response of 0, 1, 2, or 3 from the Envisalink after login with your password, but it gets '-'.

Perhaps this is just a consequence of the socket being closed already. But could there be something wrong with your password trying to connect to the Envisalink (not your alarm password)?
Are you still using the default 'user' password? Try changing it to something else.

Also line 2158 of the plugin.py file has a sleep(1) set to prevent lockup of the Envisalink. Perhaps try changing this to sleep(2) and see if this helps.

And regarding to your other question, yes the EVL-4 sends an update of the arm status of all partitions after a plugin reload.

Posted on
Thu Jan 31, 2019 5:19 pm
msageryd offline
Posts: 23
Joined: Jan 24, 2019

Re: Socket error

I actually tried to change the EVL password, but the new pssword wouldn’t stick, so I’m using the default for now. Could my attempt to change the password have worked a little bit? It seems unlikely, but I’ll try to change the password again tomorrow.

Posted on
Fri Feb 01, 2019 2:28 am
msageryd offline
Posts: 23
Joined: Jan 24, 2019

Re: Socket error

I changed the EVL password and reloaded the plugin.
No difference, the problem still haunts me.

Who is online

Users browsing this forum: No registered users and 1 guest