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 89 forks source link

Question about compatibility for Serial over IP connection (ESP8266) for EVO192 with ver.6.86 #465

Open qntris opened 4 weeks ago

qntris commented 4 weeks ago

Alarm system

EVO192, FW is 6.86 , connection method is Serial over IP with ESP8266 -->

Environment

Configuration

LOGGING_FILE: null
LOGGING_LEVEL_CONSOLE: 20
LOGGING_LEVEL_FILE: 40
LOGGING_DUMP_PACKETS: true
LOGGING_DUMP_MESSAGES: true
LOGGING_DUMP_STATUS: true
LOGGING_DUMP_EVENTS: true
CONNECTION_TYPE: IP
SERIAL_PORT: /dev/ttyUSB0
SERIAL_BAUD: 9600
IP_CONNECTION_HOST: <ip>
IP_CONNECTION_PORT: 23
IP_CONNECTION_PASSWORD: paradox # tried paradox and null
IP_CONNECTION_SITEID: null
IP_CONNECTION_EMAIL: null
IP_CONNECTION_PANEL_SERIAL: null
IP_CONNECTION_BARE: true
LIMITS: {}
SYNC_TIME: true
PASSWORD: '0000' # Tried 0000 and my main user password
MQTT_ENABLE: true
MQTT_HOST: <host>
MQTT_PORT: 1883
MQTT_USERNAME: <user>
MQTT_PASSWORD: <password>
MQTT_RETAIN: true
MQTT_BIND_ADDRESS: 127.0.0.1
MQTT_BIND_PORT: 0
MQTT_HOMEASSISTANT_AUTODISCOVERY_ENABLE: true

Question

I am using this integration on two other platforms (MG5050) and it works flawlessly. Tried it on an EVO192 with 6.86 fw version and it can't connect to the panel. Not even showing the version of the panel. The ESP8266 is properly configured and I am able to ping it. I see that in the Compatibility page, the 6.86 fw is listed as working with the IP module, but no info on connection with Serial over IP. Does that mean that it is not working or not tested with it? Should it at least print the panel version in the logs, even if not supported?

Logs (if required)

INFO     - PAI - Starting...
INFO     - PAI.paradox.paradox - Connecting to interface
INFO     - PAI.paradox.paradox - Using IP Connection
INFO     - PAI.paradox.connections.ip.connection - Connecting. Try 1/3
INFO     - PAI.paradox.connections.connection - Connection established
INFO     - PAI.paradox.paradox - Connecting to Panel
INFO     - PAI.paradox.interfaces.mqtt.core - MQTT Broker Connected
ERROR    - PAI.paradox.paradox - Timeout while connecting to panel. Is an other connection active?
yozik04 commented 4 weeks ago

Should be working the same way. What serial speed you configured on ESP module? EVO has higher baud rate.

qntris commented 3 weeks ago

I am using the default values from this file: https://github.com/ParadoxAlarmInterface/pai/files/8478086/ESP8266.OverTCP.to.Serial.txt What should be the baud rate for EVO192 ? Do I change it in this line in the file, //start UART and the server Serial.begin(9600);

or in the add-on config in Home Assistant: SERIAL_BAUD: 9600

yozik04 commented 3 weeks ago

38400 or 57600. Depends on what is selected in settings. PAI config does not matter it connects with IP Bare connection to the ESP.

qntris commented 5 days ago

@yozik04 , I tried multiple things but the result is the same. Here's what I did:

I am sure the serial port is not locked since a friend of mine was able to connect to the alarm with BabyWare (couple of months ago) before I installed it in this summer home of mine. The firmware (based on the sticker of the board is 6.86). What else can I try, any ideas?

yozik04 commented 5 days ago

Did you try ESP32 WROOM board with 38400 baud rate?

qntris commented 5 days ago

Hi Yozik, I've just tried but didn't work (again set the 38400 both in the ESP32 firmware and in the PAI add-on config). I've realised that I was using 3.3v from my buck converter. Increased it to 5V and connected the ESP32 on the 5V pin. Again, no luck. Checking the ESP32 pins with the multimeter, it seems that there's no voltage on the G16 and G17 pins which map to RX2 and TX2. There is proper voltage on the TX0 and RX0 pins. Are you sure, that Serial1 in the code does not have to map the RX2 and TX2 pins as they are not enabled by default? https://github.com/cybertza/PAI-ESP32

yozik04 commented 4 days ago

No idea. Let’s ask @cybertza ;)

cybertza commented 4 days ago

Morning Gents.

Yea, you should be able to use a Software Serial to TCP serial software on a windows machine and babyW to confirm your config of the serial port, speed and so forth, herein lies the answer as well, I believe that certain firmwares do not support unencrypted comms, hence that it worked with babyW.

Then further more so there was a read about multiple ports and so forth. I don't have a Evo192 around, so I can't 100% confirm this, but I have seen more websites advertise and sell unblocked ones.

What is required to unlock them I don't know, may be as simple as a flag from the keypad, may be a firmware build?

Would need to get a 192 to test with, that I have been meaning to do, but haven't ...

yozik04 commented 4 days ago

EVO 6.86 does not have encrypted serial.

cybertza commented 4 days ago

I would then recomend testing via the method I suggested. Then configuration for this is basically just a serial tcp bridge.

I would have to get a 192 to personally test it, so you guys are welcome to send me one and I'll do the testing and manual for one.

Th rest is rather well documented, and as mentioned unit is just a serial to tcp bridge, technically you can do the same as the paradox usb as with a usb to serial device on the 5050 range and alike.

Without hardware to test I can unfortunately not give more input on the topic, nor confirm the above statements made above.

qntris commented 1 day ago

I managed to fix it and here's what I've done:

  1. Used WinLoad to update the firmware from 4.63 -> 6.90 (it was strange that the sticker on the alarm panel was 6.86)
  2. Confirmed that the baud rate is 57600
  3. Changed the jumper wires for the TX and RX pins coming from the ESP8266 (switched to ESP8266 since the result with ESP32 was the same)
  4. Exchanged the Rx and Tx pins (perhaps on the EVO they are RX , TX, GND, 12V, instead of TX, RX...)

Except the firmware upgrade, I've tried the other three steps multiple times before that and it didn't work. Perhaps it was the firmware or some combination of those.

Then I was able to successfully connect to the panel. I am noticing a 2-3 seconds delay between the time a sensor is activated and when the MQTT message is received. Is that expected and would it improve if I use ESP32?

yozik04 commented 1 day ago

Check this: https://github.com/ParadoxAlarmInterface/pai/wiki/Configuration#improving-performance

cybertza commented 19 hours ago

Yea, the esp 8266 should be well fine at 56k even as soft serial, so if the WiFi is fine, then it should be just about the same, I just found the 8266's give up easier if you don't have any circuit to protect it, it's just been my experience, that the esp32 feels like it works better for longer, they obviously run a bit faster and some have multi core so the WiFi and the serial/soft serial don't always run in the same core.

None of this is truly scientific, my first 8266 ran for about a year, second one the same, Wemos 32 is probably sitting around 2 years fairly stable.

I'm running something like this with it.

https://www.wemos.cc/en/latest/d1_mini_shield/dc_power.html

https://www.wemos.cc/en/latest/s2/s2_mini.html

Think that's more or less the combo.

If you do find some interesting results, let me know then I can update the documents.

Especially relating to the ports and such, esp32 also has more hw serial, so could interface into the alarm more than one place if the panel supports it.