The Vera Community forums have moved!

Advanced => Plugins & Plugin Development => Programming => Caddx/GE/NetworX NX-584/NX-8E Security System => Topic started by: alexk on July 03, 2012, 06:34:22 am

Title: Setup: NX-10
Post by: alexk on July 03, 2012, 06:34:22 am
Hello - thanks for all the info on the 584/pluggin!

I have an NX10 system and am about to install a 584 card (anyone know if they work together?) in order to integrate with a soon to arrive Ivera Light.

Does anyone know if they work together? the nx10 and ivera i mean.

thanks!
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: futzle on July 03, 2012, 09:12:51 am
Hi alexk,

I've never heard of an NX10 before. All bets are off; it might be a new model, or an old model under a different name, or it might be a coincidentally-similar-sounding-but-totally-different panel.
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: alexk on August 21, 2012, 09:24:09 am
Hi Futzle.

the NX10 is basically a bigger daddy to the NX8.  it is mostly available in Europe as far as i can see.  I have an NX8 system also lying around (got it at my rented house) but the nx10 system is at my dads.  I put in the 584 card and will try out the vera lite.  in principle there shouldnt be any differences since the protocols remain the same.  we will see.

anything i should keep in mind?

thakns

Alex
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: futzle on August 23, 2012, 08:04:24 am
the NX10 is basically a bigger daddy to the NX8.  [...]  in principle there shouldnt be any differences since the protocols remain the same.  we will see.

Thanks for the info. Let us know how it goes.
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: alexk on August 23, 2012, 08:06:17 am
will do.

you mention in the instructions that specific commands need enabling on the 584 correct?  does this mean that they are disabled by default?

Alex
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: futzle on August 23, 2012, 05:31:58 pm
you mention in the instructions that specific commands need enabling on the 584 correct?  does this mean that they are disabled by default?

Honestly, I don't remember what the defaults were.  All I know is what they need to be.
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: alexk on August 27, 2012, 03:14:51 am
they are all enabled on my NX-584 just for reference.

Alex
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: alexk on August 28, 2012, 04:33:43 am
so great news.

Got the Ivera UI5 talking to the NX-584 which is wired to my NX-10 GSM Caddx.

things i will have to do is check if the baud rate (9600 on serial) is actually the setting on the 584 to see if it is working correctly.

things i have noticed

Automatic Zone discovery doesnt work - but i can do that manually so no worries
IVera for Iphone doesnt recognize the devices.


Questions to anyone who has experience.

I can seem to arm any of the partitions.  do i need to put the pin in somewhere?
I can only seem to arm partition 1.  partition 2 and 3 i can't
Do i need to use any arming options?  what is the arming options box for?
if i wanted to arm a partition 1 while bypassing zone 1 how would i do that?
how can i tell the ivera to turn all lights on in the case of an alarm on any partition?


thanks

Alex





Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: futzle on August 28, 2012, 06:25:01 am
Alex, as the developer of the Caddx plugin, I have a pretty minimalist system. Consequently I haven't tested elaborate situations like multiple partitions, or zone names. I rely on reports from users such as you.

Zone detection should work, on the "Zones" tab if you type a number in the Maximum Zone box and press Scan. If you have done this and not got the expected results, I'd like to know what *did* happen.

Users are authorized (or not) on a per-partition basis. If you are entering a PIN for user 3, and user 3 isn't authorized to arm Partition 2, then Partition 2 won't arm.

Arming without a PIN is called "quick arm" and it should be equivalent to pressing the Away button on a keypad. But on my unit I have to press Quick Stay in order to arm. This is apparently just one of the many cases where different Caddx panels have different, conflicting, behaviours. Since the whole plugin is based on one leaked interface document without any assistance from the manufacturer, it's very hard to know how many variants I haven't catered for yet. Yours might be one of them.

Bypassing is done prior to arming. Put each zone in the appropriate state by pressing Arm or Bypass on each zone. Then arm.

If you want to help me to debug these problems, you will need to be able to capture the Luup log (with a sacrificial PIN to avoid giving away your real PIN) while performing various actions. See earlier in the thread for plenty of prior examples.
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: alexk on August 28, 2012, 07:46:22 am
be happy to debug and send you info on a one 2 one basis. just let me know what test scenarios you would like me try first.  we can then post the results in the forum for people to learn from. ( i will read through all the forum in the meantime.)

i am attaching a screenshot of my interface to give you an idea of what is going on.
also let me know what you would like in terms of screenshots from the various partitions etc.

where is the entry for the pin by the way?
+
how can i create a trigger incase of alarm?

A

Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: futzle on August 28, 2012, 05:42:17 pm
be happy to debug and send you info on a one 2 one basis. just let me know what test scenarios you would like me try first.

Begin with plugin startup.  Enable "Debug to Luup log" on the panel Configure tab, then save.  Catch the Luup log as the Luup engine restarts.  I don't expect anything to be wrong here but it establishes a baseline.

Quote
where is the entry for the pin by the way?

Only on the partition's first tab ("Alarm Partition").  Type the PIN into the box then click Arm, Stay or Disarm.

(For an explanation of why the PIN entry box isn't available on the main dashboard, read back in the thread.)

Quote
how can i create a trigger incase of alarm?

Use the "Alarm Active" > "Alarm is active (in breach)" event in a scene's trigger.
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: alexk on August 29, 2012, 04:58:09 am

Begin with plugin startup.  Enable "Debug to Luup log" on the panel Configure tab, then save.  Catch the Luup log as the Luup engine restarts.  I don't expect anything to be wrong here but it establishes a baseline.


i am clear on enabling the debug.  what does the catch the luup log at engine restart mean? how do i do that? 

Question: does the reload basically restart the luup engine?
Once the log is registered.  how do i retrieve it? command line? how?


Further Qs
1. Is Baud rate of 38400 better than 9600? (as in faster comms?)

2. My alarm has a LCD keyboard so all the options on the nx-584 can be set though a menu and i think i have managed to enable the messages and commands you have indicated.  When i enable keyboard 1 then the system goes bananas, i.e. although the plugin lets me arm and disarm using a pin - I can disable the alarm from the LCD keyboard and it also messes up the GSM module i have (SMS control of the alarm). any ideas there?



Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: futzle on August 29, 2012, 05:59:18 am
what does the catch the luup log at engine restart mean? how do i do that?

SSH to the Vera command line and run: tail -f /var/log/cmh/LuaUPnP.log

Press ctrl-C to stop.

Some SSH clients will let you capture the session to a file, which will make it easier to send it to me. Otherwise it's copy-and-paste.

Quote
1. Is Baud rate of 38400 better than 9600? (as in faster comms?)

It's faster, but only better if your line quality allows faster transmission.  These panels are designed to send the serial signal over along distance, maybe even a phone line, where you might not get 38400 bps.  Personally, if 9600 bps works, I'd leave it. The protocol isn't heavy on bandwidth; you'd barely notice.

Quote
2. My alarm has a LCD keyboard so all the options on the nx-584 can be set though a menu and i think i have managed to enable the messages and commands you have indicated.  When i enable keyboard 1 then the system goes bananas, i.e. although the plugin lets me arm and disarm using a pin - I can disable the alarm from the LCD keyboard and it also messes up the GSM module i have (SMS control of the alarm). any ideas there?

You've got two pieces of hardware that I've never seen: the NX-10 and the GSM module. Already you are encountering behavior that I can't explain. I'm afraid that you will have to drive the debugging from your end. Capture communication logs from scenarios that work, and from scenarios that misbehave. Disconnect the GSM module and see if those scenarios start behaving. Be scientific about it and change only one variable at a time.
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: alexk on August 29, 2012, 06:25:33 am
thanks for taking the time.

Will be scientific and get back to you with logs.

thanks mate

alex
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: alexk on August 29, 2012, 01:44:17 pm
so here is a good log example.

Baud rate set at 9600

I am having some cases where when i press reload the luup engine hangs for the app.  in this log i didnt have the prob.

At the end of the log I armed the device (quick arm/no pin)
Disarm however didnt work (i think it is something i havent activated)

any comments on the log?

thanks again

Alex
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: futzle on August 29, 2012, 06:45:38 pm
Hi Alex,

Log 5 looks pretty clean.  That's what all Luup startups should look like for this plugin.

Log 4 is a mess.  The alarm panel is sending duplicate messages back to Vera.  Such behaviour is an indication that the panel has sent a message that it wants Vera to acknowledge, and it doesn't get the acknowledgment.  So it sends the message again.  Vera definitely is sending the acknowledgment packet, it's in the Luup log, so it's getting lost, sometimes, on the way from Vera to the panel.

The only time I've seen this before it turned out to be a dodgy serial connection.  The serial cable wasn't shielded and it was picking up RF interference.  Or the USB-to-serial adapter had a loose connection inside.  It's talked about earlier in this thread.  The fact that it happens only in Log 4 and not in Log 5 is an indication that the problem is intermittent.  Those are buggers to track down.

I can try and harden the plugin so that it is more resilient in the face of repeated messages sent by the panel, but if the Vera-to-Panel transmission channel has outages then even a best effort from the plugin is going to be a problem.

(Dis)arming with PIN requires you to have enabled the Primary keypad function with PIN feature.  The log indicates that you haven't enabled this, so only PINless arming will work.

Also, you found a bug with Log 4.  I had an uninitialized variable.  Thanks for spotting that.
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: alexk on August 30, 2012, 03:33:29 am
Hi Futzle,

Yes log 5 was my best log by far.  1/2/3 where from stuck startups and i am guessing it is to do with the cable.  I actually tucked the cable away in a box so that may be the reason.  I will take it out again for the testing and see if that makes it reliable.

Q1: Can u suggest a shielded cable i should buy?  NX-584 has  a male rs-232 pin so i would need a usb to male db9 shielded cable :). any advice welcome on that.


Q2: So regarding Primary Keypad with PIN which is a good funtion to have.  I think every time i enable that something happens to my main keyboards and wireless keyfobs + my SMS user profile.  I will do a re-enable and see what happens perhaps with a log (one thing at a time being changed :) ).  Any advice on this process? should i change the secondary keyboard setting when i change the primary one?

My current issues are:

Q3:  Partition 2/3 will not arm under the settings in the attached document. only partition 1 will and it wont disarm (obviously due to the primary keyboard setting) - am attaching a log where i try to arm partition 3 (and fail)

Q4: is keeping the log option enabled for the plugin a problem? (will it create a huge file that i need to delete?)

Also trying to add to this thread besides questions  - i am attaching a part of the nx-584 manual which indicated the default settings (bold) and in purple the ones I have on my Panel.  hope this is useful.

Re - bug log 4- i feel useful - huray!


Alex
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: futzle on August 30, 2012, 06:37:44 pm
Q1: Can u suggest a shielded cable i should buy?

Not usefully. You and I live on different continents; the chances of us both being able to buy the same item is slim.  Shielding is especially important on the RS-232 cable (the one that runs between your USB adapter and the NX-584 board).  My "cable" is actually just a gender changer plug.

If shielding isn't the issue I'd be looking for a bad connection.  Jiggle the connectors around and see if connectivity comes and goes.

Quote
Q2: should i change the secondary keyboard setting when i change the primary one?

Despite the names, there's no relationship between Primary and Secondary keypad functions.  There's nothing first-y or second-y about them.  So I do not expect changing the enabled state of one to affect the other at all.  I've got no idea why the SMS module objects to you enabling Primary Keypad function.  Let the forum know what you find out.

Quote
Q3:  Partition 2/3 will not arm under the settings in the attached document. only partition 1 will and it wont disarm (obviously due to the primary keyboard setting) - am attaching a log where i try to arm partition 3 (and fail)

I've read the log.  The plugin is definitely sending the right command (0x3e 0x02 0x04—the 0x02 is "Arm in Away mode" and the 0x04 is Partition 3).  It's even being acknowledged by the alarm, but the partition stays disarmed.  I wonder if, deep in the alarm panel's config, there is a bit that needs to be toggled to allow Quick Arm on partition 3.  It exists on the NX-8, according to the programmer manuals floating around on the Web.  (I have only an NX-4, which has only one partition.)

Quote
Q4: is keeping the log option enabled for the plugin a problem? (will it create a huge file that i need to delete?)

Vera rotates the log files.  It will just rotate them a bit quicker, is all.  I'd turn it off long-term, but a few days or weeks isn't going to hurt.  If you need to debug someone else's plugins and need to send them your log, it'd be polite to turn it off to avoid metaphorical noise in the log.

Thanks for the list of defaults vs required settings on the NX-584.
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: alexk on August 31, 2012, 07:24:42 am
hi Futzle,

regarding
Quote
Quote from: alexk on August 29, 2012, 11:33:29 pm
Q1: Can u suggest a shielded cable i should buy?

Not usefully. You and I live on different continents; the chances of us both being able to buy the same item is slim.  Shielding is especially important on the RS-232 cable (the one that runs between your USB adapter and the NX-584 board).  My "cable" is actually just a gender changer plug.

If shielding isn't the issue I'd be looking for a bad connection.  Jiggle the connectors around and see if connectivity comes and goes.

I moved the cable to away from various power sources and it is reliable.  i think the reason is that my usb serial cable is a usb to db25 with an adaptor to db9+ a connected db9 to db9 cable.  so basically more length than is necessary + a number of connections (obviously crappy shielding).  we do live in different continents but we are all served by the greater amazon organization.  i was thinking about this one.
http://www.amazon.co.uk/gp/product/B004ZMYTYC/ref=ox_sc_sfl_title_1?ie=UTF8&smid=A3P5ROKL5A1OLE
along with a gender changer.


Quote

Quote
Q2: should i change the secondary keyboard setting when i change the primary one?

Despite the names, there's no relationship between Primary and Secondary keypad functions.  There's nothing first-y or second-y about them.  So I do not expect changing the enabled state of one to affect the other at all.  I've got no idea why the SMS module objects to you enabling Primary Keypad function.  Let the forum know what you find out.


regarding Q2 (primary keyboard etc) I will do some tests now that i have reliability.  the problem isnt the sms module i am sure.  the sms module is the result of something happening to the main unit.  I am guessing it is something to do with the keyboard address set in the NX-584. will test and let you know.

Quote

Quote
Q3:  Partition 2/3 will not arm under the settings in the attached document. only partition 1 will and it wont disarm (obviously due to the primary keyboard setting) - am attaching a log where i try to arm partition 3 (and fail)

I've read the log.  The plugin is definitely sending the right command (0x3e 0x02 0x04—the 0x02 is "Arm in Away mode" and the 0x04 is Partition 3).  It's even being acknowledged by the alarm, but the partition stays disarmed.  I wonder if, deep in the alarm panel's config, there is a bit that needs to be toggled to allow Quick Arm on partition 3.  It exists on the NX-8, according to the programmer manuals floating around on the Web.  (I have only an NX-4, which has only one partition.)

you are correct.  fixed.


Q5:  do sensors in the caddx only give a tripped state when armed?  is it possible when not armed?  this way you can use the alarm sensors for other functions also.

Q6.  is it possible to have a scenario: if after sunset and before sunrise and alarm goes off then all lights on?

Q7:  why arent the partitions recognized by Ivera iphone app?  any ideas?

Q8:  what are some intersting reasons you have created this pluggin for? Obviously webcontrol of the alarm system is one.  it beats sms arming etc. also setting off lights in case of alarms + notifications ofcourse. anything else?

Q9.  Assuming you use Vera to liaise with the alarm and do functions in an alarm.  this makes the system critical.  I would like in that case to make sure that the link between vera is always working and to be notified if the link is down or the app crashes.  is this possible?  i.e. to install a check everyminute that the app is functioning and that it can talk to the alarm?


thanks and i will be back with all results from further testing. Pls do let me know if you want any scenarios tested and logged :)

Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: futzle on August 31, 2012, 06:25:26 pm
Q5:  do sensors in the caddx only give a tripped state when armed?

They work irrespective of partition state.  You can use sensors for occupancy detection independently of the alarm features.

Quote
Q6.  is it possible to have a scenario: if after sunset and before sunrise and alarm goes off then all lights on?

Yes, but that's just generic scene programming, so it's off-topic for this thread.

Quote
Q7:  why arent the partitions recognized by Ivera iphone app?

Partition support is needed in the phone app.  Some don't have partition support; I knew SQremote was in that category; seems that iVera is too.  You'll have to get support added by the developer of the app (or, since iVera is looking like abandonware, pick a different app).

Quote
Q8:  what are some intersting reasons you have created this pluggin for? Obviously webcontrol of the alarm system is one.  it beats sms arming etc. also setting off lights in case of alarms + notifications ofcourse. anything else?

Seriously, all I use it for is as a backup for when I forget to arm the panel when I leave for work.  I check over the web interface if I armed the partition, and if necessary send a quick arm.  I also have events that fire on arm and disarm that turn on/off cameras inside the house.

Quote
Q9.  [...] this makes the system critical.  I would like in that case to make sure that the link between vera is always working and to be notified if the link is down or the app crashes.  is this possible?  i.e. to install a check everyminute that the app is functioning and that it can talk to the alarm?

If there's no activity in the house then there is no activity on the serial line.  Distinguishing "no activity" from "no connection" is Hard on serial connections.  The best you could do is periodically send a dummy status request (Partition Snapshot would be a good one) and then raise the alarm (figuratively) if you get no reply.  Driving that periodic operation is actually hard, and mixing serial communication with timers on UI4 can lead to corruption of the user's devices, so I haven't tried to add it.  When I no longer have to support UI4 I will see about adding an "Are you there?" action.
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: alexk on September 10, 2012, 03:04:28 am
Goodmorning - still testing in my free time but I am going to change the RS232 cable as I am loosing some notifications when the alarm goes off.  will restart the testing after that is fixed.
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: alexk on September 11, 2012, 03:29:38 am
Futzle,

a quick question.  is it expected behaviour that the status of the partition from the web ui isnt always updated when i logon?  sometimes i need to do a refresh (ie. restart the luup engine) in order for the partition status to be correctly reported.  this only occurs when i log on and check the status. works fine after a refresh.
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: futzle on September 11, 2012, 05:04:24 am
Hi alexk, no, that is not the expected behaviour. It's also not the behaviour that I see.

See if clearing the browser cache and reloading the web page has any effect.
Title: Re: Re: Plugin for Caddx/GE/Networx NX-584/NX-8E security system
Post by: alexk on September 14, 2012, 08:56:26 am
Hey Futzle

at some point you told me to enable logging and then use the following SSH command.
tail -f /var/log/cmh/LuaUPnP.log

to capture logs.

what do i need to disable what we started? just the logging check box in the alarm device or does the tail command also start something?


thanks

Alex