pai
pai copied to clipboard
Timeout when trying to connect with USB TTL serial interface.
Brand new EVO HD panel with 7.31.001 firmware (babyware says so, on the box is says 7.30) USB TTL adapter: https://www.arduino-fans.pk/item/usb-to-ttl-ch340g-stc-microcontroller-board-usb-to-serial-rs232-converter/ Tried pai on my linux laptop before installing, powered the panel by battery, just to make sure I can get pai working. Python 3.10.5, pai 3.1.0 installed with pip. Driver module in use: ch341 1a86:7523 QinHeng Electronics CH340 serial converter
Problem is, I get a timeout when trying to connect. I ran pai-service as root to make sure it has proper access to /dev/ttyUSB0. I tried babyware in a virtualboxed windows 10, with usb passthrough of the serial device, and it worked, it connects without problems.
2022-09-06 21:53:06,961 - DEBUG - MainThread - PAI.paradox.connections.protocols - PAI -> SER b'72000000000000000000000000000000000000000000000000000000000000000000000072'
2022-09-06 21:53:07,963 - ERROR - MainThread - PAI.paradox.paradox - Timeout while connecting to panel. Is an other connection active?
I could use some more advanced loopback serial transfer tester script to test reliability of linux operation of this device. I also tried https://github.com/gorgiaxx/CH34x-Driver-Linux driver with no success.
Edit: connecting rx/tx pins in loopback, gives me this in pai, from which we can deduce the adapter is working and transmitting correctly: 2022-09-07 10:42:54,070 - DEBUG - MainThread - PAI.paradox.connections.protocols - PAI -> SER b'72000000000000000000000000000000000000000000000000000000000000000000000072' 2022-09-07 10:42:54,132 - DEBUG - MainThread - PAI.paradox.connections.protocols - SER -> PAI b'72000000000000000000000000000000000000000000000000000000000000000000000072' 2022-09-07 10:42:54,132 - DEBUG - MainThread - PAI.paradox.paradox - Unknown message: 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 72
And it also works in windows.. so the problem is with PAI/settings maybe ? I have just this in pai.conf
CONNECTION_TYPE = 'Serial' # Serial or IP
SERIAL_PORT = '/dev/ttyUSB1' # Pathname of the Serial Port
SERIAL_BAUD = 9600 # 9600 for SP/MG. For EVO: Use 38400(default setting) or 57600
PASSWORD = '0000' # PC Password. Set to None if Panel has no Password.
Update: Tried downgrading firmware to 7.2 - no fix Tried a few older pai version - no fix
Edit: FIXED ! I just had to use 57600 baud. It was not obvious since the comments in the example conf sai 38400 is the default.. and I did not change it.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.