openhab / openhab1-addons

Add-ons for openHAB 1.x
Eclipse Public License 2.0
3.43k stars 1.71k forks source link

Receiving HEX data via Serial binding #2359

Closed Tertiush closed 9 years ago

Tertiush commented 9 years ago

Hi

I've got an openhab instance on my raspberry PI and connected via a UST-TTL serial link to my alarm system, Paradox MG5050. The link works, however OH receives the HEX data as strings and as such I cannot make any sense of it. The protocol is 37 bytes longs (each message, regardless of event type) and I can only make out the bits that actually fit the ASCII/UTF-8 encoding. Everything else is either a space or some wonderful character. In actual fact I would need the data in binary, as some nibbles are used to indicate a state (0-15).

Has anybody else successes in somehow receiving HEX data on a serial link? thanks!

Tertiush commented 9 years ago

I got the data by using item.state.toString.getBytes

marcolivierarsenault commented 7 years ago

I am curious if you could explain how you got the conection between serial port and your machine. I am trying to achieve the same thing between my MG5000 and my pc, I am not sure what to use between the 4 pin SERIAL connector and my server. Is a RS232 -> USB connection will work?

Thanks.

Tertiush commented 7 years ago

The connection is TTL 5v if memory serves me correctly, not the voltage levels of RS232! These cheap USB to TTL (232) dongles is what I'm using. Do you gave an ip module? If so that's working quitr reliably for me, although the serial connection also worked like a charm.

marcolivierarsenault commented 7 years ago

No I don't have the IP module (and it is pretty expensive like 100$), this is why I am looking for the serial. Thanks for the advise I will try with a Standard connection FTDI RS232 to USB.

Tertiush commented 7 years ago

Oh one more thing, I actually ended up using a python script because openhab just didn't cut it with interpreting the streams. A work colleague of mine is busy porting the code over here: https://github.com/Tertiush/ParadoxIP150v2 to support serial connections. I used another previous (unpublished) version though but if I was you I'd wait for this newer one. It uses MQTT and is quite stable (at least the IP version).

marcolivierarsenault commented 7 years ago

Is the serial connection will be for the serial port on the IP150 module or for the Serial connector directly on the MG5050 board?

Where he should publish this? Thanks

Tertiush commented 7 years ago

We'll, update the existing scripts when done. The serial port is not the one that the IP module would use, there's another port relatively close to it, can't remember the name now, think its just labelled "Serial". The one you would use to connect Winload serially to the panel

marcolivierarsenault commented 7 years ago

Are you aware of the pinout of this "serial" port?

Tertiush commented 7 years ago

Can't remember, first forum when googling it, check the last post: https://www.experts-exchange.com/questions/28551660/Paradox-Magellan-MG50XX-series-hack-to-talk-with-PC-via-DB9-RS232.html

marcolivierarsenault commented 7 years ago

Great thanks,

marcolivierarsenault commented 7 years ago

I have play with it and it looks to be working fine. Quick one, are you aware if the serial port can be used to arm the system.

Thanks

Tertiush commented 7 years ago

Yes, and also control the PGMs and bypass zones. For PGM and arm/disarm see the link I already posted on 6 Sep.

marcolivierarsenault commented 7 years ago

Do you remember if you needed to do (program or anything else) something at first for the alarm system to send data or it just send it by default?

Also did you need to send a packet first?

marcolivierarsenault commented 7 years ago

Ok got my answer thanks