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
340 stars 91 forks source link

Unable to connect to panel #68

Closed kobuki closed 5 years ago

kobuki commented 5 years ago

System SP5500, IP150 v4.10, IP (cloud)

Describe the bug 5006dba cannot connect to site. Previous version I tested 2c51be3 connects without problems. See error messages.

To Reproduce Adapt config to local system and start using run.py.

Logs

2019-04-21 01:58:21,205 - DEBUG    - PAI.paradox.connections.ip_connection - Site Info: {
    "site": [
        {
            "daysLeft": 971,
            "module": [
... valid module data here ...
            ],
... also valid values here ...
        }
    ]
}

2019-04-21 01:58:21,203 - ERROR    - PAI.paradox.connections.ip_connection - Unable to negotiate connection to site
Traceback (most recent call last):
  File "/root/pai2/paradox/connections/ip_connection.py", line 99, in connect_to_site
    self.module = self.site_info[0]['module']
KeyError: 0
2019-04-21 01:58:21,204 - DEBUG    - PAI.paradox.connections.ip_connection - Authenticating with IP Module
2019-04-21 01:58:21,205 - ERROR    - PAI.paradox.connections.ip_connection - Unable to establish session with IP Module
Traceback (most recent call last):
  File "/root/pai2/paradox/connections/ip_connection.py", line 163, in connect_to_panel
    self.socket.send(msg)
BrokenPipeError: [Errno 32] Broken pipe

I can post the full log or config per instructions if needed. The older version mentioned above runs fine, so it's not a pw/user issue.

kobuki commented 5 years ago

I think I found the cause. Line 99 must be changed in paradox/connections/ip_connection.py to the following:

                self.module = self.site_info['site'][0]['module'][0]
yellowonblack commented 5 years ago

Are you sure that you are using the last commit? Try better dev branch, as for me it works well.

kobuki commented 5 years ago

Yes, master latest. Isn't the master branch the one for general use? Anyway, that fix is trivial and works.

jpbarraca commented 5 years ago

Use the dev branch. They are very different, with dev having many improvements. After a bug related with the IP interface is fixed we will merge to master

kobuki commented 5 years ago

Which branch do you recommend for prolonged use? I'd rather not pull it every day and watch the dev branch with possibly fast moving changes and potential bugs.

yozik04 commented 5 years ago

We usually try to keep both branches in working state. Currently it is stable enough for generic use. Please try. Nobody forces you to pull it every day. Also we need testers with different panels and connect methods on dev branch as well.

yozik04 commented 5 years ago

So did dev branch fixed the issue for you?

kobuki commented 5 years ago

It sort of works, but I get these exceptions regularly.

2019-04-22 14:12:47,027 - ERROR    - PAI.paradox.paradox - Handle event
Traceback (most recent call last):
  File "/root/pai2/paradox/paradox.py", line 476, in handle_event
    evt = event.Event(self.panel.event_map, message, label_provider=self.get_label)
  File "/root/pai2/paradox/event.py", line 76, in __init__
    self.parse(event)
  File "/root/pai2/paradox/event.py", line 96, in parse
    cfg.LABEL_ENCODING)  # Event Element Label. May be overwride localy
NameError: name 'cfg' is not defined
kobuki commented 5 years ago

Apparently, paradox/event.py is missing the import from paradox.config import config as cfg, adding it fixes the exception.

yozik04 commented 5 years ago

Good catch. This is after yesterdays commit. If you see any other exception please let us know:)

yozik04 commented 5 years ago

Just pushed the fix.