OP II serial connection

tigers

Active Member
I think this deserves a separate topic.
In starting my attempt to interface the OP II with arduino I built a serial cable db 9 to rj11 using the pinout on the installer manual of the panel.
I the. Tried to connect with PC Access through serial port 1 in the panel and everything is ok: I can connect just fine, download config and I started sniffing the messages to better understand the protocol as is was suggested.

But when I disconnect from PC access and try to send or receive messages with serial nothing happens. The same port I was listening doesn't report anything if I send a message to serial 1 from the console or from program. The same happens if I try to send a message. I tried setting port 2 to pro link protocol and doing the same but still no success.

Am I doing something wrong?
 
But when I disconnect from PC access and try to send or receive messages with serial nothing happens. The same port I was listening doesn't report anything if I send a message to serial 1 from the console or from program. The same happens if I try to send a message. I tried setting port 2 to pro link protocol and doing the same but still no success.

Am I doing something wrong?
Personally I do not know.
 
That said there are two serial settings for PCA.  One is on the top "Options / serial" used for PCA serial com.
 
The other one is the actual serial port configuration under Setup / Expansion / Serial /Port stuff
 
Relating to the serial HA software I am using its just 05 / Serial 5, rate 9600 and OmniLink (always been that).
 
The to and from serial "chatter" never stops as the application does some sort of polling (continuously none stop); whatever else is happening (PCA, other serially connected stuff and IP connected stuff).  I will shut down the application, bring up the mirror serial port monitor and restart and post what I see using PCA on said serial port then application on said serial port.  I only have one serial connection (wire) from the "box" to the HAI Panel for the software. 
 
Thinking about this I have used PCA in IP mode while concurrently talking to the HAI Panel in serial mode (to many devices).  That and I have used PCA while talking to other devices in serial mode or as said using PCA via IP, HA via Serial plus rest of the stuff (thermostats, omnitouch, russound, so forth and so on).
 
I have never though used the HA application talking and PCA talking to another serial port concurrently.  Well because the other ports are all being utilized for other hardware.  
 
Takes a couple of minutes and will post chatter.  This is a snippet of pages of chatter in a couple of minutes.
 
I am using a Digi Edgeport 8 port X 2 devices here (via a USB connection).  (fully populated with 15 other hardware devices).  Via an INI file I can configure the number of polling devices, amount of time utilized to poll, et al.  Like I poll my thermostats differently than I poll my unit devices than I poll my zones.  The whole polling thing though does sometimes slow down response time changes causing some lags.  That said I do not see any sort of lagging or slow down in reponse times on the Omnitouch serially connected consoles talking say to temperature / humidity or thermostat stuff.  A little bit on the Russound serial controls though.

2    2:07:47 PM    hspi_HAI.exe    IRP_MJ_CREATE    EdgeSer31    SUCCESS    Options: Open     
3    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_SET_WAIT_MASK    EdgeSer31    SUCCESS    Mask: RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING     
4    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_SET_QUEUE_SIZE    EdgeSer31    SUCCESS    InSize: 4000 OutSize: 512    
5    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_PURGE    EdgeSer31    SUCCESS    Purge: TXABORT RXABORT TXCLEAR RXCLEAR    
6    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_SET_TIMEOUTS    EdgeSer31    SUCCESS    RI:-1 RM:0 RC:0 WM:0 WC:5000    
7    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_GET_BAUD_RATE    EdgeSer31    SUCCESS        
8    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_GET_LINE_CONTROL    EdgeSer31    SUCCESS        
9    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_GET_CHARS    EdgeSer31    SUCCESS        
10    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_GET_HANDFLOW    EdgeSer31    SUCCESS        
11    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_GET_BAUD_RATE    EdgeSer31    SUCCESS        
12    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_GET_LINE_CONTROL    EdgeSer31    SUCCESS        
13    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_GET_CHARS    EdgeSer31    SUCCESS        
14    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_GET_HANDFLOW    EdgeSer31    SUCCESS        
15    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_SET_BAUD_RATE    EdgeSer31    SUCCESS    Rate: 9600    
16    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_SET_WAIT_MASK    EdgeSer31    SUCCESS    Mask: RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING     
17    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_CLR_RTS    EdgeSer31    SUCCESS        
18    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_SET_WAIT_MASK    EdgeSer31    SUCCESS    Mask: RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING     
19    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_WAIT_ON_MASK    EdgeSer31    SUCCESS        
20    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_SET_DTR    EdgeSer31    SUCCESS        
21    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_SET_LINE_CONTROL    EdgeSer31    SUCCESS    StopBits: 1 Parity: NONE WordLength: 8    
22    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_SET_CHAR    EdgeSer31    SUCCESS    EOF:1a ERR:0 BRK:0 EVT:0 XON:11 XOFF:13    
23    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_SET_HANDFLOW    EdgeSer31    SUCCESS    Shake:1 Replace:0 XonLimit:1000 XoffLimit:1000    
24    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_GET_COMMSTATUS    EdgeSer31    SUCCESS        
25    2:07:47 PM    hspi_HAI.exe    IRP_MJ_WRITE    EdgeSer31    SUCCESS    Length 1: 5A     
26    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_GET_COMMSTATUS    EdgeSer31    SUCCESS        
27    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_GET_COMMSTATUS    EdgeSer31    SUCCESS        
28    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_GET_PROPERTIES    EdgeSer31    SUCCESS        
30    2:07:47 PM    hspi_HAI.exe    IRP_MJ_WRITE    EdgeSer31    SUCCESS    Length 1: 01     
29    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_SET_WAIT_MASK    EdgeSer31    SUCCESS    Mask: RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING     
31    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_WAIT_ON_MASK    EdgeSer31    SUCCESS        
32    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_GET_COMMSTATUS    EdgeSer31    SUCCESS        
33    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_SET_WAIT_MASK    EdgeSer31    SUCCESS    Mask: RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING     
34    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_WAIT_ON_MASK    EdgeSer31    SUCCESS        
35    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_GET_COMMSTATUS    EdgeSer31    SUCCESS        
36    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_GET_PROPERTIES    EdgeSer31    SUCCESS        
37    2:07:47 PM    hspi_HAI.exe    IRP_MJ_WRITE    EdgeSer31    SUCCESS    Length 1: 05     
38    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_GET_COMMSTATUS    EdgeSer31    SUCCESS        
39    2:07:47 PM    hspi_HAI.exe    IOCTL_SERIAL_SET_WAIT_MASK    EdgeSer31    SUCCESS    Mask: RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING  

BTW - Here using this "do hicky" hardware serial server type of device; its as big as the RS-232 connector.  It's like a mini black box RS-232 controller of sorts.  It is plugged into the Russound serial port.  Its been a while since I purchased it.  It has 3 RS-232 ports on it.  One in and two out.  Each out port has bi-directional communications to the first port.
 
From here one RS-232 line runs over to the Levigon HAI OPII panel.  The second serial line runs over to the software HA application.  Both can control the Russound device just fine.  Directly the Russound audio zoned amplifier has Keypads connected via Cat5e.  Indirectly it goes to the Leviton HAI Panel where it is controlled by the Omnitouch screens.  2nd connection goes to the HA Homeseer software box where there it too controls the Russound Amps via more touchscreens and application web gui.
 
To connect HAI panel to a serial device (and not a PC) you need the following pinout:
 

Attachments

  • HAI_pinout.JPG
    HAI_pinout.JPG
    5.6 KB · Views: 26
OK, I succeeded in connecting and sending/receiving messages.
I used a cable connection that is a little different form the one picta posted (it has some shorted pins on the DB9 part and some of them are connected to pin 2 on the RJ11 that is not connected in picta scheme); pinned this way the cable works either connecting via PC access to a Omni-link port either via Terminal (I used Putty) but it has to be connected to a Pro-link port.
The type of port is set or via PC access or via the console in the setup part.
 
My panel has 3 serial ports and I left port 1 configured in omni-link and port 2 in pro-link. this way I can communicate fine with the panel, sending and receiving messages via pro-link, and it's a nice thing to start with: this way the Arduino can be a cheap substitute for the external expansion. Here in Italy the expansion costs around 200 EUR (make it 275 $) while an arduino and an RS232 shield cost around 30 EUR (41 $), add 10 $ for the cable, maybe 20 $ more for some relay and electronics properly connect the ins and outs of the Arduino and you have an additional 127 ports (the 127 HAI triggers available through pro-link).
I won't use them for security, but as auxiliary zones it's acceptable.
 
Then I started sniffing the protocol and I am beginning to understand it, it seems quite easy to implement in Arduino, just have to write some routine to parse the responses and do the CRC math, but I found something already made in C++ which should be easy to adapt. Now I'm just waiting for my RS232 to TTL shield to arrive and then I'll start working on it. I'll let you know how it turns out.
 
Thanks to everybody for the help.
 
 

Attachments

  • Connettore seriale.jpg
    Connettore seriale.jpg
    63.1 KB · Views: 40
Great news tigers!
 
connect the ins and outs of the Arduino and you have an additional 127 ports (the 127 HAI triggers available through pro-link).
 
Yup; today using these zones via legacy OmniLink to trigger events on the Homeseer software stuff.  They are slow but functional for use.  Faster response times would be ideal.  Today I use the panel programming lines for stuff that I want to happen fast based on analog wired sensors to the panel and PIM's connected serially to the panel.  IE: I have much lighting in the automobile garage.  I use a PIR amount other hardwared connections to trigger all of the lighting in the garage making it daylight instantly which I like.  Same with other analog wired sensors.  Very quick. 
 
The analogy would be sort of a physiological response short circuit that happens with a reflex.  IE: When you hit your kneecap with a little hammer; the motion of your knee is not guided by your brain; but rather a short circuit of sorts that by passes your brain totally.
 
As stated you are expanding and updating the physical hardware of the panel for the price of an Arduino; which is a neato thing.
 
I am looking forward to your endeavor.
 
I have been playing here a bit with the Almond +.  Its base OS is OpenWRT and there is room to play on the device.
 
BTW I have always liked that I can still utilize the battery backed up stuff (well serially connected) versus the IP network connected stuff.  That said when moving towards the use of IP; you lose a bit of resilence; unless you back up your IP network using a UPS and such (well generator and big batteries).  Otherwise you are really s out of luck should something occur where you really need to use the transport for some disasterous debaucle.  I am happy today with the serially connected very simple low powered touchscreens with battery backup that still work just fine if I have a power failure.  I do have UPS's connected to the newer managed switches and POE injector devices which work fine.
 
I'm writing something here for reference to anyone who may attempt to follow my steps in the future.
 
 
pete_c said:
Personally I do not know.
 
That said there are two serial settings for PCA.  One is on the top "Options / serial" used for PCA serial com.
 
Yes. Nothing to touch there: I made the cable, connected it, clicked on connect>Serial in PCA and all went fine. It' pretty much like the IP connection only not encrypted.
 
pete_c said:
The other one is the actual serial port configuration under Setup / Expansion / Serial /Port stuff
 
Relating to the serial HA software I am using its just 05 / Serial 5, rate 9600 and OmniLink (always been that).
 
Yes, that's where you must select if you want to use that port with the omni link protocolo (or connection with PCA) OR with the Omni-pro protocol.
My OPII is around 2005/2006 and has only 3 serial ports. I used 2 of them one for each protocol.
 
 
pete_c said:
The to and from serial "chatter" never stops as the application does some sort of polling (continuously none stop); whatever else is happening (PCA, other serially connected stuff and IP connected stuff).  I will shut down the application, bring up the mirror serial port monitor and restart and post what I see using PCA on said serial port then application on said serial port.  I only have one serial connection (wire) from the "box" to the HAI Panel for the software. 
 
That's right, but it happens in different ways. In fact the serial port must be kept open or the OPII logs you out (after 3 mins I read). the omni link protocol has an acknowledge message that is sent in response to any message sent to the console. While in the config panel in PCA after the first exchange of information such as hardware type and time/date, a single "ping" message is sent every 10 seconds or so just to keep the connection alive.
 
However, if you switch to the "status" tab in PCA it starts the polling of the zones or thermostats or whatever to show you the updated results on screen. This is exactly what I want to do.
 
I still have to experiment what happens when sending a command or setting a flag (another thing I wanna do: get external sensor readings and assigning them to flags).
 
pete_c said:
Thinking about this I have used PCA in IP mode while concurrently talking to the HAI Panel in serial mode (to many devices).  That and I have used PCA while talking to other devices in serial mode or as said using PCA via IP, HA via Serial plus rest of the stuff (thermostats, omnitouch, russound, so forth and so on).
 
I confirm this can be done without problems. Also it can be done with 2 concurrent IP connection (I do it all the time with Haiku). I think it could be done  with 2 serial connections as well.
As I said in the technical specs I see than 3 connections is the limit, but maybe it's 3 IP and 3 serial.
 
 
pete_c said:
I have never though used the HA application talking and PCA talking to another serial port concurrently.  Well because the other ports are all being utilized for other hardware.  
 
I'll try that since I want to experiment with both protocols (omni link and pro link) in Arduino so that anyone can implement whatever suits them best.
 
The pro-link is much easier and I think I could use it fully right now, the omni-link would give much much more power.
 
Neato stuff Tigers! 
 
Never really paid attention to the differences between the Omni Link and the Pro Link protocols.  I just thought that the Pro Link was an update to the Omni link and therefore the default communications protocol.
 
However, if you switch to the "status" tab in PCA it starts the polling of the zones or thermostats or whatever to show you the updated results on screen. This is exactly what I want to do.
 
I still have to experiment what happens when sending a command or setting a flag (another thing I wanna do: get external sensor readings and assigning them to flags).
 
Yup today utilize the Zones, Thermostat, Temperature and Temperature Combo Humidity sensors to drive external events or just reading the values.
 
I do utilize the analog readings from the zones in a diagnostic way similar to what is in the PCA status page. (closed , open and EOL values).
 
I do not see though the temperature devices autonomously which are directly plugged into the Omnistat thermostat in the PCA software.  The Thermostat does utilize the external directly plugged in sensors in an either internal or external average between sensors reading such that the ambient temperature reading from the thermostat can be also the externally plugged into the thermostat temperature devices.
 
I also noticed a couple of years ago as I added more devices (1/2 of a class C) to the IP network the OmniPro II board would start getting issues.  Weird but the issues would start initially with the serial com to the thermostat and Omnitouch screens.  Then the HAI Panel board time would go way off (out of sync) and the network interface would act up disconnecting randomly.  Here I put a router between the HAI Network interface and the rest of the network.  I tried to fix it with a separate VLAN and it didn't work.  Spoke with HAI customer support relating to issue.  They said its just an old design and an overly promiscuous network interface.
 
Tigers,
 
Been looking to purchase a device to connect both via serial and network with a modded Open-WRT / DD-WRT OS on it.  Thinking maybe I can utilize the serial port and network ports.  I am now seeing many low powered micro routers and I think I would be able to utilize a serial and network connection on these (well modified).  Thinking of trying a couple of these utilizing your stuff and the network ports such that it would probably run a bit more stuff on it (said modifying OS).
 
Its been about a year now that I have put in a modded DD-WRT router connecting one side to the network port.  Its too big though.
 
In the endeavor I want to utilize the power supply built into the OPII panel.
 
There are a few these days which are even less than an Ardinio board.
 
My favorite right now is from a company called Dovado.
 
It is a bit more expensive as that it includes 3G/4G connectivity.  Such that this device could connect via the NIC / Serially plus have an out to the LAN, Local wireless and external 3G/4G connectivity.
 
Dovado Tiny
 
TINY%20FINAL.jpg

 
TP-Link now has a new microrouter which would also work.  The folks at OpenWRT already have a working OS for this device which would be even easier to add the serial and network stuff to it.  The device also can be powered via the USB port.  I ordered one of these to modify / play with.  Tiny thing will fit inside of the HAI OPII can and will be powered from the HAI OPII board.
 
06.jpg
 
If these are hackerable (I thought newer models wouldn't allow you to) it'd be nice.
But I don't see the point: Arduino comes with wi-fi and Ethernet modules so it can itself connect both to LAN and WAN and be the "in the middle" between the OP II and the rest of the world, in a much powerful way than the current solutions allow.
 
I have in front of me the RS232 to TTL adapter that just arrived. I plan on doing some tests in the weekend, starting with the pro-link messages that should be easy to implement. Then I'll start some experiment with the omni.link protocol.
 
I also am experimenting with the Ethernet shield for Arduino but I'm having trouble to get it to work properly and constantly.
 
I'll let you know of the experiments and if everything goes well I think I can post some code and instructions on sunday.
 
Great news!
 
But I don't see the point: Arduino comes with wi-fi and Ethernet modules so it can itself connect both to LAN and WAN and be the "in the middle" between the OP II and the rest of the world, in a much powerful way than the current solutions allow.
 
Yup the TP-Link above for around ~$25.00 already has a replacement OpenWRT OS for it.  DD-WRT too may be around the corner.  Purchased one this morning.
 
Tell me what to purchase relating to using the Arduino and will purchase today.
 
1 - Arduino
2 - two ethernet modules
3 - serial port (included eh?)
 
The above noted will connect my Quatech serial server to serial port on the panel (well removing one being utilized) using a standard HAI RS-232 cable.
 
Hi Pete, sorry for the late response but the forum was down for me the whole day yesterday and I didn't read it in the weekend.
 
To have a start you can just buy an Arduino UNO (I'm using a Leonardo and it could be better for the project since it has a second hardware serial on board - separated from the one used to communicate with the PC).
From my experiment if you are willing to use Ethernet and maybe a couple other libraries the UNO will run out of memory.
At the moment I have an LCD and an Ethernet shield, very few lines of code and I'm using 22 of the 28k available. The code can surely be optimized and reduced once I'm done with debugging, but I'm still not using the SD card and I have to write some more code for the serial protocol.
So my final project will probably be on an Arduino MEGA.
 
For the Ethernet modules why two?
The serial is already on board and you can add more via software emulations (eating up some memory so I am not suggesting that - you can be good for trying and debugging but I won't do more than that).
 
 
On the developing side I have good news since I successfully connected the Arduino to the OPII both via PRO-link (that was very easy and is done with just 2 lines of code) and the Omni-link.
At the moment I wrote the routine to login to the HAI and sending commands (which required to do the CRC checking, that took most of the time).
 
Problem is I think my TTL to RS232 module is defective because it can't sense the response messages from the HAI (I'm still working on that to be sure the problem is in the converter and not in my code).
 
So I can write flags, send out commands to units and everything, but I can't read values or poll thermostats and temperature sensors, that is the second part of my plan: read values and log them to SD card or on the cloud with services like plot.ly o xively. Also I don't get the acknowledgement messages from the OPII, so I can send command but I can't be sure it was received and evaluated correctly.
 
I already wrote the routine to parse the OPII responses but I can't debug it - and IT IS needed because I am a poor programmer.
 
Apart from that I must only write the CRC check-routine and after that I think the project can be considered in "beta state".
 
I have been watching this thread for months hoping someone would take this a bit further...I think it would be HUGE to get the Arduinos communicating via ethernet vs. serial! I know it is more work with the encryption but please if anyone with the ability is listening, help get this started! With ethernet, we could drive many arduinos controlling many things from coffeemakers to LED pwm, etc.
 
This would really help get the "Internet Of Things" tied in with a panel that is the heart of our homes...
 
Perhaps it would be easier to script through HailkuHelper instead to communicate with Arduino? I really wish I was a little stronger on the programming end...
 
Back
Top