Author Topic: Plugin loses connection to Elk Panel (Serial to USB)  (Read 5132 times)

Offline salilathalye

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Re: Plugin loses connection to Elk Panel (Serial to USB)
« Reply #15 on: January 05, 2016, 07:16:07 am »
Connection lost this morning.

02      01/05/16 7:12:54.842    luup_log:237: ElkPlugin::Zone Change Update:Plugin not initialized <0x2f9ad680>
02      01/05/16 7:12:54.860    luup_log:237: ElkPlugin::checkMessage: length=11(0x0B), message type=PC, data='A0301', misc=00, checksum=96 <0x2f9ad680>
02      01/05/16 7:12:54.861    luup_log:237: ElkPlugin::processMessage: Unhandled message type 'PC' <0x2f9ad680>
02      01/05/16 7:12:56.280    luup_log:237: ElkPlugin::checkMessage: length=11(0x0B), message type=PC, data='A0501', misc=00, checksum=94 <0x2f9ad680>
02      01/05/16 7:12:56.281    luup_log:237: ElkPlugin::processMessage: Unhandled message type 'PC' <0x2f9ad680>
02      01/05/16 7:12:57.680    luup_log:237: ElkPlugin::checkMessage: length=10(0x0A), message type=ZC, data='0013', misc=00, checksum=CE <0x2f9ad680>
02      01/05/16 7:12:57.681    luup_log:237: ElkPlugin::handlerFunc Message type description: Zone Change Update <0x2f9ad680>
02      01/05/16 7:12:57.681    luup_log:237: ElkPlugin::Zone Change Update:Plugin not initialized <0x2f9ad680>
02      01/05/16 7:13:00.611    luup_log:237: ElkPlugin::checkMessage: length=25(0x19), message type=KC, data='0100000000001111111', misc=00, checksum=10 <0x2f9ad680>
02      01/05/16 7:13:00.612    luup_log:237: ElkPlugin::handlerFunc Message type description: Keypad KeyChange Update <0x2f9ad680>
02      01/05/16 7:13:11.870    luup_log:237: ElkPlugin::checkMessage: length=10(0x0A), message type=ZC, data='001A', misc=00, checksum=C0 <0x2f9ad680>
02      01/05/16 7:13:11.871    luup_log:237: ElkPlugin::handlerFunc Message type description: Zone Change Update <0x2f9ad680>
02      01/05/16 7:13:11.872    luup_log:237: ElkPlugin::Zone Change Update:Plugin not initialized <0x2f9ad680>
02      01/05/16 7:13:11.890    luup_log:237: ElkPlugin::checkMessage: length=11(0x0B), message type=PC, data='A0301', misc=00, checksum=96 <0x2f9ad680>
02      01/05/16 7:13:11.891    luup_log:237: ElkPlugin::processMessage: Unhandled message type 'PC' <0x2f9ad680>
02      01/05/16 7:13:13.400    luup_log:237: ElkPlugin::checkMessage: length=11(0x0B), message type=PC, data='A0501', misc=00, checksum=94 <0x2f9ad680>
02      01/05/16 7:13:13.401    luup_log:237: ElkPlugin::processMessage: Unhandled message type 'PC' <0x2f9ad680>
02      01/05/16 7:13:14.771    luup_log:237: ElkPlugin::checkMessage: length=10(0x0A), message type=ZC, data='0013', misc=00, checksum=CE <0x2f9ad680>
02      01/05/16 7:13:14.771    luup_log:237: ElkPlugin::handlerFunc Message type description: Zone Change Update <0x2f9ad680>
02      01/05/16 7:13:14.772    luup_log:237: ElkPlugin::Zone Change Update:Plugin not initialized <0x2f9ad680>
02      01/05/16 7:13:18.100    luup_log:237: ElkPlugin::checkMessage: length=10(0x0A), message type=ZC, data='001A', misc=00, checksum=C0 <0x2f9ad680>
02      01/05/16 7:13:18.101    luup_log:237: ElkPlugin::handlerFunc Message type description: Zone Change Update <0x2f9ad680>
02      01/05/16 7:13:18.101    luup_log:237: ElkPlugin::Zone Change Update:Plugin not initialized <0x2f9ad680>
02      01/05/16 7:13:18.120    luup_log:237: ElkPlugin::checkMessage: length=11(0x0B), message type=PC, data='A0301', misc=00, checksum=96 <0x2f9ad680>
02      01/05/16 7:13:18.121    luup_log:237: ElkPlugin::processMessage: Unhandled message type 'PC' <0x2f9ad680>
02      01/05/16 7:13:19.610    luup_log:237: ElkPlugin::checkMessage: length=11(0x0B), message type=PC, data='A0501', misc=00, checksum=94 <0x2f9ad680>
02      01/05/16 7:13:19.611    luup_log:237: ElkPlugin::processMessage: Unhandled message type 'PC' <0x2f9ad680>
02      01/05/16 7:13:20.600    luup_log:237: ElkPlugin::checkMessage: length=22(0x16), message type=XK, data='1006073050116010', misc=00, checksum=77 <0x2f9ad680>
02      01/05/16 7:13:20.601    luup_log:237: ElkPlugin::handlerFunc Message type description: Ethernet Module Test <0x2f9ad680>
02      01/05/16 7:13:20.960    luup_log:237: ElkPlugin::checkMessage: length=10(0x0A), message type=ZC, data='0013', misc=00, checksum=CE <0x2f9ad680>
02      01/05/16 7:13:20.961    luup_log:237: ElkPlugin::handlerFunc Message type description: Zone Change Update <0x2f9ad680>
02      01/05/16 7:13:20.962    luup_log:237: ElkPlugin::Zone Change Update:Plugin not initialized <0x2f9ad680>
02      01/05/16 7:13:22.590    luup_log:237: ElkPlugin::checkMessage: length=10(0x0A), message type=ZC, data='001A', misc=00, checksum=C0 <0x2f9ad680>
02      01/05/16 7:13:22.591    luup_log:237: ElkPlugin::handlerFunc Message type description: Zone Change Update <0x2f9ad680>
02      01/05/16 7:13:22.592    luup_log:237: ElkPlugin::Zone Change Update:Plugin not initialized <0x2f9ad680>
02      01/05/16 7:13:22.620    luup_log:237: ElkPlugin::checkMessage: length=11(0x0B), message type=PC, data='A0301', misc=00, checksum=96 <0x2f9ad680>
02      01/05/16 7:13:22.621    luup_log:237: ElkPlugin::processMessage: Unhandled message type 'PC' <0x2f9ad680>

Offline salilathalye

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Re: Plugin loses connection to Elk Panel (Serial to USB)
« Reply #16 on: January 05, 2016, 08:25:41 am »
Without any intervention on my part, the connection was reestablished a few minutes later. Here is a log file.

Offline zoot1612

  • Moderator
  • Hero Member
  • *****
  • Posts: 598
  • Karma: +19/-2
Re: Plugin loses connection to Elk Panel (Serial to USB)
« Reply #17 on: January 05, 2016, 08:26:46 am »
@salilathalye

At some point the plugin sets INITIALIZED = false. I have looked through the code and cannot see anywhere that this should happen (but it obviously does) can you check before this line.

Code: [Select]
02      01/05/16 7:12:54.842    luup_log:237: ElkPlugin::Zone Change Update:Plugin not initialized <0x2f9ad680>
to see if there are any lines that may contain anything that mentions connection or heartbeat.

Offline salilathalye

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Re: Plugin loses connection to Elk Panel (Serial to USB)
« Reply #18 on: January 05, 2016, 08:31:57 am »
I will check this evening, though the log may have wrapped. I've seen some heartbeat messages in red saying the ping time was 4 seconds.

I'm using tail -f <logfile> | grep "Elk*"

Is there a better way to capture the logs to prevent wrapping?

Thanks

Offline zoot1612

  • Moderator
  • Hero Member
  • *****
  • Posts: 598
  • Karma: +19/-2
Re: Plugin loses connection to Elk Panel (Serial to USB)
« Reply #19 on: January 05, 2016, 10:55:23 am »
@salilathalye
Everything going via log and debug should be picked up but I can't see the issue so trying to chase more info.

heartbeat uses the XK response to ensure that the links stays active. If it doesn't get an XK packet in a five minute interval the plugin should check the connection and if it has failed try to set it up again.

I think it must be failing in there somewhere but still at a loss to understand how.

Offline salilathalye

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Re: Plugin loses connection to Elk Panel (Serial to USB)
« Reply #20 on: January 07, 2016, 06:30:31 pm »
Just caught a situation where Elk and Vera lost communication. Here are the full logs using version 2.34 of your file that you sent me. I hope this can tell you why the plugin is reported as not initialized.

Offline salilathalye

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Re: Plugin loses connection to Elk Panel (Serial to USB)
« Reply #21 on: January 07, 2016, 06:47:52 pm »
Minutes later, the two reconnect without any intervention on my part other than issuing a tail -f Log command, which seemed to reload Luup.

Offline zoot1612

  • Moderator
  • Hero Member
  • *****
  • Posts: 598
  • Karma: +19/-2
Re: Plugin loses connection to Elk Panel (Serial to USB)
« Reply #22 on: January 07, 2016, 08:52:52 pm »
@salilathalye
  • Looks like something is restarting/reloading the LUUP engine, which is an issue in itself. I can't say what the issue might be as there are to many variables to take into account and may not be related to this plugin.
  • At startup it seems the ELK is not returning responses in the expected time so I have increased some of the wait periods to see if it helps. Updated file attached

Anyone else using the serial connectivity for this plugin having the same issues?

Offline salilathalye

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Re: Plugin loses connection to Elk Panel (Serial to USB)
« Reply #23 on: January 09, 2016, 07:46:15 am »
zoot1612,
I just downloaded and installed your latest file. Will send incident logs as they transpire.
Thanks for your help.

Offline salilathalye

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Re: Plugin loses connection to Elk Panel (Serial to USB)
« Reply #24 on: January 12, 2016, 03:36:09 pm »
zoot1612,
This is a 2.40 log when the Elk disconnected with the Vera.

Offline salilathalye

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Re: Plugin loses connection to Elk Panel (Serial to USB)
« Reply #25 on: January 12, 2016, 03:42:41 pm »
zoot1612,
This is using version 2.40 after a Vera reboot.

Offline zoot1612

  • Moderator
  • Hero Member
  • *****
  • Posts: 598
  • Karma: +19/-2
Re: Plugin loses connection to Elk Panel (Serial to USB)
« Reply #26 on: January 12, 2016, 07:16:14 pm »
zoot1612,
This is a 2.40 log when the Elk disconnected with the Vera.

I can't see the Elk disconnecting, it does spit an error (see below) which happens just before the Vera restarts and I assume it is because of the restart. After the restart does the Elk plugin automatically pick up the Elk panel again?

Code: [Select]
02      01/10/16 6:30:20.824    luup_log:237: ElkPlugin::checkMessage: Received message: 1 <0x2ebf7680>
50      01/10/16 6:30:20.835    luup_log:237: ElkPlugin::checkMessage: ERROR: The received message has invalid format. <0x2ebf7680>


Offline salilathalye

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Re: Plugin loses connection to Elk Panel (Serial to USB)
« Reply #27 on: January 13, 2016, 08:09:23 am »
I don't think it reconnects 100% of the time even after a reboot.

Offline zoot1612

  • Moderator
  • Hero Member
  • *****
  • Posts: 598
  • Karma: +19/-2
Re: Plugin loses connection to Elk Panel (Serial to USB)
« Reply #28 on: January 13, 2016, 07:04:04 pm »
@salilathalye
The issue is might be that the usb/serial interface is not coming up quick enough and the plugin fails at this point. You may be better off with the M1XEP or a serial Ethernet converter.

Caveat: No guarantee on this working so if you can test before committing to buy it would make sense.

Offline salilathalye

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Re: Plugin loses connection to Elk Panel (Serial to USB)
« Reply #29 on: January 23, 2016, 11:51:33 am »
zoot1612,
I landed up purchasing my second M1 XEP. I had one many years ago, but it got damaged after a lightning storm. Anyway, the M1 XEP is rock solid so far using your plugin.

During the installation of the M1 XEP I found that one of the M1 Gold settings was off, I think it was Event ASCII XMIT was set to off when it should be on according the the M1 XEP documentation. Not sure if this could be the cause of my prior intermittent issues with the serial to USB interface.

Thanks for helping the debug