gawindx / homebridge-risco-local-platform

This is plugin that integrate Homebridge with Risco Alarm Security System from local network.
MIT License
6 stars 4 forks source link

Unable to connect to panel to ProSysPlus panel #3

Open jaskedf opened 3 years ago

jaskedf commented 3 years ago

Hi,

I am trying to connect to my ProSYS Plus panel (Multi-socket IP module) without success.

Homebridge logs: [9/27/2021, 7:30:50 PM] [RiscoLocalAlarm] Initialising ProSysPlus Panel [9/27/2021, 7:30:50 PM] [RiscoLocalAlarm] Start Connection to Panel [9/27/2021, 7:30:50 PM] [RiscoLocalAlarm] Initial Discovery Phase Preparing Advertiser for 'RiscoLocalAlarm 137D' using ciao backend! Starting to advertise 'RiscoLocalAlarm 137D' using ciao backend! [9/27/2021, 7:30:50 PM] Homebridge v1.3.4 (RiscoLocalAlarm) is running on port 33624. [9/27/2021, 7:31:20 PM] [RiscoLocalAlarm] Socket Timeout. [9/27/2021, 7:31:20 PM] [RiscoLocalAlarm] TCP Socket Disconnected [9/27/2021, 7:31:20 PM] [RiscoLocalAlarm] Socket Closed. [9/27/2021, 7:31:20 PM] [RiscoLocalAlarm] TCP Socket Disconnected

Config: { "platform": "RiscoLocalAlarm", "name": "RiscoLocalAlarm", "Panel_IP": "x.x.x.x", "Panel_Port": xxxx, "Panel_Model": "prosysplus", "Panel_Password": xxxx, "Panel_Key": 1, "OccupancyPreventArming": true, "SystemMode": false, "Partition": "all", "Outputs": "all", "Detectors": "all", }

What am I doing wrong? Any help would be appreciated!

gawindx commented 3 years ago

Can you retry with debug mode enabled in Homebridge and post log?

jaskedf commented 3 years ago

[9/27/2021, 8:40:24 PM] [RiscoLocalAlarm] Socket Timeout. [9/27/2021, 8:40:24 PM] [RiscoLocalAlarm] Sending Command : DCN [9/27/2021, 8:40:24 PM] [RiscoLocalAlarm] Command CRC Value : A5E8 [9/27/2021, 8:40:24 PM] [RiscoLocalAlarm] Command Sent. [9/27/2021, 8:40:24 PM] [RiscoLocalAlarm] Sequence : 1 - Data Sent : DCN [9/27/2021, 8:40:24 PM] [RiscoLocalAlarm] SendCommand receive this response : undefined [9/27/2021, 8:40:24 PM] [RiscoLocalAlarm] Socket Destroyed. [9/27/2021, 8:40:24 PM] [RiscoLocalAlarm] Socket Disconnected. [9/27/2021, 8:40:24 PM] [RiscoLocalAlarm] TCP Socket Disconnected [9/27/2021, 8:40:24 PM] [RiscoLocalAlarm] Socket Closed. [9/27/2021, 8:40:24 PM] [RiscoLocalAlarm] TCP Socket Disconnected [9/27/2021, 8:40:24 PM] [RiscoLocalAlarm] Socket Disconnected. [9/27/2021, 8:40:34 PM] [RiscoLocalAlarm] Start Connection to Panel [9/27/2021, 8:40:34 PM] [RiscoLocalAlarm] TCP Socket is already created, Connect It [9/27/2021, 8:40:34 PM] [RiscoLocalAlarm] TCP Socket must be connected now [9/27/2021, 8:40:34 PM] [RiscoLocalAlarm] Start Connection to Panel [9/27/2021, 8:40:34 PM] [RiscoLocalAlarm] TCP Socket is already created, Connect It [9/27/2021, 8:40:34 PM] [RiscoLocalAlarm] TCP Socket must be connected now [9/27/2021, 8:40:34 PM] [RiscoLocalAlarm] Socket Connected. [9/27/2021, 8:40:34 PM] [RiscoLocalAlarm] Sending Command : RMT=xxxx [9/27/2021, 8:40:34 PM] [RiscoLocalAlarm] Command CRC Value : 7D35 [9/27/2021, 8:40:34 PM] [RiscoLocalAlarm] Command Sent. [9/27/2021, 8:40:34 PM] [RiscoLocalAlarm] Sequence : 1 - Data Sent : RMT=xxxx [9/27/2021, 8:40:39 PM] [RiscoLocalAlarm] SendCommand receive this response : undefined [9/27/2021, 8:40:39 PM] [RiscoLocalAlarm] Error when connecting to the control panel. [9/27/2021, 8:40:39 PM] [RiscoLocalAlarm] TCP Socket Disconnected

[9/27/2021, 8:41:07 PM] [RiscoLocalAlarm] Socket Error : Error: connect ETIMEDOUT _x.x.x.x:1000_ [9/27/2021, 8:41:07 PM] [RiscoLocalAlarm] TCP Socket Disconnected [9/27/2021, 8:41:07 PM] [RiscoLocalAlarm] Socket Disconnected. [9/27/2021, 8:41:07 PM] [RiscoLocalAlarm] Socket Closed. [9/27/2021, 8:41:07 PM] [RiscoLocalAlarm] TCP Socket Disconnected [9/27/2021, 8:41:07 PM] [RiscoLocalAlarm] Socket Disconnected.

[9/27/2021, 8:41:54 PM] [RiscoLocalAlarm] Start Connection to Panel [9/27/2021, 8:41:54 PM] [RiscoLocalAlarm] TCP Socket is already created, Connect It [9/27/2021, 8:41:54 PM] [RiscoLocalAlarm] TCP Socket must be connected now [9/27/2021, 8:41:54 PM] [RiscoLocalAlarm] Start Connection to Panel [9/27/2021, 8:41:54 PM] [RiscoLocalAlarm] TCP Socket is already created, Connect It [9/27/2021, 8:41:54 PM] [RiscoLocalAlarm] TCP Socket must be connected now [9/27/2021, 8:41:54 PM] [RiscoLocalAlarm] Start Connection to Panel [9/27/2021, 8:41:54 PM] [RiscoLocalAlarm] TCP Socket is already created, Connect It [9/27/2021, 8:41:54 PM] [RiscoLocalAlarm] TCP Socket must be connected now [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] Start Connection to Panel [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] TCP Socket is already created, Connect It [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] TCP Socket must be connected now [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] Start Connection to Panel [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] TCP Socket is already created, Connect It [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] TCP Socket must be connected now [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] Start Connection to Panel [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] TCP Socket is already created, Connect It [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] TCP Socket must be connected now [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] Start Connection to Panel [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] TCP Socket is already created, Connect It [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] TCP Socket must be connected now [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] Start Connection to Panel [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] TCP Socket is already created, Connect It [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] TCP Socket must be connected now [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] Start Connection to Panel [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] TCP Socket is already created, Connect It [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] TCP Socket must be connected now [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] Start Connection to Panel [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] TCP Socket is already created, Connect It [9/27/2021, 8:41:56 PM] [RiscoLocalAlarm] TCP Socket must be connected now [9/27/2021, 8:41:57 PM] [RiscoLocalAlarm] Start Connection to Panel [9/27/2021, 8:41:57 PM] [RiscoLocalAlarm] TCP Socket is already created, Connect It [9/27/2021, 8:41:57 PM] [RiscoLocalAlarm] TCP Socket must be connected now [9/27/2021, 8:41:59 PM] [RiscoLocalAlarm] Start Connection to Panel [9/27/2021, 8:41:59 PM] [RiscoLocalAlarm] TCP Socket is already created, Connect It [9/27/2021, 8:41:59 PM] [RiscoLocalAlarm] TCP Socket must be connected now [9/27/2021, 8:41:59 PM] [RiscoLocalAlarm] Start Connection to Panel [9/27/2021, 8:41:59 PM] [RiscoLocalAlarm] TCP Socket is already created, Connect It [9/27/2021, 8:41:59 PM] [RiscoLocalAlarm] TCP Socket must be connected now [9/27/2021, 8:42:01 PM] [RiscoLocalAlarm] Start Connection to Panel [9/27/2021, 8:42:01 PM] [RiscoLocalAlarm] TCP Socket is already created, Connect It [9/27/2021, 8:42:01 PM] [RiscoLocalAlarm] TCP Socket must be connected now

gawindx commented 3 years ago

I must admit that I would have preferred to have all the logs, or at least the beginning with the initialization of the plugin, the establishment of communication and the first errors. If you have the possibility to send it to me by mail (decauxnico@gmail.com). the information which you deem sensitive and which will be indicated there will remain confidential.

Regarding the error itself, keep in mind that my plugin is based on the risco communication protocol, the free implementation of which was implemented by @TJForc and, clearly, it is on this part that it blocks. In theory, communication with a Prosys central unit is possible but to date the proof has not yet been made and for the moment only the LightSys central unit is validated by TJForc (subject to having a multi socket IP module or that the control unit is not connected to RiscoCloud in the case of old IP modules). What I note for the moment is that the code indicated is not the code of the remote user by default, namely 5678. The question I am asking myself is whether this code is really the Remote User code of your control panel or if it is your user code (which I would tend to think since you are hiding it). have you tried using code 5678? if not for the rest of your config, it seems correct to me. The TCP port 1000 being the default one, you don't have to indicate it. For the IP address, I also suppose that it is well that of your central otherwise I think that you would not have the same error.

jaskedf commented 3 years ago

Nicolas, thanks for your time and analysis. I should have send the complete log, my bad. I will send it tomorrow via pm.

TJForc commented 3 years ago

Clearly, the problem encountered is due to a timeout. This means that the control panel does not respond within the allowed time BUT the problem may already be solved. I am currently working on the "proxy" mode and I had to do a lot of modification and correction during development. The new version will be available soon and all you have to do is integrate it into the @gawindx plugin. If this does not solve the problem, the only solution remaining will be to be able to connect to a Prosys control unit to understand what is happening because, theoretically, it is the same protocol for all the control units which can be programmed via the Risco " Configuration Software"

jaskedf commented 3 years ago

Hi @TJForc, thanks for your answer and the development of the new version. I look forward to test it when it is integrated in @gawindx's plugin.

gawindx commented 3 years ago

The package version has just been updated. Can you test it and give me a feedback to know if the problem you are having is still relevant with the changes made by @TJForc?

jaskedf commented 3 years ago

Thanks for the update. I now have the exact same issue as reported by @andyblac https://github.com/gawindx/homebridge-risco-local-platform/issues/4

TJForc commented 3 years ago

Sure enough, the error is in my code. My test environment did not allow me to see that I had forgotten to rename this export. it is corrected on my side. To solve your problem, all you have to do is install a previous version of 'homebridge-risco-local-platform' and then update the plugin again via the Homebridge web interface.

jaskedf commented 3 years ago

@TJForc, thanks for the quick fix. Plugin working again. @gawindx, the connection issue to the Prosys panel exists:

hb logs: [10/14/2021, 9:23:07 PM] [RiscoLocalAlarm] Start Connection to Panel [10/14/2021, 9:23:07 PM] [RiscoLocalAlarm] TCP Socket is already created, Connect It [10/14/2021, 9:23:07 PM] [RiscoLocalAlarm] TCP Socket must be created now [10/14/2021, 9:23:14 PM] [RiscoLocalAlarm] Socket Connected. [10/14/2021, 9:23:14 PM] [RiscoLocalAlarm] Sending Command : RMT=xxxx [10/14/2021, 9:23:14 PM] [RiscoLocalAlarm] Command CRC Value : 7D35 [10/14/2021, 9:23:14 PM] [RiscoLocalAlarm] Command Sent. [10/14/2021, 9:23:14 PM] [RiscoLocalAlarm] Sequence : 1 - Data Sent : RMT=xxxx [10/14/2021, 9:23:19 PM] [RiscoLocalAlarm] SendCommand Timeout!!! Command Id : '01' [10/14/2021, 9:23:19 PM] [RiscoLocalAlarm] SendCommand receive this response : undefined [10/14/2021, 9:23:19 PM] [RiscoLocalAlarm] Sending Command : DCN [10/14/2021, 9:23:19 PM] [RiscoLocalAlarm] Error when connecting to the control panel. [10/14/2021, 9:23:19 PM] [RiscoLocalAlarm] TCP Socket Disconnected [10/14/2021, 9:23:19 PM] [RiscoLocalAlarm] Command CRC Value : A5E8 [10/14/2021, 9:23:19 PM] [RiscoLocalAlarm] Command Sent. [10/14/2021, 9:23:19 PM] [RiscoLocalAlarm] Sequence : 1 - Data Sent : DCN [10/14/2021, 9:23:19 PM] [RiscoLocalAlarm] SendCommand receive this response : undefined [10/14/2021, 9:23:19 PM] [RiscoLocalAlarm] Socket Destroyed. [10/14/2021, 9:23:19 PM] [RiscoLocalAlarm] Socket Disconnected. [10/14/2021, 9:23:24 PM] [RiscoLocalAlarm] SendCommand Timeout!!! Command Id : '01'

TJForc commented 3 years ago

Well, there is a problem, the control unit does not respond...

In my opinion, there are 2 possibilities:

To check the first possibilities, assuming that the parameter authorizing communication with the CS could be disabled, can be validated by checking that the "CS Enable" parameter is validated. To do this, from the control unit programming menu, go to the menu: 1) System -> 2) Controls -> 3) Communications -> 3) CS Enable To change the value of the parameter, it is the partial key it seems to me

For the second solution (provided that the CS Enable function is validated), I would have to be able to connect to a Prosys to debug the protocol with this model of control unit. If you trust and are able to open a port with redirection to the control panel's TCP port and also give me your public Wan address (or an url pointing to your IP if it is dynamic), I should be able to connect to your control panel and test / debug the communication. Of course, do not publish anything confidential online, give me your consent here and send me this information by email: tjforc@tutanota.com

TJForc commented 3 years ago

Question may be silly, but from the host HomeBridge is on, have you tried to ping your control panel? Have you attempted a telnet to the IP address / TCP port of your control unit to check that it is the correct port that you have configured (1000 by default but can be modified in the configuration of the control unit)?

gawindx commented 3 years ago

@jaskedf, @TJForc

Any news about connection problems with the ProsysPlus?

TJForc commented 3 years ago

For now no, no news from @jaskedf

jaskedf commented 3 years ago

Hi @TJForc, sorry for the late response. ping and telnet to the panel were both positive.

However, telnet connection is automatically closed by the panel after 1 minute. Escape character to close the connection manually has no effect. Is this normal behavior?

telnet 'ip' 'port' Trying 'ip'... Connected to 'ip'. Escape character is '^]'. ^] Connection closed by foreign host.

TJForc commented 3 years ago

Which means that the port is correctly opened and that the behavior you have observed is correct.

In this case, the only possibility to help you is to be able to have access to a ProSys central unit and to understand what is wrong and why communication is not established.

Have you checked the parameters in the configuration of your panel ?

gawindx commented 2 years ago

Can you test with the new version of risco-lan-bridge. Perhaps the waiting time before connection will also solve the connection problem with the Prosys Plus Panel.

It may be necessary to uninstall / reinstall the HomeBridge plugin to force the new version of risco-lan-bridge to be taken into account.