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

EVO192 with serial connection - IP Socket Interface not working #65

Closed yellowonblack closed 5 years ago

yellowonblack commented 5 years ago

I just wanted to reopen a pending issue from https://github.com/jpbarraca/pai/issues/62#issuecomment-481261439

Using the serial connection and enabling IP Socket Interface and trying to connect with Babyware 5.2.5 to PAI on port 10000, I get ERROR:PAI.paradox.lib.async:No handler for message 7 error in PAI logs and also Identifying Panel error in Babyware.

55805472-c83a1500-5ade-11e9-9999-327ae21b4fda

@yozik04 you mentioned that the code might be broken https://github.com/jpbarraca/pai/issues/62#issuecomment-481285703

Is this issue in the work plan? 😄 Thanks

yozik04 commented 5 years ago

It is in the work plan after finishing my terrace. 😄

yellowonblack commented 5 years ago

Just wanted to keep this issue alive. Summer is coming, so hurry up with the terrace 😃

jpbarraca commented 5 years ago

@yellowonblack Can you try the IP Interface?

yellowonblack commented 5 years ago

Cannot try right now, most probably in a couple of days. I'll get back with a feedback after I test it. Thanks @jpbarraca.

yozik04 commented 5 years ago

@jpbarraca Please check if I have not broken SP/MG. Babyware connection now is ultra fast to PAI's IP Interface (EVO192 via IP150). 😱

yozik04 commented 5 years ago

When you click "Disconnect" in Babyware it actually does not disconnect. To fully disconnect you need to close Babyware. Then it closes the socket... Probably Babyware sends "Close connection" packet on "Disconnect" click. Then we need to react to it by closing the socket on our end.

yellowonblack commented 5 years ago

I finally managed to do a quick test this night:

  1. Connection succeed from Babyware if PAI is started fresh and it seems that it's working properly. I didn't push any changes to the panel yet. During authentication I get multiple "Unknown message" lines (I can provide the full error message if needed)

    Screenshot 2019-05-06 at 01 48 18
  2. After Babyware received aprox 2.000 buffered events from the panel it disconnected without notice (I think it happened before with siteID also)

  3. Trying to reconnect is hanging at "Connecting to the panel". The same if I fully restart Babyware.

  4. Trying to force PAI closing (with CTRL+C) I get the below log + error:

2019-05-06 01:21:39,449 - INFO - PAI.paradox.paradox - Clean Session 2019-05-06 01:21:39,450 - INFO - PAI.paradox.paradox - Cleaning previous session. Closing connection 2019-05-06 01:21:39,455 - INFO - PAI.paradox.paradox - Disconnected from the Alarm Panel 2019-05-06 01:21:39,456 - DEBUG - PAI.paradox.interfaces.interface_manager - Stopping all interfaces 2019-05-06 01:21:39,457 - DEBUG - PAI.paradox.interfaces.interface_manager - mqtt 2019-05-06 01:21:39,458 - DEBUG - PAI.paradox.interfaces.mqtt_interface - Stopping MQTT Interface 2019-05-06 01:21:39,461 - INFO - PAI.paradox.interfaces.mqtt_interface - MQTT Broker Disconnected 2019-05-06 01:21:39,463 - DEBUG - PAI.paradox.interfaces.interface_manager - ip_interface 2019-05-06 01:21:39,464 - INFO - PAI.paradox.interfaces.ip_interface - Stopping IP Interface 2019-05-06 01:21:39,466 - DEBUG - PAI.paradox.interfaces.interface_manager - All Interfaces stopped 2019-05-06 01:21:40,468 - INFO - PAI - Good bye! 2019-05-06 01:21:40,469 - INFO - PAI.paradox.interfaces.ip_interface - Client disconnected 2019-05-06 01:21:40,470 - DEBUG - PAI.paradox.interfaces.ip_interface - Resuming 2019-05-06 01:21:40,471 - INFO - PAI.paradox.paradox - Resuming PAI 2019-05-06 01:21:40,472 - INFO - PAI.paradox.interfaces.ip_interface - Client 1 disconnected 2019-05-06 01:21:40,474 - ERROR - PAI.paradox.connections.serial_connection - The serial port was closed 2019-05-06 01:21:40,480 - DEBUG - PAI.paradox.paradox - Receive worker loop 2019-05-06 01:21:43,485 - INFO - PAI - Starting... 2019-05-06 01:21:43,487 - ERROR - PAI - Restarting Traceback (most recent call last): File "/home/pi/pai/paradox/main.py", line 115, in main if alarm.connect(): AttributeError: 'NoneType' object has no attribute 'connect' 2019-05-06 01:21:43,491 - INFO - PAI - Starting... 2019-05-06 01:21:43,492 - ERROR - PAI - Restarting Traceback (most recent call last): File "/home/pi/pai/paradox/main.py", line 115, in main if alarm.connect(): AttributeError: 'NoneType' object has no attribute 'connect' 2019-05-06 01:21:44,495 - INFO - PAI - Starting... 2019-05-06 01:21:44,496 - ERROR - PAI - Restarting Traceback (most recent call last): File "/home/pi/pai/paradox/main.py", line 115, in main if alarm.connect(): AttributeError: 'NoneType' object has no attribute 'connect' 2019-05-06 01:21:50,503 - INFO - PAI - Starting... 2019-05-06 01:21:50,505 - ERROR - PAI - Restarting Traceback (most recent call last): File "/home/pi/pai/paradox/main.py", line 115, in main if alarm.connect(): AttributeError: 'NoneType' object has no attribute 'connect'

yozik04 commented 5 years ago

I saw this error one time. No idea how it happens. Can you please try latest dev. I have made some fixes for Babyware connection.

yellowonblack commented 5 years ago

Tested with the last dev and it seems that IP Socket Interface is stable now on EVO192. No more errors on connect, disconnect or closing BabyWare. I will test more on Send/Receive programming but for now I'm happy.

Running stable for last weeks on serial connection, so from my point of view IP150 is obsolete and I'm fully relying on PAI.

Good job @yozik04 @jpbarraca. Thanks.

jpbarraca commented 5 years ago

I'm glad it works for you, and your feedback is very important. IP150 has many other features that we do not support, as we focus in integrating the panels in scenarios not addressed by the IP modules.