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
337 stars 90 forks source link

EVO192 7.70 encrypted serial ESP32 - Cannot connect *solved* #402

Open Onepamopa opened 8 months ago

Onepamopa commented 8 months ago

Alarm system

EVO192 7.70 build 1 (as detected by PAI)

Environment

Git branch

Tried both main and dev

Describe the bug

2023-10-27 17:33:15,469 - INFO     - PAI - Starting Paradox Alarm Interface 3.2.1
2023-10-27 17:33:15,469 - INFO     - PAI - Config loaded from /data/options.json
2023-10-27 17:33:15,469 - INFO     - PAI - Console Log level set to 20
2023-10-27 17:33:15,485 - INFO     - PAI.paradox.interfaces - Starting BasicMQTTInterface Interface
2023-10-27 17:33:15,486 - INFO     - PAI.paradox.interfaces.mqtt.core - MQTT loop started
2023-10-27 17:33:15,488 - INFO     - PAI.paradox.interfaces - Starting HomeAssistantMQTTInterface Interface
2023-10-27 17:33:15,489 - INFO     - PAI - Starting...
2023-10-27 17:33:15,489 - INFO     - PAI.paradox.paradox - Connecting to interface
2023-10-27 17:33:15,489 - INFO     - PAI.paradox.paradox - Using IP Connection
2023-10-27 17:33:15,538 - INFO     - PAI.paradox.connections.ip.connection - Connecting. Try 1/3
2023-10-27 17:33:16,489 - INFO     - PAI.paradox.interfaces.mqtt.core - MQTT Broker Connected
2023-10-27 17:33:22,765 - INFO     - PAI.paradox.connections.connection - Connection established
2023-10-27 17:33:22,766 - INFO     - PAI.paradox.paradox - Connecting to Panel
2023-10-27 17:33:22,797 - INFO     - PAI.paradox.paradox - Panel Identified EVO192ª version 7.70 build 1
2023-10-27 17:33:22,797 - INFO     - PAI.paradox.paradox - Initiating panel connection
2023-10-27 17:33:27,804 - ERROR    - PAI.paradox.paradox - Timeout while connecting to panel. Is an other connection active?
2023-10-27 17:33:27,805 - ERROR    - PAI - Unable to connect to alarm

To Reproduce

Steps to reproduce the behavior: Connection via ESP32 Serial->TCP (using the provided examples) Baud rate: 57600 (as set on the panel via BabyWare) Panel has unlocked serial (I purchased unlock via Insite Gold)

Logs

lpaolini commented 8 months ago

This firmware version is not supported, as the serial communication is encrypted, see here: #335. You have to use the Paradox network adapter IP150.

Onepamopa commented 8 months ago

@lpaolini the serial communication is encrypted until you purchase an unlock code. I have purchased an unlock code, but I think I forgot to add it. I'm researching on how to do that at the moment, and will provide more information when I'm done. From what I remember the code could only be entered via TM50/TM70 keypad (of which I have both).

lpaolini commented 8 months ago

@Onepamopa Ha, interesting. How much does it cost?

Onepamopa commented 8 months ago

It costs 6$ per panel, code is provided in the invoice and in insite gold (installer), on the invoice the instructions say: To unlock, enter the code in section [3000] EVO or [300] MGSP, in installer programing mode, using a TM70/50 keypad.

It requires babyware/insite gold be disconnected, all areas - disarmed - then you enter the installer code on the keypad and so forth.

Since I'm my own "installer" i just purchased for myself, but you can purchase from your security company/installer.

I'll test connectivity ESP32 <-> PAI a bit later, and report back.

yozik04 commented 8 months ago

Interesting 🍿 If it works then we need to update our documentation.

Onepamopa commented 8 months ago

Unfortunately I fried my ESP32 and don't have a replacement. Got a few 8266s but no idea if it'd work with them... + for what I'm planning.. I'd need 2 serial ports - did a modified version of "esphome-stream-server" -- https://github.com/Onepamopa/esphome-stream-server -- to act like a "proxy" for IP150 on the 2nd serial port (not tested, no idea if it's working or not).

So.. I'll order a few ESP32s and start over :)

lpaolini commented 8 months ago

So it's just a tax for keeping on using the serial port... I wonder if the end user can purchase one or if it's just for installers.

Onepamopa commented 8 months ago

@lpaolini I'm not an official installer by any means. I just purchased everything I needed, assembled, installed, programmed it myself. In essence - I'm my own installer :) And by the way... I think everyone can purchase a code for your panel - you pay 6$ and provide the panel S/N (as required for purchasing an unlock key)..

I'll try with an 8266 now, directly connected to the 5V RX/TX pins.. hopefully it won't burn out. As for the 2nd serial - maybe there's a way to do it in software.. who knows.. For now IP150 will be offline..

Onepamopa commented 8 months ago

Okay so.... getting "Invalid PC password" - I doublechecked via the TM70 - Panel id is 0001, PC password is 4 digits. I'm setting the correct password, but getting:

Do note that this is currently the DEV version of PAI @ HA.

2023-10-27 19:40:29,591 - INFO     - PAI.paradox.interfaces - Starting BasicMQTTInterface Interface
2023-10-27 19:40:29,592 - INFO     - PAI.paradox.interfaces.mqtt.core - MQTT loop started
2023-10-27 19:40:29,594 - INFO     - PAI.paradox.interfaces - Starting HomeAssistantMQTTInterface Interface
2023-10-27 19:40:29,594 - INFO     - PAI - Starting...
2023-10-27 19:40:29,594 - INFO     - PAI.paradox.paradox - Connecting to interface
2023-10-27 19:40:29,594 - INFO     - PAI.paradox.paradox - Using IP Connection
2023-10-27 19:40:29,641 - INFO     - PAI.paradox.connections.ip.connection - Connecting. Try 1/3
2023-10-27 19:40:29,643 - INFO     - PAI.paradox.connections.connection - Connection established
2023-10-27 19:40:29,643 - INFO     - PAI.paradox.paradox - Connecting to Panel
2023-10-27 19:40:29,823 - INFO     - PAI.paradox.paradox - Panel Identified EVO192 version 7.70 build 1
2023-10-27 19:40:29,823 - INFO     - PAI.paradox.paradox - Initiating panel connection
2023-10-27 19:40:30,064 - INFO     - PAI.paradox.hardware.evo.panel - Installer login
2023-10-27 19:40:30,573 - ERROR    - PAI.paradox.paradox - Got ERROR Message: Invalid PC Password
2023-10-27 19:40:30,574 - ERROR    - PAI.paradox.lib.handlers - Exception caught during message handling
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/paradox/lib/handlers.py", line 112, in handle
    await handler(data)
  File "/usr/local/lib/python3.9/site-packages/paradox/lib/handlers.py", line 61, in __call__
    result = self._handle(data)
  File "/usr/local/lib/python3.9/site-packages/paradox/paradox.py", line 649, in handle_error_message
    raise AuthenticationFailed()
paradox.exceptions.AuthenticationFailed
2023-10-27 19:40:30,574 - ERROR    - PAI.paradox.exceptions - Unhandled exception in async loop(<_UnixSelectorEventLoop running=True closed=False debug=False>): 
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/paradox/lib/handlers.py", line 112, in handle
    await handler(data)
  File "/usr/local/lib/python3.9/site-packages/paradox/lib/handlers.py", line 61, in __call__
    result = self._handle(data)
  File "/usr/local/lib/python3.9/site-packages/paradox/paradox.py", line 649, in handle_error_message
    raise AuthenticationFailed()
paradox.exceptions.AuthenticationFailed
Task exception was never retrieved
future: <Task finished name='Task-13' coro=<HandlerRegistry.handle() done, defined at /usr/local/lib/python3.9/site-packages/paradox/lib/handlers.py:101> exception=AuthenticationFailed()>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/paradox/lib/handlers.py", line 112, in handle
    await handler(data)
  File "/usr/local/lib/python3.9/site-packages/paradox/lib/handlers.py", line 61, in __call__
    result = self._handle(data)
  File "/usr/local/lib/python3.9/site-packages/paradox/paradox.py", line 649, in handle_error_message
    raise AuthenticationFailed()
paradox.exceptions.AuthenticationFailed
2023-10-27 19:40:30,597 - INFO     - PAI.paradox.interfaces.mqtt.core - MQTT Broker Connected
2023-10-27 19:40:31,623 - ERROR    - PAI.paradox.paradox - Got ERROR Message: Invalid PC Password
2023-10-27 19:40:31,623 - ERROR    - PAI.paradox.lib.handlers - Exception caught during message handling
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/paradox/lib/handlers.py", line 112, in handle
    await handler(data)
  File "/usr/local/lib/python3.9/site-packages/paradox/lib/handlers.py", line 61, in __call__
    result = self._handle(data)
  File "/usr/local/lib/python3.9/site-packages/paradox/paradox.py", line 649, in handle_error_message
    raise AuthenticationFailed()
paradox.exceptions.AuthenticationFailed
2023-10-27 19:40:31,623 - ERROR    - PAI.paradox.exceptions - Unhandled exception in async loop(<_UnixSelectorEventLoop running=True closed=False debug=False>): 
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/paradox/lib/handlers.py", line 112, in handle
    await handler(data)
  File "/usr/local/lib/python3.9/site-packages/paradox/lib/handlers.py", line 61, in __call__
    result = self._handle(data)
  File "/usr/local/lib/python3.9/site-packages/paradox/paradox.py", line 649, in handle_error_message
    raise AuthenticationFailed()
paradox.exceptions.AuthenticationFailed
Task exception was never retrieved
future: <Task finished name='Task-15' coro=<HandlerRegistry.handle() done, defined at /usr/local/lib/python3.9/site-packages/paradox/lib/handlers.py:101> exception=AuthenticationFailed()>
Onepamopa commented 8 months ago

removed

Onepamopa commented 8 months ago

My bad.. it connected. I forgot to change the password in the 3rd location :) there's 3 places where a password can be set.. So the password after "SYNC_TIME" is the one used.

2023-10-27 19:50:23,404 - INFO     - PAI - Starting Paradox Alarm Interface 3.3.0-dev
2023-10-27 19:50:23,404 - INFO     - PAI - Config loaded from /data/options.json
2023-10-27 19:50:23,404 - INFO     - PAI - Console Log level set to 20
2023-10-27 19:50:23,422 - INFO     - PAI.paradox.interfaces - Starting BasicMQTTInterface Interface
2023-10-27 19:50:23,423 - INFO     - PAI.paradox.interfaces.mqtt.core - MQTT loop started
2023-10-27 19:50:23,425 - INFO     - PAI.paradox.interfaces - Starting HomeAssistantMQTTInterface Interface
2023-10-27 19:50:23,425 - INFO     - PAI - Starting...
2023-10-27 19:50:23,425 - INFO     - PAI.paradox.paradox - Connecting to interface
2023-10-27 19:50:23,425 - INFO     - PAI.paradox.paradox - Using IP Connection
2023-10-27 19:50:23,473 - INFO     - PAI.paradox.connections.ip.connection - Connecting. Try 1/3
2023-10-27 19:50:23,476 - INFO     - PAI.paradox.connections.connection - Connection established
2023-10-27 19:50:23,476 - INFO     - PAI.paradox.paradox - Connecting to Panel
2023-10-27 19:50:23,732 - INFO     - PAI.paradox.paradox - Panel Identified EVO192 version 7.70 build 1
2023-10-27 19:50:23,732 - INFO     - PAI.paradox.paradox - Initiating panel connection
2023-10-27 19:50:23,952 - INFO     - PAI.paradox.hardware.evo.panel - Installer login
2023-10-27 19:50:24,006 - INFO     - PAI.paradox.hardware.evo.panel - Authentication Success
2023-10-27 19:50:24,006 - INFO     - PAI.paradox.paradox - Connection OK
2023-10-27 19:50:24,006 - INFO     - PAI.paradox.paradox - Loading data from panel memory
2023-10-27 19:50:24,006 - INFO     - PAI.paradox.hardware.panel - Loading definitions
2023-10-27 19:50:24,006 - INFO     - PAI.paradox.hardware.panel - Updating Definitions from Panel
2023-10-27 19:50:24,425 - INFO     - PAI.paradox.interfaces.mqtt.core - MQTT Broker Connected
2023-10-27 19:50:25,528 - INFO     - PAI.paradox.hardware.panel - Zone definitions loaded (1.52s)
2023-10-27 19:50:25,585 - INFO     - PAI.paradox.hardware.panel - Partition definitions loaded (0.06s)
Onepamopa commented 8 months ago

Now if I can only figure out how to make babyware connect via port 10000 on PAI@HA ... would be perfect.

Getting this when connecting to HA on port 10000: telnet 192.168.254.44 10000 Trying 192.168.254.44... telnet: Unable to connect to remote host: Connection refused

Onepamopa commented 8 months ago

Additionally, the RX/TX connections with the EVO192 board to the ESP are not as described in the instructions. Here's how it's working here: EVO ESP8266 RX ---------> RX TX ---------> TX

Onepamopa commented 8 months ago

@lpaolini is there a way to connect the ESP to IP150's "PCS" serial port (to only receive events), or directly to the serial port to only receive (not transmit) ?

yozik04 commented 8 months ago

Now if I can only figure out how to make babyware connect via port 10000 on PAI@HA ... would be perfect.

Getting this when connecting to HA on port 10000: telnet 192.168.254.44 10000 Trying 192.168.254.44... telnet: Unable to connect to remote host: Connection refused

Did you enable IP Interface?

lpaolini commented 8 months ago

@Onepamopa I've just learned the PCS port is for connecting a PCS250 GPRS/GSM Communicator Module, which normally connects to the serial port of the panel, when it's not used by the IP150. Unfortunately I don't have a cable with a suitable connector to plug into that port and make some tests, but I've opened the IP150 to check the wiring and the RX/TX signals are not directly connected between the two ports. So, I'm not sure, but I would expect the PCS port to mirror the PANEL port both ways.

yozik04 commented 8 months ago

@lpaolini is there a way to connect the ESP to IP150's "PCS" serial port (to only receive events), or directly to the serial port to only receive (not transmit) ?

There was a feature request when PAI acts passively. But I did not implement it.

lpaolini commented 8 months ago

@Onepamopa I can't find any trace of that unlock code on any website. Could you please tell us the product code or how it is called in your invoice? Thanks.

Onepamopa commented 8 months ago

@lpaolini You need to use the Insite Gold app + IP150 (or any other method of remote connection between swan & your panel). IMG_6267 IMG_6268 IMG_6269

Onepamopa commented 8 months ago

As for PCS .. I'll purchase a cable for IP150 -> PCS @ monday and will try connecting the ESP there.

Onepamopa commented 8 months ago

@yozik04 yozik04

There was a feature request when PAI acts passively. But I did not implement it.

If you've got some time, add that to the dev branch? I'll gladly test.

yozik04 commented 8 months ago

It is probably not that simple. Where to get available zone data, partitions and so on... Currently we just read it out from the memory after the connection.

Onepamopa commented 8 months ago

@yozik04 I tried connecting IP150 & the esp to the same serial port, but when PAI connects, the IP module goes "missing". Ideally I'd like to keep it because it's useful..

I have 3 options:

  1. Buy a IP150->PCS cable @ monday and try connecting the ESP there.
  2. Buy BUS2SER and connect there
  3. Buy EVOHD+ which has 2 serial ports (no idea if they can be used at the same time) - considering the price of BUS2SER is almost comparable to EVOHD+, if all else fails, EVOHD+ could be the better option (if both serial ports can be used at the same time) because I'd be able to resell EVO192 and get at least some of the $ back.

Will see @ monday..

lpaolini commented 8 months ago

Some relevant info from Paradox EVOHD+ installation manual.

The EVOHD+ has two separate serial outputs allow connecting reporting devices to both ports. Serial 1 is a Master, meaning all reporting will go first to Serial 1. Serial 2 is secondary, meaning reporting will redirect to Serial 2 only if Serial 1 fails. This allows for the connection of an IP150+ in Serial 1 and a PCS in Serial 2, or any combination of reporting devices to the two serials.

Also, it looks like a few more keyboards can be used as well for entering the unlock code.

Screenshot 2023-10-29 at 20 40 14
lpaolini commented 8 months ago

@Onepamopa I don't have a Paradox account for logging into Insite Gold and request an unlock code. Is http://www.paradoxmyhome.com/ the right place to create one? I tried, but without success (the account doesn't appear to be active).

Onepamopa commented 8 months ago

@lpaolini It's been years since I created my account, I don't remember exactly where - website or the app directly.. Try to reach out to your installer, or perhaps write to support@paradox.com or any of their "reseller" branches in various countries - in my it's "Sectron" that also do support for paradox ...

lpaolini commented 8 months ago

Ok, thanks. The problem is that I'm my own installer too. I'll try to contact a reseller, but I'm not very optimistic about it. I'll let you know how it goes...

Onepamopa commented 8 months ago

@lpaolini https://www.paradox.com/SPMH-G2K_rev00.pdf

Onepamopa commented 8 months ago

Got the IP150->PCS cable, will test tomorrow.. hopefully it'd work..

Onepamopa commented 8 months ago

Well, all I can say is - success! Connecting PAI ESP8266 <-> PCS Port IP150 <-> Panel -- works like a charm.

Connection is the same - TX to TX, RX to RX (as per the connector diagram in PAI documentation)

All looks good. Now onto testing if HA detects zone changes... (it does!)

Feel free to add 7.70 firmware support (after unlock code) to the project description :) And also - the IP150 PCS compatibility (so people can keep IP150 and have PAI at the same time).

Onepamopa commented 8 months ago

@lpaolini if you're unable to get a code - let me know, I'll purchase one for you :)