I've written a python v2.7.6 script on a Mac Book to monitor an EVL-3 connected to a DSC PC1616. For the most part everything works fine. I can send commands (arm, disarm, status) and receive responses and everything works. Yeah !
My problem is after several hours the EVL-3 seems to get stuck and stops responding to polls, or the EVL-3 drops the connection. I retry the poll 3 times and then close the connection (if I retry polls too many times then I need to reboot the EVL-3).
What am I doing wrong?
* Using a thread, the script sends a poll command [000] to the EVL-3 every minute. When I first started developing the script, I was polling every ten seconds so I could see if the script stopped. 10s was clearly too often, and raising the interval to a minute increased EVL-3 up time from 2 hours to almost 4 hours. Should this be a longer interval, say 10 minutes to an hour?
* Using a thread, my script asks for status [001] once every ten minutes. Should I take this out or increase the interval, say to once an hour?
* The main part of the scripts starts the two threads, listens for user input command, and does a non-blocking receive from the EVL-3 and then decodes the response
ADDED ON 23JAN: I added some code to identify when the EVL-3 drops the link (after detecting down connection [.recv returns a 0 length string], the script sleeps for 10 seconds and then tries to reconnect). With this change, the connection stayed up for four hours. But when it goes down now, the EVL-3 must be restarted or I must wait one hour for the EVL-3 to come back on its own.
Here is some output from my script:
2015/01/20 20:48:59 - system: start envisalink script
2015/01/20 20:48:59 - system: connect 192.168.1.92 on port 4025
2015/01/20 20:49:00 - send [005mypswd]: login
2015/01/20 20:49:00 - system: threads = 1
2015/01/20 20:49:00 - system: file descriptors = 4
2015/01/20 20:49:00 - send [001]: get status
2015/01/20 20:49:00 - send [000]: poll
2015/01/20 20:49:00 - received [5053]: socket setup. request password
2015/01/20 20:49:01 - received [500005]: ack login
2015/01/20 20:49:01 - received [5051]: login successful
2015/01/20 20:49:01 - received [500001]: ack status report
2015/01/20 20:49:01 - received [610001]: zone front door or door to garage closed
2015/01/20 20:49:01 - received [610002]: zone motion sensor closed
2015/01/20 20:49:01 - received [610003]: zone back door closed
2015/01/20 20:49:01 - received [610004]: zone common area windows closed
2015/01/20 20:49:01 - received [610005]: zone spare bedroom windows closed
2015/01/20 20:49:01 - received [610006]: zone master bedroom windows closed
2015/01/20 20:49:01 - received [500000]: ack poll
2015/01/20 20:49:02 - received [6501]: partition 1 ready
2015/01/20 20:49:02 - received [8411]: partition 1 trouble LED off
2015/01/20 20:49:02 - received [51085]: lit keypad LEDs = ready memory backlight
2015/01/20 20:50:00 - send [000]: poll
2015/01/20 20:50:02 - received [500000]: ack poll
... goes for a couple of hours
2015/01/20 22:59:02 - send [000]: poll
2015/01/20 22:59:02 - received [500000]: ack poll
2015/01/20 23:00:02 - send [000]: poll
2015/01/20 23:01:02 - system: threads = 3
2015/01/20 23:01:02 - system: file descriptors = 4
2015/01/20 23:01:02 - send [001]: get status
2015/01/20 23:01:02 - send [000]: poll
2015/01/20 23:01:02 - system: poll retry = 1
2015/01/20 23:01:03 - received [500000]: ack poll
2015/01/20 23:02:02 - send [000]: poll
2015/01/20 23:03:02 - send [000]: poll
2015/01/20 23:03:02 - system: poll retry = 1
2015/01/20 23:04:02 - send [000]: poll
2015/01/20 23:04:02 - system: poll retry = 2
2015/01/20 23:05:02 - send [000]: poll
2015/01/20 23:05:02 - system: poll retry = 3
2015/01/20 23:06:02 - fatal: connection closed, no response to poll
the above shows the script dropping the connection after a failure to respond to three polls, and below is an example of the connection being dropped ...
2015/01/20 07:32:35 - fatal: socket error 32 in sendCommand
Of course, any help would be appreciated.
Thanks.
Jeff
EVL-3 PC1616 drops connection
Moderators: EyezOnRich, GrandWizard
Re: EVL-3 PC1616 drops connection
The problem above is fixed.
I posted a Intsructable at:
http://www.instructables.com/id/Etherne ... ty-System/
The code is available from:
GitHub http://github.com/dumbo25/ev3_cmd
My current version of my ev3 script is v28. GitHub has version v24. I need to update GitHub.
The current code on GitHub should not drop the link. My goal is to automate my home using a raspberry pi. There are were several issues that combined to cause the issue above: #1 The ev3 has a relatively small buffer, which over runs if too many requests are made. Slowing down the request rate helped. #2 The raspberry pi, while claiming to have 802.11n wi-fi, only transfers data at less than 2Mbps. #3 I moved my U-verse from HomePNA and coax to IPTV over ethernet. U-verse does periodic multicast to every device on the network. Creating a VLAN for my U-verse receivers and DVR, reduced the number of packets hitting the ev3.
I posted a Intsructable at:
http://www.instructables.com/id/Etherne ... ty-System/
The code is available from:
GitHub http://github.com/dumbo25/ev3_cmd
My current version of my ev3 script is v28. GitHub has version v24. I need to update GitHub.
The current code on GitHub should not drop the link. My goal is to automate my home using a raspberry pi. There are were several issues that combined to cause the issue above: #1 The ev3 has a relatively small buffer, which over runs if too many requests are made. Slowing down the request rate helped. #2 The raspberry pi, while claiming to have 802.11n wi-fi, only transfers data at less than 2Mbps. #3 I moved my U-verse from HomePNA and coax to IPTV over ethernet. U-verse does periodic multicast to every device on the network. Creating a VLAN for my U-verse receivers and DVR, reduced the number of packets hitting the ev3.
Re: EVL-3 PC1616 drops connection
Nice project, does exist any possibility to implement with Arduino instead Raspberry?.