kk7ds / pynx584

Python library and server for talking to NX584/NX8E interfaces
GNU General Public License v3.0
29 stars 26 forks source link

Unable to obtain working communications with the alarm panel #25

Closed philwild closed 6 years ago

philwild commented 6 years ago

I have an NX-12 panel with installed NX584 module hooked up to an Rpi via USB cable. Comms appears to work in that I can see data being sent from the panel using minicom and nx584_server appears to be reading the raw ASCII line.

However, that raw ASCII line does not appear to change at all depending on the state of zones and any commands I've sent do not seem to have any impact (e.g. "nx584_client arm --partition 1") does not arm . See log below. Not sure if there is an incompatibility between config panel code or if it is user configuration error.

Any advice on further debugging would be very much appreciated =)

2018-08-17 21:57:27,270 controller DEBUG Received: 6 Partition Status (data [0, 32, 0, 0, 64, 1, 4, 130])
2018-08-17 21:57:27,276 controller DEBUG Partition 1 ['reserved', 'Sensor low battery', 'Ready to arm', 'Open period', 'Delay trip in progress (common zone)']
2018-08-17 21:57:29,759 controller DEBUG Parsing raw ASCII line b'098600200000400104827784'
2018-08-17 21:57:29,764 controller DEBUG Received: 6 Partition Status (data [0, 32, 0, 0, 64, 1, 4, 130])
2018-08-17 21:57:29,771 controller DEBUG Partition 1 ['reserved', 'Sensor low battery', 'Ready to arm', 'Open period', 'Delay trip in progress (common zone)']
2018-08-17 21:57:32,259 controller DEBUG Parsing raw ASCII line b'098600200000400104827784'
2018-08-17 21:57:32,265 controller DEBUG Received: 6 Partition Status (data [0, 32, 0, 0, 64, 1, 4, 130])
2018-08-17 21:57:32,283 controller DEBUG Partition 1 ['reserved', 'Sensor low battery', 'Ready to arm', 'Open period', 'Delay trip in progress (common zone)']
2018-08-17 21:57:34,748 controller DEBUG Parsing raw ASCII line b'098600200000400104827784'
2018-08-17 21:57:34,754 controller DEBUG Received: 6 Partition Status (data [0, 32, 0, 0, 64, 1, 4, 130])
2018-08-17 21:57:34,773 controller DEBUG Partition 1 ['reserved', 'Sensor low battery', 'Ready to arm', 'Open period', 'Delay trip in progress (common zone)']
2018-08-17 21:57:37,083 _internal INFO 127.0.0.1 - - [17/Aug/2018 21:57:37] "GET /command?cmd=arm&type=auto HTTP/1.1" 200 -
2018-08-17 21:57:37,299 controller DEBUG Parsing raw ASCII line b'098600200000400104827784'
2018-08-17 21:57:37,305 controller DEBUG Received: 6 Partition Status (data [0, 32, 0, 0, 64, 1, 4, 130])
2018-08-17 21:57:37,323 controller DEBUG Partition 1 ['reserved', 'Sensor low battery', 'Ready to arm', 'Open period', 'Delay trip in progress (common zone)']
2018-08-17 21:57:38,590 controller DEBUG Sending queued [61, 5, 1, 1]
2018-08-17 21:57:39,747 controller DEBUG Parsing raw ASCII line b'098600200000400104827784'
2018-08-17 21:57:39,752 controller DEBUG Received: 6 Partition Status (data [0, 32, 0, 0, 64, 1, 4, 130])
2018-08-17 21:57:39,759 controller DEBUG Partition 1 ['reserved', 'Sensor low battery', 'Ready to arm', 'Open period', 'Delay trip in progress (common zone)']
2018-08-17 21:57:42,224 controller DEBUG Parsing raw ASCII line b'098600200000400104827784'
2018-08-17 21:57:42,229 controller DEBUG Received: 6 Partition Status (data [0, 32, 0, 0, 64, 1, 4, 130])
2018-08-17 21:57:42,236 controller DEBUG Partition 1 ['reserved', 'Sensor low battery', 'Ready to arm', 'Open period', 'Delay trip in progress (common zone)']
2018-08-17 21:57:44,720 controller DEBUG Parsing raw ASCII line b'098600200000400104827784'
2018-08-17 21:57:44,726 controller DEBUG Received: 6 Partition Status (data [0, 32, 0, 0, 64, 1, 4, 130])
2018-08-17 21:57:44,751 controller DEBUG Partition 1 ['reserved', 'Sensor low battery', 'Ready to arm', 'Open period', 'Delay trip in progress (common zone)']
2018-08-17 21:57:47,216 controller DEBUG Parsing raw ASCII line b'098600200000400104827784'
2018-08-17 21:57:47,222 controller DEBUG Received: 6 Partition Status (data [0, 32, 0, 0, 64, 1, 4, 130])
2018-08-17 21:57:47,229 controller DEBUG Partition 1 ['reserved', 'Sensor low battery', 'Ready to arm', 'Open period', 'Delay trip in progress (common zone)']
2018-08-17 21:57:49,712 controller DEBUG Parsing raw ASCII line b'098600200000400104827784'
2018-08-17 21:57:49,718 controller DEBUG Received: 6 Partition Status (data [0, 32, 0, 0, 64, 1, 4, 130])
2018-08-17 21:57:49,731 controller DEBUG Partition 1 ['reserved', 'Sensor low battery', 'Ready to arm', 'Open period', 'Delay trip in progress (common zone)']
2018-08-17 21:57:52,208 controller DEBUG Parsing raw ASCII line b'098600200000400104827784'
2018-08-17 21:57:52,214 controller DEBUG Received: 6 Partition Status (data [0, 32, 0, 0, 64, 1, 4, 130])
2018-08-17 21:57:52,221 controller DEBUG Partition 1 ['reserved', 'Sensor low battery', 'Ready to arm', 'Open period', 'Delay trip in progress (common zone)']
2018-08-17 21:57:54,705 controller DEBUG Parsing raw ASCII line b'098600200000400104827784'
kk7ds commented 6 years ago

Almost every event the NX584 can send has to be enabled in the programming of the panel. Sending zone status has to be enabled. Sending partition arm/disarm status has to be enabled. Allowing partitions to be armed has to be enabled. Have you turned all that stuff on?

philwild commented 6 years ago

I've set it up exactly as per the instructions in location 0 through 3. Location 4 is as the default as I confirmed that my LCD keypad is in partition 1-1

philwild commented 6 years ago

I just went back into program mode to check and it is setup just like this...

   - Protocol: ASCII
    Feature: 0
    Segment: 1
    Option: 1 
   - Speed: 9600 Baud (OR WHICHEVER YOU CHOOSE). 
        Nb. People have reported that anything above 9600bps can have adverse affects on some system integrations including Home Assistant. This is likely dependent on the serial hardware that is used, however 9600bps is typically a safe option.
    Feature: 1
    Segment: 1
    Option: 4 
   - Enabled Transition Messages:
    Feature: 2
    Segment: 1
        Options: 
            2 - Interface Configuration Message
                    5 - Zone Status Message
                    7 - Partition Status Message
         Segment: 2
        Options: 
                1 - System Status Message
                2 - X-10 Message Received (OPTIONAL)
                    3 - Log Event Message
                    4 - Keypad Message Received (OPTIONAL)

   - Enabled Commands:
    Feature: 3
        Segment: 1
        Options: 
            2 - Interface Configuration Request
                    4 - Zone Name Request
                    5 - Zone Status Request
                    6 - Zones Snapshot Request
                    7 - Partition Status Request
                    8 - Partitions Snapshot Request
    Segment: 2
        Options: 
            1 - System Status Request
            2 - Send X-10 Message (OPTIONAL)
                    3 - Log Event Request
                    4 - Send Keypad Text Message (OPTIONAL)
    Segment: 3
        Options:            
                    1 - Program Data Request (OPTIONAL)
                    2 - Program Data Command (OPTIONAL)
    Segment: 4
        Options: 
                    4 - Set Clock / Calendar Command
                    5 - Primary Keypad Function with PIN (OPTIONAL)
                    7 - Secondary Keypad Function (OPTIONAL)
                    8 - Zone Bypass Toggle (OPTIONAL)
philwild commented 6 years ago

I've resolved the issue and it was physical rather than code related. I'm using a straight-through serial cable so I had flipped the four jumper locations to reverse the transmit/receive pins on the DB9 interface. When moving the jumper to set RXD to pin 3 (J10) I just missed the pin so J10 was open circuit.

So even though I could see data coming from the board, the board could not read anything coming from nx584_server.

Now that that has been fixed, the board is communicating correctly.