Tertiush / ParadoxIP150v2

Python-based IP150 'middle-ware' that uses the IP module's software port for monitoring and control of the alarm via an MQTT Broker.
Eclipse Public License 1.0
73 stars 35 forks source link

MG5000 label read issue #8

Closed lalamper closed 6 years ago

lalamper commented 7 years ago

Hi,

First of all, thank you for your project. I am using it on a Raspberry Pi2 running Raspbian Jessie (latest Python is 2.7.9 for this platform) for my MG5000 (FW: 4.76) via IP150 (FW: 3.01.00) modul.

I could successfully connect to the alarm system, MQTT broker also connects fine, show events realtime, however I am unable to read out zone, user, etc. labels. Script got empty answers.

I did some research to find out what the problem could be. According to wireshark, your code sends out proper query for the registers, however alarm system answers different than expected. I have compared your and WinLoad query, it is the same, so I do not really understand why the answer is different. TCP packet size is also different, data payload is the same.

Can you please look into your code? Does the script really need Python 2.7.10+? Maybe it causes the issue..

Another question if I may. Can you please help me how could I connect HAP-NodeJS (Apple Homekit) with MQTT broker to make the alarm system in HomeKit available? :)

Thank you so much. Lajos


Here is the data from WinLoad query:

Frame 142: 118 bytes on wire (944 bits), 118 bytes captured (944 bits) on interface 0 Interface id: 0 (\Device\NPF_{F340CBE4-CAB9-4DD9-B5F3-B11E9B2AB9D9}) Encapsulation type: Ethernet (1) Arrival Time: Dec 16, 2016 12:11:24.400799000 K�z�p-eur�pai t�li id� [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1481886684.400799000 seconds [Time delta from previous captured frame: 0.027535000 seconds] [Time delta from previous displayed frame: 0.151794000 seconds] [Time since reference or first frame: 1.461567000 seconds] Frame Number: 142 Frame Length: 118 bytes (944 bits) Capture Length: 118 bytes (944 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:ethertype:ip:tcp:data] [Coloring Rule Name: TCP] [Coloring Rule String: tcp] Ethernet II, Src: Vmware_f1:5e:ab (00:0c:29:f1:5e:ab), Dst: ParadoxS_04:e0:b7 (00:19:ba:04:e0:b7) Destination: ParadoxS_04:e0:b7 (00:19:ba:04:e0:b7) Address: ParadoxS_04:e0:b7 (00:19:ba:04:e0:b7) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Source: Vmware_f1:5e:ab (00:0c:29:f1:5e:ab) Type: IPv4 (0x0800) Internet Protocol Version 4, Src: 192.168.80.232, Dst: 192.168.80.2 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) Total Length: 104 Identification: 0x2da9 (11689) Flags: 0x02 (Don't Fragment) Fragment offset: 0 Time to live: 128 Protocol: TCP (6) Header checksum: 0x0000 [validation disabled] [Header checksum status: Unverified] Source: 192.168.80.232 Destination: 192.168.80.2 [Source GeoIP: Unknown] [Destination GeoIP: Unknown] Transmission Control Protocol, Src Port: 49194, Dst Port: 64333, Seq: 257, Ack: 213, Len: 64 Source Port: 49194 Destination Port: 64333 [Stream index: 0] [TCP Segment Len: 64] Sequence number: 257 (relative sequence number) [Next sequence number: 321 (relative sequence number)] Acknowledgment number: 213 (relative ack number) Header Length: 20 bytes Flags: 0x018 (PSH, ACK) Window size value: 63074 [Calculated window size: 63074] [Window size scaling factor: -1 (unknown)] Checksum: 0x2296 [unverified] [Checksum Status: Unverified] Urgent pointer: 0 [SEQ/ACK analysis] Data (64 bytes) Data: aa25000408000014eeeeeeeeeeeeeeee5000001000000000... [Length: 64]

For this IP150 answers with two packets (correct answer):

First:

Frame 143: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0 Interface id: 0 (\Device\NPF_{F340CBE4-CAB9-4DD9-B5F3-B11E9B2AB9D9}) Encapsulation type: Ethernet (1) Arrival Time: Dec 16, 2016 12:11:24.425868000 K�z�p-eur�pai t�li id� [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1481886684.425868000 seconds [Time delta from previous captured frame: 0.025069000 seconds] [Time delta from previous displayed frame: 0.025069000 seconds] [Time since reference or first frame: 1.486636000 seconds] Frame Number: 143 Frame Length: 60 bytes (480 bits) Capture Length: 60 bytes (480 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:ethertype:ip:tcp] [Coloring Rule Name: TCP] [Coloring Rule String: tcp] Ethernet II, Src: ParadoxS_04:e0:b7 (00:19:ba:04:e0:b7), Dst: Vmware_f1:5e:ab (00:0c:29:f1:5e:ab) Destination: Vmware_f1:5e:ab (00:0c:29:f1:5e:ab) Address: Vmware_f1:5e:ab (00:0c:29:f1:5e:ab) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Source: ParadoxS_04:e0:b7 (00:19:ba:04:e0:b7) Address: ParadoxS_04:e0:b7 (00:19:ba:04:e0:b7) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Type: IPv4 (0x0800) Padding: 000000000000 Internet Protocol Version 4, Src: 192.168.80.2, Dst: 192.168.80.232 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) Total Length: 40 Identification: 0xe0ef (57583) Flags: 0x00 Fragment offset: 0 Time to live: 255 Protocol: TCP (6) Header checksum: 0xb8a4 [validation disabled] [Header checksum status: Unverified] Source: 192.168.80.2 Destination: 192.168.80.232 [Source GeoIP: Unknown] [Destination GeoIP: Unknown] Transmission Control Protocol, Src Port: 64333, Dst Port: 49194, Seq: 213, Ack: 321, Len: 0 Source Port: 64333 Destination Port: 49194 [Stream index: 0] [TCP Segment Len: 0] Sequence number: 213 (relative sequence number) Acknowledgment number: 321 (relative ack number) Header Length: 20 bytes Flags: 0x010 (ACK) Window size value: 5648 [Calculated window size: 5648] [Window size scaling factor: -1 (unknown)] Checksum: 0x5c7d [unverified] [Checksum Status: Unverified] Urgent pointer: 0 [SEQ/ACK analysis]

and the second:

Frame 148: 107 bytes on wire (856 bits), 107 bytes captured (856 bits) on interface 0 Interface id: 0 (\Device\NPF_{F340CBE4-CAB9-4DD9-B5F3-B11E9B2AB9D9}) Encapsulation type: Ethernet (1) Arrival Time: Dec 16, 2016 12:11:24.485116000 K�z�p-eur�pai t�li id� [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1481886684.485116000 seconds [Time delta from previous captured frame: 0.019060000 seconds] [Time delta from previous displayed frame: 0.059248000 seconds] [Time since reference or first frame: 1.545884000 seconds] Frame Number: 148 Frame Length: 107 bytes (856 bits) Capture Length: 107 bytes (856 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:ethertype:ip:tcp:data] [Coloring Rule Name: TCP] [Coloring Rule String: tcp] Ethernet II, Src: ParadoxS_04:e0:b7 (00:19:ba:04:e0:b7), Dst: Vmware_f1:5e:ab (00:0c:29:f1:5e:ab) Destination: Vmware_f1:5e:ab (00:0c:29:f1:5e:ab) Address: Vmware_f1:5e:ab (00:0c:29:f1:5e:ab) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Source: ParadoxS_04:e0:b7 (00:19:ba:04:e0:b7) Address: ParadoxS_04:e0:b7 (00:19:ba:04:e0:b7) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Type: IPv4 (0x0800) Internet Protocol Version 4, Src: 192.168.80.2, Dst: 192.168.80.232 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) Total Length: 93 Identification: 0xe0f0 (57584) Flags: 0x00 Fragment offset: 0 Time to live: 255 Protocol: TCP (6) Header checksum: 0xb86e [validation disabled] [Header checksum status: Unverified] Source: 192.168.80.2 Destination: 192.168.80.232 [Source GeoIP: Unknown] [Destination GeoIP: Unknown] Transmission Control Protocol, Src Port: 64333, Dst Port: 49194, Seq: 213, Ack: 321, Len: 53 Source Port: 64333 Destination Port: 49194 [Stream index: 0] [TCP Segment Len: 53] Sequence number: 213 (relative sequence number) [Next sequence number: 266 (relative sequence number)] Acknowledgment number: 321 (relative ack number) Header Length: 20 bytes Flags: 0x018 (PSH, ACK) Window size value: 5648 [Calculated window size: 5648] [Window size scaling factor: -1 (unknown)] Checksum: 0x1e4b [unverified] [Checksum Status: Unverified] Urgent pointer: 0 [SEQ/ACK analysis] Data (53 bytes) Data: aa2500027200000000eeeeeeeeeeeeee520000104f6e426f... [Length: 53]

In hex format: 0000 aa 25 00 02 72 00 00 00 00 ee ee ee ee ee ee ee 0010 52 00 00 10 4f 6e 42 6f 61 72 64 30 31 20 20 20 0020 20 20 20 20 4f 6e 42 6f 61 72 64 30 32 20 20 20 0030 20 20 20 20 2f

Your code does the following query:

Frame 809: 120 bytes on wire (960 bits), 120 bytes captured (960 bits) on interface 0 Interface id: 0 (-) Encapsulation type: Linux cooked-mode capture (25) Arrival Time: Dec 16, 2016 12:05:01.132993000 K�z�p-eur�pai t�li id� [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1481886301.132993000 seconds [Time delta from previous captured frame: 0.010039000 seconds] [Time delta from previous displayed frame: 0.128212000 seconds] [Time since reference or first frame: 44.981523000 seconds] Frame Number: 809 Frame Length: 120 bytes (960 bits) Capture Length: 120 bytes (960 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: sll:ethertype:ip:tcp:data] [Coloring Rule Name: TCP] [Coloring Rule String: tcp] Linux cooked capture Packet type: Sent by us (4) Link-layer address type: 1 Link-layer address length: 6 Source: Raspberr_78:02:79 (b8:27:eb:78:02:79) Protocol: IPv4 (0x0800) Internet Protocol Version 4, Src: 192.168.80.226, Dst: 192.168.80.2 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) Total Length: 104 Identification: 0x5122 (20770) Flags: 0x02 (Don't Fragment) 0... .... = Reserved bit: Not set .1.. .... = Don't fragment: Set ..0. .... = More fragments: Not set Fragment offset: 0 Time to live: 64 Protocol: TCP (6) Header checksum: 0xc738 [validation disabled] [Header checksum status: Unverified] Source: 192.168.80.226 Destination: 192.168.80.2 [Source GeoIP: Unknown] [Destination GeoIP: Unknown] Transmission Control Protocol, Src Port: 36712, Dst Port: 64333, Seq: 1729, Ack: 1486, Len: 64 Source Port: 36712 Destination Port: 64333 [Stream index: 5] [TCP Segment Len: 64] Sequence number: 1729 (relative sequence number) [Next sequence number: 1793 (relative sequence number)] Acknowledgment number: 1486 (relative ack number) Header Length: 20 bytes Flags: 0x018 (PSH, ACK)

  1. .... .... = Reserved: Not set ...0 .... .... = Nonce: Not set .... 0... .... = Congestion Window Reduced (CWR): Not set .... .0.. .... = ECN-Echo: Not set .... ..0. .... = Urgent: Not set .... ...1 .... = Acknowledgment: Set .... .... 1... = Push: Set .... .... .0.. = Reset: Not set .... .... ..0. = Syn: Not set .... .... ...0 = Fin: Not set [TCP Flags: ·······AP···] Window size value: 29200 [Calculated window size: 29200] [Window size scaling factor: -2 (no window scaling used)] Checksum: 0x2290 [unverified] [Checksum Status: Unverified] Urgent pointer: 0 [SEQ/ACK analysis] [iRTT: 0.000768000 seconds] [Bytes in flight: 64] [Bytes sent since last PSH flag: 64] Data (64 bytes) Data: aa25000408000014eeeeeeeeeeeeeeee5000003000000000... [Length: 64]

Answers are:

First:

Frame 811: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) on interface 0 Interface id: 0 (-) Encapsulation type: Linux cooked-mode capture (25) Arrival Time: Dec 16, 2016 12:05:01.193341000 K�z�p-eur�pai t�li id� [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1481886301.193341000 seconds [Time delta from previous captured frame: 0.038540000 seconds] [Time delta from previous displayed frame: 0.060348000 seconds] [Time since reference or first frame: 45.041871000 seconds] Frame Number: 811 Frame Length: 62 bytes (496 bits) Capture Length: 62 bytes (496 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: sll:ethertype:ip:tcp:vssmonitoring] [Coloring Rule Name: TCP] [Coloring Rule String: tcp] Linux cooked capture Packet type: Unicast to us (0) Link-layer address type: 1 Link-layer address length: 6 Source: ParadoxS_04:e0:b7 (00:19:ba:04:e0:b7) Protocol: IPv4 (0x0800) Padding: 00000000 Internet Protocol Version 4, Src: 192.168.80.2, Dst: 192.168.80.226 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) Total Length: 40 Identification: 0xe035 (57397) Flags: 0x00 0... .... = Reserved bit: Not set .0.. .... = Don't fragment: Not set ..0. .... = More fragments: Not set Fragment offset: 0 Time to live: 255 Protocol: TCP (6) Header checksum: 0xb964 [validation disabled] [Header checksum status: Unverified] Source: 192.168.80.2 Destination: 192.168.80.226 [Source GeoIP: Unknown] [Destination GeoIP: Unknown] Transmission Control Protocol, Src Port: 64333, Dst Port: 36712, Seq: 1486, Ack: 1793, Len: 0 Source Port: 64333 Destination Port: 36712 [Stream index: 5] [TCP Segment Len: 0] Sequence number: 1486 (relative sequence number) Acknowledgment number: 1793 (relative ack number) Header Length: 20 bytes Flags: 0x010 (ACK)

  1. .... .... = Reserved: Not set ...0 .... .... = Nonce: Not set .... 0... .... = Congestion Window Reduced (CWR): Not set .... .0.. .... = ECN-Echo: Not set .... ..0. .... = Urgent: Not set .... ...1 .... = Acknowledgment: Set .... .... 0... = Push: Not set .... .... .0.. = Reset: Not set .... .... ..0. = Syn: Not set .... .... ...0 = Fin: Not set [TCP Flags: ·······A····] Window size value: 5520 [Calculated window size: 5520] [Window size scaling factor: -2 (no window scaling used)] Checksum: 0x7b25 [unverified] [Checksum Status: Unverified] Urgent pointer: 0 [SEQ/ACK analysis] [This is an ACK to the segment in frame: 809] [The RTT to ACK the segment was: 0.060348000 seconds] [iRTT: 0.000768000 seconds] VSS-Monitoring ethernet trailer, Source Port: 0 Src Port: 0

And the second:

Frame 812: 109 bytes on wire (872 bits), 109 bytes captured (872 bits) on interface 0 Interface id: 0 (-) Encapsulation type: Linux cooked-mode capture (25) Arrival Time: Dec 16, 2016 12:05:01.220544000 K�z�p-eur�pai t�li id� [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1481886301.220544000 seconds [Time delta from previous captured frame: 0.027203000 seconds] [Time delta from previous displayed frame: 0.027203000 seconds] [Time since reference or first frame: 45.069074000 seconds] Frame Number: 812 Frame Length: 109 bytes (872 bits) Capture Length: 109 bytes (872 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: sll:ethertype:ip:tcp:data] [Coloring Rule Name: TCP] [Coloring Rule String: tcp] Linux cooked capture Packet type: Unicast to us (0) Link-layer address type: 1 Link-layer address length: 6 Source: ParadoxS_04:e0:b7 (00:19:ba:04:e0:b7) Protocol: IPv4 (0x0800) Internet Protocol Version 4, Src: 192.168.80.2, Dst: 192.168.80.226 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) Total Length: 93 Identification: 0xe036 (57398) Flags: 0x00 0... .... = Reserved bit: Not set .0.. .... = Don't fragment: Not set ..0. .... = More fragments: Not set Fragment offset: 0 Time to live: 255 Protocol: TCP (6) Header checksum: 0xb92e [validation disabled] [Header checksum status: Unverified] Source: 192.168.80.2 Destination: 192.168.80.226 [Source GeoIP: Unknown] [Destination GeoIP: Unknown] Transmission Control Protocol, Src Port: 64333, Dst Port: 36712, Seq: 1486, Ack: 1793, Len: 53 Source Port: 64333 Destination Port: 36712 [Stream index: 5] [TCP Segment Len: 53] Sequence number: 1486 (relative sequence number) [Next sequence number: 1539 (relative sequence number)] Acknowledgment number: 1793 (relative ack number) Header Length: 20 bytes Flags: 0x018 (PSH, ACK)

  1. .... .... = Reserved: Not set ...0 .... .... = Nonce: Not set .... 0... .... = Congestion Window Reduced (CWR): Not set .... .0.. .... = ECN-Echo: Not set .... ..0. .... = Urgent: Not set .... ...1 .... = Acknowledgment: Set .... .... 1... = Push: Set .... .... .0.. = Reset: Not set .... .... ..0. = Syn: Not set .... .... ...0 = Fin: Not set [TCP Flags: ·······AP···] Window size value: 5520 [Calculated window size: 5520] [Window size scaling factor: -2 (no window scaling used)] Checksum: 0x9104 [unverified] [Checksum Status: Unverified] Urgent pointer: 0 [SEQ/ACK analysis] [iRTT: 0.000768000 seconds] [Bytes in flight: 53] [Bytes sent since last PSH flag: 53] Data (53 bytes) Data: aa2500027200000000eeeeeeeeeeeeee7000100000000000... [Length: 53]

In hex format:

0000 aa 25 00 02 72 00 00 00 00 ee ee ee ee ee ee ee 0010 70 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0030 00 00 00 00 80

lalamper commented 7 years ago

Update: I just discovered that if Panel and/or PC password has been set, label read will not work. After setting back to default values (0000/0000), script just works!

Please update your script to make it possible to enter codes.

MnrGreg commented 7 years ago

@lalamper See https://github.com/mnrgreg/homebridge-paradox-security-system for MQTT & Homebridge/HomeKit integration

Tertiush commented 6 years ago

Closing this for now as there appears to be no way to send the code to the ip module via the software port. From what I can gather only the password is sent