ParadoxAlarmInterface / pai

Paradox Magellan, Spectra and EVO, with MQTT, Signal, Pushbullet, Pushover and others
https://gitter.im/paradox-alarm-interface
Eclipse Public License 2.0
351 stars 94 forks source link

IP Interface does not recover from client disconnect #73

Closed psyciknz closed 5 years ago

psyciknz commented 5 years ago

System Describe your panel model, access mode (Serial, IP150, etc..) and hardware. SP 6000 with IP module

Describe the bug Trying to run PAI (master branch via docker build) with IP interface turned on, so that https://github.com/psyciknz/ParadoxIP150v2 can continue to be used while I'm evaluating.

To Reproduce Steps to reproduce the behavior:

  1. Start script
  2. Start ParadoxIP150v2 (client script)
  3. Disconnect Client
  4. Try reconnect client and Connection refused.

Error

Exception in thread IPI: Traceback (most recent call last): File "/usr/local/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/opt/pai/paradox/interfaces/ip_interface.py", line 105, in run data = r.recv(1024) ConnectionResetError: [Errno 104] Connection reset by peer

I've noticed in reading the labels, and connecting, that my service wont connect (get an empty reply on connection to the IP_interface). But maybe 1 out of 5 times it will work and read all labels. Then it's great to see both applications working. I tried the Paradox IOS app, but it didn't seem to connect either.

So hoping we can get that IP_Interface error caught and recovered from.

yozik04 commented 5 years ago

It will be hard to evaluate PAI while connected to it's IP Interface as it suspends almost all it's work to let Babyware act without interference.

Probably something can be done about it... Will take a look...

psyciknz commented 5 years ago

Oh does it. I thought it worked as a proxy. Ok. I thought I saw both updating mqtt topics. But I could be wrong.

I haven’t tried with babyware to see how that disconnects and if the interface recovers.

Also with the iOS paradox app it says the panel is not supported.

jpbarraca commented 5 years ago

The main objective of it was to allow the remote configuration the panel with babyware or winload. Is there any specific feature that we do not support?

psyciknz commented 5 years ago

No not really, And even on the service I had, it was very infrequent I had to stop the container and access via mobile....its just paranoia.

yozik04 commented 5 years ago

Please check once again on dev branch.

psyciknz commented 5 years ago

Just related....as I'm trying to add homie, I obviously don't really want to take down my primary PAI connection to my alarm, for when I develop.

1, Can I use the interface on my dev machine to connect through PAI to the alarm?

  1. How does the module password/pc password work with the interface. For my alarm connection directly, I have to set both of these. The interface only exposes one password, is that the pc panel password or the module password?
yozik04 commented 5 years ago

You specify password for client in IP_INTERFACE_PASSWORD. So next PAI in the chain will use that password.

It may work =)

psyciknz commented 5 years ago

So the interface IP_INTERFACE_PASSWORD is what the IP_CONNECTION uses for 'IP_CONNECTION_PASSWORD' ? is that correct?

yozik04 commented 5 years ago

yes

psyciknz commented 5 years ago

So for the one connecting to the interface (not the panel directly) should that have the pc password

PASSWORD = b'0000'                      # PC Password. Set to None if Panel has no Password

Even though for the one connecting to that panel this has a number

yozik04 commented 5 years ago

PASSWORD is master user password. It needs to be the same for both instances.

psyciknz commented 5 years ago

Using the actual panel password didn't seem to work, the interface throws it out with an authentication error. Setting to 0000 got me a little further.:

2019-05-10 08:08:03,971 - ERROR    - PAI.paradox.paradox - Failed to connect: Panel did not replied to InitiateCommunication
2019-05-10 08:08:03,971 - ERROR    - PAI - Unable to connect to alarm
2019-05-10 08:08:10,973 - INFO     - PAI - Starting...
2019-05-10 08:08:10,980 - INFO     - PAI.paradox.paradox - Disconnecting from the Alarm Panel
2019-05-10 08:08:10,983 - INFO     - PAI.paradox.paradox - Clean Session
2019-05-10 08:08:10,985 - INFO     - PAI.paradox.paradox - Cleaning previous session. Closing connection
2019-05-10 08:08:11,005 - INFO     - PAI.paradox.paradox - Disconnected from the Alarm Panel
2019-05-10 08:08:11,009 - INFO     - PAI.paradox.paradox - Connecting to interface
2019-05-10 08:08:11,019 - INFO     - PAI.paradox.connections.ip_connection - Connecting to IP module. Try 1/3
2019-05-10 08:08:11,029 - ERROR    - PAI.paradox.connections.ip_connection - Connection to panel was lost
2019-05-10 08:08:11,065 - INFO     - PAI.paradox.connections.ip_connection - Authentication Success. Panel version 20, firmware: 1.50, serial: 710228e3
2019-05-10 08:08:11,123 - INFO     - PAI.paradox.connections.ip_connection - Session Established with IP Module
2019-05-10 08:08:11,126 - INFO     - PAI.paradox.paradox - Connecting to panel
2019-05-10 08:08:11,128 - INFO     - PAI.paradox.paradox - Initiating communication
2019-05-10 08:08:17,224 - ERROR    - PAI.paradox.paradox - Failed to connect: Panel did not replied to InitiateCommunication
2019-05-10 08:08:17,224 - ERROR    - PAI - Unable to connect to alarm
jpbarraca commented 5 years ago

Enable full debug with packet dumps and send the log (gitter or email)

jpbarraca commented 5 years ago

Closing as I cannot replicate. It works on my system.